TL;DR
This paper introduces a novel way to make Graph Neural Networks (GNNs) used in chemistry more interpretable by integrating the established "group contribution" (GC) method. By subtly modifying how GNNs aggregate information, they can reveal how different molecular fragments contribute to a prediction, all while maintaining high accuracy. This approach offers a more chemically intuitive explanation than general XAI methods.
What Problem Does This Paper Address?
Predicting chemical properties using machine learning, particularly Graph Neural Networks (GNNs), has seen remarkable success. However, these models often act as "black boxes," making it difficult to understand why they make a certain prediction. This lack of interpretability hinders trust, limits the ability of chemists to refine models with their domain knowledge, and makes it harder to make informed decisions based on predictions. While general Explainable AI (XAI) methods exist, they often require customization for specific applications like chemistry. This paper aims to bridge this gap by leveraging a well-established chemical concept, group contributions, to create more relevant and chemically intuitive explanations for GNN predictions without sacrificing accuracy.
Methods
The core innovation lies in modifying the aggregation step within GNNs. Traditionally, GNNs aggregate node embeddings after message passing to form a final prediction. This paper proposes to aggregate these embeddings based on predefined "groups" of atoms within a molecule. These groups are defined as a central atom and its neighbors, inspired by the Benson group contribution method.
Specifically, the authors:
- Modified the aggregation mechanism: Instead of a simple sum of all neighbor embeddings, they sum embeddings within each defined group and then sum these group contributions for the final prediction.
- Introduced a custom loss function: This function encourages the GNN to learn group contributions that align with those predicted by a simpler, interpretable linear regression model (based on group counts). This custom loss has two components: the standard prediction error and an error term penalizing deviations from reference group contributions. The influence of the custom loss is gradually reduced during training.
Datasets
The primary dataset used is QM9. This dataset contains quantum mechanical calculations for a large number of organic molecules. The paper focuses on predicting two properties from this dataset:
- Enthalpy of formation ($\Delta H_f$)
- HOMO-LUMO gap ($\Delta \epsilon$)
The data was split using a scaffold-based approach (70% training, 15% validation, 15% testing) to ensure a more robust evaluation of model generalization.
Key Insights and Ideas
- Domain knowledge enhances XAI: Integrating established chemical concepts like group contributions can lead to more meaningful and interpretable explanations for complex ML models in chemistry.
- GNNs learn distinct patterns: Different GNN architectures (SchNet and EGNN) can learn distinct underlying patterns, even when achieving similar predictive accuracy. This is revealed by comparing their learned group contributions.
- Custom loss can guide learning: A custom loss function can effectively guide a GNN's learning process to align with domain-specific knowledge (like reference group contributions) without significantly degrading predictive performance.
- GC methods are a powerful XAI tool for GNNs: The paper demonstrates that GC methods, traditionally used with simpler models, can be effectively adapted to explain GNNs, offering a valuable bridge between interpretable and high-performance models.
Key Results
- High Accuracy Maintained: The proposed group aggregation method and custom loss function did not significantly compromise the predictive accuracy of the GNN models (SchNet and EGNN) for both $\Delta H_f$ and $\Delta \epsilon$. For $\Delta H_f$, GNNs achieved R² values of 0.998, and for $\Delta \epsilon$, R² values ranged from 0.917 to 0.934.
- Improved Interpretability: The XAI plots generated using group contributions showed good agreement between the ridge regression baseline and the SchNet model for both properties. This indicates that SchNet learned chemically relevant group contributions.
- EGNN's Divergent Learning: The EGNN model showed lower agreement in group contributions compared to the ridge regression baseline, suggesting it learns different underlying chemical patterns than SchNet or the traditional GC approach.
- Custom Loss Effectiveness: When trained with the custom loss, the cosine similarity between GNN and ridge regression group contributions increased significantly (e.g., up to 0.99 for $\Delta H_f$ and 0.96 for $\Delta \epsilon$), demonstrating successful alignment with chemical intuition.
Limitations and Future Work
- EGNN's unique learning: The paper highlights that EGNN's learned patterns differ from those of SchNet and ridge regression. Further investigation is needed to understand why EGNN learns differently and if these unique insights can be leveraged.
- Generalizability: While the authors hypothesize their approach would generalize to more recent GNN models, this was not explicitly tested.
- Dataset scope: The study was conducted on the QM9 dataset. Future work should explore other datasets and chemical tasks to validate the robustness of the approach.
- Custom loss parameter tuning: The optimal weighting and decay schedule for the custom loss function might require further exploration for different tasks.
- Broader application of GC: The paper suggests exploring other GNN models and datasets to further validate and expand upon these results, potentially integrating more sophisticated GC methods.
Summary updated