ASMIL: Attention-Stabilized Multiple Instance Learning for Whole Slide Imaging
Organizations: University of Toronto · Stanford University · Hokkaido University
Abstract
Attention-based multiple instance learning (MIL) has emerged as a powerful framework for whole slide image (WSI) diagnosis, leveraging attention to aggregate instance-level features into bag-level predictions. Despite this success, we find that such methods exhibit a new failure mode: unstable attention dynamics. Across four representative attention-based MIL methods and two public WSI datasets, we observe that attention distributions oscillate across epochs rather than converging to a consistent pattern, degrading performance. This instability adds to two previously reported challenges: overfitting and over-concentrated attention distribution. To simultaneously overcome these three limitations, we introduce attention-stabilized multiple instance learning (ASMIL), a novel unified framework. ASMIL uses an anchor model to stabilize attention, replaces softmax with a normalized sigmoid function in the anchor to prevent over-concentration, and applies token random dropping to mitigate overfitting. Extensive experiments demonstrate that ASMIL achieves up to a 6.49% F1 score improvement over state-of-the-art methods. Moreover, integrating the anchor model and normalized sigmoid into existing attention-based MIL methods consistently boosts their performance, with F1 score gains up to 10.73%. All code and data are publicly available at https://github.com/Linfeng-Ye/ASMIL.
Figures & tables
| Dataset | CAMELYON-16 | CAMELYON-17 | BRACS | ||||
|---|---|---|---|---|---|---|---|
| Backbone | Method | F1 score | AUC | F1 score | AUC | F1 score | AUC |
| ResNet-18 ImageNet Pretrained | ABMIL ICML 2018 | ||||||
| Clam-SB Nature 2021 | |||||||
| TransMIL NeurIPS 2021 | |||||||
| DSMIL CVPR 2021b | |||||||
| DTFD-MIL CVPR 2022 | |||||||
| Dataset | CAMELYON-16 | CAMELYON-17 | BRACS | |||||
|---|---|---|---|---|---|---|---|---|
| Method | Anchor | NSF | F1 score | AUC | F1 score | AUC | F1 score | AUC |
| ABMIL ICML 2018 | ✗ | ✗ | ||||||
| ✓ | ✗ | |||||||
| ✓ | ✓ | |||||||
| Anchor | NSF | rd | F1 score | AUC |
|---|---|---|---|---|
| ✓ | ✓ | ✓ | ||
| ✓ | ✓ | ✗ | ||
| ✓ | ✗ | ✓ | ||
| ✓ | ✗ | ✗ | ||
| ✗ | ✗ | ✓ | ||
| ✗ | ✗ | ✗ |
Appendix figures & tables38 assets
Supplementary material from the paper’s appendix.
Appendix
| BRACS | |||||||
|---|---|---|---|---|---|---|---|
| Normalized Sigmoid | Softmax T=2 | Softmax T=4 | Softmax T=8 | ||||
| F1 score | AUC | F1 score | AUC | F1 score | AUC | F1 score | AUC |
| CAMELYON-16 | ||||||
| Metric | NSF | (sparsemax) | (entmax-15) | (softmax) | ||
| F1 score | ||||||
| AUC | ||||||
| Time per epoch | 6.340s | 8.451s | 8.452s | 8.451s | 8.450s | 6.336s |
| Dataset | CAMELYON-16 | |
|---|---|---|
| Online NSF | F1 score | AUC |
| ✓ | ||
| ✗ | ||
| Dataset | BRACS | |
| Online NSF | F1 score | AUC |
| ✓ | ||
| Dataset | CAMELYON-16 | CAMELYON-17 | BRACS | |||
|---|---|---|---|---|---|---|
| Mertic | F1 score | AUC | F1 score | AUC | F1 score | AUC |
| ASMIL W. SoftMax | ||||||
| ASMIL W. Mixture | ||||||
| in Equation 34 | 0.9952 | 0.9894 | 0.9963 | |||
| Dataset | CAMELYON-16 | CAMELYON-17 | BRACS |
|---|---|---|---|
| The ratio of affine dependent feature bags | 99.24% | 99.80% | 96.08% |
| PathGen-Clip-VIT-L | ||||
|---|---|---|---|---|
| Dataset | CAMELYON-16 | CAMELYON-17 | ||
| Method | F1 score | AUC | F1 score | AUC |
| Clam-SB | ||||
| TransMIL | ||||
| DSMIL | ||||
| IBMIL | ||||
| CAMELYON-16 | ||||
|---|---|---|---|---|
| # FEAT tokens | 2 | 4 | 8 | 16 |
| F1 score | ||||
| AUC | ||||
| CAMELYON-17 | ||||
| F1 score | ||||
| AUC | ||||
| Dataset | BRACS | |
|---|---|---|
| Update | F1 score | AUC |
| Epoch | ||
| Batch | ||
| Dataset | CAMELYON-16 | |
| Update | F1 score | AUC |
| Epoch | ||
| Dataset | Model | AUC | F1 | ||
|---|---|---|---|---|---|
| CAMELYON-16 | w/o anchor | 0.942 | 0.979 | 0.013 | 0.024 |
| w/ anchor | 0.967 | 0.983 | |||
| CAMELYON-17 | w/o anchor | 0.642 | 0.879 | 0.024 | 0.035 |
| w/ anchor | 0.693 | 0.899 | |||
| BRACS | w/o anchor | 0.729 | 0.866 | 0.012 | 0.009 |
| w/ anchor | 0.784 | 0.916 |
| Method | Dice | Specificity | FROC |
|---|---|---|---|
| CLAM-SB | |||
| TransMIL | |||
| DTFD-MIL | |||
| DSMIL | |||
| CAMIL | |||
| ASMIL |
| BRACS | Training | ||||
|---|---|---|---|---|---|
| Method | CLAM-SB | ABMIL | TransMIL | MHIM-MIL | ASMIL |
| Time | 2.26s | 0.95s | 5.99s | 19.4s | 7.49s |
| Memory | 94MB | 90MB | 340MB | 2178MB | 570MB |
| BRACS | Inference | ||||
| FLOPs | 162M | 164M | 781M | 345M | 542M |
| Time | 0.45s | 0.37s | 0.74s | 0.40s | 0.52s |
| BRACS | Training | Inference | |||
|---|---|---|---|---|---|
| Method | Time | Memory | FLOPs | Time | Memory |
| CLAM-SB w/o anchor | 2.26s | 94MB | 162M | 0.45s | 69MB |
| CLAM-SB W. anchor | 2.69s | 120MB | 162M | 0.45s | 69MB |
| TransMIL w/o anchor | 5.99s | 340MB | 781M | 0.74s | 246MB |
| TransMIL W. anchor | 7.27s | 443MB | 781M | 0.74s | 246MB |
| DSMIL w/o anchor | 0.57s | 60 MB | 103M | 1.09s | 113 MB |
| Method | BLCA | BRCA | GBMLGG | LUAD | UCEC |
|---|---|---|---|---|---|
| ABMIL ICML 2018 | |||||
| TransMIL NeurIPS 2021 | |||||
| ILRA ICLR 2023 | |||||
| CVPR 2024 | |||||
| DeepAttnMISL MIA 2020 | |||||
| Patch-GCN MICCAI 2021 |
| Dataset | Domain | Bags (pos/neg) | Total instances | Dim./inst. |
|---|---|---|---|---|
| MUSK1 | Drug activity | 92 (47/45) | 476 | 166 |
| MUSK2 | Drug activity | 102 (39/63) | 6598 | 166 |
| TIGER | Images (Blobworld segments) | 200 (100/100) | 1220 | 230 |
| FOX | Images (Blobworld segments) | 200 (100/100) | 1320 | 230 |
| ELEPHANT | Images (Blobworld segments) | 200 (100/100) | 1391 | 230 |
| Methods | MUSK1 | MUSK2 | FOX | TIGER | ELEPHANT |
|---|---|---|---|---|---|
| ABMIL ICML 2018 | |||||
| DSMIL CVPR 2021b | |||||
| TransMIL NeurIPS 2021 | |||||
| DEMIL NeurIPS 2023a | |||||
| RGMIL Neurips 2023 | |||||
| PSMIL ICLR 2025 |
| Method | Clam | TransMIL | DTFD-MIL | DSMIL | CAMIL | ASMIL |
| Rate | 46.93% | 3.246% | 50.34% | 48.22% | 49.78% | 54.63% |