Deformation-Aligned Local Prototypes for Few-Shot Organ Segmentation

When a model must learn to segment a new organ from one or a few labeled scans, it usually summarizes the labeled organ as a "prototype", an average feature vector, and labels every pixel in a new scan by how similar it is to that average. This breaks down because one organ looks very different across its own extent and across patients. The liver dome does not resemble the liver hilum, and one patient's kidney is not shaped like another's. The best simple fix so far keeps many small prototypes, one per cell of a fixed spatial grid, and compares each pixel of the new scan only against the prototype from the same location in the labeled scan. That fix raises Dice on VISCERAL from 30.3% to 70.3% (A Location-Sensitive Local Prototype Network for Few-Shot Medical Image Segmentation). It also assumes that the same image coordinate holds the same anatomy in both patients, which fails when bodies differ in size, posture, or pathology.

This proposal makes the coordinate system bend. It estimates a smooth deformation that maps each point in the new (query) scan to its anatomical counterpart in the labeled (support) scan, then builds the local prototype around that mapped location instead of the fixed grid cell. The claim is specific. Much of the intra-class visual variance that defeats one-prototype models is variance across anatomical position. If anatomy is aligned, that variance can be factored out with almost no extra parameters, which matters when there are fewer than five labeled scans. The harder half of the claim is that a deformation-aligned feature match should beat simply warping the support label onto the query (classical atlas segmentation), especially where registration is imperfect. That comparison decides whether the idea is worth anything.

Core Claim

Two existing lines of work handle intra-class variance at this intersection in opposite ways. The first anchors local prototypes to position. The grid network does this rigidly, and its authors report sharp sensitivity to grid scale and trouble on small, low-contrast targets such as the psoas (A Location-Sensitive Local Prototype Network). The second throws position away. PAMI splits the support organ into 64 Voronoi sub-regions and uses attention to choose which ones match the query (Partition-A-Medical-Image). PMCR matches SVD-derived prototype sets by optimal transport (Prototype Correlation Matching and Class-Relation Reasoning). MSFSeg fuses multiple supports through intersection- and union-like surrogates (Few-Shot 3D Volumetric Segmentation with Multi-Surrogate Fusion). The research file found no work that keeps the positional anchoring and lets it deform continuously. The rigid grid already shows that position is worth about 40 Dice points over a global prototype. We argue that its remaining failures come mostly from misalignment rather than from too few prototypes, and that a deformation of a few thousand parameters is a cheaper way to absorb patient-to-patient variance than a stack of debiasing transformers.

Concretely, let $f_S(y)$ and $f_Q(x)$ be encoder features at support location $y$ and query location $x$, let $m_S(y)\in\{0,1\}$ be the support mask, and let $\phi$ be the estimated query-to-support deformation. The foreground prototype for query pixel $x$ is a Gaussian-windowed masked average centred on the mapped point:

$$p_{\text{fg}}(x) = \frac{\sum_y G_\sigma(y-\phi(x))\, m_S(y)\, f_S(y)}{\sum_y G_\sigma(y-\phi(x))\, m_S(y)},$$

where $G_\sigma$ is a Gaussian of width $\sigma$. A background prototype $p_{\text{bg}}(x)$ is defined the same way with $1-m_S$. The pixel is labeled by comparing cosine similarities of $f_Q(x)$ to the two prototypes. Setting $\phi$ to the identity recovers a soft version of the rigid grid, and letting $\sigma$ grow without bound recovers the global prototype. The method therefore contains both prior designs as special cases, and the ablations can move along that axis directly. Because the background prototype is local too, the heterogeneous background (fat, bowel gas, bone) is broken into position-specific pieces without a separate clustering step. This is our answer to the background problem raised by the Tied Prototype Model and FGNet.

Research Program

The first stage is a diagnostic that can kill the project early. Using a frozen encoder pretrained with dense self-supervision in the style of DenseMP, we take labeled organs from the training scans of Abd-CT/SABS and VISCERAL. We register pairs of scans and decompose each organ's foreground feature variance into a part explained by registered anatomical position and a residual part. The same decomposition is done under identity alignment, which is the implicit assumption of the rigid grid. If registered position explains little more variance than raw coordinates, the deformation buys nothing and we stop.

The second stage builds the deformation estimator. The estimator is a small unsupervised registration network trained only on unlabeled scans from the training split, with an image-similarity loss and a smoothness penalty, and its output is restricted to an affine transform plus a coarse B-spline field. Keeping the deformation low-dimensional matters in the small-sample regime: it is the only component that sees query-support pairs at test time, and it never sees labels. The network also outputs a per-location confidence derived from residual image dissimilarity after warping. Where confidence is low, $\sigma$ is widened, so the prototype falls back smoothly toward a broader regional average instead of trusting a bad correspondence.

