Enhancing Classification of Imbalanced Muscarinic Receptor M1 Datasets Using Transfer Learning and Generative AI Techniques
Imbalanced data are a commonly encountered problem when building classification models from public databases. Typically, the databases contain a large fraction of active compounds as inactives are rarely reported in the literature. This imbalance can lead to skewed models with a high rate of false positives, making them unsuitable for virtual screening of chemical databases. Using the muscarinic receptor M1 as a case study, we investigated three strategies to balance public bioactivity datasets: 1) carefully analyzing the bioactivity distribution and selecting an appropriate decision boundary, 2) generating inactive compounds using a recurrent neural network trained on the source data, and 3) transfer learning, i.e., building a classification model on a larger corpus of related data and transferring the parameters. We found that these approaches reduced misclassification of the inactive class, increasing the specificity from 0.37 to 0.68 for a scaffold-split-generated test set and from 0.07 to 0.60 for a public high-throughput screening test set. Thus, we not only developed a robust classification model to screen chemicals against M1, but also developed a general framework for treating imbalanced data that can be translated across other targets, allowing us to build better classification models.
This repository contains the data, scripts, and models used in this study. They are sorted into 3 major sections:
-
Data folder containing all the data used in this study. It is divided into 4 sub-sections.
- Input: Contains the M1 bioactivities from ChEMBL and BindingDB, a combined public dataset and the list of compounds generated by recurrent neural network (RNN)
- Training: Contains different files used for training the model. Deep neural network (DNN) models uses Morgan fingerprints for training, and are labelled as “_FP”
- Test: Contains the scaffold-split based, high-throughput screening (HTS) and DrugBank datasets. Same naming conventions are followed as in Training
- Results: Contains a sample results file generated from the scripts
-
Scripts folder containing three python scripts that can be run with python script.py
- curate_data.py that combines data from public databases and create the training and scaffold-split-based test sets
- add_RNN.py that augments the RNN generated inactives with the training set
- pred_sklearn.py that runs the NB, RF and XG models
- pred_dnn_w_transfer_learning.py that runs the regular DNN along with transfer learning
-
Model folder containing the Naïve Bayes, Random forest, XGBoost and the various DNN models
To run the python script, you will first need Anaconda installed. From an Anaconda prompt, set up a new environment using the following commands:
conda create -n imbalanced_m1 python=3.9
conda activate imbalanced_m1
Next, navigate to this repository's folder and enter the following command to install dependencies:
pip install -r requirements.txt
python curate_data.py
python pred_sklearn.py
python pred_dnn_w_transfer_learning.py :