Rank Before You Encode: Reading a Few Percent of a Whole-Slide Image

Haoyu He, Mahdi S. HosseiniarXiv 2026

TL;DR

Analyzing a gigapixel pathology slide usually requires chopping it into 15,000 high-resolution tiles and running a massive neural network on every single one. Instead of building complex new architectures to trim that cost, the authors show you can just freeze an existing model, attach a tiny 3,300-parameter "scout" to a low-resolution thumbnail, and feed the model only the top ~6.6% most promising tiles. This drop-in shortcut runs 10–14× faster, requires zero retraining of the main model, and beats bespoke "efficient" architectures nearly every time.

What Problem Does This Paper Address?

Digital pathology deals with whole-slide images (WSIs)—vast gigapixel scans of tissue biopsies. Because no GPU can swallow a whole slide at once, the standard workflow is Multiple Instance Learning (MIL): chop the image into thousands of tiny high-res ($20\times$) patches, pass all of them through a heavy vision foundation model (the encoder), and let an aggregator network weigh the features to make a diagnosis. Over 99.9% of the compute goes into encoding those tiles—taking up to 5.2 petaFLOPs and over a minute per slide.

Recent "efficient WSI" methods try to cut this cost by selecting fewer tiles. However, they typically suffer from three headaches:

  1. They still encode every region at a coarse ($5\times$) resolution first, creating a hard computational floor.
  2. They lock you into a fixed compute budget during training.
  3. They train a brand-new model from scratch around their selection trick.

If a hospital lab already has a trusted, validated "full-bag" model (one trained on all tiles), do they really need to throw it away? And are complex new efficient models actually better than simply handing that existing frozen model a smartly chosen—or even random—subset of tiles?

Methods

Think of how a human pathologist uses a microscope: glance at the slide with the naked eye, scan suspicious areas at low power, and zoom in to high power only where it counts.

Figure 1. (Top) The testing process. A thumbnail ranking keeps K regions at the coarse level and zooms into b, and an existing model reads only their 20× tiles, weights unchanged. (Bottom) Mean test AUROC against measured seconds per slide over five design tasks (in Table 2).

The authors mimic this with a two-stage "selector" comprising just 3,328 trainable weights:

  1. The Thumbnail Gate: A single $1022\text{-pixel}$ thumbnail of the whole slide is passed through a lightweight vision model (DINOv2). A simple linear layer ranks all tissue regions and keeps the top $K$.
  2. The Coarse Scorer: Only those $K$ surviving regions are encoded at $5\times$ magnification using a pathology foundation model (Virchow2 or UNI2-h). A second linear layer ranks them and picks the top $b$ regions to zoom into at $20\times$.

Finally, the $20\times$ tiles from those $b$ regions are handed directly to the unchanged, frozen full-bag MIL model.

Figure 2. Method pipeline. The two scorers are fitted once per training split, with no new labels. A frozen attention model h (the teacher, the split’s gated ABMIL) reads the full bag of fine tiles of a training slide, and its attention, summed over each region’s fine tiles and normalised over regions, is the target π. The thumbnail scorer ψth, on DINOv2 thumbnail tokens tr, and the coarse scorer ψc, on coarse encodings Enc(ur), are linear attention models fitted to this one target by minimising KL(π ∥a) (Alg. 1). Gradients (dashed) update only the weights ωth and ωc, and the encoders and h stay frozen. The fitted selector is then frozen and serves every budget (K, b) and every model g (Fig. 1, top). Shown is a CAMELYON17 training slide of split 1 (468 regions, 6,077 fine tiles), darker meaning more attention, scaled per panel. The tumour outline (cyan) is for illustration and is never seen by any model.

What is novel here is how the selector learns where to look without needing new labels or retraining the classifier. A frozen attention-based MIL model already assigns "attention weights" to tiles it finds important when viewing a full slide. During a quick 4-to-26-minute fitting phase on training slides, the two linear scorers are trained via KL-divergence simply to predict where that frozen teacher model's attention will land. Once fitted, this single selector works across any compute budget $(K, b)$ and can feed any frozen aggregator—even ones without built-in attention.

Datasets

No new datasets are introduced, though the authors carefully split existing public benchmarks into six design tasks (used to develop the method) and three pre-registered held-out tasks (touched only once at the end, plus external transfer cohorts):

  • Design Tasks: Lymph-node metastasis detection (CAMELYON16, CAMELYON17), breast cancer subtyping (TCGA-BRCA, BRACS), lung cancer subtyping (TCGA-LUNG), and kidney cancer staging (TCGA-RCC).
  • Held-out & Transfer Tasks: Prostate biopsy diagnosis and ISUP grading (PANDA—over 10,600 slides), kidney nuclear grading (TCGA-KIRC), and external sentinel-node transfer (SLN-Breast).

