Abstract
Chemical toxicity prediction using machine learning is important in drug development to reduce repeated animal and human testing, thus saving cost and time. It is highly recommended that the predictions of computational toxicology models are mechanistically explainable. Current state of the art machine learning classifiers are based on deep neural networks, which tend to be complex and harder to interpret. In this paper, we apply a recently developed method named contrastive explanations method (CEM) to explain why a chemical or molecule is predicted to be toxic or not. In contrast to popular methods that provide explanations based on what features are present in the molecule, the CEM provides additional explanation on what features are missing from the molecule that is crucial for the prediction, known as the pertinent negative. The CEM does this by optimizing for the minimum perturbation to the model using a projected fast iterative shrinkage-thresholding algorithm (FISTA). We verified that the explanation from CEM matches known toxicophores and findings from other work.
Introduction
In drug discovery, toxicity is a multi-billion-dollar dealbreaker. While deep learning models have become increasingly accurate at predicting whether a new compound will be toxic (in silico), they are notoriously "black-box" systems. Traditional explainability in chemistry focuses on toxicophores: specific sub-structures (like a certain arrangement of nitrogen and oxygen) that act as "red flags."
However, knowing a molecule is toxic because of a specific feature is only half the story. To design safer drugs, scientists also need to understand why a molecule is not toxic, or what specific modification would tip the scales. Most current methods fail to explain the impact of absent features, leaving a gap in our mechanistic understanding of chemical safety. This paper addresses this gap by applying the Contrastive Explanations Method (CEM) to molecular toxicity.
Methodology
The researchers utilize the Contrastive Explanations Method (CEM) to move beyond simple feature identification. CEM breaks explanations into two distinct parts:
- Pertinent Positives (PP): The minimal set of features present in the molecule that justify its current classification (e.g., "It is toxic because it has this specific nitro group").
- Pertinent Negatives (PN): The minimal set of features that are missing, which, if added, would flip the model’s prediction (e.g., "It is non-toxic now, but adding a bromine atom here would make it toxic").
To implement this, molecules were represented using Morgan fingerprints, converting chemical structures into a 4096-bit vector. The CEM algorithm then uses an optimization technique called FISTA (Fast Iterative Shrinkage-Thresholding Algorithm) to find the smallest possible "perturbation"—adding or removing bits in that vector—required to change the model's output.
Experimental Setup
The study uses data from the Tox21 challenge, specifically the SR-MMP task, which measures a molecule's ability to disrupt mitochondrial membrane potential. The dataset contains roughly 10,000 molecules tested in vitro. The underlying Deep Neural Network (DNN) achieved a respectable ROC AUC of 0.8777 on this task, with a high true negative rate (0.9524), making it a reliable base for generating explanations.
Results and Discussion
The Power of the Negative
The most striking insight is that "missingness" is a valid chemical explanation. For a non-toxic molecule like triphenylphosphine oxide, the model identified that adding specific chlorine-based structures would make it dangerous. This gives researchers a "safety boundary" for molecular design.
In another example, for triphenylborane (which the model initially misclassified), CEM showed that adding just 5 specific bits—representing bromine or hydroxyl groups—would flip the prediction to toxic. This demonstrates how CEM can identify the specific chemical "tipping points" for toxicity.
Debugging and Validation
CEM also helps explain model errors. In one instance, the model incorrectly predicted a non-toxic molecule as toxic. CEM revealed the model was over-relying on the presence of a hydroxyl (OH) group and a chlorine atom—features that often correlate with toxicity in other contexts but were not the primary drivers here.
Crucially, the features identified by the CEM (both PP and PN) matched well-known "structural alerts" used by human toxicologists, such as phenolic OH groups and aliphatic halides. This alignment builds trust between AI models and human experts.
Conclusion
By highlighting Pertinent Negatives, the CEM approach provides a roadmap for chemists to design safer drugs and understand "black-box" model failures. While limitations remain—such as the distinction between correlation and causation and the lack of 3D spatial context in bit-vector representations—this method significantly advances the interpretability of computational toxicology. Future work will focus on expanding these contrastive explanations across more complex biological pathways.
Summary updated