Abstract
Vision Transformers (ViTs) have become foundational in computer vision, yet their internal decision-making processes remain opaque. This paper presents Keypoint Counting Classifiers (KCCs), a training-free framework that converts pre-trained ViTs into self-explainable models. KCCs operate by identifying semantically coherent segments, matching them as keypoints against a prototype library, and performing classification through simple arithmetic counting. Our results demonstrate that KCCs provide highly interpretable explanations that humans prefer over traditional heatmaps, while maintaining competitive accuracy on fine-grained classification tasks.
Introduction
As Vision Transformers (ViTs) increasingly serve as the backbone for safety-critical applications like medical imaging and autonomous driving, the need for interpretability has never been greater. Traditional Self-Explainable Models (SEMs) often require specialized architectures or computationally expensive retraining to generate explanations. Furthermore, the resulting visualizations—typically blurry heatmaps or coarse bounding boxes—can be imprecise and difficult for humans to interpret quickly.
KCCs address these challenges by providing a transparent reasoning process: "This image is classified as a specific species because it shares a matching beak, wing, and tail with the reference prototype." This approach leverages the inherent power of foundation models while offering human-like transparency.
The KCC Framework
The KCC framework functions through a three-step, training-free pipeline:
- Image-wise Identification: The model isolates the foreground using Grounding DINO and SAM, then partitions it into semantically coherent segments using the SLIC algorithm. The center of each segment is designated as a keypoint.
- Keypoint Matching: KCC exploits the property that ViT internal tokens naturally capture semantic parts. By comparing query image tokens against a library of prototypes, the model identifies "Mutual Nearest Neighbors" in the feature space to establish matches.
- Classification by Counting: Classification is performed via simple arithmetic. The model counts the number of matching keypoints for each class, and the class with the highest count is selected as the prediction.
To further enhance interpretability, the authors integrate vision-language models like VLParts to automatically assign text labels (e.g., "eye," "torso") to these keypoints, reducing the cognitive load for human verification.
Experimental Results
The authors evaluated KCCs on three fine-grained classification benchmarks: CUB200 (birds), Stanford Cars, and Oxford Pets.
Human Preference and Interpretability
A user study involving 51 participants revealed a strong preference for KCC explanations over traditional heatmaps. Participants rated KCC explanation quality at 3.34/4.0, significantly higher than the 2.84 rating for heatmaps. The study also noted that KCCs help mitigate the "confirmation bias trap," where users might trust a plausible-looking but incorrect heatmap; the precise points provided by KCCs are much easier to verify or debunk.
Performance Metrics
Despite requiring zero retraining, KCCs achieved an accuracy of 82.2% on CUB200, outperforming supervised SEMs like ProtoPNet (79.2%). However, the model struggled with the Stanford Cars dataset (44.8% accuracy), suggesting that objects defined by subtle geometric features may still require some level of supervised fine-tuning.
Conclusion and Future Work
Keypoint Counting Classifiers demonstrate that pre-trained ViTs are inherently part-aware and can be made self-explainable without additional training. By simplifying the explanation to a verifiable count of semantic parts, KCCs foster greater trust and clarity. Future research will explore weighted keypoints to distinguish highly diagnostic features (like a specific beak shape) from more generic ones, further refining the model's accuracy and intuition.
Summary updated