PEAR-MIL: Prototype Evidence Aggregation and Retrieval Multi-Instance Learning for Whole Slide Image Classification

Shiwei Li, Lu Wang, Xinyue Liu, Huaguan Chen, Xinyi Li, Qu He, Qingjie LiuarXiv 2026

TL;DR

When AI analyzes gigapixel-scale pathology slides, it usually squashes thousands of image patches into a single summary vector—like trying to judge a whole novel from one-sentence CliffsNotes. PEAR-MIL fixes this bottleneck by pairing standard attention pooling with a set of learnable "prototype" queries that actively retrieve distinct, recurring tissue patterns from the slide. The result is a lightweight, dual-evidence framework that boosts diagnostic accuracy, especially when the underlying image features aren't already near-perfect.

What Problem Does This Paper Address?

Whole-slide images (WSIs) in digital pathology are massive—often billions of pixels—making it prohibitively expensive for pathologists to annotate every tumor cell. Instead, researchers use weakly supervised Multiple Instance Learning (MIL): a slide is chopped into thousands of small patches, encoded by a frozen vision model, and treated as a "bag" of features with only a single slide-level label (e.g., tumor or normal).

Most modern MIL methods rely on gated attention to weigh each patch and average them into one slide-level vector. While effective, compressing an entire tissue sample into a single weighted sum can wash out subtle or recurring diagnostic patterns. The authors ask: Can we teach a model to use class- and background-associated prototypes as active queries to retrieve complementary evidence from the slide?

Methods

PEAR-MIL operates on projected patch features ($d = 512$) through two parallel paths that are fused right before the final classifier:

Fig. 1. Overview of PEAR-MIL. Patch features xi are projected through ϕ to obtain hidden representations hi. The attention evidence path (top) applies gated attention to produce fattn. In parallel, the prototype evidence path (bottom) deploys K learnable prototypes {pk} as conditional evidence queries: each prototype computes cosine similarity with all patch features, applies temperature-scaled softmax over patches to retrieve a prototype-specific evidence token ek. An evidence router aggregates {ek} into fproto, while the per-prototype maximum similarities mk provide additional diagnostic cues. The slide classifier fuses [fattn, fproto, m] for final prediction.
  1. Attention Evidence Path (Standard): A gated attention mechanism scores each patch's importance and computes a weighted sum, producing a global slide representation ($f_{\text{attn}}$).
  2. Prototype Evidence Path (New): The model maintains $K = C + 1$ learnable prototype vectors (one per class, plus one for background), guided by an attention-guided KL-divergence loss that requires no patch-level labels. Instead of just passively clustering features, each prototype acts as a slide-internal query:
  3. It computes cosine similarity with every patch in the slide.
  4. It applies a temperature-scaled softmax ($\tau$) over the patches to retrieve a prototype-specific evidence token ($e_k$).
  5. A lightweight importance router aggregates these tokens into a compact prototype representation ($f_{\text{proto}}$) using learned global relevance weights.
  6. It also extracts the maximum cosine similarity ($m_k$) per prototype as an attention-free signal of the strongest pattern match anywhere on the slide.

Finally, a linear classifier fuses $[f_{\text{attn}}, f_{\text{proto}}, m]$ to make the slide-level prediction. Beyond a standard attention MIL backbone, this adds only $K$ prototype vectors, $K$ router logits, and one linear layer.

Datasets

The authors evaluate PEAR-MIL on three public WSI benchmarks across three frozen feature extractors spanning general-purpose to pathology-specific pretraining (ResNet50, CTransPath, and UNI v2):

  • Camelyon16: Lymph-node metastasis detection (tumor vs. normal), using 269 slides for 5 random train/validation splits and 129 slides for the fixed official test set.
  • Camelyon17: Multi-center lymph-node WSIs (pN-stage), using 500 publicly labeled slides split 60:15:25 at the patient level to prevent data leakage.
  • TCGA-NSCLC: Lung cancer subtyping (LUAD vs. LUSC) across 1,043 slides, split 60:15:25 using pre-extracted UNI features.

Key Insights and Ideas

  • Not Just a Bigger Classifier Head: In parameter-matched control experiments—where prototype evidence was replaced with zero, mean, or random vectors—performance dropped across the board (e.g., dropping 8.55% AUC on Camelyon16-ResNet50 with zero evidence). The gains come from the retrieved evidence itself, not extra parameters.
  • A Dual-Benefit Mechanism: Perturbing the prototypes (freezing them randomly, shuffling their identities, or detaching gradients) revealed two distinct sources of improvement:
  • Structural benefit: Even when prototype identities are shuffled, the cosine-based multi-query aggregation still helps (only a 0.6% gap on ResNet50), because it organizes evidence differently than gated attention.
  • Semantic benefit: With stronger pathology-specific features (CTransPath), learned prototype semantics matter much more, widening the gap between learned and shuffled prototypes to 2.2%.
  • Feature Quality Dictates Retrieval Sharpness: The optimal temperature $\tau$ depends heavily on the backbone. Weaker, general-purpose ResNet50 features need sharp, focused retrieval ($\tau = 0.07$), whereas stronger pathology-pretrained features (CTransPath and UNI) prefer smoother, more inclusive retrieval ($\tau = 0.3$).
Fig. 2. Temperature sensitivity on Camelyon16. AUC (%) results across five fixed τ values (0.07, 0.1, 0.15, 0.3, 0.5) are evaluated over 5 splits. Dashed horizontal lines indicate the learnable-τ result for each backbone. ResNet50 peaks sharply at τ = 0.07, while both CTransPath and UNI prefer smoother retrieval and achieve their best performance at τ = 0.3 with flatter profiles around the optimum.

Key Results

PEAR-MIL achieved the highest AUC in 4 out of 7 backbone-dataset settings, with the most pronounced gains in non-saturated feature regimes:

  • Camelyon16 (ResNet50): 84.24% AUC, outperforming the strongest baseline (TransMIL at 80.39%) by +3.85%.
  • Camelyon16 (CTransPath): 95.19% AUC, ranking first among all compared methods.
  • Camelyon17 (CTransPath): 91.29% AUC, ranking first.
  • Camelyon17 (UNI): 98.06% AUC and 96.16% ACC, ranking first.
  • Saturated Regimes (UNI): On Camelyon16 (99.23% AUC) and TCGA-NSCLC (98.25% AUC), where top baselines already exceed 97.5%, PEAR-MIL remains highly competitive.

Limitations and Future Work

  • Fixed Temperature: Attempts to make the retrieval temperature $\tau$ learnable consistently underperformed fixed values (e.g., 76.76% vs. 84.24% AUC on ResNet50), likely because slide-level cross-entropy loss provides too indirect a signal.
  • Global Router Weights: The current evidence router uses global prototype weights shared across all slides; conditioning these weights on each slide's specific content is a natural next step.
  • Scope: The framework was evaluated on binary classification tasks; extending it to multi-class subtyping, survival prediction, and larger-scale prototype localization studies remains future work.

Summary updated

BibTeX
@misc{li2026pear,
  author = {Shiwei Li and Lu Wang and Xinyue Liu and Huaguan Chen and Xinyi Li and Qu He and Qingjie Liu},
  title = {{PEAR-MIL: Prototype Evidence Aggregation and Retrieval Multi-Instance Learning for Whole Slide Image Classification}},
  year = {2026},
  eprint = {2611.40601},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.40601},
}
Figure