Part-Set Prototypes for Explainable Mountain Gazelles Sex Classification

Tali Boneh Shitrit, Amir Kedem, Ilan Shimshoni, Anna ZamanskyarXiv 2026

TL;DR

When monitoring endangered wildlife via camera traps, black-box AI models often achieve high accuracy for the wrong reasons—memorizing background bushes instead of looking at the animals. This paper introduces Part-Set Prototypes, a self-explainable vision architecture that classifies the sex of wild Mountain Gazelles by assembling flexible, non-rigid sets of anatomical traits (like curved horns and neck mass) directly over a frozen foundation model. It matches the accuracy of unconstrained black-box probes while letting ecologists visually audit—and even surgically delete—spurious habitat shortcuts.

What Problem Does This Paper Address?

Tracking the male-to-female ratio of endangered Mountain Gazelles is vital for conservation, and camera traps make large-scale monitoring possible. In field guides, sexing a gazelle is all about horn morphology. In blurry, occluded, "in-the-wild" camera-trap photos, however, wildlife managers rely on holistic somatic clues: the heavy forequarters and thick neck of a male versus the slender profile of a female.

If we automate this with standard deep learning, we hit a trust wall. Camera-trap datasets are full of environmental confounders—time of day, season, and specific bushes often correlate with where each sex hangs out. Post-hoc explainability tools (like Grad-CAM) merely guess at what a black-box model did after the fact.

Self-explainable part-prototype networks ("this looks like that") score actual image patches as evidence, offering true transparency. However, traditional prototype models suffer from structural rigidity: they force concepts into fixed rectangular grids, assign a fixed number of parts per prototype, and typically fine-tune the vision backbone—a recipe for severe overfitting on small, noisy ecological datasets. Nature isn't shaped like a rigid $k \times k$ grid; an S-shaped horn or curved neckline requires something far more adaptable.

Methods

The authors build their architecture directly on unmodified spatial patch tokens extracted from a completely frozen DINOv3 Vision Transformer, bypassing feature adapters to prevent overfitting on scarce data.

Figure 1. Pipeline. Initialization (top): Foreground tokens are isolated via class-token attention from a frozen DINOv3 encoder, grouped into irregular candidate sets, and clustered into a bank of variable-cardinality prototypes initialized from real exemplars. Train and Infer (bottom): Member–token cosine similarities feed into a truncated Sinkhorn assignment with an opt-out gate that jointly matches each prototype’s members, preventing two members from claiming the same token. Members lacking strong token support withhold mass rather than forcing a poor match, and the resulting activations pass through a non-negative, bias-free classification head.

