TL;DR
This paper introduces PIECE, a novel method for generating plausible counterfactual and semi-factual explanations for deep learning models, particularly for image classification. PIECE addresses the challenge of creating human-understandable explanations for complex CNNs by identifying and modifying "exceptional" image features to align with a target class, outperforming existing methods in plausibility.
What Problem Does This Paper Address?
As deep learning models become increasingly powerful and are deployed in high-stakes domains like medicine and law, understanding why they make certain predictions is crucial. This field, known as Explainable AI (XAI), grapples with the "black box" nature of these models. Counterfactual explanations, which show how a small change to an input could alter the prediction, are highly valued for their computational, psychological, and legal benefits. However, generating plausible counterfactuals for image data is difficult because images are non-discrete, and changes must lie on the data manifold to be realistic. Furthermore, a related type of explanation, "semi-factuals" (which explain why a prediction would remain the same even with certain changes), are intuitively useful for human reasoning but have been largely ignored in AI. This paper aims to bridge this gap by proposing a method that generates both plausible counterfactuals and the first AI-generated semi-factuals for image classification.
Methods
The core of the proposed method, Plausible Exceptionality-based Contrastive Explanations (PIECE), lies in its "experience-guided" approach. It leverages the distributional properties of the training data to identify "exceptional" features within a test image. These exceptional features are defined as those that have a low probability of occurring for the target (counterfactual) class.
The process involves:
- Identifying the Counterfactual Class: This is straightforward for misclassifications (the true label is the target) but requires a novel gradient ascent method for correct classifications to find a plausible alternative class.
- Identifying Exceptional Features: For a given test image and its latent representation, PIECE models the probability distribution of each neuron's activation for the counterfactual class. Features with low probability (either activating when they shouldn't, or not activating when they should) are flagged as exceptional.
- Modifying Exceptional Features: PIECE then modifies these exceptional features to their "expected" values for the counterfactual class. Crucially, it only modifies features that are likely to influence the classification towards the target class. For semi-factuals, this modification process is stopped before the prediction crosses the decision boundary.
- Generating Explanatory Images: A Generative Adversarial Network (GAN) is used to visualize these modified latent representations back into plausible image explanations.
Datasets
The paper evaluates its method on two standard image datasets:
- MNIST: A dataset of handwritten digits, used for both training and testing.
- CIFAR-10: A dataset of small color images in 10 classes, also used for training and testing.
The authors note that their method is applicable to any pre-trained CNN and GAN trained on the same dataset.
Key Insights and Ideas
- Semi-factuals are overlooked but valuable: The paper highlights that humans naturally use semi-factual explanations ("Even if X happened, Y would still be true") to reinforce reasoning, yet AI research has focused almost exclusively on counterfactuals. PIECE demonstrates that semi-factuals can be generated effectively and offer unique benefits.
- "Exceptionality" as a key to plausibility: The core idea of identifying features that are "unusual" for the target class and making them "normal" is a powerful heuristic for generating realistic counterfactuals. This mirrors human intuition where we often focus on what's different or unexpected.
- Bridging the gap between discrete and continuous explanations: The challenge of generating plausible counterfactuals for images (continuous data) is addressed by working in the latent space of the CNN and using GANs for visualization, effectively translating abstract feature changes into visual ones.
- Automating counterfactual generation for multi-class problems: Unlike some prior work that focused on binary classification, PIECE automates the process for multi-class scenarios, which is a significant practical advancement.
Key Results
- Superior Plausibility: In Experiment 1, PIECE consistently outperformed other counterfactual explanation methods across multiple plausibility metrics (MC-Mean, MC-STD, NN-Dist, IM1, R%-Sub) on both MNIST and CIFAR-10 datasets. For instance, PIECE achieved a significantly higher R%-Sub score (69.32%) on MNIST compared to Min-Edit (42.87%).
- First AI-Generated Semi-Factuals: Experiment 2 demonstrated PIECE's ability to generate semi-factual explanations. PIECE produced significantly better semi-factuals (measured by L1 pixel distance) than minimal-edit methods, indicating more substantial, yet still non-class-changing, modifications.
- Robustness: PIECE was shown to be effective across different types of classifications (correct, close-correct, and incorrect) and did not require human intervention for identifying counterfactual classes.
Limitations and Future Work
- Computational Cost: While PIECE automates the process, generating explanations still involves optimization steps and GAN inference, which can be computationally intensive.
- Dataset Specificity: The current implementation relies on a trained GAN for the specific dataset. Extending this to new datasets would require training a new GAN.
- Future Directions: The authors suggest extending PIECE to more complex image datasets, exploring its application to text and tabular data using recent generative models, and further investigating semi-factual explanations due to their rich potential. They also acknowledge the ethical implications of revealing how algorithms work, balancing transparency with proprietary concerns.
Summary updated