🤖 AI Summary
Existing explainable AI methods for molecular property prediction often employ masking strategies that yield chemically invalid substructures, undermining interpretability and practical utility. To address this, we propose a counterfactual masking framework that replaces masked substructures with chemically valid, distributionally consistent fragments sampled from a generative model—ensuring counterfactual molecules adhere to the underlying molecular distribution. Our approach integrates substructure masking, graph generation, counterfactual reasoning, and fidelity evaluation, constituting the first interpretable analysis method that explicitly preserves molecular distribution. Extensive experiments across multiple benchmark datasets demonstrate that our method significantly improves the chemical plausibility, intuitiveness, and design-oriented applicability of explanations. By grounding interpretability in causal, distribution-aware perturbations, it bridges model transparency with actionable molecular design insights.
📝 Abstract
Molecular property prediction is a crucial task that guides the design of new compounds, including drugs and materials. While explainable artificial intelligence methods aim to scrutinize model predictions by identifying influential molecular substructures, many existing approaches rely on masking strategies that remove either atoms or atom-level features to assess importance via fidelity metrics. These methods, however, often fail to adhere to the underlying molecular distribution and thus yield unintuitive explanations. In this work, we propose counterfactual masking, a novel framework that replaces masked substructures with chemically reasonable fragments sampled from generative models trained to complete molecular graphs. Rather than evaluating masked predictions against implausible zeroed-out baselines, we assess them relative to counterfactual molecules drawn from the data distribution. Our method offers two key benefits: (1) molecular realism underpinning robust and distribution-consistent explanations, and (2) meaningful counterfactuals that directly indicate how structural modifications may affect predicted properties. We demonstrate that counterfactual masking is well-suited for benchmarking model explainers and yields more actionable insights across multiple datasets and property prediction tasks. Our approach bridges the gap between explainability and molecular design, offering a principled and generative path toward explainable machine learning in chemistry.