TL;DR
Deep learning models that segment 3D medical scans often fail spectacularly when moved to a new hospital, scanner, or imaging modality, yet training solely on "domain-invariant" features discards too much useful clinical detail. MaskGen fixes this by feeding a standard network both raw images and stable foundation model features—randomly masking channels during training so the network can't lazily rely on just the raw pixels. Best of all, it outperforms complex baselines while adding just five lines of code to a standard PyTorch loop.
What Problem Does This Paper Address?
In controlled benchmarks, 3D medical image segmentation—automatically outlining organs, vessels, or tumors—is essentially a solved problem. Step into a real clinic, however, and things fall apart. Models trained on CT scans fail on MRIs; models trained at Hospital A stumble on scanner protocols at Hospital B.
Existing Domain Generalization (DG) methods try to anticipate these shifts during training using extreme data augmentations or complex feature-mixing architectures, which are computationally heavy and inconsistent. Meanwhile, Domain Adaptation methods require retraining or fine-tuning on data at the deployment site—demanding ML infrastructure that hospitals rarely have.
Recently, 3D biomedical foundation models (like anatomix) have emerged that extract "domain-stable" representations—features that look roughly the same regardless of scanner or modality. Intuition suggests we should just train our segmentors on these invariant features and call it a day. Surprisingly, the authors show that invariant features alone hit a strict performance ceiling because stripping away domain-specific quirks also strips away subtle, task-relevant signal. How do we combine the safety net of stable features with the sharp detail of raw images without the model taking shortcuts?
Methods
The authors introduce MaskGen, an architecture- and loss-agnostic training strategy that requires marginal overhead and zero test-time adaptation.
Here is how it works:
- Extract Stable Features (Standard): Pass a 3D input volume (e.g., a CT scan) through a frozen, pre-trained 3D foundation model (anatomix, trained purely on synthetic data) to get per-voxel, domain-invariant representations.
- Concatenate (Simple): Stack the raw image channel ("unstable" source) and the foundation model’s feature channels ("stable" source) together along the channel dimension.
- View Masking (The Secret Sauce): If you train a standard 3D UNet directly on this stacked input, it falls victim to shortcut learning—latching onto the crisp, in-domain raw image intensities to minimize training loss while ignoring the stable features. To prevent this, MaskGen applies standard 3D channel dropout (
F.dropout3d) directly to the concatenated input during training, independently zeroing out the raw image and individual feature channels with probability $r$ (e.g., 50% or 75%).
At inference, masking is turned off, and the task-specific network makes predictions using the full combined input.
Datasets
No new benchmarks were introduced; instead, the authors evaluated MaskGen across six existing public 3D datasets chosen to span five distinct real-world clinical shifts:
- AMOS & TopCoW (Modality shift): Training on CT/CTA and testing on MRI/MRA for abdominal organs and cerebral vessels, respectively.
- MSD-BraTS (Sequence shift): Brain tumor MRIs trained on T1, T2, and T1-CE sequences, tested on unseen FLAIR scans.
- HVSMR (Disease severity shift): Cardiac scans trained on mild/moderate congenital heart disease, evaluated on severe cases.
- PanDG (Imaging phase shift): Abdominal MRIs trained on venous-phase scans and tested on out-of-phase scans across sites.
- Multi-site Prostate MRI (Clinical site shift): Trained and evaluated across distinct hospital collections.
Key Insights and Ideas
- Invariance has a mathematical ceiling: Using information theory, the authors prove (Proposition 2) that discarding unstable raw inputs strictly bounds your best possible performance. Raw image intensities carry complementary, task-relevant signal within any given environment that invariant features smooth over.
- Naïve combination breeds laziness: Ablations confirm that concatenating raw images with foundation features at a 0% mask rate leaves the network heavily dependent on the raw image channel. When the domain shifts at test time, those raw intensities change and the model breaks.
- Targeted input masking beats generic dropout: Masking specifically at the input interface forces first-layer weights to extract signal from both stable and unstable sources (proven in Proposition 1). Applying generic channel dropout across all layers of a standard UNet performs significantly worse.
Key Results
MaskGen was tested in both all-data (250k steps) and few-shot (5 subjects, 40k steps) regimes, measured by Dice score (0–100 overlap metric, higher is better):
- Consistent SOTA in All-Data: MaskGen achieved the best overall average rank (1.5) across all six datasets. Under severe modality shifts, it jumped from 57.4 (standard ERM) to 67.5 Dice on AMOS (CT $\rightarrow$ MRI), and from 24.6 to 47.8 Dice on TopCoW (CTA $\rightarrow$ MRA), beating the strongest DG baseline (GIN+IPA, 37.6).
- Massive Few-Shot Gains: With only five training scans, MaskGen dominated every dataset—outperforming the runner-up methods by +15.6 Dice on AMOS (53.4 vs. 37.8) and +11.0 Dice on Prostate (64.2 vs. 53.2).
- Beats Test-Time Adaptation (without adapting): Despite never seeing target-domain data, MaskGen outperformed methods that actively calibrate or train on unlabeled test data on 4 of 6 datasets (average rank 1.3 vs. 3.0–4.2).
Limitations and Future Work
- Computational Overhead: Running a forward pass through the frozen foundation model increases training time by ~26% per iteration and inference time by ~8% compared to standard ERM (though this is much lighter than top DG rival GIN+IPA, which adds a 450% training overhead).
- Reliance on Extractor Stability: MaskGen is only as good as its foundation model's invariance. Swapping anatomix for nnInteractive—another 3D foundation model not explicitly trained for domain stability—resulted in slightly lower performance on 4 of 6 datasets.
- Future Work: The authors only evaluated 3D medical foundation models; extending MaskGen to 2D natural-image backbones like DINOv2 or SAM remains an open direction.
Summary updated