A segmentation network trained on one kind of medical scan usually fails badly on another. A cardiac model trained on one MRI sequence (bSSFP) drops to 4.9% Dice, a measure of overlap between predicted and true masks, when tested on T2-weighted MRI (Gradient-Map-Guided Adaptive Domain Generalization for Cross Modality MRI Segmentation). An MRI-trained model scores 13.2% when tested on CT (PnP-AdaNet). The methods that recover this gap use one of three tools. Some see unlabeled target scans during training. Some synthesize target-style images. Others fine-tune the model on every test scan, which is slow and breaks when its anatomical priors are wrong. None of these fits the common clinical case of one labeled source modality, no target data, and a single fast forward pass at deployment.
We propose a small attention module that can be inserted into an existing segmentation backbone without changing its tensor shapes. The module learns where the network should stop listening. During training, we produce several copies of each source image with randomly remapped intensities, mimicking contrast changes between modalities. We measure which internal features change across these copies, and train the module to predict that instability from a single image. At test time, the module dims the predicted unstable features before they reach the rest of the network. In two sentences: the network learns, from source data alone, to recognize and suppress the parts of its own representation that depend on image contrast. It does this with one forward pass and no target data.
Core Claim
Contrast instability can be predicted from a single image. A gate trained to predict it, with an explicit target computed across intensity-remapped views, generalizes across modalities better than three simpler options using the same augmentation: a consistency loss alone, channel-statistic recalibration alone, or a generic attention block trained on the same data. The new ingredient is the supervision target. Prior "ignore" attention learns what to suppress only through the task loss. Prior style-augmentation methods only reweight whole-channel statistics. Neither tells the network, location by location, which features are contrast-driven.
Positioning Against Prior Work
Prior work plays three different roles here: some papers supply mechanisms, some motivate the problem, and some constrain the design.
Two papers supply the mechanism. Learning to ignore: rethinking attention in CNNs inverts attention activations to suppress easy background patterns rather than highlight foreground. It reports gains over squeeze-and-excitation blocks on CIFAR-100 and more stable training. Its inversion operators are hand-tuned and learned only through the task loss. We keep the "suppress, don't highlight" form but give the suppression an explicit target. BA-Net shows that channel attention computed from several preceding layers beats attention computed from one layer. We borrow this multi-layer input for the gate, since contrast effects are clearest when shallow and deeper features are compared.
The motivating and constraining work comes from cross-modality segmentation. Generalizable Cross-modality Medical Image Segmentation via Style Augmentation and Dual Normalization simulates modality shifts with Bézier-curve intensity remapping, a smooth random curve that maps old pixel intensities to new ones. It routes features through two batch-normalization paths, reaching 54.44% Dice with a T2 source on BraTS. We reuse its augmentation as our view generator. Dual normalization only rescales each channel's mean and variance, so it cannot suppress a contrast-dependent feature at one location while keeping it at another.
Gradient-Map-Guided Adaptive Domain Generalization shows that structural inputs, here edge-filtered gradient maps, bridge most of the gap, reaching 85.4% Dice on bSSFP to T2. That result depends on per-scan test-time fine-tuning, which the authors themselves flag for latency and prior brittleness. It sets the accuracy bar we must approach without test-time optimization.
PnP-AdaNet argues that early layers carry modality-specific texture. It swaps out the whole early encoder, using adversarial training on target CT. Learning Pose-aware Representations in Vision Transformers found its inserted attention helped only in late layers. These two papers disagree about placement, so we test placement directly rather than assume an answer.
Two further methods are close but need things our setting forbids. Transferable-Guided Attention for Video Domain Adaptation steers attention toward domain-ambiguous content using a domain discriminator. That discriminator requires target data. Our cross-view instability signal replaces it using only source images. De-LightSAM avoids interference between modalities with one decoder channel per known modality. That design cannot handle a modality never seen in training, which is exactly our test condition.
Research Program
The backbone is a standard 2D U-Net, the encoder-decoder network common in medical segmentation, with skip connections kept intact. Keeping skip connections matters because PnP-AdaNet had to remove them. The gate is placed after an encoder stage $l$. It reads pooled features from that stage and the previous one, BA-Net style, and outputs a suppression map $g_l \in [0,1]^{C \times H \times W}$, where $C$ is the channel count and $H \times W$ the spatial size. The module returns $F_l \odot (1 - g_l)$, where $F_l$ is the stage's feature map and $\odot$ is elementwise multiplication. Output shape equals input shape, so the gate can be added to a pretrained source model and fine-tuned with or without unfreezing the backbone.
For each training image we draw $K$ Bézier-remapped views $x^{(1)},\dots,x^{(K)}$. Let $\sigma_l(u,c)$ be the standard deviation of the backbone's ungated feature at location $u$ and channel $c$ across the $K$ views. Let $\bar\sigma_l$ be that quantity rescaled to $[0,1]$ within each image. Gradients are stopped through $\bar\sigma_l$, so the backbone cannot shrink its own target. The training objective is
$$ \mathcal{L} = \frac{1}{K}\sum_{k=1}^{K} \mathcal{L}_{\text{seg}}\big(x^{(k)}\big) + \lambda \sum_{l} \frac{1}{K}\sum_{k=1}^{K} \big\| g_l(x^{(k)}) - \bar\sigma_l \big\|_1 , $$
Here $\mathcal{L}_{\text{seg}}$ is the usual Dice plus cross-entropy loss and $\lambda$ weights the gate target. The gate must predict the same instability map from each single view. At test time it therefore estimates instability from one image of an unseen modality.
One risk is that the gate suppresses everything. A second is that instability simply tracks foreground anatomy. We will measure overlap between $g_l$ and ground-truth masks on held-out source data. We will also cap the mean suppression per image as a fallback.
The analysis has three parts. First, we test whether high-instability regions on source views coincide with regions where target-modality features differ most from source features. This is checkable on co-registered multi-sequence BraTS scans. Second, we sweep placement across encoder stages. Third, we check whether a gate trained on one source modality transfers to several target modalities without retraining.
Baselines
The naive reference is the source-only U-Net trained with no augmentation. Reported values are 4.9% average Dice on MS-CMRSeg2019 bSSFP to T2 (Gradient-Map-Guided) and 13.2% on MM-WHS MRI to CT (PnP-AdaNet). We rerun it in our own pipeline. A second reference is the same U-Net trained on Bézier-augmented views with no extra module ("augmentation only"), which isolates what augmentation alone buys.
The strongest competitor without test-time optimization is dual normalization with style augmentation (Style Augmentation and Dual Normalization). It reports 54.44% Dice on BraTS with a T2 source, against 35.17% for its DeepAll baseline. It is the strongest competitor because it uses the same augmentation, the same single-source setting, and a single forward pass. Any gain we show over it must come from spatial suppression rather than from the data.
The strongest overall method is gradient-map input plus test-time adaptation, which reports 85.4% Dice on bSSFP to T2. We treat it as an accuracy ceiling with a latency cost. We will report its per-scan inference time alongside ours. We also run gradient-map input without test-time adaptation. Lacuna has no reported result for that variant, so we produce the number ourselves.
PnP-AdaNet, at 63.9% Dice on MM-WHS, sees target CT during training. We report it only as an upper reference for what target data buys.
All of our own reruns share the backbone, data splits, augmentation sampler, number of views $K$, optimizer, and training steps. Each method gets the same hyperparameter search budget, 20 configurations, selected on held-out source-modality data only. No target data is used for selection.
Three ablations isolate the key ingredient. In the first, the gate is trained with the task loss only, with no instability target. This is effectively learning-to-ignore on augmented data. In the second, the gate is replaced by a CBAM block trained identically. In the third, we drop the gate and keep only a cross-view feature consistency loss.
Beating the field means two things. On MS-CMRSeg2019 and BraTS, we must exceed dual normalization and all three ablations on target-modality Dice by a margin larger than the seed-to-seed spread over three seeds. On bSSFP to T2, we must close at least most of the distance to 85.4% at single-pass latency.
Why not just…?
Why not just add a consistency loss across augmented views? This is the most serious threat. A loss forcing features to agree across remapped views could make the gate redundant by removing instability from the backbone itself. Our case rests on one argument: a consistency loss shapes training-time features but gives the model no mechanism to react, at test time, to instability patterns it has never seen in that exact form. The gate supplies such a mechanism. If the consistency-only ablation matches the full method on unseen target modalities, the gate adds nothing. We would then report the result as a negative finding and reframe the contribution around the analysis.
Why not just feed gradient maps instead of raw intensities? Gradient maps remove much of the intensity shift by construction, and the 85.4% result shows how strong that is. That number includes test-time fine-tuning, and the paper attributes the remaining local discrepancies to effects the gradient input does not fix. We run gradient-map input without test-time adaptation as a baseline. We also run our gate on top of gradient-map input. If the gate gives no gain there, its benefit is subsumed by the structural input.
Why not just use a standard attention block like CBAM or squeeze-and-excitation with the same augmentation? BA-Net and the learning-to-ignore paper both report that generic blocks underperform their designs, but only on natural images and within one distribution. Neither shows anything about cross-modality shift. The CBAM ablation, trained on identical augmented data, answers this directly for our setting.
Proposed Experiments
Training and evaluation use only a single source modality, with no target images used for training or model selection. We use three benchmarks, chosen to give one main test, one generality test, and one harder test.
The main test is MS-CMRSeg2019, with bSSFP as source and T2 and late-gadolinium-enhancement MRI as targets. We report Dice, Jaccard, and HD95 for left ventricle, right ventricle, and myocardium. This benchmark lets us compare directly to the 4.9% and 85.4% figures.
The generality test is BraTS, with each of T1, T1ce, T2, and FLAIR used once as the sole source and evaluated on the other three for whole-tumor Dice. This matches the setting where dual normalization reports 54.44%.
The harder test is MM-WHS MRI to CT for four cardiac structures. Here the physics differ most, and PnP-AdaNet's 63.9% is the target-data reference.
We report per-scan inference latency for every method. The decisive checks are four. First, the full method must beat the consistency-only ablation and the task-loss-only gate on unseen targets; otherwise the instability target is not the cause of any gain. Second, the gate's predicted instability must correlate with actual source-to-target feature differences on co-registered BraTS scans more strongly than with plain foreground masks. Third, a placement sweep must show whether gains concentrate in early stages, as PnP-AdaNet's premise predicts, or late stages, as the pose-aware ViT result suggests. Fourth, on MM-WHS, the method must improve over augmentation-only without collapsing on thin structures such as the myocardium, which we check with HD95 rather than Dice alone.
References
- Gradient-Map-Guided Adaptive Domain Generalization for Cross Modality MRI Segmentation
- PnP-AdaNet: Plug-and-Play Adversarial Domain Adaptation Network at Unpaired Cross-Modality Cardiac Segmentation
- Learning to ignore: rethinking attention in CNNs
- BA-Net: Bridge Attention for Deep Convolutional Neural Networks
- Generalizable Cross-modality Medical Image Segmentation via Style Augmentation and Dual Normalization
- Learning Pose-aware Representations in Vision Transformers for Understanding Activities of Daily Living
- Transferable-Guided Attention Is All You Need for Video Domain Adaptation
- De-LightSAM: Modality-Decoupled Lightweight SAM for Generalizable Medical Segmentation