Chest X-ray classifiers often learn to "detect" a collapsed lung (pneumothorax) by detecting the chest tube that doctors insert to treat it. Such a model looks excellent on average and fails on exactly the untreated patients who need the diagnosis. The most reliable known fix is to supervise with pixel-level outlines of the disease, but those outlines are expensive. This note proposes a cheaper route through the network's architecture. We would use a "white-box" transformer, whose layers are derived as steps of an explicit optimization algorithm. In such a network each attention head projects tokens onto its own learned low-dimensional subspace, and object-like segmentations appear without anyone asking for them. With a few dozen disease outlines we would pick out which heads carry pathology and which carry devices. The diagnostic classifier would then be forced to read only the pathology heads.
The bet is that architecture can stand in for most of the annotation. If the heads of a white-box network already separate image content into interpretable parts, a handful of masks is enough to identify the right part, and spatial supervision becomes a selection problem rather than a dense labeling problem. The experiments compare this against the strongest annotation-based, contrastive, and generative fixes on the shortcut benchmarks those methods were reported on. One ablation applies the identical recipe to an ordinary vision transformer. It tests whether the white-box structure is doing the work at all.
Core Claim
Reducing Reliance on Spurious Features in Medical Image Classification with Spatial Specificity trains classifiers with increasingly precise location labels and shows that this suppresses shortcuts. On SIIM-ACR pneumothorax with the tube correlation inverted at test time, robust AUROC rises from 0.46 with image-level labels to 0.72 with boxes and 0.82 with full masks. The authors stress that masks are the bottleneck. Their semi-supervised variant still uses 600 segmented images, and its exact score is not given in the file.
Separately, Emergence of Segmentation with Minimalistic White-Box Transformers introduces CRATE, a transformer built from unrolled steps of a sparse rate-reduction objective. Rate reduction is a compression criterion that pushes token features into a union of low-dimensional subspaces. CRATE's attention ties queries, keys and values to one subspace basis per head. Under plain supervised classification its heads segment objects and parts, reaching 23.9 mIoU on PASCAL VOC against 14.1 for a supervised ViT-S/8.
Our claim is that these two findings compose. A CRATE model trained on chest radiographs, with "support devices" included as its own training label, will route device evidence and lung-pathology evidence into largely distinct head subspaces. A small number of pathology masks, which we expect to be tens rather than hundreds, then suffices to select the pathology heads. A classifier restricted to those heads should approach the robustness of full-mask supervision.
The proposal differs from the spatial-specificity paper in where the masks act. There, masks are a training signal on every image. Here, masks only choose among structures the architecture already built. The proposal also differs from CRATE in what it tests: CRATE was never evaluated on medical images, worst-group performance, or shortcuts.
Research Program
The model is a CRATE-Small or CRATE-Base encoder trained on CheXpert (CheXpert: A Large Chest Radiograph Dataset with Uncertainty Labels and Expert Comparison) with all 14 observation labels. One of those labels is Support Devices. Including it is deliberate. It gives the network an explicit reason to devote subspaces to hardware rather than folding the tube into the pneumothorax representation.
After training, we compute a token-level activation map for each head $k$ in each layer. A token's activation for head $k$ is the norm of its projection onto that head's subspace basis $U_k$. With $m$ pathology masks from SIIM-ACR, each head is scored by how well its activation map separates in-mask from out-of-mask tokens, using the token-level AUROC $s_k$. If tube annotations are available on the same images, we also compute a matching device score $d_k$. We keep the heads with high $s_k$ and low $d_k$. The pneumothorax classifier is a linear probe, plus light fine-tuning of the final layers, on tokens pooled only from the selected subspaces. Every other head's contribution is projected out before pooling.
The program has three analyses. The first asks whether device and pathology subspaces separate at all. We measure this by the overlap of the top-scoring heads for the two kinds of mask, and by how well a probe on pathology heads predicts tube presence. Prediction near chance is the target, mirroring the cross-prediction test in MIMM-X: Disentangling Spurious Correlations for Medical Image Analysis. The second is a mask-budget curve over $m \in \{0, 10, 25, 50, 100, 600\}$. At $m = 0$, heads are chosen only by low device score, using tube labels derived from the Support Devices annotation. The third is a faithfulness check that addresses the saliency problem raised by Benchmarking saliency methods for chest X-ray interpretation. We delete tube pixels by inpainting them with the local lung texture and confirm that the restricted classifier's output barely moves, while the unrestricted model's output drops.
The method then transfers to dermoscopy, where rulers and ink markings play the role of the tube. Here the pre-training data is ISIC rather than CheXpert, and lesion masks drive head selection.
The central risk deserves stating plainly. Emergent segmentation in CRATE comes from the classification labels. Because pneumothorax labels are confounded with tubes, a head can learn "tube-plus-collapsed-lung" as a single object. The Support Devices label is our main defense against this, and an ablation removes it. If pathology and device scores remain tightly coupled across heads, the core claim fails, and the experiments are designed to show that clearly.
Baselines
The naive reference point is empirical risk minimization: training on image-level pneumothorax labels and nothing else. On the SIIM-ACR inverted-shortcut split it scores a robust AUROC of 0.46 in Reducing Reliance on Spurious Features in Medical Image Classification with Spatial Specificity. We rerun it with both a standard ViT and CRATE. Comparing the two CRATE runs, with and without head selection, measures how much the architecture alone helps (Gap 1 in the research file).
The strongest annotation-based competitor is the spatial-specificity method itself. Its full-mask upper bound is 0.82 robust AUROC on SIIM-ACR and 0.73 on ISIC. Bounding boxes reach 0.72 on SIIM-ACR, and the semi-supervised pixel-similarity variant uses 600 masks. We rerun its semi-supervised pixel-level similarity loss at every mask budget $m$ in our curve, with the same images, the same train/test splits, and a matched hyperparameter search budget. That gives a head-to-head comparison at equal annotation cost. Beating it means exceeding its robust AUROC at every $m \le 100$ and reaching 0.75 or more by $m = 50$, close to its full-mask number.
The strongest annotation-free competitor is SpurCon: Weighted Supervised Contrastive Learning for Mitigating Spurious Cues in Medical Imaging. It trains a contrastive head on frozen BiomedCLIP features, pairing images of the same patient with and without the artifact. It reports 73.0% worst-group accuracy on CheXpert pneumothorax with support devices, against a 35.6% baseline, and 65.0% on ISIC 2020 rulers. We run it on the same CheXpert worst-group split with patient IDs available, as SpurCon requires. We also run a version with patient IDs withheld, since our method does not need them.
For dermoscopy we also include MaskMedPaint: Masked Medical Image Inpainting with Diffusion Models for Mitigation of Spurious Correlations. It repaints image backgrounds with a diffusion model to break the shortcut and reports 34.4% broken-shortcut accuracy on ISIC 2018, against a 14.6% baseline. We give MaskMedPaint the same $m$ lesion masks, restricting its inpainting to those $m$ images, as well as its full-mask setting.
The key ablation applies the same head-scoring and head-restriction recipe to a standard supervised ViT of matched size. That ViT is trained on the same CheXpert labels, and we use its per-head attention-weighted value outputs in place of CRATE's subspace projections. If the ViT matches CRATE, the white-box structure is not the active ingredient, and the contribution reduces to "pick heads with a few masks." Smaller ablations remove the Support Devices training label and replace mask-based head selection with random selection of the same number of heads.
Why not just…?
Why not just use the 600-mask semi-supervised method, or a few more masks? This is the most serious alternative. It is the exact comparison our mask-budget curve is built to settle. If the pixel-level similarity loss with a standard backbone matches us at 25 to 50 masks, then architecture buys nothing over annotation, and we would say so. Our expectation of an advantage rests on a structural difference. A loss-based method must learn spatial focus from the masks it is given. Our method only has to choose among a few dozen heads, which is a far smaller selection problem. Still, how many masks the baseline needs at small budgets has not been reported, so this is an open empirical question.
Why not just crop to the lung field with an off-the-shelf lung segmenter, as Graf et al. do? Pneumothorax and chest tube classification on chest x-rays for detection of missed pneumothorax crops to the lung field and ensembles three classifiers. Its AUC falls only from 0.958 overall to 0.948 on tube-free images. However, chest tubes run through the lung field, so cropping cannot remove them. That pipeline also needs several separately trained networks. We include lung-cropped ERM as an extra baseline on the SIIM-ACR inverted split. If it matches us there, the honest conclusion is that a coarse anatomical prior suffices for chest X-rays. Dermoscopy would then become the test case, because rulers can lie next to lesions.
Why not just use SpurCon on a frozen foundation model? Its 73.0% worst-group accuracy on CheXpert is a strong number, and we may not beat it when patient IDs are available. Its stated dependence on repeated same-patient acquisitions is the gap. We would report both regimes. A useful result here is matching SpurCon without patient IDs, or exceeding it once IDs are withheld. Beating it in the setting where it has everything it needs is not required.
Why not just read attention maps or Grad-CAM from an ordinary network? Saliency maps agree poorly with expert regions (Benchmarking saliency methods for chest X-ray interpretation; Agreement Between Saliency Maps and Human-Labeled Regions of Interest: Applications to Skin Disease Classification). Standard ViT heads segment worse than CRATE's on natural images (14.1 vs 23.9 mIoU). The ViT head-selection ablation tests this alternative directly.
Proposed Experiments
Pre-training uses CheXpert with all 14 labels for chest X-rays, and ISIC for dermoscopy. Evaluation has three parts. The first is robust AUROC on the SIIM-ACR inverted-tube split, following the spatial-specificity protocol. The second is worst-group accuracy on CheXpert, with groups defined by pneumothorax crossed with support devices, following SpurCon. The third is broken-shortcut accuracy on ISIC 2018 and worst-group accuracy on ISIC 2020. All methods share data, splits, and a fixed number of tuning trials, and we report three seeds.
Three results decide the question. The first is the mask-budget curve against the pixel-similarity baseline at equal $m$. The second is the gap between CRATE and the standard ViT under identical head selection. The third is whether pathology heads predict tube presence at near chance and stay stable when tube pixels are inpainted away. The claim survives only if CRATE beats the ViT ablation and matches or beats the pixel-similarity baseline at 50 masks or fewer. If device and pathology scores remain correlated across heads even with the Support Devices label, we will report that emergent segmentation inherits the shortcut. That would be a useful negative result for white-box design, which has so far been evaluated only on natural images.
References
- Reducing Reliance on Spurious Features in Medical Image Classification with Spatial Specificity
- Emergence of Segmentation with Minimalistic White-Box Transformers
- CheXpert: A Large Chest Radiograph Dataset with Uncertainty Labels and Expert Comparison
- MIMM-X: Disentangling Spurious Correlations for Medical Image Analysis
- Benchmarking saliency methods for chest X-ray interpretation
- SpurCon: Weighted Supervised Contrastive Learning for Mitigating Spurious Cues in Medical Imaging
- MaskMedPaint: Masked Medical Image Inpainting with Diffusion Models for Mitigation of Spurious Correlations
- Pneumothorax and chest tube classification on chest x-rays for detection of missed pneumothorax
- Agreement Between Saliency Maps and Human-Labeled Regions of Interest: Applications to Skin Disease Classification