ProtoMask: Segmentation-Guided Prototype Learning

Steffen Meinert, Philipp Schlinge, Nils Strodthoff, Martin Atzmueller · DOI

Abstract

Prototype-based image classifiers aim to provide interpretable "this looks like that" explanations by comparing image features to learned prototypical representations. However, standard architectures often suffer from a "truthfulness gap," where prototypes supposedly representing specific object parts are actually influenced by background noise or irrelevant context. We present ProtoMask, a novel framework that leverages foundation segmentation models to restrict a model's focus to semantically meaningful object parts. By enforcing a restricted receptive field through cropped inputs, ProtoMask ensures that visual explanations are grounded in the actual object, significantly reducing the "Clever Hans" effect while maintaining competitive classification accuracy.

Introduction

In the field of Explainable AI (XAI), prototype-based models like ProtoPNet have gained popularity for their human-like reasoning process. These models classify an image by identifying parts of it that resemble stored "prototypes" of a specific class—for example, identifying a bird species because its beak resembles a known prototype of that species.

Despite their intuitive appeal, these models often fail to be truly faithful to the underlying data. Because deep Convolutional Neural Networks (CNNs) have large receptive fields, a prototype that appears to focus on a bird's head might actually be extracting features from the sky or a branch in the background. This phenomenon, known as the "Clever Hans" effect, results in explanations that are visually misleading. ProtoMask addresses this by integrating segmentation-driven constraints directly into the learning loop.

The ProtoMask Framework

ProtoMask introduces a multi-step pipeline designed to physically limit what a prototype can "see," thereby guaranteeing the semantic integrity of the learned features.

1. Multi-View Preprocessing

Rather than processing a whole image, ProtoMask utilizes foundation models such as SAM2 (Segment Anything Model 2) or SLIT to generate a set of segmentation masks. These masks identify distinct semantic components within the image.

2. Restricted Receptive Fields via Cropping

For every generated mask, the model creates a "view"—a specific crop of the image defined by the mask's bounding box. Each view is passed through the CNN backbone individually. Because the input is restricted to a small patch, the resulting embedding is physically incapable of incorporating information from the rest of the image. This architectural constraint forces the model to find discriminative features within the segmented object parts rather than relying on global context or background shortcuts.

3. Similarity and Classification

The model calculates similarity scores between these restricted "view embeddings" and a set of learned prototypes. The final classification is determined by the maximum similarity score for each prototype, ensuring that the model's decision is tied to the most relevant semantic patches identified during the segmentation phase.

4. Diversity Loss

To prevent the model from collapsing into a state where it learns redundant prototypes, the authors implement a diversity loss term ($L_{div}$). This encourages the model to distribute its prototypes across different parts of the object, ensuring a more holistic and informative explanation of the classification.

Experimental Evaluation

ProtoMask was evaluated on three standard fine-grained classification benchmarks where subtle part-based differences are critical:

  • CUB200-2011: 200 bird species.
  • Stanford Dogs: 120 dog breeds.
  • Stanford Cars: 196 car models.

Performance and Truthfulness

On the CUB200 dataset, ProtoMask (using SAM2) achieved a competitive 73.03% accuracy. This performance matches or exceeds several established prototype models, such as ProtoPNet (68.62%) and ProtoPool (67.74%), while remaining within range of the state-of-the-art PIP-Net (74.38%).

More importantly, ProtoMask demonstrated superior "truthfulness" metrics. It achieved the highest Object Overlap (42.61%) and significantly lower Background Overlap scores compared to baselines. Qualitative analysis of saliency maps confirms these findings: while older models often produce "smeared" heatmaps that bleed into the background, ProtoMask’s explanations are tightly focused on specific, relevant object parts.

Discussion and Limitations

The research highlights that the quality of the foundation segmentation model is a primary driver of explainability. The authors found that SAM2 significantly outperformed SLIT, suggesting that as segmentation models improve, so too will the groundedness of prototype-based XAI.

However, challenges remain. Inconsistent segmentation is a primary hurdle; if a segmentation model identifies a "wing" in one image but only a "head" in another of the same class, the prototype learning process can become unstable. Additionally, the computational cost of processing multiple cropped views per image is higher than traditional single-pass architectures.

Conclusion

ProtoMask represents a significant step toward making "this looks like that" explanations actually true. By using segmentation to "blindfold" the model to irrelevant background information, ProtoMask ensures that prototypes are derived from the object itself. Future work will focus on achieving more consistent semantic segmentation across datasets to further stabilize and refine these grounded visual explanations.

Summary updated

BibTeX
@inproceedings{meinert2025protomask,
  author = {Steffen Meinert and Philipp Schlinge and Nils Strodthoff and Martin Atzmueller},
  title = {{ProtoMask: Segmentation-Guided Prototype Learning}},
  booktitle = {ICTAI},
  year = {2025},
  doi = {10.1109/ictai66417.2025.00128},
}
Figure