Source-linked AI summary
On Generating Plausible Counterfactual and Semi-Factual Explanations for Deep Learning
Eoin M. Kenny, Mark T. Keane
TL;DR
Opaque deep-learning predictions need explanations, yet plausible image counterfactuals and semi-factuals remain underexplored. PIECE modifies exceptional latent features for CNN explanations, and experiments report stronger counterfactual plausibility and semi-factual results than other methods.
Problem
Plausible, human-detectable image counterfactuals are difficult to generate, and semi-factual explanations have received little attention in AI.
Source: Explanations (PIECE) · p. 3Method
PIECE identifies exceptional latent features from the counterfactual class perspective, modifies them toward expected values, and uses a GAN to visualize the result.
Source: The Algorithm: PIECE · p. 3, Step 2: Changing the Exceptional to… · p. 5Results
PIECE generated more plausible counterfactuals than other methods across the reported tests, except IM1 on CIFAR-10, and produced the best semi-factuals in the comparisons.
Source: Experiment 1: Counterfactuals · p. 6, Experiment 2: Semi-Factuals · p. 7Takeaways & Limitations
The work brings semi-factual explanations into deep-learning XAI, where the paper describes them as largely ignored.
Source: Related Work · p. 2SoftMax probability is not considered a reliable measure of CNN certainty, though the paper uses it as a baseline.
Source: Experiment 1: Counterfactuals · p. 6
Abstract
from arXiv · showhide
There is a growing concern that the recent progress made in AI, especially regarding the predictive competence of deep learning models, will be undermined by a failure to properly explain their operation and outputs. In response to this disquiet counterfactual explanations have become massively popular in eXplainable AI (XAI) due to their proposed computational psychological, and legal benefits. In contrast however, semifactuals, which are a similar way humans commonly explain their reasoning, have surprisingly received no attention. Most counterfactual methods address tabular rather than image data, partly due to the nondiscrete nature of the latter making good counterfactuals difficult to define. Additionally generating plausible looking explanations which lie on the data manifold is another issue which hampers progress. This paper advances a novel method for generating plausible counterfactuals (and semifactuals) for black box CNN classifiers doing computer vision. The present method, called PlausIble Exceptionality-based Contrastive Explanations (PIECE), modifies all exceptional features in a test image to be normal from the perspective of the counterfactual class (hence concretely defining a counterfactual). Two controlled experiments compare this method to others in the literature, showing that PIECE not only generates the most plausible counterfactuals on several measures, but also the best semifactuals.
Introduction
The paper motivates contrastive explanations for opaque deep-learning predictions, highlighting the neglect of semi-factuals and the difficulty of plausible image counterfactuals. It positions PIECE as an approach to these gaps for CNNs.
Introduction
- Opaque deep-learning models are increasingly used in high-stakes decisions, creating a need to give end-users insight into predictions.The paper names medicine and law as examples.Source: Introduction · p. 1
Contrastive Explanation
- Semi-factuals offer contrastive explanations without crossing a decision boundary, potentially requiring fewer feature changes, but have been largely ignored in AI.The paper also notes that semi-factuals may reduce negative emotions compared with counterfactuals.Source: Contrastive Explanation · p. 2
Related Work
- Image-focused XAI needs human-detectable, comprehensible, plausible changes, while prior semi-factual work was limited to tabular data and few methods addressed pretrained multiclass CNNs.The paper notes that only one of the cited GAN-based methods explained pretrained CNNs in multiclass classification.Source: Related Work · p. 2
- PIECE detects exceptional latent features and modifies them toward expected values; tests report improved counterfactual measurements and better semi-factuals than other methods.The method automates counterfactual generation for multiclass classification with pretrained CNNs.Source: Related Work · p. 2
Explanations (PIECE)
PIECE seeks plausible contrastive explanations by identifying features that are unusual from the target class’s perspective and changing selected features toward expected values. A GAN renders the changes, and stopping edits before the decision boundary produces semifactuals.
Explanations (PIECE)
- Plausible image explanations should change human-detectable features; PIECE illustrates counterfactual and semifactual changes on MNIST, including a minimal-edit counterfactual with imperceptible changes.The examples contrast changing an “8” so the CNN classifies it as an “8” with changing a “9” without changing its prediction.Source: Explanations (PIECE) · p. 3
The Algorithm: PIECE
- A CNN evaluates feature edits while a GAN trained on the same dataset renders them; semifactual edits stop before the prediction crosses the counterfactual decision boundary.PIECE identifies exceptional target-class features, changes them toward expected values, and visualizes the resulting latent representation.Source: The Algorithm: PIECE · p. 3
Step 1: Identifying Exceptional Features
- For each target class, PIECE models neuron activations from training examples using CNN-predicted classes, fits candidate distributions, and flags feature values with probability below α=0.05.The method fits Gaussian, Gamma, and Exponential distributions and selects the best fit using the Kolmogorov–Smirnov test.Source: Step 1: Identifying Exceptional Features · pp. 4–5
Step 2: Changing the Exceptional to the Expected
- PIECE modifies only exceptional features whose changes move the CNN toward the target class, ordering them from lowest to highest probability for semifactual generation.Changing the features in that order allows edits to stop short of the decision boundary.Source: Step 2: Changing the Exceptional to… · p. 5
Step 3: Visualizing the Explanation
- After constructing x′, PIECE optimizes the GAN’s latent input z′ to match x′ in CNN feature space, then feeds z′ to the generator to visualize the explanation.Source: Step 3: Visualizing the Explanation · p. 5
Experiment 1: Counterfactuals
Experiment 1 evaluates PIECE against other counterfactual-generation methods on MNIST and CIFAR-10. PIECE is reported as more plausible across the tests, with one stated exception for IM1 on CIFAR-10.
Experiment 1: Counterfactuals
- The comparison included PIECE, Min-Edit, C-Min-Edit, CEM, and Proto-CF, with Table 1 reporting average performance across MNIST and CIFAR-10.R%-Substitutability was tested on MNIST only.Source: Experiment 1: Counterfactuals · p. 5, Table 1 · p. 6
- The MNIST test set contained 163 images split among correct (N=60), close-correct (N=62), and incorrect (N=41) classifications; CIFAR-10 used 60 images split evenly by correctness.The MNIST close-correct group had SoftMax probability below 0.8.Source: Experiment 1: Counterfactuals · p. 6
- Plausibility was assessed with MC Dropout, nearest-neighbor distance, autoencoder IM1, and MNIST R%-Substitutability measures.MC-Mean is better when higher, MC-STD and IM1 when lower; R%-Substitutability uses a pixel-space k-NN classifier.Source: Experiment 1: Counterfactuals · p. 6
- PIECE generated more plausible counterfactuals than the other methods across tests (AD > 22, p < .001), except for IM1 on CIFAR-10.Proto-CF and CEM each failed to find explanations for 20 of 25 images on MNIST.Source: Experiment 1: Counterfactuals · p. 6
- On MNIST, NN-Dist had significant linear relationships with MC-Mean and MC-STD scores (r = -0.8/0.82).The authors report that counterfactuals more grounded in training data were more likely to be plausible.Source: Experiment 1: Counterfactuals · p. 6
Experiment 2: Semi-Factuals
Experiment 2 compares semi-factuals from PIECE and two minimal-edit methods using pixel-space L1 distance and plausibility measures. PIECE produced the strongest L1 results, while progressive feature changes revealed a plausibility trade-off.
Experiment 2: Semi-Factuals
- The tests compared max-edit semi-factuals, performance at 25%, 50%, 75%, and 100% feature changes, and PIECE plausibility across those proportions.The minimal-edit methods were optimized to PIECE's corresponding latent-space L2 distances in the progressive test.Source: Experiment 2: Semi-Factuals · p. 7, Figure 4 · p. 7
- The experiment used 60 correctly classified MNIST test images; semi-factual goodness was measured by L1 pixel distance, with larger distances considered better.PIECE's exceptional features were identified using α = 0.05.Source: Experiment 2: Semi-Factuals · p. 7
- In comparative semi-factual tests, PIECE achieved significantly higher L1 distance scores than min-edit methods (AD > 2.5, p < .029), and significantly better semi-factuals at every distance tested (AD > 3.3, p < .015).Source: Experiment 2: Semi-Factuals · p. 7
- As PIECE semi-factuals improved, they could sacrifice some plausibility, with a trade-off between MC-Dropout measures and NN-Dist.Across progressive changes, MC-Mean, MC-STD, and NN-Dist changed significantly, while IM1 and IM2 did not; the authors suggest the former may be more sensitive.Source: Experiment 2: Semi-Factuals · p. 7
Conclusion
The conclusion presents PIECE as a method for plausible CNN counterfactual explanations and reports that competitive tests support its contribution. It identifies broader image and generative-model domains, as well as further semi-factual work, as future directions.
Conclusion
- PIECE is proposed to produce plausible counterfactuals as post-hoc explanations for CNN classifications.The conclusion says competitive tests show that PIECE adds to the existing XAI tools.Source: Conclusion · p. 7
- Future work includes extending the approach to more complex image datasets and to text and tabular domains using generative models.The conclusion names recent advances in text and tabular generative models as examples.Source: Conclusion · p. 7
- The conclusion identifies semi-factual explanations as a substantial, untapped area for further research.Source: Conclusion · p. 7
Ethics Statement
The ethics statement situates the work within efforts to support fairness, accountability, and trust judgments about AI. It also notes possible disclosure risks and potential uses of explanations for identifying bias and supporting human oversight.
Ethics Statement
- The work is framed as supporting judgments about fairness, accountability, and trust in AI systems used for decisions such as health and legal applications.Source: Ethics Statement · pp. 7–8
- Counterfactual and semi-factual explanations may reveal how a proprietary algorithm works, a risk the authors say falls more on proprietors than users.Source: Ethics Statement · p. 8
- The authors say these explanations may reveal dataset and algorithm biases, support model debugging, and help reduce passive AI use through spontaneous causal thinking.They describe appropriate human trust and human-in-the-loop systems as potential benefits.Source: Ethics Statement · p. 8