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

Two-Stage Holistic and Contrastive Explanation of Image Classification

Weiyan Xie, Xiao-Hui Li, Zhi Lin, Leonard Poon, Caleb Chen Cao, Nevin L. Zhang

Abstract

The need to explain the output of a deep neural network classifier is now widely recognized. While previous methods typically explain a single class in the output, we advocate explaining the whole output, which is a probability distribution over multiple classes. A whole-output explanation can help a human user gain an overall understanding of model behaviour instead of only one aspect of it. It can also provide a natural framework where one can examine the evidence used to discriminate between competing classes, and thereby obtain contrastive explanations. In this paper, we propose a contrastive whole-output explanation (CWOX) method for image classification, and evaluate it using quantitative metrics and through human subject studies.

Introduction

Traditional "Explainable AI" (XAI) tools for computer vision often focus on a single question: "Why did the model think this is a cat?" However, this Individual Output Explanation (IOX) approach creates a significant blind spot when a model is uncertain. If a model is torn between two visually similar labels, standard heatmaps for each label often look nearly identical, failing to reveal how the model distinguishes between them.

Presented at UAI 2023, this research introduces CWOX-2s, a two-stage method for Whole-Output Explanation (WOX). Instead of focusing on one label, CWOX explains the entire probability distribution, answering the more nuanced question: "Why did the model choose label A rather than label B?"

The Problem: Saliency Blind Spots

Most saliency maps highlight pixels important for a specific prediction. When a model confuses two objects—like a screwdriver and a syringe—the resulting heatmaps often overlap entirely. This lack of contrast makes it impossible for a human user to understand the model's internal logic for choosing one over the other.

Figure 1: Comparison of standard saliency maps (b) vs. contrastive explanations (c). Standard maps for 'screwdriver' and 'syringe' look identical, whereas contrastive maps highlight the specific features used to discriminate between them.

The CWOX-2s Method

The authors propose a two-stage approach that mirrors human hierarchical logic: first identifying the general location of an object, then looking for fine-grained details to name it.

1. Offline Phase: Grouping Confusion

Using Hierarchical Latent Tree Analysis (HLTA), the system analyzes model behavior across a dataset to build an "internal taxonomy." It groups classes into confusion clusters based on how often the model confuses them. For example, string instruments like "cello" and "violin" are clustered together, separate from "acoustic" and "electric" guitars.

2. Online Phase: Two-Stage Explanation

When a new image is classified, CWOX-2s generates explanations in two steps:

  • Stage 1 (Inter-cluster): A heatmap contrasts different clusters to provide object localization (e.g., "The evidence for string instruments is here, while guitars are there").
  • Stage 2 (Intra-cluster): Within a cluster, a second heatmap provides fine-grained discrimination (e.g., "This is a cello because of the specific shape of the body bottom").
Figure 2: The CWOX-2s two-stage explanation process. Stage 1 (b, c) localizes clusters of instruments, while Stage 2 (b.1-c.3) provides specific evidence to distinguish between labels within those clusters.

Key Insights and Results

  • Structured Confusion: Model errors are not random. By mapping the model's consistent internal taxonomy, CWOX-2s provides more faithful explanations of the decision-making process.
  • New Metrics: To measure contrastive quality, the authors introduced CAUC (Contrastive AUC) and CDROP (Weighted Drop in Contrastive Score). These metrics evaluate how well a heatmap identifies pixels that shift the balance between competing classes.
  • Human Interpretability: In a study of 120 participants, CWOX-2s significantly improved human understanding. Accuracy in matching labels to heatmaps jumped from ~45% with standard methods to 75-83% with CWOX-2s. Users also reported much higher confidence in their understanding of the model.

Conclusion

CWOX-2s represents a shift from simple object localization to true discriminative explanation. By leveraging the structured nature of model confusion and a two-stage hierarchical approach, it provides a clearer, more human-centric window into the "black box" of deep learning classifiers. While currently focused on image classification, this framework offers a promising path for contrastive explanations in other domains like NLP and tabular data.

Summary updated

BibTeX
@inproceedings{xie2023two,
  author = {Weiyan Xie and Xiao-Hui Li and Zhi LIN and Leonard Poon and Caleb Chen Cao and Nevin L. Zhang},
  title = {{Two-Stage Holistic and Contrastive Explanation of Image Classification}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2023},
  url = {https://openreview.net/forum?id=S8KkeGzioei},
}
Figure