1 MIN READ
journal · 2025 · Published · open access (CC BY 4.0)Attention-Guided Erasing
Can a model decide what not to erase?
IN ONE SENTENCE
Summary
Use a self-supervised model's own attention to choose which pixels an augmentation is allowed to destroy — then check the four tasks where that helps and the one where it does not.01 / THE QUESTION
Random erasing does not know what a lesion is.
Random erasing cuts out an arbitrary rectangle to regularize training. On a mammogram it can just as easily remove the dense tissue or the calcification cluster the classifier is supposed to learn from.
So: could a model that has never seen a label still say which pixels are worth keeping?
02 / THE IDEA
Let self-supervised attention be the erasing policy.
A ViT-S/16 is pretrained with DINO on the target cohort. Its six final-layer attention maps are thresholded into binary masks; everything outside the mask is erased with a chosen probability during fine-tuning.
Which head to trust is task-dependent, so each of the six is tried and the one with the best validation F1 is used — never the test set.
- 01Mammogram
- 02DINO pretraining
- 03Attention heads
- 04Binary mask
- 05Guided erasing
- 06Fine-tuned classifier
03 / WHAT WE TESTED
Five tasks, three cohorts, whole images and small crops.
Two whole-image tasks (BI-RADS breast density in digital mammography, malignancy in contrast-enhanced mammography) and three ROI-level tasks (calcification, CEM lesions, masses). Every setting was run five times against a no-erasing and a random-erasing baseline.
04 / MAIN RESULT
It works where attention can isolate the evidence.
AGE gave the best mean macro F1 in all five tasks, significantly so in four. On CEM whole images it also cut run-to-run variance about fourfold — the augmentation is acting as a regularizer, not just a lucky seed.
The mass task is the honest counter-example: the lesion already occupies most of the crop, so there is almost no disposable background to erase and the gain vanishes into the noise.
| Task (test size) | NE | RE | AGE | p |
|---|---|---|---|---|
| Breast density, VinDr-Mammo (4,000) | 0.5594 | 0.5691 | 0.5910 | < 0.0001 |
| Malignancy, CDD-CESM image (116) | 0.6076 | 0.6406 | 0.6579 | < 0.0001 |
| Calcification ROI, CBIS-DDSM (326) | 0.6803 | 0.6846 | 0.6892 | < 0.0001 |
| Lesion ROI, CDD-CESM (116) | 0.7617 | 0.7859 | 0.7920 | 0.0227 |
| Mass ROI, CBIS-DDSM (378) | 0.5530 | 0.5471 | 0.5537 | n.s. |
Standard deviations, per-class scores and the full ablation over erasing probabilities are in the open-access paper. Two-tailed unpaired t-test; n.s. = not significant.
05 / WHY IT MATTERS
The dataset can supply its own augmentation policy.
No radiologist masks, no extra annotation budget — the augmentation is derived from unlabelled images of the same cohort, which is the setting most medical imaging projects are actually in.
And because the method is reported as conditional rather than universal, it is usable: you can predict in advance whether it will help a given task.
LIMITATION
What this does not show
The attention maps are weak, dataset-derived localizations used to shape augmentation. They are not lesion segmentations, and they should not be read as an explanation of a diagnosis. All results are retrospective.
READ IT YOURSELF
Paper · DOI · Code · Citation
View original abstract + citation
Abstract
Purpose: We evaluate the effectiveness and generalizability of attention-guided erasing (AGE), a data augmentation technique initially proposed for breast density classification, across various tasks in breast abnormality classification and different mammographic imaging modalities. Methods: A Vision Transformer is pretrained with DINO on the target dataset; self-attention maps of the final-layer attention heads are converted into binary masks that preserve regions of interest while background regions are erased with a random probability during downstream transfer learning. The attention head is treated as a hyperparameter and selected by validation F1-score. Results: AGE achieved the best mean macro F1-score in all five evaluated tasks, with statistically significant improvements in four of them. Conclusion: Self-supervised attention can provide a task-aware augmentation policy without pixel-level annotations, but the benefit depends on whether the relevant structure is localized within the input.
Citation
A. Bhandary Panambur, S. Bhat, H. Yu, P. Madhu, S. Bayer, A. Maier. Attention-guided erasing for enhanced transfer learning in breast abnormality classification. International Journal of Computer Assisted Radiology and Surgery, 20(3):433–440, 2025. doi:10.1007/s11548-024-03317-6