Abstract
Machine learning techniques paired with the availability of massive datasets dramatically enhance our ability to explore the chemical compound space by providing fast and accurate predictions of molecular properties. However, learning on large datasets is strongly limited by the availability of computational resources and can be infeasible in some scenarios. Moreover, the instances in the datasets may not yet be labelled and generating the labels can be costly, as in the case of quantum chemistry computations. Thus, there is a need to select small training subsets from large pools of unlabeled data points and to develop reliable ML methods that can effectively learn from small training sets. This chapter focuses on predicting the molecules’ atomization energy in the QM9 dataset. We investigate the advantages of employing domain knowledge-based data sampling methods for an efficient training set selection combined with informed ML techniques. In particular, we show how maximizing molecular diversity in the training set selection process increases the robustness of linear and nonlinear regression techniques such as kernel methods and graph neural networks. We also check the reliability of the predictions made by the graph neural network with a model-agnostic explainer based on the rate-distortion explanation framework.
Introduction
In computational chemistry, predicting molecular properties like atomization energy traditionally relies on ab initio methods such as Density Functional Theory (DFT). While highly accurate, DFT is computationally expensive, limiting its application to relatively small sets of molecules. Machine learning (ML) offers a fast alternative, but training accurate models requires large datasets of molecules already labeled via these expensive calculations.
When computational budgets limit labeling to a small fraction of a chemical space, the strategy for selecting training samples becomes critical. Furthermore, standard metrics like Mean Absolute Error (MAE) can be misleading; a model might perform well on average but fail catastrophically on specific outliers. This research explores how selecting small, highly informative training subsets can maximize model robustness and minimize these critical worst-case errors.
Methodology
Data Sampling Strategies
Rather than relying on 3D coordinates for selection, the study utilizes 64-dimensional topological vectors generated via the Mordred library from 2D SMILES strings. Three strategies are compared:
- Random Sampling (RDM): The standard baseline.
- Farthest Point Sampling (FPS): A greedy algorithm that maximizes diversity by iteratively selecting molecules furthest from the existing set in the feature space.
- Cluster-based FPS (C-FPS): A method ensuring representativeness by clustering molecules by size and bond types before applying FPS within those clusters.
Machine Learning Models
The study evaluates three distinct architectures:
- SchNet: A geometry-based Graph Neural Network (GNN) utilizing 3D atomic coordinates.
- Kernel Ridge Regression (KRR): A classical approach using a Gaussian kernel based on 2D Mordred features.
- Spatial 3-Hop Convolution Network: A novel topology-based GNN proposed in this work that performs spatial convolutions based on path matrices, relying solely on 2D graph structure.
Explainability
To validate model learning, the Graph Rate-Distortion Explainer (GRDE) was employed. This post-hoc technique masks parts of the molecular graph to identify which nodes and edges most influence the model's predictions.
Results and Discussion
Diversity and Robustness
The primary finding is that diversity-driven sampling (FPS) acts as a safeguard against outliers. While it may not always drastically lower average error, it significantly reduces the maximum absolute error. For instance, FPS reduced the worst-case error of the KRR model by an order of magnitude compared to random sampling.
For the geometry-based SchNet, FPS reduced worst-case errors by at least 0.5 eV in small training sets (up to 500 samples). However, these benefits diminished as the dataset size grew, likely due to a mismatch between the global features used for FPS and the local feature aggregation inherent to GNNs.
Bridging the 2D/3D Gap
Geometry-based models like SchNet typically outperform 2D models because 3D coordinates encode significant physical information. However, by employing FPS, the simpler 2D topology-based KRR model achieved worst-case errors comparable to SchNet, suggesting that diversity sampling allows simpler models to achieve high robustness.
Chemical Interpretability
Explainability analysis via GRDE revealed that models trained on diverse (FPS) datasets learn more meaningful chemistry. These models balanced their attention across both node features (atomic numbers) and edge features (double or aromatic bonds). In contrast, models trained on random subsets often ignored critical edge features, treating them as noise.
Conclusion
This research demonstrates that carefully selecting a small, diverse training set is a powerful tool for building robust molecular ML models. By focusing on diversity rather than just volume, researchers can achieve high reliability even with limited computational budgets for labeling. Future work will focus on establishing a theoretical foundation for these empirical results and applying these techniques to Machine Learning Interatomic Potentials (MLIPs) for molecular dynamics simulations, where preventing worst-case errors is vital for simulation stability.
Summary updated