Project 02 · Molecular Machine Learning
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.
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.
The workflow connects molecular preprocessing, graph construction, model training, structure-aware evaluation, and interactive deployment.
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.
Each molecule is represented as a PyTorch Geometric graph. Covalent bonds are encoded bidirectionally so information can propagate through neighboring atoms during message passing.
Node features encode chemically relevant atom-level information used by the graph neural network.
Two graph neural network architectures were trained using the same molecular representation and regression objective to provide a controlled comparison.
The GCN propagates information across bonded atoms through graph convolution layers, followed by graph-level pooling and a regression head for logS prediction.
The GAT uses attention-based message passing to learn differential weighting of neighboring atoms before graph-level aggregation and regression.
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 |
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.
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.
Users can query the model through an accessible web interface and obtain aqueous-solubility predictions from molecular structure.
The application connects the deployed predictor with supporting model context so users can interpret the prediction alongside the underlying evaluation framework.
Try the deployed solubility predictor or explore the source code, model training workflow, and benchmark results on GitHub.