Why not just use invariant features?
Stable features and image detail offer different information. The challenge is teaching a predictor to use both without taking shortcuts. MaskGen combines a frozen feature extractor with channel masking during training. No test-time adaptation is needed.
See how masking works
During training, whole input channels are randomly masked. At inference, all channels are available.
Schematic subset of channels; this is not a live segmentation model. Masking removes channels, not spatial image patches.
Why combine both sources?
Representation-only training can discard useful image information. Concatenation alone can still encourage dependence on the image. The paper analyzes when view masking prevents the stable source from being ignored; its assumptions and conditions matter.
Explore the evidence
Choose a shift and training-data setting. Use the published examples alongside the measured scores.
Held-out test Dice (0–100, higher is better), mean ± standard error. Three selected methods, not the complete leaderboard. Paper Tables 1–2.
No qualitative example for this dataset / setting is included in the paper’s main comparison figures. Scores above are still available.
Does masking change performance?
Validation Dice from Table 6, not test scores. Buttons select independently trained configurations; they do not alter the predictions above.
Published results · selected methods
| Dataset / setting | ERM | GIN+IPA | MaskGen |
|---|---|---|---|
| AMOS / all-data | 57.4 ± 1.7 | 66.5 ± 0.8 | 67.5 ± 0.9 |
| AMOS / five-shot | 5.4 ± 1 | 37.8 ± 1.5 | 53.4 ± 1.4 |
| BraTS / all-data | 38.9 ± 1.8 | 44.7 ± 1.6 | 46.2 ± 1.6 |
| CoW / all-data | 24.6 ± 1.5 | 37.6 ± 1.9 | 47.8 ± 1.3 |
| CoW / five-shot | 18.2 ± 1.3 | 23.8 ± 1.7 | 40.3 ± 1.5 |
| HVSMR / all-data | 63.6 ± 3 | 64.7 ± 2.6 | 65.8 ± 3.4 |
| HVSMR / five-shot | 40.4 ± 3.8 | 44.5 ± 3.8 | 46.3 ± 3.8 |
| PanDG / all-data | 25.3 ± 2.5 | 50.3 ± 1.4 | 46 ± 1.9 |
| Prostate / all-data | 83 ± 0.7 | 84.1 ± 0.6 | 84.7 ± 0.5 |
| Prostate / five-shot | 27.8 ± 5 | 27.9 ± 5.1 | 64.2 ± 4.4 |
Experimental protocol and full comparisons ↗. Five-shot uses five source-domain training subjects; BraTS and PanDG were not evaluated in this setting.
Add it to a training loop
The predictor receives the image and frozen features together. Channel dropout is active only during training.
# feature_extractor is frozen and in evaluation mode.
with torch.no_grad():
features = feature_extractor(images)
inputs = torch.cat([images, features], dim=1)
inputs = F.dropout3d(inputs, p=mask_rate, training=predictor.training)
prediction = predictor(inputs)
loss = loss_fn(prediction, labels)
Illustrative core only; use the implementation for preprocessing, augmentation, and training configuration. At inference, use the same frozen extractor and all input channels.
Practical considerations
The extractor adds computation at training and inference. Representation quality and masking rate remain relevant choices. Consult the runtime analysis and implementation details for the evaluated configuration.
Read the abstract
We present MaskGen, a simple and theoretically-grounded approach for domain generalization in 3D biomedical image segmentation. Modern segmentation models degrade sharply under shifts in modality, disease severity, clinical sites, and other factors, creating brittle models that limit reliable deployment. Existing domain generalization methods rely on extreme augmentations, mixing domain statistics, or architectural redesigns, yet incur significant implementation overhead and yield inconsistent performance across biomedical settings. MaskGen instead proposes a principled learning strategy with minimal overhead that leverages both source-domain image intensities and domain-stable foundation model representations to train robust segmentation models. As a result, MaskGen achieves strong gains in both fully supervised and few-shot segmentation across a broad range of shifts in biomedical studies. Unlike prior approaches, MaskGen is architecture- and loss-agnostic, compatible with standard augmentation pipelines, computationally lightweight, and tackles arbitrary anatomical regions. Our implementation is publicly available.
BibTeX
@inproceedings{diaz2026maskgen,
title = {Why Invariance is Not Enough for Biomedical Domain
Generalization and How to Fix It},
author = {Diaz, Sebo and Golland, Polina and
Adalsteinsson, Elfar and Dey, Neel},
booktitle = {Advances in Neural Information Processing Systems},
year = {2026},
url = {https://arxiv.org/abs/2604.02564}
}