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

ProtoPFormer: Concentrating on Prototypical Parts in Vision Transformers for Interpretable Image Recognition

Mengqi Xue, Qihan Huang, Haofei Zhang, Lechao Cheng, Jie Song, Minghui Wu, Mingli Song · DOI

Introduction: The "This Looks Like That" Paradigm

Deep learning models have long been criticized as "black boxes" due to their opaque decision-making processes. To bridge the gap between high performance and human trust, researchers introduced Prototypical Part Networks (ProtoPNets). These models employ a "This Looks Like That" reasoning process: they classify an image by identifying specific parts (e.g., a bird's unique wing pattern) and comparing them to learned "prototypes" from the training set. This mimicry of human categorization provides a clear, visual explanation for every prediction.

The Challenge: Prototype Distraction in ViTs

While ProtoPNets were highly effective when paired with Convolutional Neural Networks (CNNs), the transition to Vision Transformers (ViTs) proved problematic. ViTs rely on global self-attention to capture long-range dependencies across an image. While this boosts accuracy, it can undermine interpretability. In a standard ViT-based ProtoPNet, learned prototypes often suffer from "distraction"—they activate on irrelevant background noise (like grass or sky) or produce fragmented, scattered heatmaps that fail to correspond to distinct physical parts of the object.

The ProtoPFormer Architecture

To resolve these issues, the authors propose ProtoPFormer, a framework specifically designed to harness the strengths of ViTs while enforcing spatial interpretability. The architecture is built around four key innovations:

  1. Dual-Branch Structure: The model splits into a Global Branch, which uses the ViT's class token to capture holistic features of the entire object, and a Local Branch, which utilizes image tokens to focus on specific prototypical parts.
  2. Foreground Preserving (FP) Mask: To prevent the model from focusing on the background, ProtoPFormer employs "attention rollout" from the class token. This generates a mask that filters out background tokens, ensuring the local prototypes are grounded in the foreground object.
  3. Prototypical Part Concentration (PPC) Loss: This loss function treats prototype similarity maps as bivariate Gaussian distributions. It minimizes the variance to create tight "hotspots" and maximizes the distance between different prototype centers to ensure the model learns a diverse set of parts (e.g., head vs. wing).
  4. Mutual Correction: During the final decision phase, the global and local branches work in tandem. If the global branch is uncertain, the specific evidence found by the local branch can correct the classification, leading to more robust and accurate joint decisions.
The ProtoPFormer architecture featuring Global and Local branches, the FP mask, and the PPC loss mechanism.

Results and Visual Interpretability

ProtoPFormer was evaluated on three fine-grained visual categorization (FGVC) datasets: CUB-200-2011 (birds), Stanford Dogs, and Stanford Cars. The results demonstrate a significant leap in both performance and clarity.

Quantitative Performance

ProtoPFormer consistently outperforms previous interpretable methods. On the CUB dataset, using a DeiT-Ti backbone, it achieved an accuracy of 82.26%, surpassing both the vanilla ViT (80.57%) and the original CNN-based ProtoPNet (81.36%). This confirms that the added interpretability constraints do not come at the cost of predictive power; rather, they enhance it.

Qualitative Superiority

The most striking advantage of ProtoPFormer is the quality of its visual explanations. As shown in the comparison below, standard ViTs often produce noisy heatmaps that cover the entire image. In contrast, ProtoPFormer generates highly localized bounding boxes that tightly encompass meaningful anatomical features.

Comparison of prototype visualizations across CNN, ViT, and ProtoPFormer. ProtoPFormer achieves significantly more localized and meaningful part-based explanations.

Conclusion

ProtoPFormer successfully adapts the "This Looks Like That" reasoning to the Vision Transformer era. By introducing the FP Mask and PPC Loss, it overcomes the "prototype distraction" inherent in global self-attention mechanisms. The result is a model that is not only more accurate than its predecessors but also provides remarkably clean, human-understandable evidence for its decisions. Future work may extend this framework to more complex, cluttered environments or critical domains like medical imaging, where interpretability is a prerequisite for deployment.

Summary updated

BibTeX
@misc{xue2022protopformer,
  author = {Mengqi Xue and Qihan Huang and Haofei Zhang and Lechao Cheng and Jie Song and Minghui Wu and Mingli Song},
  title = {{ProtoPFormer: Concentrating on Prototypical Parts in Vision Transformers for Interpretable Image Recognition}},
  year = {2022},
  eprint = {2208.10431},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.10431},
}
Figure