Wednesday, July 29, 2020

OrbNet: Deep Learning for Quantum Chemistry Using Symmetry-Adapted Atomic-Orbital Features


Figure 4 from the paper. (c) the authors 2020.

This method takes information from a GFN1-xTB calculation as input to a graph-convolution (GC) NN to predict the difference between DFT and GFN1-xTB total energies. In conventional GC the molecule is typically represented by an adjacency matrix (a binary matrix where 1 indicates a bond) and a list of atomic and bond features, such as nuclear charges and bond orders, associated with each node and edge. This approach uses the diagonal and off-diagonal elements of matrices such as Fock, overlap, and density matrices from a GFN1-xTB calculation as node and edge features, respectively. 

The model gets state-of-the-art accuracies for QM9 total energies and the same model also gets excellent results for conformational energies from a different data set. Basically DFT level accuracy at semiempirical cost (it's not clear to me how it can be faster than the underlying GFN1-xTB calculation, but that might be down to different implementation of the GFN1-xTB method).

It's not clear to me weather the method can be used to optimise geometries, and thereby correct any deficiency in GFN1-xTB structures, and it's also not clear whether the code will be made available.

Monday, June 29, 2020

What Does the Machine Learn? Knowledge Representations of Chemical Reactivity

Joshua A. Kammeraad, Jack Goetz, Eric A. Walker, Ambuj Tewari, and Paul M. Zimmerman (2020)
Highlighted by Jan Jensen

Figure 1 from the paper (c) American Chemical Society 2020

While I don't agree with everything said in the paper, I highlight it here because I found it very thought provoking. 

The paper tests several feature sets and ML modes for the prediction of activation energies and compares their performances to using Evans-Polanyi relationships (i.e. where the activation energy is a linear function of the reaction energy for certain reaction classes). The overall goal is to determine find a ML model that is "accurate & easy to interpret" (last panel of the figure above).

More specifically, the authors test SVM, NN, and 2-nearest neighbour models using several feature sets that all include the reaction energy. They find that all models and feature sets perform (roughly) equally well and conclude that "the machine-learning models do little more than memorize values from clusters of data points, where those clusters happened to be similar reaction types." 

Furthermore, the authors show that using an Evans−Polanyi model for different reaction is about 5% more accurate than the machine learning models suing one-hot encoding of atom and bond-types in addition to the reaction energy. They go one to write "This low-dimensionality model (2 parameters per reaction type) is algorithmically and conceptually easier to apply and can be evaluated using chemical principles, making it transferable to new reactions within the same class."

I would argue that the ML has rediscovered the Evans−Polanyi model. From an ML perspective, the feature set of the Evans−Polanyi model is the reaction energies and (a one-hot encoding of) the reaction types. This representation is shown to work quite well with the ML models, and the lack of improvement upon including more features (such as atomic charges) shows that (almost) all the information needed for accurate predictions is contained in the reaction energy. 

Furthermore, the fact that you get good results from the 2-nearest neighbour model (where the prediction is an average of the two nearest points) suggests that the relationship between between reaction energy and activation energy is linear. If the average is weighted and the linear relationship is exact, then one would get exact results from the 2-nearest neighbour model. 

The only "memorization" comes from the selection of reaction types. The selection of reaction types by the authors is done based on atom and bond types, so it's not surprising that a one-hot encoding of these properties also encodes these reaction types. 

Given the simplicity of the representation, 2-nearest neighbours or SVM do not necessarily require more data to parameterise than the Evans−Polanyi model.
In my opinion, the last panel in the figure above should be redrawn, so that the concepts (the coloured shapes) are the inputs to the model, which in this case are the reaction energies and (one-hot encoded) reaction types. 

These concepts are implicitly encoded in the molecular graph and can be learned by graph convolution using much more complex ML models and lots of data. But, in analogy with complex but accurate wavefunctions which also encodes these concepts implicitly, extracting them from a complex ML models is not necessarily possible. If one wants simple, qualitative explanations, one has to construct simple qualitative models.

As Robert Mulliken said more than 50 years ago, the more accurate (and complex) the calculations become the more the concepts tend to vanish into thin air. Nothing has changed in this regard.

Sunday, May 31, 2020

Learning Molecular Representations for Medicinal Chemistry

Kangway V. Chuang, Laura M. Gunsalus, and Michael J. Keiser (2020)
Highlighted by Jan Jensen


Figure 3 from the paper. (c) ACS 2020.

I found this miniperspective a very enjoyable read. It covers much more than the title suggests (at least to me), such as a mini history of deep learning in MedChem, when to use deep learning and when to use other ML techniques such as regression of random forest (see the figure above), and some of the fundamental challenges of using ML and generative models in MedChem (just to name a few). 

I found the last topic particularly interesting and include two of my favourite quotes from the paper below, but I really recommend that you read the entire paper.

Critically, small-molecule drug discovery breaks standard assumptions in many technological applications of machine learning. Most machine learning algorithms operate on the assumption that training and testing data are independently and identically distributed (the i.i.d. assumption). For example, we would expect a standard image classifier trained to exclusively distinguish cats from dogs to generalize to new images of cats and dogs. This model will likely produce nonsensical classifications if asked to evaluate pictures of humans. In stark contrast, real-world drug-discovery breaks this standard i.i.d.assumption. The optimization and design of small molecules necessarily explore structural variations drawn from intentionally novel regions of chemical space. Large structural changes to small-molecule hits are typically required to become a lead. For a model to be useful to the practicing medicinal chemist, it must generalize to out-of-distribution examples.
Critically, if generative models are to guide drug design, they cannot merely produce trivial extensions of the training data set. It remains unclear whether the latent spaces of generative models, which effectively interpolate across the chemical space of the training data, are capable of usefully extrapolating into new regions of chemical structure space. Furthermore, current generative models are torn between novelty and accessibility.



This work is licensed under a Creative Commons Attribution 4.0 International License.

Monday, May 18, 2020

Open Graph Benchmark: Datasets for Machine Learning on Graphs

A diverse collection of datasets for use in ML applications to graphs has been collected by Hu et al. The Benchmark is intuitively structured and includes evaluation protocols and metrics. Furthermore, the authors have reported the measured performance of a few popular approaches within each application (e.g., ROC-AUC,PRC-AUC, hits, or accuracy). There are several datasets in all three classes of tasks: Node property prediction (ogbn-), link property (ogbl-) prediction, and graph property prediction (ogbg-). 

Of particular interest to those of us who work in biochemistry broadly defined are the SMILES molecular graphs adapted from MoleculeNet [2] such as ogbg-molhiv (HIV) and ogbg-pcba (PubChem Bio Assay); however, also ogbl-ppa (Protein-Protein Association) and ogbn-proteins (Protein-Protein Association) are of interest. Note that MoleculeNet is not included in its entirety - far from it. So, that resource is definitely also interesting to have a close look at if you have not already explored it.

If you are the competitive type, your efforts can be submitted to scoreboards at the hosting website: https://ogb.stanford.edu