Drug Bioactivity Predictor

A machine-learning model for predicting whether a chemical compound is likely to be active or inactive against EGFR based on its molecular structure represented as a SMILES string.

The model uses RDKit molecular descriptors and Morgan molecular fingerprints as input features and a Random Forest classifier for binary classification.

Research use only: This model is intended for educational, research, and compound-prioritization purposes. It is not a clinical diagnostic tool and must not be used to make medical, therapeutic, regulatory, or patient-care decisions.


Model Overview

Property Value
Target EGFR
ChEMBL Target ID CHEMBL203
Assay endpoint IC50
Activity unit nM
Task Binary classification
Active threshold IC50 ≀ 1000 nM
Inactive threshold IC50 > 1000 nM
Model Random Forest Classifier
Molecular descriptors 8
Morgan fingerprint 2048 bits
Total features 2056

Objective

The objective of this project is to develop an end-to-end machine-learning pipeline that takes a compound SMILES string and predicts:

  • ACTIVE
  • INACTIVE

against the EGFR target.

The project combines:

  • Chemical data curation
  • Cheminformatics
  • Molecular descriptors
  • Molecular fingerprints
  • Machine learning
  • Model evaluation
  • Scaffold-based validation
  • Interactive Streamlit deployment

Input

The model accepts a valid chemical SMILES representation.

Example:

CCO

or:

CCOC1=CC=CC=C1

The SMILES is converted into an RDKit molecular representation before feature generation.


Feature Engineering

Each molecule is represented using two feature groups.

Molecular descriptors

The following eight descriptors are calculated using RDKit:

  1. Molecular Weight
  2. LogP
  3. Hydrogen Bond Donors
  4. Hydrogen Bond Acceptors
  5. Rotatable Bonds
  6. Topological Polar Surface Area
  7. Ring Count
  8. Heavy Atom Count

Morgan fingerprint

A Morgan circular fingerprint is generated using:

Radius: 2
Fingerprint size: 2048 bits

Therefore:

8 descriptors
+
2048 Morgan fingerprint bits
=
2056 features

Activity Definition

The curated dataset uses an IC50 threshold of:

1000 nM

Classification:

IC50 ≀ 1000 nM
        ↓
     ACTIVE
IC50 > 1000 nM
        ↓
    INACTIVE

This threshold is a project-level classification rule and should not be interpreted as a universal biological definition of EGFR activity.


Dataset

The final curated dataset contains:

13,577 compounds

Class distribution:

Class Compounds Fraction
ACTIVE 9,142 67.33%
INACTIVE 4,435 32.67%
Total 13,577 100%

The data curation pipeline includes:

  • Removal of invalid measurements
  • IC50 filtering
  • Unit normalization
  • Missing-value handling
  • SMILES validation
  • Duplicate measurement removal
  • Compound-level aggregation
  • Activity classification

Model Comparison

Three machine-learning models were evaluated.

Model Accuracy Precision Recall F1 ROC-AUC PR-AUC
Logistic Regression 0.8384 0.8913 0.8655 0.8782 0.8776 0.9193
Random Forest 0.8921 0.9364 0.9010 0.9184 0.9512 0.9743
XGBoost 0.8840 0.9079 0.9213 0.9145 0.9410 0.9690

The Random Forest model was selected based primarily on ROC-AUC.


Random-Split Evaluation

The selected Random Forest model achieved:

Metric Score
Accuracy 0.8921
Precision 0.9364
Recall 0.9010
F1 0.9184
ROC-AUC 0.9512
PR-AUC 0.9743

Five-fold cross-validation produced:

Mean ROC-AUC: 0.9478
Std ROC-AUC : 0.0054

Scaffold-Split Evaluation

A Bemis-Murcko scaffold split was additionally performed to evaluate generalization to chemically different molecular scaffolds.

Results:

Metric Score
Accuracy 0.8401
Precision 0.8760
Recall 0.8884
F1 0.8822
ROC-AUC 0.9118
PR-AUC 0.9551

The scaffold split is more challenging than a conventional random split because structurally related compounds are less likely to appear across both training and test sets.


Generalization

The difference between random-split and scaffold-split ROC-AUC was:

Random split ROC-AUC   = 0.9512
Scaffold split ROC-AUC = 0.9118

Generalization gap     = 0.0394

The scaffold evaluation provides a more conservative estimate of how the model may perform on chemically distinct compounds.


Model Files

This repository contains:

bioactivity_model.joblib
model_metadata.json
README.md

bioactivity_model.joblib

Serialized scikit-learn Random Forest model.

model_metadata.json

Contains model configuration and reproducibility metadata including:

  • Target information
  • Activity threshold
  • Feature configuration
  • Molecular descriptors
  • Morgan fingerprint configuration
  • Validation metrics
  • Dataset statistics
  • Software versions

