Table of Contents
Fetching ...

Causal Generative Explainers using Counterfactual Inference: A Case Study on the Morpho-MNIST Dataset

Will Taylor-Melanson, Zahra Sadeghi, Stan Matwin

TL;DR

This work tackles the challenge of explaining image classifiers by leveraging causal deep generative models to produce counterfactual explanations on Morpho-MNIST. It introduces three explainer modalities: pixel-level SHAP with counterfactual attribute interventions, Monte Carlo attribute explanations in the CGM latent space, and gradient-based and model-agnostic counterfactuals that operate in the CGM attribute space. Through quantitative metrics (e.g., IM1, IM2, oracle scores) and visual comparisons, the authors demonstrate that CGM-based counterfactual explanations achieve higher interpretability than OmnixAI, and that attributes like thickness and slant are key drivers of classifier decisions. The approach yields actionable, human-interpretable insights into how causal visual features affect predictions and holds promise for applications such as handwriting legibility feedback and broader XAI on causal data, while outlining directions for more advanced regularization and interpolation techniques. $E(oldsymbol{x},oldsymbol{a})$ and $\boldsymbol{x}'(\boldsymbol{a}')$ are used to formalize counterfactual generation on Morpho-MNIST, and the methods are compatible with pretrained CGMs like DeepSCM and ImageCFGen.

Abstract

In this paper, we propose leveraging causal generative learning as an interpretable tool for explaining image classifiers. Specifically, we present a generative counterfactual inference approach to study the influence of visual features (i.e., pixels) as well as causal factors through generative learning. To this end, we first uncover the most influential pixels on a classifier's decision by varying the value of a causal attribute via counterfactual inference and computing both Shapely and contrastive explanations for counterfactual images with these different attribute values. We then establish a Monte-Carlo mechanism using the generator of a causal generative model in order to adapt Shapley explainers to produce feature importances for the human-interpretable attributes of a causal dataset in the case where a classifier has been trained exclusively on the images of the dataset. Finally, we present optimization methods for creating counterfactual explanations of classifiers by means of counterfactual inference, proposing straightforward approaches for both differentiable and arbitrary classifiers. We exploit the Morpho-MNIST causal dataset as a case study for exploring our proposed methods for generating counterfacutl explantions. We employ visual explanation methods from OmnixAI open source toolkit to compare them with our proposed methods. By employing quantitative metrics to measure the interpretability of counterfactual explanations, we find that our proposed methods of counterfactual explanation offer more interpretable explanations compared to those generated from OmnixAI. This finding suggests that our methods are well-suited for generating highly interpretable counterfactual explanations on causal datasets.

Causal Generative Explainers using Counterfactual Inference: A Case Study on the Morpho-MNIST Dataset

TL;DR

This work tackles the challenge of explaining image classifiers by leveraging causal deep generative models to produce counterfactual explanations on Morpho-MNIST. It introduces three explainer modalities: pixel-level SHAP with counterfactual attribute interventions, Monte Carlo attribute explanations in the CGM latent space, and gradient-based and model-agnostic counterfactuals that operate in the CGM attribute space. Through quantitative metrics (e.g., IM1, IM2, oracle scores) and visual comparisons, the authors demonstrate that CGM-based counterfactual explanations achieve higher interpretability than OmnixAI, and that attributes like thickness and slant are key drivers of classifier decisions. The approach yields actionable, human-interpretable insights into how causal visual features affect predictions and holds promise for applications such as handwriting legibility feedback and broader XAI on causal data, while outlining directions for more advanced regularization and interpolation techniques. and are used to formalize counterfactual generation on Morpho-MNIST, and the methods are compatible with pretrained CGMs like DeepSCM and ImageCFGen.

Abstract

In this paper, we propose leveraging causal generative learning as an interpretable tool for explaining image classifiers. Specifically, we present a generative counterfactual inference approach to study the influence of visual features (i.e., pixels) as well as causal factors through generative learning. To this end, we first uncover the most influential pixels on a classifier's decision by varying the value of a causal attribute via counterfactual inference and computing both Shapely and contrastive explanations for counterfactual images with these different attribute values. We then establish a Monte-Carlo mechanism using the generator of a causal generative model in order to adapt Shapley explainers to produce feature importances for the human-interpretable attributes of a causal dataset in the case where a classifier has been trained exclusively on the images of the dataset. Finally, we present optimization methods for creating counterfactual explanations of classifiers by means of counterfactual inference, proposing straightforward approaches for both differentiable and arbitrary classifiers. We exploit the Morpho-MNIST causal dataset as a case study for exploring our proposed methods for generating counterfacutl explantions. We employ visual explanation methods from OmnixAI open source toolkit to compare them with our proposed methods. By employing quantitative metrics to measure the interpretability of counterfactual explanations, we find that our proposed methods of counterfactual explanation offer more interpretable explanations compared to those generated from OmnixAI. This finding suggests that our methods are well-suited for generating highly interpretable counterfactual explanations on causal datasets.
Paper Structure (13 sections, 10 equations, 12 figures, 1 table)

This paper contains 13 sections, 10 equations, 12 figures, 1 table.

Figures (12)

  • Figure 1: The proposed method of using a generative causal model (such as the generator $G$ of a BiGAN from ImageCFGen dash2022evaluating) to rank important human-interpretable attributes for an image classifier. Attributes to be explained are either sampled from an SCM $\mathcal{M}$ or from an available test set, and these along with a random sample of latent features form the input to the image generator $G$, which feeds inputs to a classifier $f$ to define a classification of the attributes. From this, any explanation method can be used in the attribute space, though this work has chosen to use SHAP shap.
  • Figure 2: Instances from the Morpho-MNIST training set used in this work. Each digit has a varying class, thickness, intensity, and slant sampled from the ground-truth SCM.
  • Figure 3: Causal graph for Morpho-MNIST, identical to the one used by dash2022evaluating.
  • Figure 4: Evolution of SHAP pixel values as the thickness attribute of Morpho-MNIST varies on a digit '4'. Positive attributions (red) grow for the score for class 4 with the thickness, and positive regions for class 4 often correspond to negative regions for class 9 (and vice-versa). The displayed counterfactuals were computed using a VAE.
  • Figure 5: Evolution of SHAP pixel values as the slant attribute of Morpho-MNIST varies on a digit '6'.
  • ...and 7 more figures