ProtoPFormer: Concentrating on Prototypical Parts in Vision Transformers for Interpretable Image Recognition
Mengqi Xue, Qihan Huang, Haofei Zhang, Jingwen Hu, Jie Song, Mingli Song, Canghong Jin
TL;DR
This paper addresses prototype distraction when transferring ProtoPNet to vision transformers (ViTs) by introducing ProtoPFormer, a dual-branch architecture with global prototypes on the class token and local prototypes on image tokens. It uses a foreground-preserving (FP) mask derived from attention rollout to concentrate local prototypes on foreground regions and a prototypical-part concentration (PPC) loss to enforce diverse, centralized prototypical parts, with final decisions made by combining global and local predictions. Empirical results on CUB, Dogs, and Cars across multiple ViT backbones show superior accuracy and clearer visual explanations compared with SOTA prototype-based baselines, aided by mutual correction between branches. The approach yields interpretable, faithful reasoning from both holistic and part-based perspectives, advancing the practical deployment of prototype-based XAI in ViT-based image recognition.
Abstract
Prototypical part network (ProtoPNet) has drawn wide attention and boosted many follow-up studies due to its self-explanatory property for explainable artificial intelligence (XAI). However, when directly applying ProtoPNet on vision transformer (ViT) backbones, learned prototypes have a "distraction" problem: they have a relatively high probability of being activated by the background and pay less attention to the foreground. The powerful capability of modeling long-term dependency makes the transformer-based ProtoPNet hard to focus on prototypical parts, thus severely impairing its inherent interpretability. This paper proposes prototypical part transformer (ProtoPFormer) for appropriately and effectively applying the prototype-based method with ViTs for interpretable image recognition. The proposed method introduces global and local prototypes for capturing and highlighting the representative holistic and partial features of targets according to the architectural characteristics of ViTs. The global prototypes are adopted to provide the global view of objects to guide local prototypes to concentrate on the foreground while eliminating the influence of the background. Afterwards, local prototypes are explicitly supervised to concentrate on their respective prototypical visual parts, increasing the overall interpretability. Extensive experiments demonstrate that our proposed global and local prototypes can mutually correct each other and jointly make final decisions, which faithfully and transparently reason the decision-making processes associatively from the whole and local perspectives, respectively. Moreover, ProtoPFormer consistently achieves superior performance and visualization results over the state-of-the-art (SOTA) prototype-based baselines. Our code has been released at https://github.com/zju-vipa/ProtoPFormer.
