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 K. M. Poon, Caleb Chen Cao, Nevin L. Zhang

TL;DR

The paper introduces CWOX-2s, a novel two-stage framework for explaining image classification that moves beyond single-label saliency maps. By clustering confusing classes using latent tree analysis, it provides contrastive explanations that first localize relevant objects and then pinpoint the fine-grained features the model uses to discriminate between similar-looking labels.

What Problem Does This Paper Address?

Most current Explainable AI (XAI) methods, like Grad-CAM or RISE, are "individual output explanation" (IOX) methods. They generate a saliency map for a single predicted class. However, deep learning models output a probability distribution over many classes.

Focusing on just the top class can be misleading. For example, if a model is unsure whether an image contains a "screwdriver" or a "syringe," standard saliency maps for both might look nearly identical, highlighting the same central object. This doesn't tell the user why the model preferred one over the other. Furthermore, real-world images often contain multiple objects (e.g., a keyboard and a mouse), leading to multiple high-probability classes that standard methods struggle to disentangle.

Figure 1: Explanations of the outputs of GoogleNet on two input images: (b.1-2) Grad-CAM is applied to each top output class separately (SWOX); (c.1-2) The top output classes are contrasted against each other (CWOX).

Methods

The authors propose Contrastive Whole-Output Explanation (CWOX), specifically a two-stage version called CWOX-2s. The process involves:

  1. Offline Clustering: The authors use Hierarchical Latent Tree Analysis (HLTA) to build a model of class co-occurrences. By treating the top-K predictions for thousands of training images as "documents," they cluster labels that the model frequently confuses (like "cello" and "violin") or that often appear together in scenes (like "mouse" and "keyboard").
  2. Two-Stage Online Explanation: For a new test image:
  3. Stage 1 (Localization): The top predicted classes are grouped into "confusion clusters" based on the pre-built latent tree. CWOX-2s generates heatmaps to contrast these clusters against each other, effectively localizing different objects or regions in the image.
  4. Stage 2 (Discrimination): Within each cluster, it generates heatmaps that contrast individual classes against their "siblings" in the same cluster. This highlights the specific, fine-grained evidence (e.g., the large bottom of a cello vs. the strings of a violin) that supports one label over its competitors.

CWOX-2s acts as a "meta-explainer" that can be wrapped around existing base explainers like Grad-CAM, RISE, or LIME.

Figure 5: A part of the latent tree model built from the outputs of ResNet50 on ImageNet training examples. Solid lines are direct connections, and dashed lines are indirect connections with intermediate nodes removed. Images of the classes are displayed for visual reference. They are not part of the model. The tree reveals co-occurrence patterns of class labels in classification outputs.

Datasets

  • ImageNet: The primary dataset used for both building the latent tree model (using training data) and evaluating the explanation methods (using 10,000 images from the validation set).
  • The study utilized two popular pre-trained architectures: ResNet50 and GoogleNet.

Key Insights and Ideas

  • Co-occurrence as Confusion: A key innovation is using label co-occurrence in model outputs as a proxy for model confusion. If two labels frequently appear together in the top-K predictions across a dataset, the model likely finds them difficult to distinguish for certain inputs.
  • Localization vs. Discrimination: The two-stage approach mirrors human reasoning. We first identify where an object is (localization) and then look for specific details to decide what it is (discrimination).
  • New Evaluation Metrics: The authors argue that standard "deletion" metrics aren't enough for contrastive explanations. They introduce Contrastive AUC (CAUC) and Weighted Drop in Contrastive Score (CDROP) to specifically measure how quickly a model's confidence shifts between competing classes when salient pixels are removed.

Key Results

  • Quantitative Superiority: CWOX-2s consistently outperformed standard whole-output explanations (SWOX) and one-stage contrastive methods (CWOX-1s) across all metrics. For instance, on ResNet50 using RISE as a base, CWOX-2s achieved a CAUC of $4.08 \times 10^{-3}$, significantly better than SWOX's $5.18 \times 10^{-3}$.
  • Human Interpretability: In a user study, participants were asked to match heatmaps to labels. CWOX-2s led to much higher accuracy (~83% for experts) compared to SWOX (~45%) and one-stage contrastive methods (~57%). Users also reported significantly higher confidence when using CWOX-2s explanations.
Figure 3: CWOX-2s explanation of the output of ResNet on the input image (with Grad-CAM as the base explainer).

Limitations and Future Work

  • Offline Dependency: The quality of the explanation depends on the latent tree built during the offline phase. The authors suggest exploring other word-clustering methods beyond HLTA in the future.
  • Hyperparameter Sensitivity: The method requires choosing $K$ (number of top classes) and $\delta$ (saliency threshold), which can impact the granularity of the clusters and heatmaps.
  • Domain Expansion: While highly effective for images, the authors leave the application of CWOX-2s to other modalities like natural language processing or tabular data for future research.

Summary updated

BibTeX
@inproceedings{xie2023two,
  author = {Weiyan Xie and Xiao-Hui Li and Zhi Lin and Leonard K. M. 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