Manuscript Offprint

arXiv:2611.22995

CAST: Calibrating Correspondences for Training-Free Biomedical In-Context Segmentation

Mingze Jiang, Jiashu Han, Haonan Chen, Zhiyi Li, Yilun Du, Kunzan Liu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Biomedical image segmentation must keep up with new anatomical structures, subjects, imaging modalities, and acquisition protocols, yet dense expert annotations are scarce and models trained on one cohort often struggle to transfer. In-context segmentation (ICS) offers a way out: a new structure is specified by a few annotated exemplars at inference time. However, reliable correspondence remains challenging in biomedical images, where adjacent structures often share similar appearances, and variations across subjects and imaging conditions further obscure their distinctions. We introduce CAST, a training-free framework built on a frozen DINOv3 backbone to calibrate fine-grained correspondences. Its stability test improves feature reliability at both global and patch-specific levels, while its coherence test assesses whether candidate correspondences are supported by consistent local structural context. Together, these tests enable more reliable correspondence across diverse anatomical structures and imaging conditions. Across eight biomedical benchmarks spanning 2D and 3D segmentation, cross-subject, and cross-modality transfer, CAST outperforms the strongest overall baseline by 12.34 percentage points in Dice and ranks first across all six volumetric settings. The versatility of CAST further opens up opportunities for challenging biomedical applications, including 2D-to-3D segmentation and atlas label transfer.

1 Introduction

Biomedical image segmentation has become remarkably accurate and remarkably brittle. Task-specific models encode anatomical priors and domain expertise [13, 36], but models trained on a limited source cohort can struggle with shifts in scanners, acquisition protocols, patient populations, and imaging modalities [43, 9, 25]. Extending these models to new settings often requires dense expert annotations and retraining, which are costly and, for many specialized biomedical tasks, difficult to obtain. The field needs segmentation that adapts as fast as the data changes.

In-context segmentation (ICS) offers that adaptability by specifying the task rather than training for it: a few annotated exemplars presented at inference time define what to segment in a new image. The paradigm has shown strong potential in natural images [35, 34] and has inspired exemplar- and context-conditioned approaches in medical imaging [1, 27, 6]. Recent advances in vision foundation models have further expanded its potential. By leveraging the transferable representations of frozen self-supervised vision transformers [2, 23, 29], training-free methods [3, 12, 26] have demonstrated promising results through direct feature correspondence, without task-specific optimization. This offers a flexible route to segmenting previously unseen structures, but places a premium on reliable matching between exemplar and query patches in the frozen feature space.

We argue that this matching problem is particularly challenging in biomedical images. In many natural-image settings, target objects exhibit clear appearance differences from non-target regions. Biomedical images, however, often contain multiple adjacent anatomical structures that share tissue appearance, intensity, and texture, with boundaries defined by anatomical organization rather than pronounced visual transitions, as illustrated in Fig. 2. The most challenging non-target regions in biomedical images are often other anatomical structures. We expect two consequences in frozen feature space. First, subtle distinctions between neighboring structures can be obscured by variations induced by geometry, subject, and acquisition, allowing visually similar but anatomically incorrect patches to rank above the correct correspondences. Second, non-target surroundings are not merely regions to be rejected, but structured anatomy that provides additional evidence for distinguishing visually similar targets. Consequently, center-level appearance similarity alone is insufficient for reliable anatomical correspondence.

If appearance alone cannot be trusted, reliable correspondences must draw on evidence beyond individual patch similarity. Our observation is that annotated exemplars provide two complementary sources of such evidence: the stability of visual features under geometric changes and the spatial organization of labeled anatomy. We introduce CAST, a training-free framework that brings these sources together through two tests. The stability test accounts for feature variations under geometric transformations, while the coherence test examines whether candidate matches are consistent with their surrounding anatomical context. By combining these complementary cues, CAST establishes more reliable correspondences between exemplars and query images, supporting segmentation across diverse anatomical structures and imaging conditions. Built upon the transferable representations of a frozen DINOv3 backbone [29], CAST requires no additional training or gradient-based adaptation.

Figure

Figure 2: Comparison of DINOv3 feature similarity between natural and biomedical images. Similarity maps are obtained by computing cosine similarities between query patch features and annotated target features from the source image. Natural images exhibit clear similarity contrast between foreground and background, whereas biomedical images show similar responses across neighboring anatomical structures. Green contours indicate source annotations.

We evaluate CAST on eight biomedical benchmarks spanning 2D and 3D segmentation, cross-subject, and cross-modality transfer. CAST achieves the highest overall performance, exceeding the strongest baseline by 12.34 percentage points in Dice and ranking first across all six volumetric settings. We further explore atlas label transfer, an important step toward bringing standardized anatomical knowledge to specimen-specific imaging. CAST maintains promising performance in this challenging setting, highlighting its potential for adapting to diverse biomedical imaging scenarios.

Figure

Figure 3: Overview of CAST. Given an annotated source image, its mask, and an unlabeled query image, CAST calibrates and refines source–query patch correspondences through two complementary tests. The stability test characterizes feature variations induced by geometric transformations, providing global debiasing before candidate retrieval and patch-specific metrics for subsequent reranking. The coherence test evaluates retrieved candidates through neighborhood feature contrast and target–non-target layout consistency. Within the correspondence refinement framework, globally debiased features guide class-conditional candidate retrieval, after which source-specific metrics and neighborhood evidence jointly rerank the candidates. The top-NtopN_{\mathrm{top}} candidates from each class are then aggregated through voting to produce the final segmentation.

References (33)