Example Inference

A compound can be processed using the project's prediction wrapper.

Example:

from src.predict import BioactivityPredictor

predictor = BioactivityPredictor(
    "models/bioactivity_model.joblib"
)

result = predictor.predict(
    "CCOC1=CC=CC=C1"
)

print(result["prediction"])
print(result["active_probability"])

Example output:

ACTIVE
0.874

The probability represents the model's estimated probability for the predicted class and should not be interpreted as a calibrated probability of biological efficacy.


Application

The model is integrated into an interactive Streamlit application.

The application supports:

  • SMILES input
  • SMILES validation
  • Molecular property calculation
  • ACTIVE/INACTIVE prediction
  • Prediction probability
  • CSV batch prediction
  • Molecular descriptors
  • Chemical structure visualization

Technology Stack

Programming

  • Python 3.14

Cheminformatics

  • RDKit

Data Science

  • Pandas
  • NumPy
  • SciPy

Machine Learning

  • Scikit-learn
  • XGBoost
  • Joblib

Visualization

  • Matplotlib
  • Seaborn

Application

  • Streamlit

Development

  • JupyterLab
  • Pytest
  • Ruff
  • Git
  • GitHub
  • Hugging Face Hub

Project Architecture

SMILES
   β”‚
   β–Ό
RDKit Molecular Parsing
   β”‚
   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚               β”‚
   β–Ό               β–Ό
Molecular       Morgan
Descriptors     Fingerprint
   β”‚               β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
           β–Ό
      2056 Features
           β”‚
           β–Ό
    Random Forest
           β”‚
           β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                   β”‚
 β–Ό                   β–Ό
ACTIVE            INACTIVE
 β”‚
 β–Ό
Probability

Limitations

This model has several important limitations.

1. Target-specific model

The model was trained for:

EGFR / CHEMBL203

It should not automatically be assumed to generalize to other biological targets.

2. Endpoint-specific model

The training endpoint is:

IC50

The model should not be interpreted as a predictor for other assay endpoints such as:

  • EC50
  • Ki
  • Kd
  • cellular viability
  • toxicity
  • clinical response

without appropriate retraining and validation.

3. Dataset bias

Bioactivity databases contain heterogeneous experimental measurements generated using different:

  • assay protocols
  • experimental conditions
  • laboratories
  • compound series
  • measurement practices

Therefore, the model may inherit biases present in the underlying data.

4. Chemical space limitations

Performance can decrease for molecules substantially different from the training distribution.

The scaffold-split ROC-AUC of approximately 0.912 demonstrates that performance is lower under a more challenging chemical split than under a random split.

5. Probability calibration

The predicted probability is a machine-learning model output and has not been established as a clinically calibrated probability of biological activity.

6. No clinical interpretation

The model does not predict:

  • drug approval
  • therapeutic efficacy
  • patient response
  • toxicity
  • pharmacokinetics
  • pharmacodynamics
  • clinical safety

Intended Use

Appropriate uses include:

  • Educational cheminformatics projects
  • Machine-learning research
  • Molecular data analysis
  • Computational compound prioritization
  • Benchmarking molecular fingerprints
  • Exploring structure-activity relationships
  • Prototyping drug-discovery workflows

Out-of-Scope Use

This model should not be used as the sole basis for:

  • Clinical decisions
  • Drug prescribing
  • Patient treatment
  • Regulatory submissions
  • Safety-critical decisions
  • Confirmation of biological activity
  • Replacement of laboratory experiments

Predictions should be experimentally validated before drawing biological conclusions.


Reproducibility

The project includes:

  • Data curation scripts
  • Feature generation
  • Model training
  • Model evaluation
  • Scaffold evaluation
  • Automated tests
  • Model metadata
  • Evaluation reports

The software environment is documented in the project requirements files.


Repository

Source code:

https://github.com/sintu7781/drug-bioactivity-predictor

Hugging Face model:

https://huggingface.co/prime7781/drug-bioactivity-predictor


Disclaimer

This project is a research and educational machine-learning application.

Predictions are computational estimates and do not constitute experimental evidence of biological activity, medical advice, or clinical recommendations.

Any compound prioritization based on this model should be followed by appropriate experimental validation.


Future Improvements

Potential future improvements include:

  • Probability calibration
  • External validation on independent datasets
  • Larger multi-target datasets
  • Additional molecular fingerprints
  • Graph neural networks
  • Molecular transformers
  • Explainable AI
  • Applicability-domain estimation
  • Uncertainty quantification
  • Active learning
  • Multi-task bioactivity prediction
  • Experimental validation
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support