CXPlain: Causal Explanations for Model Interpretation under Uncertainty

Patrick Schwab, Walter Karlen

As machine learning models—especially deep neural networks and complex ensembles—become more sophisticated, they simultaneously become harder to trust. To peer inside these "black boxes," practitioners rely on attribution methods to understand which input features (such as specific pixels in an image or words in a text) led to a specific prediction.

However, existing attribution methods face a challenging "trilemma":

  1. Computational Cost: Model-agnostic methods like LIME and SHAP are notoriously slow, requiring thousands of model evaluations to generate a single explanation at test time.
  2. Accuracy: Many methods struggle with high-dimensional data, often producing "superfluous" attributions that highlight irrelevant background noise rather than the true causal features.
  3. Uncertainty: Most tools provide a single importance score without any indication of confidence. If an explanation is wrong, the user has no statistical way of knowing.

To resolve this trilemma, researchers introduce CXPlain (Causal Explanations), a model-agnostic framework that treats feature importance as a supervised causal learning task. By training a separate "explanation model" to predict how much individual features contribute to a target model's accuracy, CXPlain delivers faster, more accurate attributions while providing crucial uncertainty estimates.

The CXPlain Methodology

Instead of perturbing inputs at test time (the approach taken by LIME), CXPlain shifts the computational burden to the training phase. It trains a separate, dedicated explanation model ($f_{exp}$) to learn the relationship between inputs and the target model's behavior.

Architecture of CXPlain showing a separate explanation model alongside the predictive model.

Key technical components of this approach include:

  • Causal Objective: Based on the Granger/Humean definition of causality, a feature is considered "important" if its presence significantly improves the model's ability to predict the ground truth. The training objective minimizes the KL-divergence between the explanation model’s output and the actual marginal contribution of features to the target model's accuracy.
  • Model-Agnostic Training: To train CXPlain, the "ground truth" importance for a training set is precomputed by masking features and measuring the resulting drop in the target model's performance. Once trained, the explanation model can generate attributions for new, unseen samples in a single, rapid forward pass.
  • Architecture Tailoring: The framework allows the explanation model's architecture to be tailored to the data type. For images, the authors utilize a U-net architecture, which is naturally suited for pixel-level dense prediction tasks and allows the explanation model to leverage spatial context.
  • Bootstrap Ensembling: To quantify uncertainty, the authors train an ensemble of $M$ explanation models on different bootstrap resamples of the training data. The variance across these models provides a reliable confidence interval for each feature's importance.

Key Insights and Results

The researchers evaluated CXPlain on two classic image classification benchmarks: a binary MNIST task (distinguishing '8' vs. '3') and an ImageNet subset (distinguishing 'Gorilla' vs. 'Zebra') to test performance on high-resolution, complex natural images.

Explanation as Supervised Learning

The most significant conceptual shift in CXPlain is treating explanation not as an optimization problem solved at test time, but as a learning problem solved at training time. This amortizes the heavy computational cost. On ImageNet, CXPlain was orders of magnitude faster than LIME and SHAP at evaluation time. While LIME and SHAP took thousands of seconds to explain 100 images, CXPlain (using a U-net) finished in roughly 34 seconds.

Semantic Focus and Accuracy

By using a loss function based on the marginal contribution to accuracy, CXPlain ignores features that the model might be looking at but aren't actually helping it get the right answer (causality over mere correlation).

Visual comparison of attributions on ImageNet. CXPlain produces a much cleaner heatmap focused on the subject compared to SHAP and LIME.

Qualitatively, this results in much "cleaner" heatmaps. While SHAP or LIME often highlight irrelevant background pixels, CXPlain focuses tightly on the semantic object of interest. Quantitatively, CXPlain significantly outperformed LIME and SHAP in identifying the most influential pixels, as measured by the drop in log-odds when those highlighted pixels were masked.

Informative Uncertainty

The authors found that CXPlain's uncertainty estimates (the width of the confidence intervals) are strongly correlated with the actual rank error of the importance scores. If CXPlain is "unsure" about a pixel, it is statistically more likely that the attribution for that pixel is incorrect. Using just 5 bootstrap members was enough to produce uncertainty estimates that significantly outperformed a random baseline.

Limitations and Future Directions

While highly effective at test time, CXPlain does require a significant upfront investment to train the explanation model, involving many evaluations of the target model to create the training labels.

Furthermore, the authors clarify that "causal" in this context refers to the internal logic of the model (how features cause the prediction), not necessarily real-world physical causality (how features cause the outcome). Finally, while U-nets work exceptionally well for images, future work will need to explore which architectures are best suited for other data modalities like time-series or tabular data, as well as more sophisticated masking schemes beyond simply zeroing out features.

Summary updated

BibTeX
@inproceedings{schwab2019cxplain,
  author = {Patrick Schwab and Walter Karlen},
  title = {{CXPlain: Causal Explanations for Model Interpretation under Uncertainty}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure