When the Mask Is the Shortcut: Auditing and Hardening Segmentation-Gated Diagnosis Across Sites

Many medical imaging classifiers first segment an organ or lesion and then diagnose using only the pixels inside that outline, which is called region-of-interest (ROI) masking. The aim is to keep the classifier from latching onto background clues such as skin layers, scanner borders, or burned-in text. This proposal argues that the step meant to remove shortcuts can quietly put them back.

The mask comes from a segmentation model or an atlas, meaning a reference anatomy warped onto each patient. Such tools fail most often on unusual anatomy, and unusual anatomy is often exactly what disease produces: atrophied hippocampi, enlarged ventricles, distorted nodules. They also fail differently on scanners they were not built for. As a result, how wrong the mask is can be correlated with the diagnosis at one hospital and correlated differently at the next. A classifier trained on masks from one site can then learn "this outline looks the way outlines look on sick patients here." That signal disappears at a new hospital, and nobody suspects it, because the pipeline was designed to be shortcut-free.

We propose to measure this effect directly and then build against it. The measurement is a cascade-sensitivity audit: how much the diagnosis changes when the input mask is swapped for other anatomically plausible masks of the same patient. The defence is to train the classifier on many such masks so that its output stops depending on segmentation idiosyncrasies. The same sensitivity score, at deployment, flags cases to withhold from clinicians rather than show them a confident but fragile answer.

Core Claim

The claim is testable. In atlas- or segmenter-gated diagnosis, mask error correlates with both disease label and acquisition site. This correlation accounts for a measurable share of the performance drop when a model trained at one site is tested at another. Making the downstream classifier invariant to anatomically structured mask variation should recover part of that drop. Random, unstructured perturbation of the mask should recover less. Separately, per-patient cascade sensitivity should predict which external-site cases the model gets wrong, better than generic uncertainty scores do.

Where This Sits in Prior Work

Three groups of papers shape the proposal.

The first motivates it. The Role of Pleura and Adipose in Lung Ultrasound AI shows unmasked classifiers reading chest-wall tissue instead of lung, which is the standard argument for masking. Masking pipelines then follow, and all of them treat the mask as fixed and correct:

Shortcut Learning in Medical Image Segmentation breaks that assumption. It shows segmenters themselves exploit calipers, text, and center-of-image position, losing about 6–7% Dice on fetal cervix when annotations are removed. However, it explicitly stops at the mask and never asks how these errors propagate into a downstream diagnosis. That cascade is the gap we target.

The second group supplies the method for generating plausible masks. AtlasMorph learns age- and sex-conditioned brain templates with topology-preserving warps, trained on 10,195 scans from ADNI, OASIS, ABIDE and IXI. Its outputs are probabilistic label maps of the kind a pipeline would actually use. A probabilistic histological atlas of the human brain for MRI segmentation (NextBrain) supplies an independent, histology-derived set of 333 regions. The inter-subject variability literature explains why these tools disagree in structured rather than random ways:

We use these differences as samples of plausible mask variation. We do not try to pick the single correct atlas.

The third group constrains the design and the clinical framing. Calibrate the inter-observer segmentation uncertainty via diagnosis-first principle (DiFF) is the closest method. It chooses a ground-truth mask that maximizes downstream diagnostic accuracy, but it does so within one site, in 2D, and for one fixed classifier. Optimizing the mask for in-site accuracy is the very mechanism that could absorb site-specific mask error. We do the opposite and make the classifier indifferent to the mask within its plausible range.

Predicting Brain Age using Transferable coVariance Neural Networks shows that parcellation-agnostic models still carry constant site offsets. This warns that invariance to the atlas alone will not remove every site effect, so our audit separates mask-mediated error from other site error.

On the translation side, Do as AI say found that 27.54% of radiologists and 41.73% of non-experts followed incorrect advice every time it was shown. Withholding fragile predictions is therefore safer than hoping clinicians catch them. DEPLOYR documents retrospective-to-prospective decay (AUROC 0.76 to 0.69) for tabular models. Leave-one-site-out testing is our offline stand-in for that decay in imaging.

Research Program

The primary setting is dementia classification from T1-weighted brain MRI. We mask medial temporal and ventricular regions, train at one cohort, and test at the other, using ADNI and OASIS because both carry cognitive labels. ABIDE and IXI contribute only healthy anatomy, which is used to estimate how mask behaviour varies with site and age.

For each scan we produce a family of $K$ masks $m_1,\dots,m_K$ that a reasonable pipeline might have generated:

  • FreeSurfer labels.
  • NextBrain labels.
  • AtlasMorph labels obtained by registering the scan to templates whose conditioning age is shifted by up to ±10 years. This mimics the template-to-patient mismatch that occurs when a patient's anatomy is atypical for their recorded age.

As a secondary, non-brain check, LIDC-IDRI provides up to four radiologists' nodule outlines per nodule. These give a human-derived mask family against which our synthetic families can be compared.

The audit has three outputs. First, at each site, the correlation between mask disagreement (pairwise Dice across the family) and diagnosis label, age, and site. This tests whether mask error is label-correlated and whether the correlation differs between sites. Second, the per-patient cascade sensitivity:

