Nature Machine Intelligence
Nature Machine Intelligence
Molecular deep learning at the edge of chemical space
Molecular machine learning models often fail to generalize beyond the chemical space of their training data, limiting their ability to reliably perform predictions on structurally novel bioactive molecules. Here, to advance the ability of machine learning to go beyond the 'edge' of their training chemical space, we introduce a joint modelling approach that combines molecular property prediction with molecular reconstruction. This approach allows the introduction of unfamiliarity, a reconstruction-based metric that enables the estimation of model generalizability. Via a systematic analysis spanning more than thirty bioactivity datasets, we demonstrate that unfamiliarity not only effectively identifies out-of-distribution molecules but also serves as a reliable predictor of classifier performance. Even when faced with the presence of strong distribution shifts on large-scale molecular libraries, unfamiliarity yields robust and meaningful molecular insights that go unnoticed by traditional methods. Finally, we experimentally validate unfamiliarity-based molecule screening in the wet lab for two clinically relevant kinases, discovering seven compounds with low micromolar potency and limited similarity to training molecules. This demonstrates that unfamiliarity can extend the reach of machine learning beyond the edge of the charted chemical space, advancing the discovery of diverse and structurally novel molecules.
Molecular machine learning is rapidly gaining traction in early drug discovery. One key objective is identifying novel bioactive molecules ('hits') on one or more pharmacological targets. In this context, finding structurally novel hit molecules is crucial for addressing unmet therapeutic needs, ensuring commercial viability, and overcoming drug resistance. However, moving beyond the structural features of the training molecules (for example, to identify novel bioactive molecular cores) poses a substantial challenge for machine learning models, which often fail when applied to out-of-distribution molecules. This is especially true for discrete data, such as molecules, which can quickly deviate from the data distribution learned during model training. This is further exacerbated by the scarcity of structurally diverse molecular data with high-quality experimental annotations, due to the costly and time-consuming nature of biochemical experiments. As a result, training sets typically contain only hundreds of molecules, while libraries used for screening may contain billions of existing, but previously unseen, chemicals to be predicted. Dealing with the resulting distribution shifts makes the discovery of structurally novel hit molecules with machine learning a herculean task. In this regard, quantifying how reliable predictions are beyond the 'edge' of the explored chemical space holds enormous promise.
Ensuring prediction reliability in prospective hit-screening campaigns has been an active topic of research. A well-established approach involves defining an applicability domain, which delimits the chemical space of reliable predictions, most often via a threshold on molecular similarity to the training data. However, this method does not incorporate the information learned by the model, and, due to its similarity-based definition, hampers the discovery of structurally novel molecules. Another widely used approach is based on uncertainty estimation, which leverages the model's prediction confidence, often through probabilistic modelling techniques. While uncertainty estimation allows the consideration of structurally novel molecules in principle, it may provide overconfident predictions when confronted with out-of-distribution samples. Hence, being able to make reliable predictions on out-of-distribution molecules remains one of the core challenges of molecular machine learning in drug discovery.
Here we offer a fresh perspective on how to better navigate the 'edge' of chemical space with deep learning, while accounting for prediction reliability on out-of-distribution molecules. To achieve this, we leverage recent advances in generative deep learning for de novo molecule design, in particular autoencoders. Autoencoders can be trained to encode molecular structures into a lower-dimensional latent space, and subsequently decode them back to their original form. In this work, through joint molecular modelling, we simultaneously train deep learning models to predict molecular properties (for example, bioactivity) and reconstruct the input molecule in a semi-supervised manner, that is, by learning from a combination of labelled and unlabelled molecular data.
Our joint learning approach breaks with the well-established application of leveraging a self-supervised learning task for generative chemistry or for predictive performance improvement, by using reconstruction capabilities as a direct proxy for out-of-distribution estimation. Specifically, we hypothesize that poorly reconstructed molecules are less familiar to the model, indicating that they fall outside the distribution learned from the training data. Building on this hypothesis, we introduce a metric, termed unfamiliarity, which captures a model's reconstruction ability and is proposed to quantify how much a molecule deviates from the training distribution.
In this systematic study, spanning thirty-three experimentally labelled molecular datasets, we show not only that the introduced unfamiliarity metric is a robust indicator of molecular distribution shifts, but also that it strongly correlates with classifier performance. The capacity of unfamiliarity to identify structurally diverse and bioactive molecule is further validated in the wet lab, discovering several compounds with low micromolar activity on two kinase proteins.
Ultimately, the introduced concept of molecular unfamiliarity provides a principled approach to estimating model generalizability, even in the presence of molecular distribution shifts. Our approach offers a fresh perspective on estimating prediction reliability, complementing established concepts such as the applicability domain and uncertainty estimation, guiding the discovery of structurally novel molecules in a more precise and informed manner.
Results
Results
In what follows, we will elaborate on our joint molecular model, introduce the unfamiliarity metric and demonstrate its ability to quantify molecular distribution shifts. Next, we relate molecular property prediction to distribution shifts and leverage this relationship to estimate prediction reliability. Finally, we apply the unfamiliarity metric to prioritize molecules in a virtual screening case study, followed by experimental validation in the wet lab.