Surplus and Deficit Maps: Unbalanced Transport to a Normal-Anatomy Reference for Radiological Mimics

Many chest diseases look alike on an X-ray. Silicosis and tuberculosis can be nearly indistinguishable. Viral and bacterial pneumonia both appear as hazy opacities. Underneath all of these sits the same ribs, heart and lung fields, and that shared anatomy dominates what an image model learns, so distinct diseases end up close together in its feature space. This proposal does not ask the network to learn the disease signal directly. Instead it computes, for every image, what is left over after explaining that image with healthy anatomy. We do this with unbalanced optimal transport, a way of matching two collections of features that may leave some mass unmatched at a price. The image's patch features are matched to patch features pooled from healthy radiographs. Mass that matches cheaply is shared anatomy. Mass the solver chooses to discard on the image side is a surplus (something present that normal lungs do not have enough of). Mass discarded on the healthy side is a deficit (normal tissue that is missing or replaced).

The key point is that transport has a capacity budget, and nearest-neighbour comparison does not. A diffuse disease such as silicosis scatters many small nodules that each, individually, resemble some normal structure, for instance a vessel seen end-on. A per-patch "distance to the nearest healthy patch" score therefore stays low everywhere. A transport plan, however, cannot route a hundred nodule-like patches to the handful of vessel-like patches a normal lung contains. The excess must be discarded, and it shows up as surplus. Our claim is that this budgeted matching produces language-free, spatial, multi-scale deviation maps. Those maps separate radiological mimics better than per-patch novelty scores and better than balanced transport, and the gain should concentrate in diffuse rather than focal disease.

Core Claim and How It Differs From Prior Work

The closest prior work is OTCXR. It aligns dense chest X-ray feature maps across two augmented views of the same image using balanced transport, with the marginals (how much mass each patch carries) set by a cross-view attention module. It reports 68.8% AUC under 1% labels on NIH ChestX-ray14, against 67.7% for DenseCL. Its authors name sensitivity to those globally derived marginals as the main limitation for subtle or rare pathology.

Simply swapping OTCXR's solver for an unbalanced one is the obvious move, and it is not what we propose. In view-to-view alignment, discarded mass is just noise to be ignored. In our setup the transport runs from a patient's image to a healthy reference, and the discarded mass is the diagnostic output.

This inverts the role unbalanced transport plays in JUMBOT and ROOT. Both supply the core mechanism: a soft marginal penalty lets the solver throw away mass that would be costly to match. JUMBOT gains about 15% on average in partial domain adaptation on Office-Home. ROOT shows that discarded samples receive exponentially suppressed weights. Both treat discarded mass as contamination to remove, and both operate on flat sample sets rather than spatial feature maps. We treat the discarded mass as signal.

The decomposition goal is shared with semantically-guided feature decomposition, which splits chest X-ray features into an anatomy-invariant part and a disease-discriminative part. That work operates on pooled latent vectors and needs BioBERT text descriptors to shape the discriminative part, a dependence its authors flag as a weakness for poorly described findings. Our split is spatial and needs no text, only a pool of normal studies.

Research Program

Let $a \in \mathbb{R}^n_{+}$ be uniform mass over the $n$ patch features $x_i$ of a test image at one scale. Let $b \in \mathbb{R}^m_{+}$ be uniform mass over $m$ patch features $y_j$ drawn from $K$ retrieved healthy reference images. Let $P \in \mathbb{R}^{n \times m}_{+}$ be the transport plan. We solve

$$\min_{P \ge 0} \sum_{i,j} P_{ij}\big(\|x_i - y_j\|^2 + \beta\,\|p_i - q_j\|^2\big) + \tau\,\mathrm{KL}(P\mathbf{1}\,\|\,a) + \tau\,\mathrm{KL}(P^\top\mathbf{1}\,\|\,b).$$

Here $p_i$ and $q_j$ are normalized anatomical positions (after lung-field registration), $\beta$ trades local texture against global anatomical placement, and $\tau$ is the price of leaving mass unmatched. The surplus map is $s = \max(a - P\mathbf{1}, 0)$, read on the image grid. The deficit map is $d = \max(b - P^\top\mathbf{1}, 0)$, projected back onto image positions through the reference-to-image registration.

The parameter $\beta$ is where the local-global trade-off becomes an explicit, interpretable knob rather than an architectural choice. At $\beta = 0$, an apical nodule may be matched to a hilar vessel anywhere in the lung. At large $\beta$, matching is confined to the same anatomical neighbourhood, so global context constrains local evidence. This is a different handle on the same tension that SHIELD addresses by ensembling networks at 1024, 512 and 256 pixels, and that DualAttNet addresses by gating local anchor attention with global channel attention.

We solve the problem separately at the three resolutions SHIELD found useful. We use the majorization-minimization multiplicative updates of Chapel et al. rather than entropic Sinkhorn, because those updates yield sparse plans without the smoothing that would smear surplus across neighbouring patches. Batched on a GPU, they remain tractable at around $10^3$ patches per side. LARS-UOT, the same paper's exact path solver, scales roughly as $O(n^{3.27})$. We use it only offline, on subsampled images, to trace how surplus emerges as $\tau$ varies. That trace gives a principled way to pick $\tau$, which the JUMBOT authors identify as the method's main hyperparameter risk.

The reference pool comes from studies labelled "No finding", about 70% of the VinDr-CXR training set according to the dataset paper. References are retrieved per image by global-embedding similarity, so body habitus and projection roughly match.

