Science and engineering
Machine learning for chemistry
Chemists use machine learning to predict molecular properties such as solubility and toxicity, to rank candidate compounds before synthesis, and to propose reaction conditions. Models learn from molecular fingerprints, descriptors or graphs built from chemical structures.
How machine learning is used in chemistry
Predicting molecular properties
Models map a molecule's structure, encoded as a fingerprint, a set of descriptors or a graph of atoms and bonds, to properties such as solubility, toxicity or activity. Chemists can then score thousands of structures before making any. Random forests on fingerprints and message-passing graph neural networks are the usual baselines.
Real exampleChemprop (Yang et al., 2019)Compared fingerprint and descriptor models with a directed message-passing neural network on 19 public and 16 proprietary industrial datasets; the model is available as the open-source Chemprop package.
Screening libraries for new active compounds
A trained activity model ranks large libraries of real or virtual compounds so that only the most promising few go to the lab. The bottleneck shifts from testing everything to choosing well.
Real exampleHalicin antibiotic discovery (MIT, 2020)MIT researchers trained a deep learning model to predict antibacterial activity, screened large compound collections and identified halicin, a molecule that killed many bacterial strains in laboratory tests.
Planning synthesis routes
Retrosynthesis models suggest how to make a target molecule by working backwards through known reaction types. Neural networks rank which transformations to try, and a search procedure assembles them into complete routes for chemists to judge.
Real examplePlanning chemical syntheses with deep neural networks and symbolic AI (Segler et al., Nature, 2018)Combined deep neural networks with Monte Carlo tree search to plan routes; in a double-blind test, chemists on average considered its routes equivalent to reported literature routes.
Choosing reaction conditions
Bayesian optimisation suggests the next combination of catalyst, solvent, temperature and concentration to try, balancing promising conditions against unexplored ones. It reaches good yields in fewer experiments than one-factor-at-a-time searches.
Real exampleBayesian reaction optimisation (Shields et al., Nature, 2021)Compared Bayesian optimisation with human decision-making on a palladium-catalysed reaction benchmark and found it more efficient and more consistent on average.
Can you learn machine learning for chemistry?
Yes. Chemists with some quantitative background can learn the machine learning they need in stages: Python, handling molecules with RDKit, classical models on fingerprints, then graph neural networks. Chemistry knowledge is what makes the models useful, so it is an advantage rather than a gap.
- Python basicsWrite scripts and notebooks; most cheminformatics tools are Python libraries.Learn it in Python
- Data handling with pandasClean assay tables, merge measurements from different sources and handle duplicates and units.Learn it in Data Tools
- Molecules as data with RDKitParse SMILES, standardise structures and compute fingerprints and descriptors.
- Classical models and honest validationTrain random forests and gradient boosting on fingerprints, using scaffold splits so test molecules are structurally new.Learn it in Machine Learning
- Graph neural networksMessage-passing networks learn their own molecular representations; Chemprop is a practical place to start.Learn it in Deep Learning
Moving into machine learning for chemistry
If you already work in the field
Chemists bring the judgement to spot impossible structures, unreliable assay data and chemically meaningless predictions. Add Python and RDKit, reproduce a published property model on an open dataset such as those in MoleculeNet, then apply the same workflow to data from your own lab. Computational chemistry and medicinal chemistry teams are natural places to start.
If you come from data science or ML
Machine learning practitioners should learn how molecules are represented (SMILES, graphs and 3D conformers), what common assays measure and why measurement noise limits achievable accuracy. A medicinal or organic chemistry refresher and the RDKit documentation cover much of the gap, and working beside bench chemists does the rest.
Roles that do this workCheminformatics scientistComputational chemistMachine learning scientist, drug discoveryResearch scientist, AI for chemistry
Tools you will use
| Tool | What you use it for |
|---|---|
| RDKit | Parse molecules, compute descriptors and fingerprints, and generate scaffold splits. |
| DeepChem | Load chemistry benchmarks and train molecular property models in one library. |
| Chemprop | Train message-passing neural networks that predict properties directly from SMILES strings. |
| PyTorch Geometric | Build custom graph neural networks over atoms and bonds. |
| scikit-learn | Fit fingerprint-based baselines such as random forests and ridge regression. |
Public data to practise on
- Therapeutics Data Commons: Curated molecular property tasks such as solubility, toxicity and absorption with ready-made scaffold splits.
- ChEMBL: Measured bioactivity of drug-like molecules against protein targets, for building activity prediction models.
Your first project
Download a solubility dataset from Therapeutics Data Commons, predict solubility with a random forest on Morgan fingerprints, and compare it with linear regression on a few RDKit descriptors using RMSE on a scaffold split.
Common questions
Do chemists need to learn programming for machine learning?
Yes, at least Python. Most cheminformatics and machine learning tools are Python libraries, and even no-code platforms are easier to use well when you can inspect the data yourself.
What is cheminformatics?
Cheminformatics is the use of computing to store, search and model chemical information such as structures, reactions and properties. Machine learning on molecules grew out of it, and tools like RDKit come from that tradition.
What is a scaffold split and why does it matter?
A scaffold split keeps molecules with the same core structure in the same subset, so the test set contains genuinely new chemotypes. Random splits let near-duplicates leak between training and test sets and make models look better than they will be on new chemistry.
Is machine learning in chemistry only for drug discovery?
No. It is also used for materials, catalysts, batteries, reaction prediction, spectroscopy and process chemistry. Drug discovery simply has the most public datasets and the most hiring.
Courses for these skills
- Practical Machine Learning in PythonMatch losses and validation to measured molecular endpoints.51 published lessons · more lessons in production
- Deep Learning with PyTorchStudy differentiable models and neural optimisation.Syllabus available · lessons open as produced
- Maths for Machine LearningConnect gradients to energy and force relationships.26 published lessons · all planned lessons open
New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.