A lymph node slide that contains a micrometastasis is mostly healthy tissue. The tumor may cover less than one percent of the image, and the healthy part is itself varied: lymphocyte sheets, fat, capsule, vessels, stroma, and occasional rare structures. Prototype-based detectors summarize "normal" with a handful of representative vectors, called prototypes, and flag patches that sit far from all of them. They decide in advance how many prototypes there are. When there are too few, rare healthy tissue sits far from every prototype and is flagged as tumor, so false alarms dominate. When there are too many, and especially when prototypes are fitted on slides that contain tumor, a spare prototype can drift onto the tumor itself and quietly label it normal. We propose to let the number of normal prototypes grow only from slides known to be tumor-free. Growth stops at the point where held-out healthy tissue is covered at the false-alarm rate the clinic will actually operate at.
Put in two sentences: decide how many "normal" anchors to keep by asking how many are needed so that unseen healthy tissue is almost never flagged, and let only tumor-free slides create anchors. Prototype capacity then tracks how varied healthy tissue is, and tumor cannot buy its own prototype.
Core Claim
Weakly supervised whole-slide classification is a form of multiple instance learning (MIL), in which each slide is a "bag" of patches with one label for the whole bag. MIL has an asymmetry that current prototype methods do not use. Negative bags are certified normal at every instance, while positive bags mix a few tumor patches ("witnesses") with many normal ones. We claim that a normal-prototype set built under three rules will reduce false positives on rare healthy tissue at fixed tumor sensitivity, compared with both a single normal prototype and a large fixed bank. The first rule is that prototypes are created only from negative-bag patches. The second is that a new prototype is added wherever held-out negative patches are poorly covered. The third is that each patch is scored against prototypes keyed to its spatial neighborhood. We also claim the gains will be largest when tumor witnesses are scarcest. The context step encodes the idea that whether a patch is abnormal depends on what surrounds it.
The allocation rule can be stated in one line. Let $d_c(x)$ be the distance from patch embedding $x$ to the nearest normal prototype in context group $c$. Let $\alpha$ be the target per-patch false-alarm rate. Let $\tau$ be a shared score threshold. Prototypes are added to group $c$, by splitting the worst-covered prototype, until
$$ Q_{1-\alpha}\big(\{ d_c(x) : x \in \mathcal{N}^{\text{val}}_c \}\big) \le \tau \quad \text{for every } c, $$
where $\mathcal{N}^{\text{val}}_c$ is the set of held-out patches from negative slides in context $c$, and $Q_{1-\alpha}$ is their $(1-\alpha)$ quantile. Under this rule, homogeneous tissue ends up with one or two prototypes and heterogeneous tissue gets many. Rare but valid normal modes are covered because the criterion is about the tail of the distance distribution, not about where most of the data lies.
Relation to Prior Work
Several papers motivate this design by showing that fixed prototype counts fail. PDM-Net predicts distant video frames against a fixed bank of 100 normal motion prototypes, and its authors name dynamic allocation as the open problem. Levi et al. and Xu et al. show that diverse sub-groups forced into one prototype collapse into an average. TPMIL does exactly this for normal tissue: it trains $K$ tumor-subtype prototypes plus one normal prototype and pulls every slide patch toward them with attention-derived soft labels. We keep TPMIL's idea of scoring every patch by distance to a prototype. We replace its single normal anchor with a coverage-sized set and stop positive slides from shaping that set.
Two works supply the allocation precedents we depart from. DLAN-AC sizes prototypes per video scene with a self-organizing map and then prunes redundant clusters. It does this for dense, unsupervised frame reconstruction, so its stopping criterion is about how well the clusters fit the data, not about false alarms. Fauvel scales prototype counts by kurtosis, a measure of how heavy the tails of a distribution are. Our criterion differs from both in two ways: it is tied directly to the detection operating point, and it uses label asymmetry to keep anomalous data out of the allocation.
Two other papers constrain the design. ReCAP shows that when prototypes are allowed to shift with the input image, the normal prototype can slide onto a lesion, which its authors call "anomaly leakage." ReCAP limits the shift with a learnable gate and a tanh bound, but it keeps one normal and one abnormal prototype. Our design avoids leakage by never letting positive-bag patches move or create normal prototypes, and we test whether this matters more than bounding. UMIL shows that MIL models latch onto background shortcuts that happen to correlate with the bag label. This warns us that context features could themselves become shortcuts. For that reason, context in our design only selects which prototypes a patch is compared with; it never feeds the classifier directly.
Context grouping borrows its neighborhood definition from CAMIL, which uses an 8-neighbor tile graph combined with Nystromformer attention, a linear-cost approximation of full self-attention. CAMIL has no explicit model of what normal tissue looks like. CLAWS uses a two-cluster normal/abnormal objective and suffers from lingering false alarms. That supports the claim that a single normal center fails on varied normal data.
Research Program
All methods use the same frozen patch encoder, followed by a small learned projection. Each patch's context is the mean of the projected embeddings of its 8 neighbors, clustered into a modest number of context groups using negative slides only. We fit prototypes on negative training slides in each context group. We start from one prototype per group and split the prototype whose assigned held-out negatives have the worst tail distance, repeating until the inequality above holds. The projection is trained with a bag loss in which a slide's score is a soft maximum over its patches' context-keyed distances. Gradients from positive slides update only the projection, never the prototypes. Prototypes are refit on negatives at each epoch with the projection held fixed.
We set $\alpha$ from the target slide-level specificity. Because $\alpha$ is a stated knob rather than a hidden one, we report how it trades prototype count against sensitivity. Localization heatmaps come directly from the distances, as in TPMIL. A second, smaller study applies the identical recipe to UCF-Crime, using normal videos as negative bags and 1-second snippets as instances. This tests whether the rule transfers from space to time and whether coverage-sized normals reduce the lingering post-event false alarms that CLAWS documents.
Baselines
The naive reference point is a single normal prototype fitted on negative slides, scored by distance with no context and no allocation. It shows how much any extra capacity buys.
The strongest existing methods on the primary benchmark are CAMIL and TPMIL. CAMIL reports 95.9% slide AUC on CAMELYON16 and a lesion-localization Dice of 0.515, against 0.459 for CLAM-SB and 0.103 for TransMIL. That makes it the bar for both detection and localization on sparse metastases. TPMIL is the closest architecture to ours: it is prototype-based MIL with one normal anchor. Its reported numbers are 0.9417 AUC on TCGA Brain and 0.9799 AUC on TCGA Lung. We found no reported TPMIL result on Lacuna for CAMELYON16, so we will rerun it there.
Every method will be rerun with the same frozen encoder, the same patch grid, the same train/validation/test splits, and an equal hyperparameter search budget. CAMIL's published number is kept as an external sanity check. Beating CAMIL means matching its slide AUC within run-to-run noise while improving Dice and, above all, lowering the false-positive rate on negative test slides at 95% tumor sensitivity.
On UCF-Crime the competitor is UMIL, which reports 86.75% frame AUC. The claim there is only that frame AUC is not worse and that false alarms after the event end are fewer.
Three ablations isolate the key ingredient. The first lets positive-bag patches create and move prototypes, which is a test for leakage. The second replaces the coverage rule with k-means at the same final prototype count, isolating where the prototypes go from how many there are. The third removes context keying.
Why not just…?
Why not just use a large fixed prototype bank fitted on negatives? A bank of 50 or 100 prototypes fitted by k-means places its centers where the data is dense. Rare normal tissue therefore still gets no prototype, while common lymphocyte sheets get dozens. PDM-Net's authors report that their fixed bank of 100 is insufficient for complex scenes, and DLAN-AC needed explicit pruning because surplus slots absorbed background noise. The k-means ablation at matched count tests this directly. If a fixed bank matches us on rare-tissue false positives, the allocation rule adds nothing and we will say so.
Why not just keep every negative patch and score by nearest-neighbor distance? This is the real threat, because a full memory of negative patches is effectively unlimited prototypes and covers rare modes trivially. We found no reported result on Lacuna for nearest-neighbor patch memories on CAMELYON16, so we will run one, both at full size and subsampled to our prototype budget. We expect full memory to match our false-positive rate but at orders of magnitude more storage across millions of patches, and we expect random subsampling to lose the rare modes. If full memory also beats us on sensitivity, the contribution shrinks to compression, and the note's claim would have to be restated as an efficiency result.
Why not just use attention MIL or CAMIL, which already find sparse witnesses? TPMIL reports that attention heatmaps are disturbed by tissue folds and staining artifacts, and UMIL shows that attention picks up conspicuous background shortcuts. Neither has an explicit model of normal tissue that could explain why a rare healthy structure is acceptable. The stratified false-positive analysis below shows whether CAMIL's errors concentrate on rare normal tissue, which is the specific weakness our method targets.
Decisive Experiments
The primary benchmark is CAMELYON16, whose 399 slides include many negatives. CAMELYON17 is used for cross-center transfer. Beyond slide AUC and Dice, the key measurement is the false-positive rate on negative test slides at fixed tumor sensitivity. We stratify it by how rare each normal mode is, using the frequency of each mode's context group among negative patches. The method succeeds if false positives fall most in the rarest strata, the Dice improvement over CAMIL holds, and the leakage ablation shows tumor patches captured by normal prototypes as soon as positives are allowed to create them.
To measure leakage directly, we compute the fraction of annotated tumor patches whose nearest normal prototype is closer than $\tau$. A second test examines witness scarcity. We sort positive test slides by annotated tumor fraction and check whether our advantage over TPMIL grows as the fraction shrinks, which is the sparse regime where signal dilution should hurt single-anchor methods most.
The plot of prototype count against $\alpha$ should show counts concentrating in heterogeneous context groups. If instead counts track group frequency, the coverage rule has collapsed into ordinary clustering and the central claim fails.
References
- Long Short-Term Dynamic Prototype Alignment Learning for Video Anomaly Detection
- Rethinking preventing class-collapsing in metric learning with margin-based losses
- Learning Transferable Conceptual Prototypes for Interpretable Unsupervised Domain Adaptation
- Trainable Prototype Enhanced Multiple Instance Learning for Whole Slide Image Classification
- Dynamic Local Aggregation Network with Adaptive Clusterer for Anomaly Detection
- A Lightweight, Efficient and Explainable-by-Design Convolutional Neural Network for Internet Traffic Classification
- Beyond Static Anchors: Bounded Prototype Conditioning for Language-Free Medical Anomaly Detection
- Unbiased Multiple Instance Learning for Weakly Supervised Video Anomaly Detection
- CAMIL: Context-Aware Multiple Instance Learning for Cancer Detection and Subtyping in Whole Slide Images
- CLAWS: Clustering Assisted Weakly Supervised Learning with Normalcy Suppression for Anomalous Event Detection