Rank Before You Encode: Reading a Few Percent of a Whole-Slide Image
Organizations: Department of Computer Science and Software Engineering (CSSE), Concordia University, Montreal, Canada · Mila - Quebec AI Institute, Montreal, Canada
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.
Figures & tables
| Method | Reads first | Budget by | Existing | Trained | Labels | Train min | F% |
| ZoomMIL [ 25 ] | all regions | training | no | 3.4M | yes | 48 to 197 | 7.3 to 8.0 |
| ZoomMIL (3 lev.) | all regions | training | no | 5.2M | yes | 30 to 123 | 2.8 to 3.6 |
| HAG-MIL [ 27 ] | all levels | training | no | 63.5M | yes | 62 to 313 | 106 |
| GFR-MIL [ 21 ] | all regions | training | no | 13.3M | yes | 37 to 90 | 34 |
| SASHA [ 10 ] | all regions | training | no | 56.4M | yes | 661 to 1672 | 15 to 27 |
| PathCTM [ 9 ] | all regions | per slide | no | 179.0M | yes | 107 to 445 | 7.4 to 7.8 |
| LUNG | RCC staging | BRACS | CAMELYON16 | CAMELYON17 | ||||||||||||
| Method | AUROC | F% | AUROC | F% | AUROC | F% | AUROC | F% | AUROC | F% | Mean | |||||
| Virchow2 | ||||||||||||||||
| gated ABMIL (baseline code) | 0.979 ±.018 | 100 | 1.0 | 0.770 ±.048 | 100 | 1.0 | 0.905 ±.013 | 100 | 1.0 | 0.990 ±.006 | 100 | 1.0 | 0.975 ±.023 | 100 | 1.0 | 0.9238 |
| ZoomMIL [ 25 ] | 0.970 ±.030 | 8.0 | 10.9 | 0.762 ±.052 | 7.3 | 11.0 | 0.904 ±.028 | 7.8 | 11.8 | 0.975 ±.007 | 7.7 | 13.0 | 0.923 ±.037 | 7.7 | 12.5 | 0.9068 |
| ZoomMIL, 3 levels | 0.975 ±.016 | 3.6 | 20.8 | 0.745 ±.052 | 2.8 | 24.3 | 0.888 ±.015 | 3.4 | 27.2 | 0.890 ±.044 | 3.5 | 28.0 | 0.884 ±.052 | 3.4 | 27.2 | 0.8765 |
| PathCTM [ 9 ] | 0.970 ±.031 | 7.8 | 10.2 | 0.745 ±.055 | 7.4 | 10.3 | 0.887 ±.018 | 7.6 | 11.6 | 0.975 ±.013 | 7.6 | 12.5 | 0.927 ±.046 | 7.6 | 12.5 | 0.9009 |
| performance-first rule | ||||||||
| Frozen gated ABMIL | cost | minus full bag | minus random | cost | minus full bag | minus random | cost | minus full bag |
| Held-out tasks | ||||||||
| PANDA cancer | 37% | 37% | 46% | |||||
| PANDA ISUP | 37% | 37% | 37% | |||||
| KIRC grade | 4.1% | 6.4% | 60% | |||||
| Across centres and datasets | ||||||||
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | rule | rule keeps full bag | ||
|---|---|---|---|---|
| CAMELYON16 | 21.1 [17.6, 24.7] | 14.2 [12.7, 15.8] | 6.86 [5.82, 7.87] | 0% |
| CAMELYON17 | 21.8 [18.1, 25.5] | 13.9 [12.3, 15.7] | 1.23 [1.18, 1.27] | 60% |
| BRCA | 21.2 [17.1, 25.0] | 14.3 [12.3, 16.0] | 4.39 [3.60, 5.09] | 0% |
| LUNG | 13.3 [10.1, 16.8] | 10.0 [8.2, 11.9] | 4.81 [3.91, 5.64] | 4% |
| RCC staging | 13.3 [10.0, 16.4] | 10.2 [8.5, 11.7] | 1.14 [1.09, 1.17] | 72% |
| BRACS | 17.8 [14.3, 21.5] | 12.5 [11.0, 14.1] | 1.33 [1.22, 1.43] | 40% |
| Task | full bag, summed (s) | ours , summed (s) | ours , median (s) |
|---|---|---|---|
| CAMELYON16 | 1234 | 58.5 | 3.05 |
| CAMELYON17 | 1327 | 60.9 | 3.03 |
| BRCA | 1424 | 67.3 | 3.56 |
| LUNG | 935 | 70.2 | 3.52 |
| RCC staging | 876 | 66.1 | 3.52 |
| BRACS | 1248 | 70.1 | 3.58 |
| Task | thumbnail (s) | (s, ms per tile) | (s, ms per tile) | total (s) | random tiles (s, ms per tile) | / random |
|---|---|---|---|---|---|---|
| CAMELYON16 | 0.17 | 2.06, 4.4 | 0.67, 4.4 | 2.90 | 2.77, 4.4 | 1.05 |
| CAMELYON17 | 0.15 | 2.22, 4.5 | 0.72, 4.6 | 3.09 | 2.95, 4.5 | 1.05 |
| BRCA | 0.38 | 2.30, 4.9 | 0.75, 4.7 | 3.43 | 2.87, 4.5 | 1.20 |
| LUNG | 0.59 | 2.14, 5.4 | 0.77, 4.9 | 3.50 | 2.56, 4.6 | 1.37 |
| RCC staging | 0.41 | 2.10, 5.3 | 0.77, 4.9 | 3.29 | 2.56, 4.6 | 1.29 |
| BRACS | 0.38 | 2.40, 5.0 | 0.75, 4.7 | 3.53 | 2.94, 4.5 | 1.20 |
| Task | training slides | regions per slide | preparation (GPU-min) | full bag (s) | (s) | break-even (slides) |
|---|---|---|---|---|---|---|
| CAMELYON16 | 214 | 980 | 16 | 61.0 | 2.72 | 16 |
| CAMELYON17 | 400 | 963 | 29 | 66.5 | 2.95 | 28 |
| BRCA | 732 | 1000 | 63 | 71.5 | 3.35 | 56 |
| LUNG | 841 | 832 | 70 | 46.5 | 3.46 | 98 |
| RCC staging | 742 | 965 | 67 | 43.9 | 3.18 | 99 |
| BRACS | 394 | 854 | 30 | 62.4 | 3.51 | 30 |
| Task | opening (s) | segmentation (s) | grid (s) | grid (s) | ours vs full bag, with tiling | vs ZoomMIL, with tiling |
|---|---|---|---|---|---|---|
| CAMELYON16 | 0.02 | 0.80 | 0.23 | 0.02 | 17.1 | 1.50 |
| CAMELYON17 | 0.01 | 0.87 | 0.24 | 0.02 | 15.9 | 1.45 |
| BRCA | 0.01 | 0.60 | 0.38 | 0.03 | 15.9 | 1.55 |
| LUNG | 0.01 | 0.56 | 0.22 | 0.02 | 10.9 | 1.18 |
| RCC staging | 0.01 | 0.52 | 0.16 | 0.02 | 10.0 | 1.15 |
| BRACS | 0.01 | 0.57 | 0.36 | 0.03 | 13.5 | 1.38 |
| CAMELYON16 | CAMELYON17 | BRCA | LUNG | RCC staging | BRACS | |
| runs | 25 | 25 | 25 | 25 | 25 | 5 |
| 128 | 330 | 128 | 4 | 64 | 1 | |
| AUROC | 0.964 | 0.961 | 0.972 | 0.965 | 0.758 | 0.887 |
| cost (%) | 1.11 | 2.37 | 1.06 | 0.26 | 0.66 | 0.23 |
| LUNG | BRACS | RCC staging | CAMELYON17 | |
|---|---|---|---|---|
| 1 | 0.955 (0.2) | 0.887 (0.2) | 0.683 (0.2) | 0.892 (0.2) |
| 2 | 0.954 (0.2) | 0.897 (0.2) | 0.709 (0.2) | 0.910 (0.2) |
| 4 | 0.965 (0.3) | 0.895 (0.3) | 0.725 (0.3) | 0.898 (0.3) |
| 8 | 0.963 (0.3) | 0.895 (0.3) | 0.757 (0.3) | 0.906 (0.3) |
| 16 | 0.966 (0.4) | 0.905 (0.3) | 0.747 (0.3) | 0.933 (0.3) |
| 32 | 0.968 (0.5) | 0.884 (0.4) | 0.736 (0.4) | 0.932 (0.4) |
| full bag | random tiles | ||
|---|---|---|---|
| AUROC | 0.983 | 0.990 | 0.932 |
| minus | |||
| specificity, carried threshold | 0.894 | 0.886 | |
| sensitivity, carried threshold | 0.971 | 0.992 | |
| sensitivity, threshold re-set on SLN negatives | 0.963 | 0.984 | |
| metastatic slides missed at and found by the full bag, per run | 0.88 (carried), 1.12 (re-set) |
| Task | Frozen model | runs | full | lower bound | random |
|---|---|---|---|---|---|
| PANDA cancer | gated ABMIL | 5 | |||
| DSMIL | 5 | ||||
| TransMIL ∗ | 5 | ||||
| PANDA ISUP | gated ABMIL | 5 | |||
| DSMIL | 5 | ||||
| TransMIL ∗ | 5 |
| Method | Budget setting | Value used | Released code | Commit |
|---|---|---|---|---|
| ZoomMIL | regions zoomed per level | 12 at , 16 tiles each, at most 192 tiles at . Three levels use at both steps | da7bb7f | |
| PathCTM | tokens passed to the next scale | 10, with 20 steps per scale and two scales | 494d66d | |
| IPS | memory and patches per step | 4c17c1d | ||
| HDMIL | target rate in its loss (keep ratio) | 0.6 on CAMELYON16, CAMELYON17 and RCC staging, 0.7 on BRCA, LUNG and BRACS | 0.6 on CAMELYON16 and RCC, 0.7 on BRCA and NSCLC | ef3d468 |
| HAG-MIL | regions zoomed in training and test | and at | and at | 9fec1ca |
| GFR-MIL | share of regions kept per step | 0.2 then 0.1, two steps | the same | 25c9b1e |
Whole-Slide Image Analysis
Whole-slide image analysis uses AI to interpret gigapixel pathology slides for diagnosis, prognosis, tissue mapping, and report generation.
See all 253 papers