$$S(x) = \frac{1}{K}\sum_{k=1}^{K} \left| f(x, m_k) - f(x, m_0) \right|$$

Here $f(x,m)$ is the classifier's predicted disease probability for image $x$ under mask $m$, and $m_0$ is the mask the pipeline would ship by default. Third, the cross-site AUROC drop split into two parts: the part that disappears when test-site masks are replaced by masks from the training-site pipeline's distribution, and the part that remains.

The intervention is mask-family training. During training, each example is shown with a mask drawn from its family. An added penalty on $S(x)$ pushes predictions under different masks of the same scan toward agreement. This penalty is analogous in spirit to the within-patient variance penalty of Learning Repeatable Speech Embeddings Using An Intra-class Correlation Regularizer. At test time, $S(x)$ serves as a referral score: the highest-sensitivity cases are routed to a human without displaying the model's answer. We also check that the mask family can be produced quickly. NextBrain's roughly one-hour inference rules it out at the bedside, so a deployment version would rely on the fast AtlasMorph samples alone, and we report how much is lost by doing so.

Baselines

The naive reference is a whole-scan 3D classifier with no mask, trained on the training site. This is the configuration ROI masking is supposed to improve on. If it matches masked models cross-site, the premise that masking helps generalization is itself in doubt, and we will report that.

The strongest reported number in this setting is NextBrain-based Alzheimer's classification on ADNI, AUROC 0.953, against 0.911 for FreeSurfer (A probabilistic histological atlas of the human brain for MRI segmentation). That is a within-ADNI figure. We found no reported result on Lacuna for ADNI-to-OASIS or OASIS-to-ADNI masked dementia classification, so we will reproduce the NextBrain-masked and FreeSurfer-masked pipelines ourselves under the leave-one-cohort-out protocol. Beating this baseline means improving cross-cohort AUROC without losing more than about one point of within-cohort AUROC relative to our reproduction.

DiFF (Calibrate the inter-observer segmentation uncertainty via diagnosis-first principle) is the closest method that also reasons about which mask to use. It reports AUC gains of up to 2.04–2.73% on ISIC, TNMIX and REFUGE-2. We will apply its mask-selection idea to our family, choosing per scan the mask that best serves training-site diagnosis. We will run it on LIDC-IDRI, where real multi-rater masks exist, against DenseSharp+'s reported 0.9566 AUC and 91.52% accuracy (Probabilistic Radiomics).

Two ablations isolate the key ingredient. One trains on a single mask with random morphological erosion and dilation of matched magnitude. The other trains on the family but without the sensitivity penalty.

All methods share the same backbone, training data, preprocessing, and an equal hyperparameter search budget. Every method is selected on a training-site validation split only, so no method sees the test site during tuning.

Why not just…?

Why not just skip masking and train a whole-scan model on many sites? Multi-center training is the established remedy: Artificial intelligence for the detection of COVID-19 pneumonia on chest CT using multinational datasets pooled data across four countries to suppress protocol shortcuts. It does not answer our question, though. Many sites cannot pool data, and the lung ultrasound evidence shows unmasked models drift to irrelevant tissue. The no-mask baseline is in our comparison, and we will also train it on ADNI plus the healthy scans from ABIDE and IXI. If it closes the cross-cohort gap as well as mask-family training, we will say that pooling, not mask handling, is the better investment.

Why not just perturb masks randomly? This is the most serious threat. Random dilation and erosion is cheap and may capture most of the benefit. Our reason to expect it to fall short is that atlas errors are spatially structured and age-dependent, concentrated in atrophic and highly variable regions, as the folding-variability and thalamic-atlas results indicate. Isotropic noise does not reproduce that structure. The random-perturbation ablation settles the question directly. If it matches the family-trained model on cross-site AUROC and on referral quality, the contribution shrinks to the audit, and we will report it that way.

Why not just use Monte Carlo dropout or a classifier ensemble for referral? Generic uncertainty measures the classifier's doubt about the image. It does not measure doubt arising from the segmentation step, which is outside the classifier entirely. We will compare $S(x)$ against both, judging which better ranks external-site errors. If the generic scores do as well, segmentation-specific referral is unnecessary.

Decisive Checks

The first check is whether mask disagreement correlates with diagnosis differently at ADNI and OASIS. If it does not, the hypothesized mechanism is absent and the method has nothing to fix.

The second is whether swapping test-site masks for training-pipeline-distributed masks recovers a meaningful share of the cross-cohort AUROC drop. This share is the size of the problem.

The third is whether mask-family training beats both the reproduced NextBrain-masked baseline and the random-perturbation ablation on cross-cohort AUROC and expected calibration error.

The fourth concerns referral. Withholding the top 10% of cases by $S(x)$ should remove more external-site errors than withholding by dropout or ensemble uncertainty, measured as error rate and AUROC on the retained 90%.

On LIDC-IDRI, $S(x)$ computed from synthetic masks should rank-correlate with $S(x)$ computed from the radiologists' own outlines. This shows the synthetic families resemble real disagreement.