NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Meaningfully debugging model mistakes using conceptual counterfactual explanations

Abubakar Abid, Mert Yüksekgönül, James Zou

TL;DR

The authors introduce Conceptual Counterfactual Explanations (CCE), a framework that explains why a machine learning model makes a mistake by identifying which human-understandable concepts (like "stripes" or "hues") would need to be added or removed to correct the prediction. Unlike traditional saliency maps that highlight pixels, CCE provides actionable, high-level insights into model biases and spurious correlations without requiring access to the original training data.

What Problem Does This Paper Address?

When a deep learning model fails—such as misclassifying a zebra as a dog—practitioners usually resort to "ad-hoc" debugging. They stare at dozens of misclassified images and guess at the underlying cause (e.g., "maybe the stripes are too faint?").

Existing interpretability tools often fall short:

  1. Saliency maps (like Grad-CAM) highlight where a model looks but not what it is looking for.
  2. Counterfactual explanations usually perturb pixels to flip a label, often resulting in "adversarial-looking" images that are hard for humans to interpret.
  3. Concept-based methods (like TCAV) explain what a model knows generally but aren't designed to diagnose specific, individual failures.

CCE bridges this gap by providing a systematic way to say: "The model missed this zebra because it lacked the 'stripes' concept and was distracted by the 'grass' background."

Methods

CCE combines two established ideas: Counterfactual Explanations and Concept Activation Vectors (CAVs).

Overview of the Conceptual Counterfactual Explanations (CCE) framework.
  1. Learning a Concept Bank: The researchers define a library of human-understandable concepts (e.g., textures, objects, colors). For each concept, they train a simple linear classifier (SVM) in the model's bottleneck layer to find a "direction" in the embedding space that represents that concept.
  2. Generating Explanations: Given a misclassified image, CCE searches for a weighted combination of these concept vectors that, when added to the image's embedding, flips the model's prediction to the correct label.
  3. Optimization with Constraints: This is the core technical contribution. The authors use a constrained optimization problem to ensure the explanation is:
  4. Correct: It actually fixes the prediction.
  5. Sparse: It uses as few concepts as possible (via Elastic Net regularization).
  6. Valid: It doesn't suggest adding a concept that is already present in the image (e.g., it won't suggest "add stripes" to a clearly striped zebra). They use the concept SVMs to set bounds on how much of a concept can be added or removed.

Crucially, CCE is a white-box method that only requires access to the model's internal layers; it does not require the original training data or model retraining.

Datasets

The authors validated CCE across several domains:

  • Natural Images: They used a pretrained ResNet18 on ImageNet and a concept bank of 170 concepts derived from the BRODEN dataset.
  • Spurious Correlations: They used MetaDataset to create 20 controlled scenarios where models were intentionally trained on biased data (e.g., all dogs appear in the snow).
  • Dermatology: They trained a model on the Fitzpatrick17k dataset (16k+ skin images) and learned 8 clinically relevant concepts (e.g., "dark skin type," "blur," "skin hair").
  • Cardiology: They used chest X-rays from Stanford Health Care (SHC) and the NIH to diagnose domain shift issues.

Key Insights and Ideas

  • The "Validity" Constraint is Essential: Without validity constraints, a debugger might suggest adding a concept the image already has, leading to nonsensical explanations. By checking the "margin" of existing concepts, CCE ensures the explanation is contextually grounded.
  • Spurious Correlation Detection: CCE can identify if a model is "cheating." For example, if a model only recognizes dogs when snow is present, CCE correctly identifies "snow" as the missing concept when the model fails on a dog in a park.
  • Debugging "In the Wild": In medical applications, CCE revealed that a dermatology model's errors were significantly correlated with "dark skin type" and "image blur," providing a quantitative measure of model bias that clinicians could confirm.
  • Batch Mode: CCE can be applied to a whole batch of mistakes at once, allowing researchers to find the "global" reason a model is failing on a specific sub-population.

Key Results

CCE successfully recovers spurious correlations, significantly outperforming random baselines.
  • High Precision: In controlled spurious correlation tests, CCE identified the ground-truth cause of the mistake as one of the top 3 explanations in 95% of cases (Precision@3), compared to just 2% for random guessing and 73% for the previous state-of-the-art (CoCoX).
  • Medical Utility: In the cardiology task, CCE identified that the model failed on 100% of "Lateral View" X-rays because it had only been trained on "Frontal View" images.
  • Efficiency: Once the concept bank is learned, explaining a single mistake takes less than 0.3 seconds on a standard CPU.

Limitations and Future Work

  • Concept Bank Dependency: The quality of the explanation is strictly limited by the richness of the concept bank. If the reason for a mistake isn't in your library, CCE can't find it (though it may find "hinting" concepts).
  • White-Box Access: The method requires access to the model's internal embeddings, making it unusable for "black-box" API-only models.
  • Modality: While the paper focuses on images, the authors suggest the framework could be extended to text or audio, provided concept vectors can be defined for those modalities.
  • Human-in-the-loop: Future work could involve user studies to see how much these explanations actually help practitioners improve their models in real-time.

Summary updated

BibTeX
@inproceedings{abid2022meaningfully,
  author = {Abubakar Abid and Mert Yüksekgönül and James Zou},
  title = {{Meaningfully debugging model mistakes using conceptual counterfactual explanations}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
}
Figure