SFDA-DeP Fixes AI Tumor Classifiers That Fail Across Hospitals
A new source-free domain adaptation method borrows tricks from machine unlearning to stop histopathology models from collapsing onto dominant classes.
ProTakeaways
- SFDA-DeP adapts WSOL histopathology models to new hospitals without needing the original training data.
- Borrows a machine unlearning trick to suppress prediction bias toward dominant classes during self-training.
- Selectively lowers confidence on high-entropy samples from over-predicted classes, preserves confident predictions.
- A jointly trained pixel-level head restores sharper CAM localization after domain shift.
- Beats prior SFDA baselines on GlaS, CAMELYON-16 and CAMELYON-17 for classification and PxAP.
- Code available at anonymous.4open.science/r/SFDA-DeP-1797.
Pathology AI has a portability problem. A tumor classifier trained on slides from one hospital tends to misbehave when it sees tissue from a different organ, a different scanner, or a different staining protocol. A new paper called SFDA-DeP tackles this head-on by borrowing an idea from machine unlearning: instead of blindly trusting the model's predictions on new data, it periodically forces the model to become less confident about the classes it is over-predicting.
Why self-training eats itself in histology
Weakly Supervised Object Localization (WSOL) is attractive for pathology because it lets models classify histology images by cancer grade and identify regions of interest using only cheap global image-class annotations, rather than pixel-level tumor masks drawn by pathologists. The catch is deployment. A WSOL model trained on one labeled source dataset has to be adapted to a new target domain when there are significant shifts caused by variations in staining, scanners, and cancer type.
Source-Free Domain Adaptation (SFDA) is the standard fix: adapt the pre-trained model using only unlabeled target images, without ever touching the original training data, which is often locked up for privacy reasons. The problem the authors identify is that SFDA in histology relies on self-training, so any initial prediction bias gets amplified over iterations. Under strong cross-domain shifts the model starts over-predicting a dominant class, and each round of self-training drifts decision boundaries further toward that class. The localization quality collapses along with the classifier.
The unlearning trick
SFDA-DeP treats adaptation as an iterative debiasing loop. Inspired by machine unlearning, the method reduces the contribution of uncertain samples from dominant classes, identified through normalized entropy. By increasing uncertainty for these samples, the WSOL model avoids reinforcing biased assignments during boundary refinement, while stable, confident samples are retained to support consistent class separation.
Concretely, at each adaptation cycle the algorithm does three things:
- Look at the target pseudo-label distribution and flag classes that are being over-predicted relative to their expected frequency.
- Within those over-predicted classes, find the high-entropy (uncertain) images and actively push the model to be less confident on them, an unlearning-style step.
- Leave the low-entropy, confident predictions alone so genuine signal is not destroyed.
To keep localization from degrading in parallel, a lightweight pixel-level head is jointly optimized against foreground and background priors derived from class activation maps, improving foreground and background separation after adaptation. Class activation maps (CAMs) are the heatmaps that WSOL models produce to explain which pixels drove a classification, and the auxiliary head effectively distills them into sharper masks.
Results across organs and centers
The team evaluated on three widely used histopathology benchmarks that span both cross-organ and cross-center shifts: GlaS (colon glands), CAMELYON-16, and CAMELYON-17 (breast cancer lymph node metastases from multiple hospitals). SFDA-DeP consistently improved both classification and localization over state-of-the-art SFDA baselines across several WSOL models.
Adding the pixel-level supervision head also boosted PxAP, the pixel-average-precision metric used for localization quality. Qualitatively, SFDA-DeP produced more coherent activations concentrated on tumor tissue with reduced responses on background regions, whereas the SFDA baselines often highlighted spurious areas under strong shift.

When it helps, and when it will not
This is a narrow but practical contribution. If you are shipping a WSOL classifier into a new hospital and cannot retrain from scratch, SFDA-DeP is a drop-in adaptation loop that is especially valuable when:
- The target dataset is class-imbalanced or has a strongly dominant class (very common in cancer screening where negatives outnumber positives).
- You care about the CAM heatmap, not just the label, because a pathologist will look at it.
- The source data is inaccessible for privacy or licensing reasons.
The limitations are worth flagging. The method assumes you have a reasonable prior on target class frequencies to detect over-prediction, and the entropy-based selection can misfire when the source model is already miscalibrated. It is also designed around CAM-style WSOL architectures, so teams using pure multiple-instance learning pipelines will need to adapt the pixel head. And like most SFDA work, gains shrink when the domain gap is small enough that vanilla fine-tuning would already work.
Availability
Code is released anonymously at anonymous.4open.science/r/SFDA-DeP-1797, following the arXiv preprint's double-blind convention. The repository covers the adaptation loop, the pixel-level head, and the evaluation harness for the three benchmarks, which should make it straightforward to plug into an existing WSOL codebase and rerun the cross-organ and cross-center experiments.