← Back to Projects

Project 02 · Molecular Machine Learning

Molecular Solubility Prediction with GNNs

Predicting aqueous solubility directly from molecular structure using graph neural networks. I developed an end-to-end molecular machine-learning workflow using AqSolDB, RDKit, PyTorch, and PyTorch Geometric, comparing GCN and GAT architectures under both random and Bemis–Murcko scaffold-based evaluation.

PyTorch PyTorch Geometric RDKit AqSolDB GCN GAT Streamlit
01 · Problem

Learning molecular properties from graph structure

Aqueous solubility is an important molecular property in drug discovery and chemical design. Instead of relying only on manually engineered molecular descriptors, graph neural networks can learn representations directly from molecular connectivity and atom-level chemical information.

GCN + GAT Two graph neural network architectures evaluated under the same molecular-learning framework.
2 Split Strategies Random and Bemis–Murcko scaffold splits were used to compare conventional and structure-aware generalization.
logS Continuous aqueous-solubility prediction formulated as graph-level molecular regression.
02 · Workflow

End-to-end molecular ML pipeline

The workflow connects molecular preprocessing, graph construction, model training, structure-aware evaluation, and interactive deployment.

AqSolDB Molecular solubility data
RDKit Molecule processing
Graphs Atoms + bonds
GCN / GAT Graph regression
Evaluation Random + scaffold
Streamlit Interactive inference
03 · Molecular Representation

Molecules represented as graphs

SMILES strings are converted into molecular graphs using RDKit and PyTorch Geometric. Atoms become graph nodes and covalent bonds define graph edges, allowing the neural network to learn directly from molecular topology and local chemical environments.

Graph Structure

Each molecule is represented as a PyTorch Geometric graph. Covalent bonds are encoded bidirectionally so information can propagate through neighboring atoms during message passing.

Atom Features

Node features encode chemically relevant atom-level information used by the graph neural network.

Element Atomic Degree Formal Charge Hybridization Hydrogens Aromaticity Ring Membership Atomic Mass
04 · Model Development

GCN vs GAT

Two graph neural network architectures were trained using the same molecular representation and regression objective to provide a controlled comparison.

Graph Convolutional Network

The GCN propagates information across bonded atoms through graph convolution layers, followed by graph-level pooling and a regression head for logS prediction.

Graph Attention Network

The GAT uses attention-based message passing to learn differential weighting of neighboring atoms before graph-level aggregation and regression.

05 · Generalization

Random vs scaffold evaluation

Random splitting provides a conventional machine-learning benchmark, while Bemis–Murcko scaffold splitting creates a more stringent evaluation by separating compounds according to core molecular scaffolds. This better tests performance on structurally distinct chemistry.

Model Split Test R² RMSE MAE
GCN Random 0.821 0.980 0.662
GAT Random 0.787 1.070 0.736
GCN Scaffold 0.786 1.095 0.751
GAT Scaffold 0.776 1.121 0.791
Model-selection takeaway

The random-split GCN achieved the strongest numerical test performance with R² = 0.821 and RMSE = 0.980. The scaffold-trained GCN achieved R² = 0.786 and RMSE = 1.095 under the more stringent structure-aware evaluation and was retained for downstream solubility prediction and deployment.

06 · Deployment

From trained model to interactive predictor

The selected scaffold-trained GCN was integrated into a Streamlit application so predictions can be explored interactively rather than only through training notebooks or command-line scripts.

Interactive Inference

Users can query the model through an accessible web interface and obtain aqueous-solubility predictions from molecular structure.

  • Molecule name or SMILES input
  • PubChem molecule lookup
  • Molecular structure visualization
  • Predicted logS
  • Molecular descriptors

Model Evaluation

The application connects the deployed predictor with supporting model context so users can interpret the prediction alongside the underlying evaluation framework.

  • Scaffold-trained GCN
  • Test-set performance context
  • Comparison with experimental test data
  • Downloadable PDF reports
  • Reproducible GitHub implementation

Explore the model

Try the deployed solubility predictor or explore the source code, model training workflow, and benchmark results on GitHub.