The patch features come from a single frozen encoder shared by every method we compare. That encoder is a self-supervised model pretrained on NIH, retrained by us, since we cannot assume OTCXR weights are available. Because the transport cost depends on feature quality, a limitation ROOT also notes, we additionally report results with an ImageNet-initialized encoder.

The downstream classifier is deliberately small. It receives the original pooled feature plus surplus-weighted and deficit-weighted poolings of the patch features at each scale, together with the total surplus and total deficit per lung zone. This keeps the transport step as the only new ingredient. A secondary variant backpropagates through the unrolled solver to fine-tune the encoder, but the frozen version is the main test.

Baselines

The naive reference point is the same frozen encoder with global average pooling and a linear or small classifier, trained on the same labels. It shows how much any deviation-aware pooling adds.

The strongest published system on the mimicry problem is SHIELD. On the Rajasthan stone-worker dataset (Silicosis, Silicotuberculosis, TB, Normal) it reports 72% accuracy and an average AUC of 0.91 (SHIELD). This is the number to beat on that dataset. Our method has to exceed SHIELD's average AUC and, more tellingly, its per-class discrimination between Silicosis and TB, the confusion SHIELD's authors say persists. Because that dataset may not be public, we will request access. If access fails, we build an analogous four-way mimicry split from VinDr-CXR findings and say clearly that the SHIELD number is then not directly comparable.

For dense self-supervised features, OTCXR's 68.8% AUC at 1% labels on NIH is the reference. Our deviation pooling, built on an encoder trained with OTCXR's recipe, should add to it rather than replace it.

For localization, DualAttNet reports 0.116 mAP on VinDr-CXR, against 0.104 for CoT (DualAttNet). Our maps are weakly supervised, so we do not expect to beat a box-supervised detector on mAP. We compare against it to locate the gap. The fair comparison is against the attention maps of image-label-trained baselines, scored by pointing accuracy inside radiologist boxes.

The ablation that isolates the key ingredient, the mass budget, is a per-patch novelty score: each patch's distance to its nearest healthy reference patch under the identical cost, including the position term. We add a second variant that also includes a global "bag of patch types" histogram difference against the reference. Two further ablations complete the comparison. The first is balanced transport with a single slack "dustbin" row and column, in the style of RPM-Net. The second is entropic Sinkhorn unbalanced transport replacing the sparse solver.

Every method shares the encoder, the reference pool, the patient-level splits, and a hyperparameter search with an equal number of trials per method on a validation fold. Results are reported over five seeds with patient-level bootstrap intervals.

Why not just…?

Why not just score each patch by its distance to the nearest healthy patch? This is the most serious competitor because it is far cheaper. It fails by construction on our target case: diffuse excess of individually normal-looking texture, where every patch has a close healthy neighbour. The synthetic experiment below tests exactly this. If the nearest-neighbour score matches our method on real diffuse findings, the capacity argument is wrong for real data, and we will report that.

Why not just compare histograms of patch types against healthy lungs? This captures "too much of something" without solving a transport problem, and it is a real threat on classification. What it lacks is location: it says that surplus exists but not where. Our method should therefore beat it on localization and on findings defined by where they occur, such as upper-zone predominance. If the histogram variant ties us on both classification and pointing accuracy, the contribution reduces to an efficient implementation, and we will say so.

Why not just use balanced transport, as OTCXR does, perhaps with a dustbin? Balanced transport forces every unit of surplus mass onto some healthy patch, which spreads the abnormality signal across the plan. This is the forced-matching artifact that JUMBOT and ROOT measure in other domains (ROOT is 34% ahead of the balanced baseline OTDF). A single dustbin with one global price is close to our method. The comparison therefore tests whether separate soft penalties on the image side and the reference side, which give distinct surplus and deficit maps, matter beyond a single discard cost.

Why not just ensemble resolutions or add supervised attention? SHIELD and DualAttNet do exactly this and remain the numbers to beat. Their reported failures are diffuse interstitial patterns misread as TB, and small lesions respectively. Those are the cases where our per-scale surplus should help. The stratified analysis below checks whether that is where our gains actually fall.

Why not just guide features with text? Semantically-guided decomposition improves AUROC by 3–5% but depends on good descriptors. We include it on NIH where descriptors exist. We expect parity there, and an advantage only on findings with poor descriptions.

Proposed Experiments and Decisive Checks

The first decisive check is synthetic. Into held-out normal radiographs we paste many copies of genuine normal vessel-cross-section patches, at controlled density, into one lung zone. We also create focal insertions of the same patches. Per-patch novelty should detect neither condition well. Our surplus maps should detect the dense condition, with detection AUC rising with density, and should be flat for sparse focal insertions of normal texture. If they are not, the core claim fails.

The second check is on real data, stratified by morphology. On VinDr-CXR's 22 local findings we group labels into diffuse findings (for example infiltration, interstitial lung disease, pulmonary fibrosis) and focal findings (nodule or mass). We then measure the gain over the nearest-neighbour ablation for each group. The prediction is that the gain is concentrated in the diffuse group. A uniform gain would suggest that something other than the mass budget is responsible.

The third check is on the mimicry task itself, Rajasthan or its VinDr substitute. We report four-way AUC and accuracy against SHIELD's 0.91 and 72%, along with the Silicosis-versus-TB confusion entry.

The fourth check sweeps $\beta$ and $\tau$, using the LARS-UOT path, and asks two questions. Is there a stable middle range of $\tau$? And do intermediate values of $\beta$, which mix local texture with anatomical position, beat both extremes, as the local-global argument predicts?

Finally, NIH linear evaluation at 1% labels and SIIM-ACR pneumothorax Dice (OTCXR reports 0.586) check that adding deviation pooling never hurts general transfer.