Feature-Space Bias Fields: Test-Time Correction of Spatially Varying Shift in 3D Scans

A segmentation network trained on one kind of 3D scan often fails on another. Diagnostic CT versus the cone-beam CT (CBCT) used during interventions is a common case, as is one MRI scanner vendor versus another. The usual story is that the shift is "non-linear" and needs a heavy fix: adversarial co-training with source data, or new adapter layers trained on target labels. This proposal tests a narrower and cheaper hypothesis. Much of the non-linearity in volumetric scanner shift comes from the fact that the distortion varies smoothly across space, while at any given location it is close to a simple per-channel rescale and offset of the network's internal features. CBCT scatter, beam hardening, a truncated field of view and pooled contrast agent all corrupt the volume in spatially structured ways. A single global correction cannot represent that, but a smooth 3D field of local corrections can.

We propose to estimate such a field inside the network's early 3D feature maps at test time, from one incoming volume, using forward passes and closed-form updates only. The method borrows the logic of classical MRI bias-field correction, which jointly assigns voxels to tissue classes and fits a smooth multiplicative intensity field. Here that is lifted from raw intensities into deep features. If the hypothesis holds, a frozen 3D model should recover a large share of the gap that currently needs offline adaptation, at a fraction of the memory cost of gradient-based test-time adaptation. If it fails, the experiments show where it fails: shifts that are not smooth in space, such as the "context shift" of objects crammed into cluttered surroundings.

Core Claim

Two directions meet here: non-linear domain shift, and the 3D spatial context of volumes. Each has a clear hole at the point where they meet.

Progressive Embedding Alignment (PEA) corrects test features without backpropagation. It matches their mean and covariance to source statistics with a whitening-coloring transform, which is the method we build on. That transform is global, so it assumes the whole shift reduces to one set of first- and second-order moments. BFTT3D does backprop-free test-time adaptation in 3D. It works on point-cloud classification and bridges domains through a linear subspace (Transfer Component Analysis). Neither handles dense voxel grids, and neither lets the correction vary with position.

On the volumetric side, Unsupervised Adaptation of 3D CT Foundation Models for 3D CBCT Segmentation closes most of the CT→CBCT liver gap. It does so with offline, redundancy-reducing adversarial training that needs source and target volumes together, and it aligns only at a single deep representation head. SpotTUnet found that scanner shift hits early encoder blocks far harder than decoder blocks. That tells us where a correction should sit, but SpotTUnet needs target labels and works on 2D slices.

Our claim is that a spatially smooth, locally affine correction of early 3D encoder features captures most of the scanner-induced shift. The correction is anchored to class-conditional source statistics and estimated per volume without gradients. Such a correction is non-linear as a whole, because it differs from place to place, yet it stays solvable in closed form.

Concretely, let $z_t(x) \in \mathbb{R}^C$ be the target feature vector at 3D physical location $x$ in a chosen encoder layer. The source features at that layer are summarized by a $K$-component Gaussian mixture with means $\mu_k$ and covariances $\Sigma_k$, stored once from source data. The components act roughly as tissue types. We model

$$ z_t(x) \approx a(x) \odot z_s(x) + b(x), \qquad a, b \in \text{span}\{\phi_j(x)\}_{j=1}^{J}, $$

where $\odot$ is per-channel multiplication and $\phi_j$ are $J$ smooth 3D B-spline basis functions laid out on a coarse control grid in millimetres. Working in millimetres makes anisotropic voxel spacing and differing slice thickness enter naturally.

Estimation alternates two steps. First, voxels are softly assigned to source components using the current corrected features $\hat z(x) = (z_t(x) - b(x)) \oslash a(x)$. Second, the spline coefficients of $a$ and $b$ are re-solved by weighted least squares plus a smoothness penalty. Each step is closed form. The corrected features are then passed through the rest of the frozen network.

When the control grid shrinks to a single point, the method reduces to a global, class-conditional version of PEA's whitening-coloring transform. That reduction is the ablation that isolates the spatial ingredient.

Research Program

The first stage is diagnostic and could falsify the premise before any method is tuned. The Pancreatic-CT-CBCT-SEG benchmark used by Miralles et al. contains the same patients under both modalities. Where CT and CBCT of one patient can be registered, we run a frozen source encoder on both. We then fit three "oracle" maps from CT features to CBCT features, layer by layer: a global affine map, our smooth-field affine map at several grid resolutions, and an unconstrained small MLP. We measure the fraction of feature discrepancy each map explains.

The hypothesis predicts two things. The smooth field should explain nearly as much as the MLP, and clearly more than the global map. And the advantage should be largest in early encoder layers, consistent with SpotTUnet's finding and with the depth-dependent non-linearity reported by Kim et al. and Klimaszewski et al.. If a global map already explains nearly everything, the project reduces to "apply PEA in 3D", and we would report that instead.

The second stage builds the test-time procedure for two frozen backbones. One is a 3D U-Net in the style of 3D U-Net. The other is a 3D transformer segmenter such as SegVol, or VISTA-3D as used by Miralles et al. The design choices to settle are which layers receive a field (guided by the stage-one diagnostic), the number of mixture components, the control-grid spacing in millimetres, and whether $a$ is diagonal or a low-rank full matrix. All of these are fixed on a held-out source-like validation split, never on target labels.

A single volume supplies millions of early-layer feature vectors. That makes the estimate of a coarse field with a few hundred coefficients per channel well-posed even without batching across patients. It is the reason we expect per-volume estimation to be stable, where per-image covariance estimation in 2D would not be.

The third stage checks the claim's boundaries. It covers different kinds of shift (CT→CBCT, MRI vendor and field strength, CT→MRI) and a shift the model should not fix: the BugNIST context shift.

