[Paper Review] Explaining Deep Graph Networks with Molecular Counterfactuals
This paper proposes MEG, a reinforcement learning-based framework that generates chemically valid molecular counterfactuals to explain predictions from deep graph networks in molecule property prediction. By generating structurally similar molecules with divergent predicted properties, MEG reveals model behavior and exposes limitations in local explainers like GNNExplainer, offering domain experts actionable insights into model reasoning.
We present a novel approach to tackle explainability of deep graph networks in the context of molecule property prediction tasks, named MEG (Molecular Explanation Generator). We generate informative counterfactual explanations for a specific prediction under the form of (valid) compounds with high structural similarity and different predicted properties. We discuss preliminary results showing how the model can convey non-ML experts with key insights into the learning model focus in the neighborhood of a molecule.
Motivation & Objective
- To address the lack of interpretability in deep graph networks (DGNs) for molecule property prediction, especially in safety-critical applications.
- To provide domain experts with intuitive, case-based reasoning tools through counterfactual molecules that are structurally similar but predictably different.
- To overcome the narrow scope of local explainers like GNNExplainer by generating broader, more generalizable explanations through counterfactual sampling.
- To validate that counterfactual explanations can reveal model inconsistencies and align with chemical domain knowledge.
- To develop a model-agnostic, explainability framework that works with any DGN by leveraging only input-output behavior.
Proposed method
- MEG frames counterfactual generation as a multi-objective reinforcement learning (RL) problem to maximize prediction disagreement and structural similarity.
- The RL agent uses a policy network to generate molecular counterfactuals via graph-editing operations constrained by chemical validity rules.
- The objective function combines a prediction disagreement loss ℒ(φ(m), φ(m′)) and a structural similarity measure 𝒦[m, m′] to balance fidelity and contrast.
- The agent is implemented using a DQN-based architecture (MolDQN) adapted for molecular graph space with domain-knowledge-constrained actions.
- Explanations are generated by bootstrapping from the input molecule and iteratively modifying it using valid chemical operations.
- The framework is evaluated on two tasks: toxicity classification (Tox21) and solubility regression (ESOL), using both neural encoding and Tanimoto similarity metrics.
Experimental results
Research questions
- RQ1Can counterfactual molecules generated via RL provide more robust and generalizable explanations than local model-agnostic explainers like GNNExplainer?
- RQ2To what extent do MEG-generated counterfactuals reflect chemically meaningful structural changes that alter model predictions?
- RQ3How well do counterfactuals expose inconsistencies in existing local explanation methods, such as GNNExplainer’s fragility to minor structural perturbations?
- RQ4Can the model generate valid, structurally similar molecules with substantially different predicted properties, thereby revealing model focus?
- RQ5Does the use of counterfactuals improve domain experts’ ability to assess whether a DGN’s predictions align with established chemical knowledge?
Key findings
- For the Tox21 dataset, MEG generated counterfactuals (A1–A3) with 76–79% cosine similarity to the original non-toxic molecule (A0), all predicting toxicity with 80–90% confidence, demonstrating a clear shift in model behavior.
- The addition of a carbon atom (e.g., A1, A2) led to a significant increase in predicted toxicity, indicating that the model may be sensitive to specific substructures.
- Counterfactual A3, which broke a ring structure, had the lowest similarity (68%) but still produced a high-confidence toxic prediction, suggesting substructure-awareness in the model.
- In the ESOL dataset, removing or modifying the oxygen atom in pentachlorophenol (B0) led to a substantial drop in predicted solubility (from -4.28 to -6.11), highlighting oxygen’s critical role in the model’s prediction.
- GNNExplainer identified the substructure CC(N)O as key for A0, but MEG counterfactuals emphasized different fragments, revealing that GNNExplainer’s explanation lacks generalization to minor structural changes.
- MEG’s counterfactuals outperformed GNNExplainer in capturing model behavior across a local neighborhood, suggesting MEG can serve as a sanity check for local explainers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.