Sanity checks for patch visualisation in prototype-based image classification

Romain Xu-Darme, Georges Quénot, Zakaria Chihani, Marie-Christine RoussetWorkshops @ CVPR 2023 · DOI

Abstract

Prototype-based image classifiers, such as ProtoPNet and ProtoTree, are designed to provide intrinsic explanations by identifying image patches that resemble learned prototypes. However, the standard upsampling method used to visualize these patches often lacks precision, potentially misleading users into believing the model relies on background features. This paper introduces a "sanity check" for these visualizations, comparing standard upsampling against more advanced saliency methods like Prototype Relevance Propagation (PRP). The results demonstrate that these models are significantly more object-focused and robust than their default visualizations suggest, highlighting the critical need for faithful explanation methods in Explainable AI (XAI).

Introduction

In the quest for interpretable machine learning, prototype-based classifiers offer a promising "this looks like that" reasoning process. For instance, a model might classify a bird by matching a patch of its wing to a known prototype. The transparency of this process depends heavily on the accuracy of the visualization. If the visualization highlights a tree branch instead of the bird's wing, a human observer may incorrectly conclude that the model is biased toward the background. This paper investigates whether such perceived biases are inherent to the models or are merely artifacts of imprecise visualization techniques—a "broken lens" through which we view their explanations.

Methods

The authors evaluate two prominent architectures, ProtoPNet and ProtoTree, using several saliency methods to generate patch visualizations:

  • Upsampling: The default method, which simply scales up low-resolution heatmaps from the model's latent space.
  • SmoothGrads: A technique that reduces noise in explanations by averaging gradients over multiple noisy versions of the input image.
  • Prototype Relevance Propagation (PRP): A specialized form of Layer-wise Relevance Propagation (LRP) designed to identify the specific pixels contributing most to a prototype's similarity score.
Comparison of visualization methods and the resulting patch selection pipeline.

To quantify the faithfulness of these methods, the researchers utilized the Area Under the Deletion Curve (AUDC). This metric involves progressively removing the most "important" pixels identified by a saliency method and measuring the resulting drop in model confidence. A steeper drop indicates a more faithful explanation. Additionally, they proposed a relevance metric by calculating the overlap between visualized patches and ground-truth object masks using the CUB-200-2011 (birds) and Stanford Cars datasets.

Key Results and Insights

The study reveals a significant "receptive field gap" in standard upsampling. For ProtoTree, default upsampling suggested that over 35% of prototypes focused on the background. However, when using the more precise PRP method, this figure dropped to just 0.5%. This indicates that the models are far more object-centric than they appear through default visualizations.

Deletion curves showing the similarity ratio drop as pixels are removed.

Quantitatively, PRP and SmoothGrads consistently outperformed upsampling across all benchmarks. On the CUB dataset, ProtoTree's AUDC improved from 0.98 (upsampling) to 0.78 (PRP). Furthermore, the percentage of irrelevant patches for ProtoTree (ResNet50) plummeted from 51.9% to 0.5% when switching to PRP. The choice of neural network backbone also proved influential; models using VGG19 showed a higher tendency for background noise compared to those using ResNet50.

Conclusion

This research underscores that a model's interpretability cannot be assessed independently of its visualization method. By applying rigorous sanity checks, the authors demonstrate that prototype-based models are often more faithful to the objects they classify than previously reported. While these findings improve our visual understanding of model logic, future work is needed to ensure that the model's mathematical definition of "similarity" aligns more closely with human perceptual intuition.

Summary updated

BibTeX
@inproceedings{xudarme2023sanity,
  author = {Romain Xu-Darme and Georges Quénot and Zakaria Chihani and Marie-Christine Rousset},
  title = {{Sanity checks for patch visualisation in prototype-based image classification}},
  booktitle = {Workshops @ CVPR},
  year = {2023},
  doi = {10.1109/cvprw59228.2023.00377},
}
Figure