Key Insights and Ideas

  • Don't retrain; just curate: Existing full-bag models are surprisingly resilient to missing 93%+ of their input tiles, provided the remaining tiles preserve the diagnostic signal.
  • Focal vs. Diffuse tasks: Comparing smart selection against random tile sampling reveals the nature of the disease. When hunting for tiny focal metastases in lymph nodes, smart selection beats random sampling by ~0.10 AUROC. On diffuse tasks (like distinguishing broad lung or breast cancer subtypes where tumor fills the slide), random tiles work nearly as well!
  • A missing baseline in the literature: Many bespoke "efficient" MIL architectures look good on paper, until you realize they lose to a standard frozen model given the exact same tile budget.

Key Results

  • Sweet-spot budget $(K=1000, b=10)$: Encodes ~6.6% of the full slide's FLOPs and runs 10–14× faster (excluding tiling). Across 36 pairs of tasks and frozen aggregators, AUROC drops by no more than 0.005 in 33 of 36 cases.
  • Fast budget $D=(500, 10)$: Drops encoder cost to ~4% and speeds up inference by 13–22×. Even at this aggressive cut, the frozen gated-ABMIL model beats nine dedicated efficient methods across 55 of 60 paired comparisons.
  • Zero-compromise adaptive rule: Using a validation-calibrated "performance-first" budget rule keeps all 36 task-aggregator pairs within 0.004 AUROC of full-bag accuracy at 14–100% of the compute cost.
Figure 5. What the selection reads and what it misses on CAMELYON16 test slides (selector and frozen gated ABMIL of split 0, Virchow2). Each column is one read of one slide, with the outcome in its title. Top, the slide, with the regions kept by the thumbnail gate in grey, the ten regions read at 20× in orange and the annotated lesions in cyan. A dashed circle locates a lesion too small to see at this scale. Bottom, the 20× field at the black ring, 0.375 mm wide. If the read calls the slide positive, the field is centred on the tile with the highest attention among the tiles read, drawn as a thick orange square, with the other tiles read in thin orange. If the read misses the slide, the field is centred on the largest lesion, and the absence of orange squares shows that the lesion was not read. The tick or cross under each field says whether our read and the full bag call the slide correctly at 95% specificity on the validation negatives. All reads are at D = (500, 10) except (e), which repeats the slide of (d) at (1000, 10). The slides are chosen by rule, as (a) the first slide by id with a macrometastasis, (b) the smallest micrometastasis that is zoomed and called, (c) the only positive slide that our read calls and the full bag misses, and (d) and (f) the only two annotated positive slides with no lesion among the zoomed regions.

Limitations and Future Work

  • Needles in haystacks still hurt at ultra-low budgets: Pushing down to 4% cost ($D$) misses tiny lesions. On CAMELYON17—where positive slides may contain only isolated tumor cells ($\le 0.10\text{ mm}$)—AUROC drops by up to 0.035 because tiny clusters can fall outside the coarse thumbnail gate.
  • Cohort shift: While the selector transfers well across scanners and hospitals overall, moving a validation-chosen budget rule between different lymph-node cohorts caused an unexpected 0.017 AUROC dip on CAMELYON16.
  • Tuning caveat & future standard: Because rival efficient methods were run using their published default settings without per-task hyperparameter tuning, part of their performance gap could stem from tuning differences. Moving forward, the authors advocate a simple rule of thumb for future WSI efficiency papers: always benchmark your shiny new architecture against an existing frozen model fed both selected and random tiles at the exact same compute cost.

Summary updated

Abstract

Classifying a whole-slide image requires encoding thousands of high-resolution tiles with a pathology foundation model, which accounts for most of the inference cost. Existing efficient methods reduce this cost by selecting fewer tiles, but typically train a new model around their selection strategy. A largely unexplored alternative is to keep an existing full-bag model frozen and run it on selected tiles at the same encoder cost. We introduce this comparison, alongside random tile sampling at matched cost. To select tiles, we fit a lightweight selector with 3.3K parameters to the attention of a frozen model, without additional slide labels. The selector ranks regions from a slide thumbnail, encodes the top K regions at 5x magnification, and selects b for processing at 20x. We evaluate seven frozen MIL aggregators on six tasks and compare them with nine efficient methods trained on the same features and splits. At a budget of (K,b)=(1000,10), encoding costs about 6.6% of the full bag and is 10-14x faster, excluding tiling. The AUROC drop is no more than 0.005 in 33 of 36 aggregator-task pairs. At (500,10), the cost falls to about 4% and inference is 13-22x faster, but AUROC drops by up to 0.035 on CAMELYON17, where small metastases are easily missed. Selection improves over random sampling by about 0.10 AUROC on tasks with focal lesions, while random sampling performs well on diffuse tasks. In our comparisons, the frozen model at (500,10) is ahead of nine efficient methods in 55 of 60 paired comparisons. Giving an existing WSI model fewer tiles is thus a baseline that a new efficient model should be compared with at matched encoder cost.
BibTeX
@misc{he2026rank,
  author = {Haoyu He and Mahdi S. Hosseini},
  title = {{Rank Before You Encode: Reading a Few Percent of a Whole-Slide Image}},
  year = {2026},
  eprint = {2611.34523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.34523},
}
Figure