Evaluating Machine Learning Models for Molecular Property Prediction: Performance and Robustness on Out-of-Distribution Data

Hosein Fooladi, Thi Ngoc Lan Vu, Miriam Mathea, Johannes KirchmairJournal of Chemical Information and Modeling 2025

TL;DR

This paper investigates how well machine learning models predict molecular properties when faced with data that differs from their training data (out-of-distribution, or OOD). They found that the "hardness" of the OOD data split significantly impacts model performance and that the correlation between in-distribution and OOD performance isn't always a reliable indicator for model selection.

What Problem Does This Paper Address?

Machine learning (ML) models are increasingly used in drug discovery to predict molecular properties. However, these models are typically trained and evaluated on data that is very similar to the training data (in-distribution, or ID). In real-world applications, models often encounter molecules that are quite different from what they've seen before (out-of-distribution, or OOD). This can lead to a significant drop in performance, making predictions unreliable. The challenge is to understand how different ways of creating OOD data affect model performance and whether a model's good performance on ID data guarantees good performance on OOD data.

Methods

The researchers evaluated 14 ML models, including classical methods like Random Forests and advanced Graph Neural Networks (GNNs). They used ten different strategies to split their data into training (ID) and testing (OOD) sets, aiming to create varying degrees of "out-of-distributionness." These splitting strategies ranged from simple property-based splits (like molecular weight) to more complex clustering-based methods. They then measured model performance using ROC-AUC and hit rate, comparing performance on ID versus OOD data. They also analyzed the correlation between ID and OOD performance to see if good ID performance reliably predicts good OOD performance.

Datasets

The study used eight publicly available datasets from the Therapeutic Data Commons (TDC) database, focusing on ADMET (absorption, distribution, metabolism, excretion, and toxicity) and bioactivity prediction tasks. These datasets were selected based on specific criteria: binary classification tasks, data set sizes between 5,000 and 20,000 data points, and class balance between 30% and 70% active compounds.

Key Insights and Ideas

  • Scaffold splitting isn't always the "hardest" OOD challenge: Contrary to some previous assumptions, the study found that splitting based on Bemis-Murcko scaffolds often leads to less challenging OOD scenarios than clustering-based methods. This is because scaffolds can be very specific, leading to many unique scaffolds with few molecules, which doesn't always create a significant structural shift.
  • Clustering is a tougher OOD test: Methods like UMAP-based clustering and Lo-Hi splitting proved to be the most challenging for models, creating the largest distribution shifts and performance drops.
  • ID performance is not a perfect predictor of OOD performance: While there's often a positive correlation between in-distribution (ID) and out-of-distribution (OOD) performance, this correlation is highly dependent on how the OOD data is generated. For "easier" splits (like random or scaffold), the correlation is strong, but for "harder" splits (like clustering), it weakens significantly. This means a model that performs well on ID data might not necessarily perform well on OOD data, especially in challenging scenarios.
  • GNNs show more robustness than classical models in some cases: While both classical ML and GNNs generally follow similar trends in performance degradation, GNNs sometimes demonstrated greater robustness, especially in chemically challenging splits.

Key Results

  • Performance Gap Varies Widely: The difference in performance (measured as Δ ROC-AUC) between ID and OOD test sets varied significantly depending on the splitting strategy. For example, the scaffold splitter showed a small gap (around 0.01-0.04), while UMAP clustering and Lo-Hi splitting showed larger gaps (around 0.088 and 0.070, respectively, for aggregated results).
  • Correlation Strength Varies: The Pearson correlation coefficient between ID and OOD ROC-AUC ranged from a strong 0.97 (for random splitting with classical ML) down to a weak 0.19 (for Lo-Hi splitting with classical ML).
  • Model Type Matters for Robustness: While both classical ML and GNNs struggled with harder splits, GNNs and pretrained GNNs showed slightly better robustness in some clustering-based splits, meaning their performance dropped less severely.
  • Hit Rate and ROC-AUC Can Diverge: The study found moderate correlations between hit rate and ROC-AUC, indicating that these metrics don't always tell the same story, especially under challenging distribution shifts.

Limitations and Future Work

  • Data Set Size and Scope: The study used datasets with 5,000-20,000 molecules. The generalizability of findings to much smaller or larger datasets, common in different stages of drug discovery, needs further investigation.
  • Binary Classification Focus: The study focused on binary classification tasks. Extending the analysis to regression tasks or other molecular property domains is needed.
  • Target Promiscuity: The datasets used had promiscuous targets, meaning many structurally diverse compounds were active. This might bias results against scaffold splitting, which is more effective for congeneric series often found in industry.
  • Fixed Hyperparameters: To ensure fair comparison, fixed hyperparameters were used. This might lead to suboptimal performance for some models on specific datasets.
  • Future Work: The authors suggest investigating the impact of these findings on smaller datasets, exploring other evaluation metrics, and understanding the inverse correlations observed in some cases. They also highlight the need for more reliable evaluation protocols for OOD scenarios.

Summary updated

BibTeX
@article{fooladi2025evaluating,
  author = {Hosein Fooladi and Thi Ngoc Lan Vu and Miriam Mathea and Johannes Kirchmair},
  title = {{Evaluating Machine Learning Models for Molecular Property Prediction: Performance and Robustness on Out-of-Distribution Data}},
  journal = {Journal of Chemical Information and Modeling},
  year = {2025},
  doi = {10.1021/acs.jcim.5c00475},
}
Figure