When Medical Shortcuts Come From Selection, Stop Scrubbing Them

Many "shortcuts" in medical image classifiers are not caused by some hidden common cause of the image and the diagnosis. They are created by how the dataset was assembled. Suppose a pneumonia benchmark takes its positive cases mostly from one hospital and its negative cases from another. Or suppose a cohort over-recruits sick women and healthy men. Then whether an image ends up in the dataset depends on both the disease and the attribute. Causal inference calls this a collider: a variable that two others both feed into. Restricting attention to the included sample manufactures a correlation that does not exist in the patients the model will later see. The usual remedy in medical imaging is to scrub the attribute out of the network's internal representation, using adversarial training or mutual-information penalties. That remedy assumes the attribute is a nuisance. When the attribute also changes what the image looks like (sex changes thoracic anatomy, age changes skin and bone), scrubbing removes information the classifier needs. The correct fix under selection is different and simpler: keep the attribute, and correct the distorted joint frequency of disease and attribute using external population marginals.

This note proposes to test that claim directly. Under a selection mechanism, the classic selection-bias recovery formula prescribes the correction exactly, and the required external quantities (disease prevalence by sex or by site) are often available in hospital statistics. We predict a crossover. When the attribute is a pure artifact, such as hospital source, scrubbing and selection-aware reweighting should perform about equally. When the attribute shapes how disease appears in the image, selection-aware reweighting should beat scrubbing on target-population accuracy and calibration. Finding that crossover, or failing to find it, would tell practitioners which family of debiasing methods fits which kind of shortcut.

Core Claim

Take an image $X$ generated from disease $Y$ and attribute $A$. Let a binary inclusion indicator $S$ depend on $(Y, A)$, and assume that given those two variables, inclusion carries no further information about the image ($S \perp X \mid Y, A$). Then the per-group image distribution is unbiased in the selected data, and only the joint $P(y,a)$ is distorted. The target-population posterior is recovered by

$$P_T(y \mid x) \;\propto\; \sum_a P(y, a \mid x, S{=}1)\, \frac{P_T(y,a)}{P(y,a \mid S{=}1)},$$

where $P_T(y,a)$ is the deployment-population joint of disease and attribute, supplied externally. This is the external-data recovery result of Recovering from Selection Bias in Causal and Statistical Inference, which reweights biased conditionals by population marginals of a covariate set. Here the covariate set is the attribute, and the conditional is a neural network's joint prediction of disease and attribute from pixels.

The formula makes the regime prediction concrete. The network should be trained to predict the pair $(y,a)$, not trained to forget $a$. Whenever $P(x \mid y, a)$ varies with $a$, a representation forced to be independent of $A$ cannot represent $P(y \mid x)$ in any population. That is collider-style "explaining away" at the level of features. The argument also predicts that the gap between the two approaches grows with how strongly $A$ alters disease appearance.

Relation to Prior Work

Several papers motivate this proposal. A causal perspective on dataset bias in machine learning for medical imaging draws causal graphs that include selection nodes. It separates prevalence, presentation, and annotation disparities and argues that no single fix covers all three. It is purely conceptual. We turn its prevalence-versus-presentation distinction into an algorithm and an experiment.

Detecting shortcut learning for fair medical AI using shortcut testing (ShorT) shows that a network can encode an attribute without using it. It also reports that scrubbing age with gradient reversal did not close the subgroup gap for acne in dermatology. We read that failure as the presentation-relevant regime our claim predicts. ShorT itself does not model inclusion as a collider.

The closest existing method papers take a different route. Chest X-ray Image Classification: A Causal Perspective models devices and text markers as confounders. It applies backdoor adjustment with an assumed uniform confounder distribution and pushes confounder-token predictions toward uniform. Under a collider, both the confounder graph and the uniform prior are wrong. Latent Adversarial Debiasing: Mitigating Collider Bias in Deep Neural Networks uses the word "collider" but treats the shortcut as an input feature to erase through autoencoder edits. It is tested only on Colored MNIST and Corrupted CIFAR-10, and it depends on reconstructions that would blur fine radiographic detail. Our method needs no generative decoding.

Benchmarking Dependence Measures to Prevent Shortcut Learning in Medical Imaging supplies the strongest scrubbing competitor, MINE (a neural estimator of mutual information used as a penalty), along with the CheXpert sex-inversion benchmark. Pseudo Bias-Balanced Learning for Debiased Chest X-ray Classification (PBBL) supplies the source-biased pneumonia benchmark and a way to infer attribute labels when they are missing.

The epidemiology literature constrains the design. Keven Joyal‐Desmarais et al. found that adjusting for demographics in convenience samples increased bias in nearly half of the cases they analyzed. Simon Haworth et al. showed that voluntary participation induces spurious associations. Both results warn against treating "remove the attribute" as a safe default.

One honest caveat about scope: the chest-drain shortcut of Hidden Stratification Causes Clinically Meaningful Failures in Machine Learning for Medical Imaging is a consequence of treatment, not a collider. A drain does not change how pneumothorax looks. Our theory therefore predicts that scrubbing or masking is adequate there, and we use it as a control rather than a showcase.

Research Program

The work has three parts.

The first part builds controlled collider benchmarks from real radiographs. Starting from CheXpert, we subsample with a known inclusion rule $P(S{=}1 \mid y, a)$ for three attributes chosen to span the two regimes. Hospital source, using the source-biased pneumonia construction, sits near the pure-artifact end. Sex and age sit at the presentation-relevant end. Because the unselected pool is available, the true target joint and a matching target test set are known exactly. Varying the strength of selection traces out a curve rather than a single point.

