Contrastive learning trains an image encoder by pulling two augmented views of the same image together and pushing every other image in the batch away. The push fails when the "other" image actually shares what is being compared. Most work on this failure, called false negatives, asks a whole-image question: does image $j$ belong to the same class as image $i$? Interpretable models such as prototype networks and concept bottlenecks do not reason about whole images. They reason about parts and attributes, like a yellow beak, a striped wing, or a car's front grille, and many different classes share these parts. When a contrastive loss is applied to part representations, a gull and a tern, which are correctly different species, still get their identical beaks pushed apart. We propose that this part-level collision is a direct and fixable cause of two known problems in interpretable vision: prototypes that bind to a head in one image and a tail in another, and interpretable models that trail black boxes in accuracy.
The proposal is to learn a fixed set of part "slots" with a slot-wise contrastive loss. For each slot and each negative pair, the method estimates the probability that the two images actually share that part. It then scales down the repulsion by that probability, per pair and per slot. If this works, the model gets shared, consistent parts in a single training phase, with no offline merging step. Those parts can then be named and edited at test time like concept-bottleneck concepts. The test is whether removing part-level repulsion raises both prototype consistency and accuracy together, rather than trading one for the other.
Core Claim
Existing debiasing methods decide once per pair of images whether a negative is false. ProGCL does this by fitting a two-component Beta mixture to anchor–negative similarities and reweighting negatives by their posterior probability of being true negatives. GDCL does it by clustering nodes and dropping negatives from the anchor's cluster. Both motivate this work: they show that the hardest negatives are often same-class neighbors, and that repelling them damages cluster structure. Both also constrain it, because a single yes/no decision per image pair cannot represent "different species, same beak."
Our claim is that the right unit for the decision is the pair-slot triple $(i, j, k)$. Let $z_k(x)$ be the unit-normalized embedding of slot $k$ for image $x$. Let $x_i'$ be an augmented view of $x_i$. Let $s_{ijk} = z_k(x_i)^\top z_k(x_j)$ be the slot-$k$ similarity between images $i$ and $j$, and let $\tau$ be a temperature. The loss for slot $k$ is
$$ \mathcal{L}_k = -\sum_i \log \frac{\exp(z_k(x_i)^\top z_k(x_i')/\tau)}{\exp(z_k(x_i)^\top z_k(x_i')/\tau) + \sum_{j \neq i} w_{ijk}\,\exp(s_{ijk}/\tau)} $$
Here $w_{ijk} = p(\text{part not shared} \mid s_{ijk})$ comes from a Beta mixture fitted separately for each slot. We expect slot-wise similarity distributions to be bimodal even in vision, where ProGCL found image-level similarities unimodal. The reason is that a given part is either present and alike in two images or it is not. Checking this bimodality is the first experiment. If it fails, the mixture step is replaced by the alternatives discussed below.
The slots feed a linear classifier restricted to non-negative weights. This reuses the Score Aggregation idea from EvalProtoPNet, so that detecting a part can only add evidence for a class.
The closest existing work is Bayesian Gated Non-Negative Contrastive Learning (BayesNCL). It identifies the same push–pull conflict for shared content such as sky backgrounds. It fixes the conflict with a learned per-sample Bernoulli gate over anonymous latent dimensions, guided by an "inverse prevalence" prior that down-weights frequent features. Our method differs in three ways:
- Pair-specific decision. Our cancellation depends on whether these two images share this part. BayesNCL's gate depends on how common a feature is overall.
- Frequent parts are kept. A beak shape shared by thirty species is exactly the kind of feature an inverse-prevalence prior suppresses. It is also exactly what a shared prototype should represent.
- Nameable, editable units. Our units are spatial part slots that can be named and edited. BayesNCL explicitly leaves concept-level and intervention use open.
Research Program
Architecture. The model uses a standard backbone (ResNet-34/50 for comparability with the prototype literature, and a ViT-S as a secondary setting). A small attention head produces $K$ spatial slot maps, and each slot's pooled feature is $z_k(x)$.
Training schedule. Training starts with uniform weights $w=1$ for a warm-up period, because the file identifies early mixture fitting as a source of self-confirming errors. After warm-up, the per-slot Beta mixtures are refit every epoch on a subsample of pairs from a memory queue. To limit self-confirming errors further, we clip $w_{ijk}$ from below at a floor. This ensures no negative is ever fully and permanently cancelled on the strength of a possibly wrong early fit.
Classifier and naming. A supervised cross-entropy head with non-negative weights is trained jointly on class labels. No part annotations are used for training.
Turning slots into concepts. Slots are named after training in two ways. The first assigns each slot the CUB attribute whose annotations best predict its activation. The second assigns each slot the text concept, drawn from the LLM-generated concept pools of Sparse-CBM, with the highest CLIP similarity to the slot's top patches. The named slots then support concept-bottleneck-style intervention as in Concept Bottleneck Models: a user overwrites a slot's activation and the prediction updates.
Diagnosis. We will measure how often part-level false negatives occur. On CUB, we count negative pairs whose images share a ground-truth attribute tied to the slot's best-matching part. We then record gradient cosines between the attractive and repulsive terms on those pairs, testing the conflicting-gradient story from GDCL at the part level.
Baselines
Naive reference. The do-nothing reference is the same slot architecture trained with plain slot-wise InfoNCE ($w \equiv 1$) plus the same classifier. This isolates what cancellation adds. Alongside it we report a vanilla ProtoPNet (This looks like that), which reports 78.0% CUB accuracy with VGG19 and 84.8% for its ensemble. We also report its ResNet-34 consistency score of 15.1% from EvalProtoPNet.
Strongest prototype baseline. This is EvalProtoPNet. It fixes prototype drift by aligning deep feature similarity structure to shallow layers and by using non-negative score aggregation. It reports a 70.6% consistency score with ResNet-34 and accuracy "up to 88.5%" on CUB. It is the strongest competitor because it targets the same symptom, inconsistent parts, by a different cause, missing spatial anchoring. It does not address contrastive repulsion.
We will rerun it with its released recipe on our backbone, image resolution, and epoch budget, and give it the same hyperparameter search budget as our method. Beating it means one of two things. Either we match its accuracy within noise while exceeding its consistency on the same protocol, or we exceed it on both. Because the two methods address different causes, we also test EvalProtoPNet's alignment loss combined with our cancellation. An additive gain there would be evidence that the causes are distinct.
Concept-bottleneck baselines. Sparse-CBM builds a concept layer on frozen CLIP using LLM concepts and Gumbel-softmax sparsity. It reports 80.02% on CUB. It is the strongest label-free concept baseline, and its contrastive concept loss is not debiased. We run it with the same concept pool we use for naming. Our target is higher accuracy at equal concept count, together with a better intervention curve. We also report the attribute-supervised joint CBM from Concept Bottleneck Models, with 19.9% CUB task error and roughly 48–49% error on CUB+Places. We treat this as an upper reference, because it uses dense attribute labels that our method does not.
Ablations isolating the key ingredient. These are the most important comparisons. All share our architecture and budget; only the negative weighting changes.
- Instance-level weighting (ProGCL-style). One Beta mixture on whole-image similarity, applied identically to every slot.
- Instance-level filtering (GDCL-style). Cluster-based removal of negatives from the anchor's cluster.
- Per-sample gating (BayesNCL-style). A Bernoulli gate over slots with its sparsity prior, tuned over its reported inverted-U range.
- Oracle. Cancellation driven by ground-truth CUB attribute sharing, as an upper bound.
If instance-level weighting matches slot-level weighting, the core claim fails.
Why not just…?
Why not just drop negatives and use a non-contrastive, positive-only loss on the slots? With no repulsion there are no false negatives, so this is a real threat. The risk is that slots collapse onto the same salient region, or onto a constant, because nothing separates different parts. We will run a BYOL-style positive-only slot objective with the same architecture and budget, and report slot diversity (the average number of distinct part locations covered per image) alongside consistency and accuracy. If it matches our method, the conclusion is that repulsion itself is the problem, and we will report that.
Why not just supervise the slots with CUB's attribute labels, like a standard concept bottleneck? On CUB that is possible, and it is why the supervised CBM appears as an upper reference. The target regime, however, is data without dense concept annotations, which Concept Bottleneck Models names as the main burden of the approach. We will additionally run a partial-label version that uses 10% of attribute labels to tell whether our method is complementary to weak supervision.
Why not just use frozen CLIP with a sparse concept layer? Sparse-CBM already reaches 80.02% on CUB this way. Its concepts, however, are whole-image text similarities, not localized parts, so it cannot report where a concept fired. On CUB+Places, image-level CLIP concepts are exposed to background leakage, the same leakage that raised the supervised CBM's error to roughly 48–49%. Our comparison on CUB+Places will show whether localized, debiased slots are less affected.
Why not just merge redundant prototypes after training, as ProtoPShare does? ProtoPShare prunes up to 80% of prototypes without losing accuracy. That is strong evidence that sharing is right, but it is achieved by an offline two-phase procedure over data-dependent similarities. We will compare against ProtoPShare at a matched final prototype count and matched total compute. If post-hoc merging recovers the same consistency, the advantage of our method reduces to cost, and we will state it as such.
Proposed Experiments
Controlled test on FunnyBirds. The first decisive check uses FunnyBirds, where ground-truth parts are known. We generate class sets in which the fraction of parts shared across classes ranges from low to high. The prediction is specific: the gap between plain and cancelled slot-wise InfoNCE, in both explanation correctness and accuracy, should widen as sharing increases. Instance-level weighting should not close that gap. We score explanations with summed similarity maps rather than bounding boxes, because that paper shows the choice alone moves single-deletion scores from 0.24 to 0.73.
Main CUB-200-2011 evaluation. We report accuracy, the EvalProtoPNet consistency and stability scores, and the intervention curve: task error as the $n$ worst-predicted named slots are corrected with attribute ground truth.
Stress tests. Background leakage is tested on CUB+Places. Transfer beyond birds is checked on Stanford Cars and PartImageNet. A linear probe on ImageNet-100 checks that part-level cancellation does not hurt general representations relative to BayesNCL's reported 70.44% top-1, or SimCLR's 68.31%, both from Bayesian Gated Non-Negative Contrastive Learning. No Lacuna result was found for EvalProtoPNet or ProtoPShare on Stanford Cars, so we will generate those baselines ourselves.
Falsification. The claim is falsified if either of two things happens. The first is that slot-wise similarity distributions are not bimodal, so the mixture posterior carries no information. The second is that instance-level weighting matches slot-level weighting on FunnyBirds at high part sharing.
References
- ProGCL: Rethinking Hard Negative Mining in Graph Contrastive Learning
- Graph Debiased Contrastive Learning with Joint Representation Clustering
- Is ProtoPNet Really Explainable? Evaluating and Improving the Interpretability of Prototypes
- Bayesian Gated Non-Negative Contrastive Learning
- Sparse Concept Bottleneck Models: Gumbel Tricks in Contrastive Learning
- Concept Bottleneck Models
- This looks like that: deep learning for interpretable image recognition
- ProtoPShare: Prototype Sharing for Interpretable Image Classification and Similarity Discovery
- Revisiting FunnyBirds evaluation framework for prototypical parts networks