Organizations: College of Computer Science and Electronic Engineering, Hunan University, Changsha, Hunan, China · Department of Bioengineering and Imperial-X, Imperial College London, London, UK
Whole-slide multiple-instance learning (MIL) observes only the patches admitted by its selector. Deployment can alter this selector through compute limits, tissue masking, or regional workflows, even when the patch count is unchanged. We introduce BagShift, a paired protocol that changes the selector for the same case while holding its features and predictor fixed, thereby isolating selector response from case mix. With equal 128-patch budgets, sampling across the tissue or concentrating around one coordinate exposes markedly different evidence: on PANDA, the two views reduce quadratic weighted kappa by 1.57 and 17.96 points, respectively (QWK reported on the ×100 scale). On CAMELYON16, lesion annotations withheld from model development show that localized views retain tumor in only 10.0% of micrometastatic observations, and matched exposure does not consistently recover the loss. The same fixed-count stressor produces a much smaller response on external lung subtyping, although differences in relative coverage make cross-task severity descriptive. When repeated localized observations are available, unioning their patches before one nonlinear MIL pass improves PANDA QWK by 7.87 points over averaging regional predictions. Patch count specifies computation, not observed evidence; deployment evaluations should report both what a selector preserves and how repeated observations are aggregated.
Figures & tables
Figure 1: Equal patch budgets can retain different focal evidence. (a) The same CAMELYON16 micrometastatic slide under reference, dispersed-128, and localized-128 selection; magenta marks annotated tumor and colored overlays mark retained patches. Both restricted bags contain 128 patches but retain one versus zero tumor-overlap patches. (b) Metastasis probability across five model seeds. (c) Tumor-retention frequency across 27 micrometastatic slides and ten selector draws. The deterministic case-selection rule is given in the supplement.
Figure 2: BagShift measures selector response by paired intervention. (a) Exact PANDA coordinates for the reference pool and equally sized dispersed and localized bags; the footprints depict sampling geometry rather than histology. (b) The intervention changes only the selector while holding the slide, label, features, and predictor fixed. (c) Five-seed mean Δ QWK for reference-only and validation-selected matched exposure ( α=1 ); exposure reduces both responses but leaves a large geometry gap.
Absolute QWK ↑
Degradation (Ref. − policy) ↓
Control family
Training control
Ref.
Budget-128
Spatial-128
Δ Budget
Δ Spatial
Baseline
Reference only
94.13 ± 0.34
92.56 ± 0.81
76.17 ± 2.29
1.57 ± 0.78
17.96 ± 2.38
Deletion
Random deletion only
94.26 ± 0.27
93.17 ± 0.92
77.23 ± 1.47
1.09 ± 1.03
17.03 ± 1.57
Exposure
Spatial-policy only
93.96 ± 0.36
92.88 ± 0.96
79.30 ± 1.04
1.08 ± 0.73
14.66 ± 1.21
Exposure/weight
Matched average, α=0.5
94.27 ± 0.24
93.33 ± 0.68
77.82 ± 1.52
0.93 ± 0.75
16.45 ± 1.75
Exposure/weight
Matched average, α=1 †
94.29 ± 0.16
93.48 ± 0.91
78.98 ± 1.44
0.81 ± 0.79
15.30 ± 1.54
Table 1: PANDA test QWK on the ×100 scale (mean ± SD across five seeds). The controls separate deletion, exposure, weight on restricted views, consistency, and reduction within each case. Higher absolute QWK and lower degradation are better; † marks the operating point selected on validation data.
AUROC
Balanced accuracy
Training
Ref.
Budget
Spatial
Sp. − Bu.
Ref.
Budget
Spatial
Sp. − Bu.
Reference only
99.19 ± 0.85
88.22 ± 1.19
68.50 ± 1.92
− 19.72 ± 0.89
90.00 ± 5.12
80.21 ± 0.62
61.63 ± 0.11
− 18.58 ± 0.60
Matched average
99.16 ± 0.55
88.08 ± 1.10
67.38 ± 2.02
− 20.70 ± 1.61
92.24 ± 5.52
80.47 ± 1.01
61.71 ± 0.20
− 18.76 ± 0.85
Table 2: CAMELYON16 response on the official test set (%, mean ± SD across five seeds after averaging metrics for each draw within each seed). Budget and spatial views both contain 128 patches. Localized selection loses substantially more performance, and matched exposure does not recover it.
Training control
Ref.
Spatial
Δ
Average, α=0.5
96.74 ± 0.61
96.18 ± 0.64
0.56 ± 0.24
Average, α=1
96.71 ± 0.44
96.08 ± 0.51
0.63 ± 0.39
Worst policy
97.04 ± 0.25
96.50 ± 0.29
0.54 ± 0.19
Table 3: CPTAC AUROC after patient aggregation (%, mean ± SD across five seeds) after TCGA training. Δ is reference minus spatial AUROC.
Figure 3: Aggregation order changes the response to the same acquired views. (a) Prediction averaging uses K independent MIL passes; union-before-MIL deduplicates patches and uses one shared pass. (b) PANDA Δ QWK versus K (mean ± SD across three seeds); the upper axis gives union coverage. At K=5 , union-before-MIL gains 7.87 QWK points (paired 95% CI 6.07–9.82).
Figure S1: Detailed selector diagnostics. (a) Three-seed mean expected-grade shifts for budget and spatial selectors on PANDA. (b) CPTAC spatial-window true-class margin shifts with conditional patient-bootstrap intervals. Negative values denote movement away from the true class.
Figure S2: Two deterministically selected PANDA cases on level-1 H&E. The reference column overlays the retrospective Radboud grade mask; the middle columns show the exact 128-patch views. The tall first slide is folded into upper and lower halves without rescaling. All panels preserve tissue aspect ratio; white padding only standardizes the display cells. Masks were unavailable to model and selector development; predictions use the unchanged validation-selected Attention control. In the affected case, reference and Budget-128 distributions nearly coincide while Spatial-128 shifts to grade 3; in the stable case, all three distributions nearly coincide by the frozen case-selection rule.
Model
Reference
Spatial 128
Δ
CLAM-SB
96.40 ± 1.36
95.51 ± 1.93
0.90 ± 0.58
CLAM-SB + views
97.13 ± 0.07
96.56 ± 0.36
0.56 ± 0.29
DSMIL
96.48 ± 0.23
95.40 ± 0.08
1.08 ± 0.16
DSMIL + views
96.26 ± 0.44
95.36 ± 0.48
0.91 ± 0.28
TransMIL
96.85 ± 0.49
96.11 ± 0.50
0.73 ± 0.21
TransMIL + views
95.18 ± 0.27
94.18 ± 0.45
1.00 ± 0.18
Table S1: CPTAC patient AUROC after TCGA training (%).
Model
Objective
Reference
Spatial
Δ
CLAM-SB
Average
93.44 ± 0.60
77.52 ± 1.84
15.92 ± 1.63
CLAM-SB
Worst
93.80 ± 0.53
78.72 ± 1.40
15.08 ± 1.40
DSMIL
Average
94.44 ± 0.61
77.36 ± 2.04
17.08 ± 1.96
DSMIL
Worst
94.03 ± 0.52
77.97 ± 0.96
16.05 ± 1.05
TransMIL
Average
94.73 ± 0.27
79.15 ± 1.64
15.58 ± 1.44
TransMIL
Worst
94.54 ± 0.58
79.23 ± 1.57
15.31 ± 1.49
Table S2: Five-seed PANDA QWK on the ×100 scale for matched-average α=0.5 and worst-policy objectives using identical views.
Control
Ref. AUC/BAcc
Spatial AUC/BAcc
Δ
Average, α=0.5
96.74 ± 0.61/90.49 ± 1.52
96.18 ± 0.64/90.13 ± 1.61
0.56 ± 0.24
Average, α=1
96.71 ± 0.44/89.67 ± 1.34
96.08 ± 0.51/89.40 ± 1.51
0.63 ± 0.39
Worst policy
97.04 ± 0.25/90.57 ± 1.28
96.50 ± 0.29/89.66 ± 1.52
0.54 ± 0.19
Table S3: Untouched CPTAC patient results after TCGA training (%, five-seed mean ± SD). Cells report AUROC/BAcc; Δ is reference minus spatial AUROC.
Variant
PANDA
CPTAC ref.
CPTAC spatial
Attention
74.88
96.73 / 89.73
95.72 / 88.53
+ policy views
77.20
96.82 / 90.08
96.00 / 89.31
+ CVaR
79.73
96.83 / 90.13
96.13 / 89.37
+ EMA loss
79.68
97.10 / 90.96
96.43 / 90.25
Table S4: Earlier Attention component means on ×100 scales. PANDA reports spatial QWK; CPTAC reports patient AUROC / balanced accuracy.
Figure S3: Fixed-weight sensitivity. (a) One global α is selected by mean QWK over five validation policies, five model seeds, and ten selector draws. (b) Spatial-128 test response; the dashed line marks worst-policy performance. (c) Absolute reference QWK across the same weights. Error bars are SD across seeds; the shaded band and dotted line mark the selected α .
Control
Val. mean
Reference
Spatial
Δ
Average, α=0.25
91.09 ± 0.24
94.27 ± 0.29
77.44 ± 1.76
16.83 ± 1.99
Average, α=0.50
91.23 ± 0.20
94.27 ± 0.24
77.82 ± 1.52
16.45 ± 1.75
Average, α=1.00
91.36 ± 0.12
94.29 ± 0.16
78.98 ± 1.44
15.30 ± 1.54
Average, α=1.50
91.32 ± 0.18
94.22 ± 0.35
79.26 ± 1.37
14.96 ± 1.69
Average, α=2.00
91.33 ± 0.19
94.21 ± 0.31
79.51 ± 1.20
14.70 ± 1.42
Worst policy
–
94.39 ± 0.37
79.65 ± 1.15
14.74 ± 1.37
Table S5: Complete fixed-weight QWK curve on the ×100 scale (five-seed mean ± SD). Validation is the mean QWK over five policies; remaining columns are PANDA test results.
Control
Ref.
Sp. Δ
Draw SD
Max Δ
Stripe Δ
Spatial-policy only
93.96
14.01
1.41
16.13
11.88
Validation-selected α=1
94.29
14.88
1.36
17.01
12.58
Sensitivity endpoint α=2
94.21
14.22
1.44
16.36
12.05
Policy-wise worst
94.39
14.03
1.33
16.12
11.95
Table S6: PANDA selector variability over five model seeds and ten draws per seed. Ref. is reference QWK; remaining policy values are QWK degradation points, and SD is across selector draws.
K
Coverage
Localized prediction average
Localized patch union
Dispersed prediction average
Coverage-matched random
1
32.8%
13.47±1.38
13.47±1.38
1.31±0.94
1.43±0.31
2
51.4%
12.72±1.46
5.50±0.98
0.22±0.23
1.02±0.44
5
79.9%
9.16±0.73
1.29±0.56
0.04±0.51
0.42±0.51
10
94.4%
9.43±0.25
0.18±0.16
−0.18±0.15
0.12±0.27
20
99.3%
8.68±0.95
0.08±0.12
−0.08±0.10
0.01±0.03
Table S7: PANDA QWK degradation in points (three-seed mean ± SD) as the number of localized observations increases. Lower is better; negative values indicate a small improvement over the reference view. At K=5 , localized union improves over localized prediction averaging by 7.87 points (paired 95% CI 6.07–9.82).
Task
Strategy
Skill loss
Directional shift
PANDA
Spatial average
16.45%
−0.0408
PANDA
Spatial union
0.08%
+0.0000
CPTAC
Spatial average
0.99%
−0.0097
CPTAC
Spatial union
0.00%
−0.0000
Table S8: Twenty-draw mechanism check. Skill loss and directional shift compare the restricted strategy with its reference prediction.
Training
Policy
AUROC
AUPRC
Balanced accuracy
Reference only
Full
0.9919±0.0085
0.9898±0.0092
0.9000±0.0512
Random keep 75%
0.9902±0.0095
0.9884±0.0099
0.8980±0.0404
Random keep 50%
0.9844±0.0084
0.9832±0.0081
0.8943±0.0352
Random budget 128
0.8822±0.0119
0.8828±0.0079
0.8021±0.0062
Spatial window 128
0.6850±0.0192
0.6647±0.0150
0.6163±0.0011
Matched average
Full
0.9916±0.0055
0.9894±0.0068
0.9224±0.0552
Table S9: CAMELYON16 official-test policy response. Metrics are proportions; budget and spatial views contain 128 patches.
Training
View
Stage
Sensitivity
AUROC vs. normal
Mean positive probability
Reference only
Full
Macro
1.000±0.000
1.000±0.000
0.729
Full
Micro
0.637±0.168
0.985±0.014
0.568
Budget 128
Macro
0.982±0.030
0.994±0.011
0.719
Budget 128
Micro
0.299±0.063
0.791±0.034
0.406
Spatial 128
Macro
0.435±0.062
0.747±0.062
0.471
Spatial 128
Micro
0.073±0.058
0.634±0.054
0.308
Table S10: CAMELYON16 stage response (mean ± SD across 50 nested seed/draw cells). The full view is deterministic within a model seed.
K
Median retained
Component AUROC
Matched-random AUROC
Difference
Micro tumor retained component / random
1
44.9%
92.02±1.46
97.64±0.84
−5.62±1.12
74.1% / 99.6%
2
79.8%
99.17±0.61
98.82±0.82
+0.35±0.31
88.9% / 99.6%
3
89.3%
99.14±0.68
99.04±0.95
+0.10±0.34
96.3% / 100.0%
5
96.2%
99.28±0.62
99.11±0.93
+0.17±0.32
100.0% / 100.0%
10
98.4%
99.22±0.78
99.18±0.86
+0.03±0.08
100.0% / 100.0%
Table S11: Exploratory CAMELYON16 tissue-component cleanup. AUROC is in percentage points (five-seed mean ± SD); random metrics first average ten draws within each seed. Difference is component minus exact-cardinality random. At K=1 , all five seed differences are negative. A label-stratified paired bootstrap on seed/draw-averaged slide predictions gives −7.55 AUROC points (95% CI −14.18 to −2.17 ).
K
Mean patches
Coverage
Prediction average
Union before MIL
Cardinality-matched random
1
128
3.45%
0.6202±0.0319 / 0.5857±0.0056
0.6202±0.0319 / 0.5857±0.0056
0.8831±0.0114 / 0.8060±0.0089
2
250
6.60%
0.6971±0.0396 / 0.6122±0.0414
0.7161±0.0301 / 0.6579±0.0051
0.8865±0.0070 / 0.8134±0.0211
5
601
15.62%
0.8139±0.0162 / 0.5857±0.0056
0.8282±0.0143 / 0.7735±0.0133
0.9133±0.0129 / 0.8531±0.0256
10
1,105
27.45%
0.8327±0.0180 / 0.5980±0.0091
0.8443±0.0105 / 0.8000±0.0056
0.9660±0.0075 / 0.8988±0.0244
20
1,900
44.41%
0.8968±0.0139 / 0.6041±0.0046
0.9116±0.0148 / 0.8571±0.0250
0.9701±0.0085 / 0.9041±0.0406
Table S12: CAMELYON16 repeated-window response under five matched-model seeds. Entries are AUROC / balanced accuracy; coverage is the fraction of each reference bag represented by the exact union.
Task ( K=5 )
Aggregation
Spearman ↑
Macro AUROC ↑
Log loss ↓
RPS ↓
Sensitivity ↑
PANDA
Prediction average
0.9019±0.0008
93.62±0.24
0.810±0.003
0.0617±0.0002
–
PANDA
Union before MIL
0.9331±0.0025
95.45±0.26
0.635±0.016
0.0432±0.0014
–
CAMELYON16
Prediction average
–
81.39±1.62
0.581±0.005
–
17.1±1.1
CAMELYON16
Union before MIL
–
82.82±1.43
0.482±0.020
–
54.7±2.7
Table S13: Probability-level aggregation diagnostics (model-seed mean ± SD). PANDA macro AUROC is one-versus-rest and RPS is the normalized ranked probability score. CAMELYON16 specificity is 100% for both aggregation orders at the fixed 0.5 threshold.
True-class probability
Balanced accuracy
Hospital
All cases
Paired cases
Evidence+
Random
Evidence −
Evidence+
Random
Evidence −
H1
1,981
202
46.92 ± 1.49
38.28 ± 1.10
30.94 ± 0.70
59.09 ± 1.18
48.77 ± 1.73
40.63 ± 2.52
H2
3,981
242
53.53 ± 0.99
42.07 ± 0.51
30.81 ± 0.55
71.95 ± 2.29
57.65 ± 1.36
41.90 ± 2.02
Table S14: Two-hospital human-evidence selection (%, five-seed mean ± SD; ten selector draws). Positive and negative views each contain one image from the same held-out case.
Hospital
Cases
Median
Mean
Max.
H1
5,000
2
2.088
27
H2
5,000
2
2.010
6
H3
5,000
2
2.258
29
Table S15: Frozen private cohort.
Hospital
Policy
I2T R@1
Drop
Matched cosine
Drop
H1
Full
12.76 ± 0.89
–
50.22 ± 1.10
–
Random single
11.07 ± 1.09
1.69
47.66 ± 1.13
2.56
Keep 50%
11.24 ± 1.04
1.52
47.93 ± 1.12
2.29
Top-attention drop 50%
10.76 ± 1.37
2.00
47.22 ± 1.15
3.00
H2
Full
10.69 ± 1.38
–
54.98 ± 1.08
–
Random single
7.83 ± 1.54
2.86
49.73 ± 1.08
5.25
Table S16: Attention MIL image-removal response (%). Drops are relative to the full multi-image case; larger positive drops indicate greater sensitivity.
Hospital
Policy
Attention
Earlier retrieval objective
Difference
Favorable seeds
H1
Full
12.76 ± 0.89
12.09 ± 1.08
−0.67
0/3
Random single
11.07 ± 1.09
10.82 ± 0.91
−0.25
2/3
Keep 50%
11.24 ± 1.04
10.92 ± 0.86
−0.32
2/3
Top-attention drop 50%
10.76 ± 1.37
10.36 ± 0.28
−0.40
2/3
H2
Full
10.69 ± 1.38
11.97 ± 0.41
+1.28
3/3
Random single
7.83 ± 1.54
8.25 ± 0.43
+0.41
2/3
Table S17: Equivalence-aware image-to-text Recall@1 (%). Positive differences favor the earlier retrieval objective, which is distinct from the BagShift measurement framework studied in the main paper.