The second part implements selection-aware recovery. The network gets a shared image encoder and a joint head over $(y,a)$, trained with ordinary cross-entropy on the biased data. At test time we apply the recovery formula with external $P_T(y,a)$. For realistic use we take this joint from published prevalences, and we test how sensitive results are to misspecifying it. When $A$ is unlabeled, we substitute pseudo-attributes from a deliberately shortcut-prone early model, following PBBL, and measure how errors in those pseudo-labels propagate.

The third part is a regime diagnostic a practitioner can run before choosing a method. On a small group-balanced held-out set, we fit disease classifiers on frozen features with and without access to $A$. If giving the classifier $A$ improves disease prediction, the attribute is presentation-relevant and scrubbing should be avoided. We check whether this diagnostic predicts, before training, which method wins.

Baselines

The naive reference is standard empirical risk minimization on the biased sample with no correction, the same encoder, and the same training schedule. On the CheXpert sex-inversion benchmark, Benchmarking Dependence Measures to Prevent Shortcut Learning in Medical Imaging reports this kind of model at 45.8 inverted-confounder AUROC. On source-biased pneumonia at 99% correlation, PBBL reports vanilla bias-conflicting AUC as low as 4.9%.

The strongest scrubbing method is MINE-penalized training, which reaches 87.7 inverted-confounder AUROC on CheXpert sex in the same paper. It is the most direct competitor because it targets exactly the attribute-independence that our claim says is wrong in the presentation regime. We run gradient reversal and distance-correlation variants alongside it.

The strongest method that works without attribute labels is PBBL, which reports 77.6% bias-conflicting AUC on source-biased pneumonia and 78.8% external AUC on PadChest. For the support-device setting, SpurCon reports 73.0% worst-group accuracy on CheXpert (SpurCon), and we include it there.

All methods share the backbone, the data splits, the augmentation, and an equal hyperparameter-search budget. Every method, ours included, gets the same number of trials, selected on the same biased validation split, so no method sees target data during tuning.

Two ablations isolate the key ingredients. In the first, our reweighting is combined with a MINE penalty on $A$. This keeps the correction but removes access to the attribute, so it isolates "keep the attribute." In the second, our joint-head model uses uniform group weights instead of external marginals. This is effectively group balancing, and it isolates the value of the population joint.

Beating the baselines means two things. First, a statistically reliable improvement over MINE in target-population AUROC and expected calibration error on the sex and age benchmarks. Second, parity, not loss, on the source benchmark. Any improvement must reproduce across at least three selection strengths and over resampled seeds.

Why not just…?

Why not just rebalance groups or upweight the minority? This is the most serious threat. When the deployment joint happens to be uniform, our method reduces to group balancing. The uniform-weight ablation above is exactly this alternative. We expect it to match our method on uniform target test sets and to lose on calibration and decision thresholds when the target joint is skewed, as real prevalence is. If it matches us on skewed targets too, the external-marginal ingredient adds nothing, and we will report that. Separately, Benchmarking Dependence Measures to Prevent Shortcut Learning in Medical Imaging observed that rebalancing gave only marginal gains on its own benchmark.

Why not just scrub every attribute with mutual-information or adversarial penalties? This is the hypothesis under test, not one we dismiss. ShorT's dermatology age result is suggestive evidence that scrubbing fails when the attribute shapes presentation. The decisive evidence will be the regime-by-method interaction in our experiments. If MINE matches selection-aware recovery on sex and age, our central claim is false.

Why not just supervise with segmentation masks? Reducing Reliance on Spurious Features in Medical Image Classification with Spatial Specificity raises robust AUROC on SIIM-ACR from 0.46 with image labels to 0.82 with masks. That works for localized artifacts like drains and rulers. Masks cannot remove sex or age, because those attributes are expressed in the very anatomy the mask keeps. Masks also require expert annotation that hospital-scale datasets avoid. We include masks only in the drain control.

Why not just audit with saliency maps? Benchmarking saliency methods for chest X-ray interpretation and Agreement Between Saliency Maps and Human-Labeled Regions of Interest found that saliency maps often fail to match expert regions. More fundamentally, a selection-induced shortcut need not be spatially separable from the pathology at all.

Proposed Experiments

The main experiment crosses three attributes (source, sex, age) with three selection strengths on CheXpert-derived benchmarks. Each condition is evaluated on test sets drawn at three target joints: uniform, the unselected CheXpert joint, and an inverted joint. Metrics are target-population AUROC, worst-group accuracy, and expected calibration error. We emphasize calibration because pure label-prior shifts leave AUROC unchanged but distort probabilities, whereas group-level reweighting can change rankings across groups.

The decisive check is the interaction. Selection-aware recovery minus MINE should be near zero for source and clearly positive for sex and age, and the size of that gap should track the regime diagnostic's measured benefit from providing $A$.

The external tests apply the same experimental logic in less controlled settings. On PadChest we train on CheXpert-derived biased data and compare against PBBL's reported 78.8% external AUC. On the source-biased pneumonia benchmark we compare against PBBL's 77.6% bias-conflicting AUC.

Two further checks bound the claim. The SIIM-ACR drain control is a negative case: if our method beats masking there, that would suggest it succeeds for reasons other than the theory. A misspecification sweep perturbs the external $P_T(y,a)$ by up to a factor of two, to find the error level at which the advantage disappears. Finally, a Morpho-MNIST version with an exactly known image-generating process checks that the recovery formula behaves as derived before any claims about radiographs are made.