Retrieval-Augmented Correction for Generalist Medical Image Segmentation

Vincenzo Marcianò, Xiaoming Zhang, Michela Antonelli, Sebastien Ourselin, Maria A ZuluagaarXiv 2026 · arXiv

TL;DR

GRACE (Generalist Retrieval-Augmented Correction for Segmentation Errors) is a new framework that treats medical image segmentation refinement as a Retrieval-Augmented Generation (RAG) problem. By querying a knowledge base of verified cases for anatomical "exemplars," a single generalist model can correct structural errors across diverse organs and imaging modalities without needing anatomy-specific retraining.

What Problem Does This Paper Address?

Automated medical image segmentation is a cornerstone of modern clinical workflows, yet even state-of-the-art models frequently produce structural artifacts—like holes, disconnected components, or jagged boundaries—that require manual correction by radiologists.

Current automated correction methods generally fall into two camps:

  1. Hand-crafted rules: Fast but brittle and non-transferable across different anatomies.
  2. Anatomy-specific specialists: Deep learning models trained to learn the "prior" shape of a specific organ (e.g., just the liver).

The problem is scalability. Training a dedicated corrector for every single organ, lesion type, and imaging modality is impractical. The authors aim to bridge this gap with a generalist refiner that can handle multiple anatomies by looking up relevant "cheat sheets" (verified prior cases) at inference time.

Methods

The core innovation is the application of Retrieval-Augmented Generation (RAG) to the domain of 3D medical masks. The framework, illustrated in Figure 1, consists of three main components:

  1. Anatomy-Aware Knowledge Base ($\mathcal{K}$): A library of verified image-mask pairs. These are embedded into a high-dimensional space using a frozen multimodal encoder (MedGemma).
  2. Shape-Aware Retrieval: When a new "coarse" segmentation needs fixing, the system embeds it and searches the knowledge base for the most similar verified case. Crucially, the authors train a light projection head that aligns these embeddings specifically to prioritize shape similarity (measured by Dice score) rather than just general visual appearance.
  3. The Refiner ($\mathcal{R}_\theta$): A generalist model trained once on a diverse multi-organ corpus. It takes the corrupted mask, the original image, and the retrieved "exemplar" mask as inputs to produce a refined output.
Overview of the GRACE framework showing the retrieval process and the refiner interface.

The authors propose three architectural variants for the refiner:

  • GRACE-U: A deterministic pixel-space 3D U-Net (the fastest version).
  • GRACE-M: A deterministic latent-space refiner using a frozen mask autoencoder.
  • GRACE-M-D: A generative latent-space model using flow matching, which can produce multiple plausible refinements to estimate uncertainty.

Datasets

The study is impressively broad, utilizing 18 public datasets spanning CT, MRI, and Ultrasound:

  • Training Corpus: 15 datasets (including the Medical Segmentation Decathlon, AMOS22, and ACDC) covering 38 anatomical structures.
  • Held-out Evaluation: Three datasets never seen during refiner training or indexed in the initial knowledge base: ProstateX (MRI), CHAOS (CT/MRI), and LUMIERE (Brain tumor MRI).

Key Insights and Ideas

  • Retrieval as a Shape Prior: Instead of forcing the model to memorize the shape of every organ in its weights, the retrieved exemplar provides a spatial "template." Ablations showed that the retrieved mask contributes roughly 40% of the total performance gain at high corruption levels.
  • Emergent Temporal Memory: On the longitudinal LUMIERE dataset, the system exhibited a fascinating emergent behavior: as a patient’s visits were added to the knowledge base, the system naturally began retrieving that specific patient's own prior scans to guide the refinement of new scans, acting as an implicit temporal memory (see Figure 6).
  • Conservative Refinement: A major challenge for refiners is "doing no harm." GRACE is designed to be conservative; if the input mask is already high-quality (e.g., from a strong segmentor like TotalSegmentator), the refiner makes minimal changes, preserving the original details.
  • Semantic Hierarchy: The embedding space naturally organizes itself into anatomical clusters (e.g., abdominal organs vs. neurological structures), as shown in the dendrogram in Figure 2.