What is novel here is how prototypes are structured, initialized, and matched:

  • Data-Mined Variable-Cardinality Set Prototypes: Instead of single vectors or rigid grids, a prototype is an unordered set of local feature vectors with no fixed spatial geometry. In a single offline pass before training, the model uses DINOv3's class-token attention to isolate foreground animal tokens, clusters them within each image via $k$-means to form irregular part candidates (bounded between 4 and 12 tokens), and clusters those across the dataset into a shared global bank of 96 prototypes without rigid per-class quotas.
  • Joint Placement via Truncated Sinkhorn Competition: If you match each vector in a prototype set independently to an image, two vectors meant for the left and right horns might collapse onto the single clearest horn. To prevent this without messy auxiliary diversity losses, the authors run a single-sweep truncated Sinkhorn normalization—an optimal-transport-inspired layer that forces set members to compete for distinct image tokens.
  • Per-Member Opt-Out Gate: What if a gazelle is in profile and one horn is hidden? Pure competition would force that unmatched vector onto background grass, corrupting the gradient. The authors attach a learnable sigmoid "opt-out gate" to each member. Unsupported parts cleanly withhold their mass (though abstention still counts in the averaging denominator, penalizing incomplete matches so prototypes can't cheat by dropping hard parts).
Figure 2. Comparison of token assignment mechanisms. Left: Our joint Sinkhorn matching with per-member opt-out gates en- forces spatial competition and allows an irrelevant habitat-bound member to cleanly opt out by withholding its mass. Right: A greedy assignment baseline forces all members onto the image, leading to degenerate background matches.

Finally, prototype activations feed into a non-negative, bias-free linear layer, making every class prediction a transparent, additive sum of visual evidence.

Datasets

The authors evaluate their method on an existing Mountain Gazelle (Gazella gazella) sex-classification camera-trap dataset containing 1,833 cropped images of adult gazelles (1,244 females, 589 males) across 24 camera-season deployments. To prevent spatial data leakage—ensuring the model doesn't just memorize specific backgrounds—data is split strictly by camera deployment: 14 cameras for training (1,109 images), 2 for validation (484 images), and the exact 8-camera benchmark test split from prior work (240 images).

Key Insights and Ideas

  • Shape flexibility matters: Restricting sets to traditional single vectors ($K=1$) drops macro-F1 by 4.0 points and takes twice as many epochs to converge. Variable-sized sets naturally trace non-contiguous, curved anatomy.
  • Turning invisible shortcuts intodeletable artifacts: Even with foreground filtering during mining, three low-impact prototypes latched onto habitat features rather than gazelle anatomy. Because the architecture is natively transparent, an ecologist can spot these background prototypes, delete them, and refit the linear head in 3 epochs—ensuring population surveys won't silently break when cameras are moved.
  • Interpretability without the "accuracy tax": Operating directly in frozen foundation-model space keeps parameter counts tiny (suitable for a single-GPU ecology lab) while nearly matching an unconstrained black-box linear probe.

Key Results

On the Mountain Gazelle test split, Part-Set Prototypes achieve 0.879 accuracy and 0.878 macro-F1.

  • This substantially outperforms previously published benchmarks on this dataset, including Multi-size PIP-Net (0.754 macro-F1) and a black-box ConvNeXt (0.758 macro-F1).
  • Using the exact same frozen DINOv3 features, an unconstrained black-box linear probe reaches 0.891 macro-F1—putting the self-explainable model within just 1.3 points of an unstructured upper bound.
  • Pruning the three habitat-bound prototypes yields 0.874 macro-F1, sacrificing just 0.4 points for verified anatomical grounding.
Figure 3. The most influential prototypes ordered by their contribution to the evaluation set (leftmost being the most frequently top- scoring, and rightmost the least). The top row displays each prototype as its strongest-activating training image along with its active tokens (with gated-out tokens removed). The bottom row shows representative test images and their corresponding activation maps where each respective prototype was most responsive, highlighting learned anatomical features such as horns, neck, and body structure.

Qualitatively, the most decisive prototypes consistently localize to the exact dimorphic traits used by human wildlife managers: S-shaped horns, muscular male necks, and slender female mid-bodies.

Limitations and Future Work

The authors note a few practical boundaries:

  • Human-in-the-loop overhead: Auditing and pruning a prototype bank requires domain expertise compared to deploying an off-the-shelf black-box detector.
  • Reliance on clear visual signals: The framework assumes diagnostic traits exist in the image and are resolved by the frozen encoder; tasks with subtle or inconsistent visual cues (like sexing zebras) remain tough.
  • Prototype redundancy: The bank retains near-duplicate prototypes across scales and orientations (though the authors note this redundancy actually helps detect camouflaged animals across shifting backgrounds).

For future work, the team plans to automate habitat screening, conduct empirical user studies with field ecologists, and extend the framework to broader conservation tasks—such as age estimation, body-condition scoring, and animal welfare assessment across other species.

Summary updated

Abstract

Self-explainable visual models for fine-grained recognition are often hindered by rigid geometric constraints that cannot capture diverse semantic shapes in unconstrained "in-the-wild" imagery. Real-world camera-trap data introduces challenges, including non-optimal poses, lighting variations, occlusions, animal camouflage, and environmental shortcuts. To address this, we introduce set prototypes, a general architecture where both part cardinality and unconstrained spatial layouts are mined directly from data. Our joint-matching formulation places parts simultaneously on a frozen DINOv3 token grid via truncated Sinkhorn competition, allowing unsupported parts to abstain without spatial collapse. We evaluate our approach on Mountain Gazelle sex classification, a camera-trap benchmark, where our model achieves 0.878 macro-F1--outperforming prior architectures and at par with an unconstrained linear probe. The strongest prototypes localize to distinctive biological areas such as horns, neck and body, allowing ecologists to visually verify decisions before trusting the metric. This formulation generalizes naturally to diverse ecological monitoring challenges beyond a single species.
BibTeX
@misc{shitrit2026part,
  author = {Tali Boneh Shitrit and Amir Kedem and Ilan Shimshoni and Anna Zamansky},
  title = {{Part-Set Prototypes for Explainable Mountain Gazelles Sex Classification}},
  year = {2026},
  eprint = {2611.32343},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32343},
}
Figure