The third stage is episodic training on base organs, followed by evaluation on held-out organs under both standard protocols (base and novel classes appearing in training images, and novel classes excluded). The encoder, registration network, and window schedule are trained jointly with the deformation regularized to stay close to its pretrained solution. In the 5-shot setting, each support is registered to the query separately. The resulting prototypes are weighted by registration confidence, which is a principled replacement for MSFSeg's hand-designed surrogates.

Baselines

The naive reference point is a single global prototype from masked average pooling (vanilla PA-Net). DenseMP reports 31.86% mean Dice for it on Abd-CT, and the grid network's own ablation drops to 30.3% on VISCERAL. We rerun it on our encoder so that the gap reflects prototype design and not pretraining.

The most direct competitor is the rigid location-sensitive grid network (A Location-Sensitive Local Prototype Network). It reports 66.7% mean Dice on VISCERAL 1-way 1-shot (70.3% with 14 extra training classes) against 56.7% for SENet. It shares our inductive bias and differs only in the deformation, so beating it isolates the contribution. We will reimplement it with the same encoder, the same pretraining, and the same split of 65 training and 20 test scans, and tune its grid scale with the same budget we spend tuning $\sigma$.

The strongest location-free methods are PAMI and MSFSeg. PAMI reports 82.38% DSC on CHAOS and 77.69% on SABS. MSFSeg reports 77.14 Dice in 1-shot and 83.27 in 5-shot on Abdomen-CT under its unseen-class setting. PMCR reports 87.37% on Abdominal-MRI setting #1. These papers use different protocols and backbones, so their published numbers will be quoted, not compared head to head. We will rerun PAMI and MSFSeg under our protocol with matched encoders and episode counts. Beating them means a higher mean Dice on unseen organs at equal or lower inference memory, with the gain concentrated on small or displaced organs.

Two ablations isolate the key ingredient. The first sweeps the deformation from identity to affine to full B-spline. The second removes the confidence-adaptive window. The confidence-weighted 5-shot fusion is also compared against plain averaging of the per-support prototypes.

The most dangerous baseline is atlas label warping: register each support scan to the query with the same registration network and take the warped mask, majority-voted across supports in the 5-shot case. The research file reports no result for this on Lacuna for these benchmarks. We will run it with identical registration so that the only difference is whether the final decision uses feature similarity.

Why not just…?

Why not just warp the support label onto the query, as atlas segmentation does? This is a real threat. If registration is good, warping the label may match or beat any feature-based method, and our method would reduce to an expensive atlas. We have no evidence from the file either way. The proposal is designed so that the comparison is clean, using the same deformation, and we predict where each wins. Label warping should be competitive on large, consistently shaped organs. Feature matching should win at boundaries where registration residuals are large: organs that slide relative to neighbours, low-contrast kidneys and psoas, and anatomy displaced by synthetic mass effect. If label warping is within noise of our method everywhere, we will report that the positional gains in the grid network were really registration gains, which is itself a useful negative result.

Why not just let attention find matching sub-regions, as PAMI and MSFSeg do? Attention can learn correspondence without an explicit deformation, and PAMI's numbers are strong. Two costs remain. Learned correspondence from base-class episodes must transfer to novel organs. MSFSeg also notes heavy memory demands for dense 3D cross-attention. A smooth deformation, by contrast, is shared across all organs and carries no class-specific parameters. The matched-encoder reruns, broken down by organ size and by support-query mask overlap, will show whether explicit alignment helps beyond attention or merely matches it at lower cost.

Why not just append normalized coordinates to the features? This keeps a single network and adds position cheaply. It still uses absolute image coordinates, though, which is exactly the rigid assumption that fails when fields of view and body sizes differ. We include coordinate-augmented PA-Net as an extra baseline. If it closes most of the gap to the rigid grid, position matters but locality does not. If our deformation beats it under synthetic displacement, alignment matters.

Proposed Experiments

The main benchmarks are VISCERAL (1-way 1-shot, using the split of the grid paper), Abd-CT/SABS and CHAOS-MRI under both standard few-shot settings, and 1-shot and 5-shot evaluation. The metric is mean Dice per organ, with Hausdorff distance added to expose boundary errors that Dice hides.

Three checks are decisive. First, the variance diagnostic must show that registered position explains substantially more intra-organ feature variance than raw coordinates. Second, on VISCERAL our method must beat the rerun rigid grid, with the largest gains on kidneys and psoas, where that paper reported weakness. Third, the method must beat same-registration atlas label warping in a displacement stress test. In that test, query scans receive synthetic local expansions mimicking organomegaly or tumor mass effect at graded magnitudes. The expected pattern is that the rigid grid degrades fastest, label warping degrades with registration error, and confidence-adaptive feature matching degrades slowest.

We also stratify results by support-query mask overlap, using the below-40% regime highlighted by the grid paper, and report inference memory and time against MSFSeg. If the method wins only on clean anatomy and loses the stress test, the core claim is wrong and the paper reports that.