Figure 2: Semantic topology and latent anatomical hierarchy of the anatomy-aware knowledge base K. (Left) Similarity graph: A 3-nearest neighbour connectivity graph where edges denote a cosine similarity ≥0.9, illustrating strong intra-class cohesion. (Middle) Embedding space projected on a t-SNE vector space. (Right) Semantic hierarchical clustering: A dendrogram of class centroids computed via average linkage and cosine distance. The topological structure demonstrates that K intrinsically captures underlying anatomical relationships and modality-specific groupings (e.g., abdominal CT and neurological MR clusters).

Key Results

The authors tested GRACE against seven different "upstream" segmentors ranging from weak to strong:

  • Massive Gains for Weak Models: When refining a weak U-Net (starting DSC of 0.386), GRACE-U improved the Dice Similarity Coefficient (DSC) by a staggering +0.353.
  • Stability for Strong Models: For high-performing models like TotalSegmentator (starting DSC 0.932), GRACE maintained performance (0.000 change), proving it doesn't degrade already-good results.
  • Generalization: In held-out dataset transfers, GRACE-M improved brain tumor segmentations in the LUMIERE dataset by +0.079 DSC and reduced boundary errors (HD95) by 4.2mm.
  • Efficiency: The pixel-space variant (GRACE-U) is highly efficient, running in sub-second time per case on a standard NVIDIA A100 GPU.
Quantitative comparison of different refiner variants across weak, mid, and strong upstream segmentors.

Limitations and Future Work

  • Modality Gaps: While the model generalizes well between CT and MRI, transferring to completely different imaging physics (like Ultrasound) remains difficult. The authors noted that a refiner trained only on CT/MRI actually degraded performance on Ultrasound cardiac scans.
  • Knowledge Base Dependency: The system's "intelligence" is capped by the diversity of its knowledge base. If a patient has a rare pathology not represented in the library, the retrieved context will be weak.
  • Minimum Support Cases: Future research is needed to determine the minimum number of verified cases required to successfully "plug in" a new anatomical class into the knowledge base without retraining.

Summary updated

Abstract

Automated segmentation is routinely used as the first step in quantitative image-based clinical workflows, where predicted masks are subsequently reviewed and corrected by human operators. Automated correction of the residual structural errors is currently addressed one anatomy at a time, so the number of trained correctors scales with the number of segmentation targets. We present GRACE, a retrieval-augmented refiner that edits an input mask under context drawn from a shared knowledge base of verified prior cases. The refiner is trained once on a multi-organ corpus spanning compact organs, cavities, branching vessels, and tumour lesions. In the held-out dataset-transfer evaluation, three held-out datasets query a fixed knowledge base built from training data only. A separate leave-one-anatomy-out experiment tests parameter-free index extension: verified cases of an unseen solid organ enter the knowledge base, and the refiner stays frozen. A light shape-aware projection head on a frozen multimodal encoder maps embedding similarity to the shape agreement of the masks, so the knowledge base returns cases that the refiner can use as a shape prior. We evaluate GRACE on 18 public datasets spanning CT, MRI and ultrasound, using nine refinement configurations and seven upstream segmentors that span weak, mid, and strong operating regimes. We report each change with the DSC of its input mask. On the weak tier, the input DSC is 0.386 and GRACE adds up to +0.35 DSC. On a strong segmentor, the input DSC is 0.932 and the mean change is small. Transfer to an imaging modality that is absent from training and from the index is partial and depends on the anatomy, and remains an open research direction. Our results suggest retrieval-conditioned refinement is a practical alternative to anatomy-specific correction models. Code: https://github.com/robustml-eurecom/grace
BibTeX
@misc{marciano2026retrieval,
  author = {Vincenzo Marcianò and Xiaoming Zhang and Michela Antonelli and Sebastien Ourselin and Maria A Zuluaga},
  title = {{Retrieval-Augmented Correction for Generalist Medical Image Segmentation}},
  year = {2026},
  eprint = {2611.23189},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23189},
}
Figure