Baselines

The naive reference is the frozen source model applied directly. On the radiation-therapy CT→CBCT liver benchmark (Pancreatic-CT-CBCT-SEG with LiTS as source), Miralles et al. report 80.0 F1 for zero-shot VISTA-3D. On AMOS22 CT→MRI zero-shot transfer, nnU-Net reaches 10.9% Dice and MA-SAM 60.4% Dice. For CC359 cross-scanner transfer, no reported result found on Lacuna for a numeric source-only Dice, so we measure it ourselves across all 30 source-target pairs.

The strongest competitor in our own regime is PEA's global whitening-coloring transform, re-implemented on 3D feature maps at the same layers as our fields. We also run a class-conditional global variant, which is exactly our method with a one-point control grid. It is the most dangerous rival because it uses the same statistics, the same forward-pass budget and the same frozen weights; it lacks only the spatial variation. Beating it means a statistically reliable Dice gain across patients, together with a reduction in 95th-percentile Hausdorff distance on CBCT volumes, where artifacts are spatially concentrated. We regard at least half of the gap between the two methods' Dice, measured against the supervised target bound, as a meaningful win.

The strongest existing method overall is the offline unsupervised adaptation of Miralles et al. They report 90.0 F1 with VISTA-3D, against a target-only supervised bound of 91.4 F1. That method sees target volumes during training and needs source data, so we treat it as a ceiling for label-free adaptation rather than a like-for-like rival. Our goal is to recover most of the 80.0→90.0 gap without training. We will report where we land between 80.0 and 90.0 on the same split and backbone.

Two further baselines complete the set. The first is classical histogram matching applied to input volumes. The second is a gradient-based entropy-minimization test-time adapter, in the Tent family discussed by PEA and BFTT3D, run with the same number of passes per volume. For it we report memory and latency alongside accuracy, since PEA documents Tent/EATA needing more than 6,100 MB versus 887 MB for PEA even in 2D.

Every method uses identical preprocessing, the same backbone checkpoint and the same sliding-window settings. Hyperparameters for every method are tuned on the same source-side validation data with the same trial budget.

Three ablations isolate the ingredients:

  • a per-slice 2D field, which removes smoothness along the depth axis and tests whether volumetric continuity matters;
  • a single mixture component, which removes class conditioning and tests whether we are merely instance-normalizing away anatomy;
  • a field at deep layers only, mimicking alignment at a single bottleneck.

Why not just…?

Why not just apply PEA's global whitening-coloring transform to the 3D features? This is the real threat. PEA already works backprop-free with tiny memory, and if scanner shift is mostly global, a spatial field adds nothing. Our method contains the global transform as a special case, so the one-point-grid ablation and the stage-one oracle diagnostic settle the question directly. If spatial fields do not beat it on CBCT, where scatter and truncation are visibly localized, we will conclude the spatial hypothesis is wrong for that shift.

Why not just histogram-match the input volumes? SpotTUnet compared this on CC359 across 30 scanner pairs and found it less effective than learned layer adaptation. A global intensity remap also cannot undo scatter or contrast pooling, whose effect depends on location and neighbouring tissue. We include it anyway because it costs nothing, and because if our method's gains over it are small on MRI vendor shift but large on CBCT, that pattern itself supports the claim that spatial structure is what matters.

Why not just run the offline unsupervised adaptation of Miralles et al.? When a site can collect a target cohort and retrain with source data, it may well win; its 90.0 F1 is our ceiling. Our method answers a different deployment question. What can be recovered per incoming volume, with no retraining, no source images at the site (only stored moments), and no target cohort? We will report the fraction of that method's gain we recover. If we recover little, the offline method is the right tool.

Why not just use gradient-based test-time adaptation? On dense 3D volumes, the memory cost PEA documents in 2D grows further. BFTT3D and PEA both report error accumulation and forgetting under continual updating. We will measure all three, accuracy, peak memory and drift over a stream of volumes, on the same stream. We concede the comparison if gradient adaptation is both more accurate and stable.

Proposed Experiments

The decisive experiment is on the radiation-therapy CT→CBCT liver benchmark. We compare source-only, global PEA, class-conditional global, 2D per-slice field, and full 3D field, reporting Dice/F1, 95th-percentile Hausdorff distance, and a slice-to-slice consistency score on sagittal and coronal reformats. The consistency score probes the staircase artifacts that Choo et al. documented for slice-wise processing. Where the benchmark labels structures beyond the liver, we report them separately, since Miralles et al. leave small structures untested. We also correlate per-patient gains with the spatial variance of the fitted field: if gains come from the field, patients with more non-uniform fields should improve more.

Replication covers two further settings: all 30 vendor and field-strength pairs of CC359 with a native 3D U-Net, which also tests whether SpotTUnet's encoder-first vulnerability holds in 3D, and AMOS22 CT→MRI against the 60.4% Dice MA-SAM zero-shot figure. CT→MRI changes tissue contrast ordering, not just intensity scale, so we expect partial success at best. That makes it a useful stress test of how far "locally affine" stretches.

Finally, BugNIST is a planned negative control. Its context shift arises from touching objects and clutter, not from a smooth acquisition field, and its authors observe that classification collapses while localization degrades only moderately. Our hypothesis predicts little benefit there. A large gain would mean we have misunderstood what the field is correcting. A null result, alongside CBCT gains, would scope the claim cleanly: smooth feature-space fields fix acquisition physics, not scene composition.

Across all settings we report peak GPU memory and wall-clock time per volume next to accuracy, because the case for this method rests on doing most of the work of offline adaptation at close to inference cost.