CARATE: teaching computers to read molecules as graphs
TL;DR
CARATE is an open-source deep learning model by Julian M. Kleber that reads molecules as graphs of atoms and bonds. It was tested on seven public benchmarks, from small drug-like molecules to proteins. Small-molecule training usually converged in two epochs on a desktop CPU, and some protein test splits reached 100% accuracy.
Why is describing a molecule to a computer hard?
Drug design needs good guesses about how a molecule will behave before anyone makes it in a lab. Computers can help, but only if they get a good description of the molecule.
The most common descriptions are text strings like SMILES and InChI, or simple drawings of atoms and lines. The paper argues these are abstractions that leave out too much. It also points out that the original SMILES method was claimed to give one unique string per molecule, which was later shown not to hold.
The other problem is scale. A drug is a small molecule, but it acts on proteins that are much larger. Most tools handle one size well and the other badly.
What does CARATE do?
CARATE reads a molecule as a graph. Each atom is a point, each bond is a line, and both can carry extra information. A graph keeps far more detail than a text string.
The model has two kinds of building blocks. Graph convolution layers let each atom collect information from its neighbours. Graph attention layers learn which neighbours matter most. Stacked together they form an encoder that turns any molecule, small or large, into a compact set of numbers. On top of that encoder sits a small layer for the actual task, such as predicting a property or a class.
The paper frames this compact representation as a learned stand-in for the molecule's wave function, the quantity that describes its electrons in quantum mechanics. That is the author's interpretation and is discussed further below.
How was it tested?
CARATE was tested on seven public datasets. ZINC and ALCHEMY ask the model to predict physical and quantum chemical numbers for small molecules. MCF-7, MOLT-4 and YEAST are drug discovery sets that sort small molecules by activity. ENZYMES and PROTEINS ask the model to classify whole proteins.
Datasets were used as published, without cleaning. Every test used five-fold stratified cross-validation, so each result is checked on five different splits of the data. An ablation study removed parts of the model one at a time to see which parts matter.
The training ran on desktop processors (AMD Ryzen 9) with 64 GB of memory, not on a computing cluster. The author reports the same results on several Linux systems.
What were the results?
On the small-molecule regression sets ZINC and ALCHEMY, training converged in fewer than 10 epochs and usually in two. An epoch is one pass through the training data.
On the protein sets ENZYMES and PROTEINS, CARATE reached up to 100% accuracy on some splits. The paper reports that it outperformed the graph-based baselines it compared against on classification of both proteins and small molecules, and on the quantum chemical regression tasks.
The ablation study showed that no single part of the model reaches full performance alone. The second linear layer mainly reduced variance between runs.
Key terms in plain language
Graph: a set of points (nodes) joined by lines (edges). For a molecule, atoms are the nodes and bonds are the edges.
Graph convolution: a step in which every atom updates its description using information from the atoms it is bonded to.
Graph attention: a step that learns how much weight each neighbouring atom should get, instead of treating all neighbours the same.
Regression and classification: regression predicts a number, such as an energy. Classification predicts a category, such as active or inactive.
Cross-validation: splitting the data into parts and testing on each part in turn, so a good score cannot come from one lucky split.
Overfitting: when a model learns the training data so closely that it does worse on new data.
What are the limits?
The model tends to overfit. Training longer often made results worse, and early stopping helped in most cases. On very noisy datasets the paper expects it may do worse than classic methods like random forests unless settings are adjusted.
The wave-function interpretation and the comparison with quantum chemistry methods are the author's arguments, not something the benchmarks prove on their own. The paper itself says more experiments are needed to confirm the results. It is a preprint and has not been peer reviewed.
Can I use CARATE?
Yes. The code is open source on Codeberg and installable from PyPI with pip. The repository holds configuration files, logs and trained models. Related work on molecules where standard methods break is in Can fluorine form triple bonds?.
Frequently asked questions
What is CARATE?
An open-source graph neural network that encodes molecules and proteins as graphs and predicts their properties. It combines graph convolution and graph attention layers.
Does CARATE need a GPU?
No. The reference results were trained on desktop CPUs. The paper reports GPU training as slightly faster but less reproducible across CUDA versions.
Which datasets was it tested on?
ZINC, ALCHEMY, MCF-7, MOLT-4, YEAST, ENZYMES and PROTEINS, each with five-fold stratified cross-validation.
Is CARATE peer reviewed?
Not yet. It is a bioRxiv preprint, currently in version 6.
Read the paper
Introducing CARATE: Finally speaking chemistry through learning hidden wave-function representations on graph-based attention and convolutional neural networks
Julian M. Kleber. bioRxiv preprint (version 6), 2024-05-02. Not peer reviewed.
How to cite: Kleber, J. M. (2024). Introducing CARATE: Finally speaking chemistry through learning hidden wave-function representations on graph-based attention and convolutional neural networks. bioRxiv. https://doi.org/10.1101/2022.02.12.470636
Links
About the author
Julian M. Kleber is a scientist and engineer in Berlin working on chemistry, machine learning and scientific software. ORCID · Google Scholar · LinkedIn · julianmkleber.com
More
sail.black
How do you stay in control of many SI agents at once?
Reeldemo
How to remove the click in a wavetable loop
Reeldemo
Signal discontinuities matter beyond music
Li
Li: a programming language for fast, checkable software
How do bacteria close the rings of antibiotics? A new idea
Can fluorine form triple bonds? A plain-language look
CACHE #1: can computers find drugs for a Parkinson's target?
Watching drugs move: Markov models of protein interactions