Cycle Context Verification for In-Context Medical Image Segmentation

Shishuai Hu, Zehui Liao, Liangli Zhen, Huazhu Fu, Yong Xia

TL;DR

This paper introduces Cycle Context Verification (CCV), a novel framework that enhances in-context learning (ICL) for medical image segmentation. CCV uses a cyclic self-verification process and a learnable query-specific prompt to improve the alignment between query images and their context, leading to more robust segmentation, especially in low-data scenarios.

What Problem Does This Paper Address?

Universal medical image segmentation aims to segment various anatomical structures across different imaging modalities using a single model. In-context learning (ICL) has emerged as a promising approach for this, leveraging example image-mask pairs (in-context pairs) to guide segmentation. However, ICL's performance is highly sensitive to the quality of these in-context pairs. In medical imaging, obtaining sufficient, well-aligned in-context pairs is challenging due to data scarcity and the risk of catastrophic forgetting if models are fine-tuned. This paper addresses the problem of improving ICL-based medical image segmentation performance when dealing with limited and potentially suboptimal in-context data, without requiring extensive fine-tuning.

Methods

The core of the proposed method is the Cycle Context Verification (CCV) framework. It operates in a cyclic manner during inference:

  1. Initial Prediction: The ICL model generates an initial segmentation mask for the query image using provided in-context pairs.
  2. Self-Verification: The roles of the query and an in-context pair are swapped. The original query image and its predicted mask become a new in-context pair, and an original in-context image becomes the new query. The model then predicts a mask for this new query.
  3. Accuracy Estimation: The accuracy of this secondary prediction (using the ground truth of the original in-context image) serves as an indirect measure of the reliability of the initial query prediction.
  4. Query-Specific Prompt Optimization: A learnable, spatially aligned prompt is introduced and added to the query image. This prompt is iteratively optimized to maximize the accuracy measured in the self-verification step. This prompt aims to enhance the alignment between the query and in-context images.
  5. Final Prediction: Once the prompt is optimized, the enhanced query image and the original in-context pairs are used to generate the final segmentation mask.

This approach avoids direct model fine-tuning and instead focuses on optimizing a query-specific prompt to improve context alignment.

Datasets

The paper evaluates CCV on seven medical image segmentation datasets:

  • BreastUS (BUS)
  • COVID-QU-Ex (CQE)
  • GlaS (GLS)
  • NeoPolyp (NPP)
  • OCT-CMЕ (OCT)
  • REFUGE (ROC and ROD)
  • UWaterlooSkin-Cancer (USC)

These datasets cover eight tasks across seven medical imaging modalities. The datasets were partitioned into 3:1:1 for test, validation, and candidate in-context samples, respectively. Notably, these datasets were not included in the training sets of the ICL backbones used.

Key Insights and Ideas

  • Self-Verification as a Proxy for Alignment: The core idea that a model can implicitly assess the quality of its initial prediction by attempting to segment an original in-context image (now treated as a query) is a clever way to leverage available ground truth without explicit supervision for the prompt optimization.
  • Query-Specific Prompts are Crucial: The paper emphasizes that learning a prompt tailored to each individual query image, rather than a single prompt for the entire dataset, significantly improves performance, especially in low-data scenarios.
  • Complementarity of CCV and Existing Methods: CCV is designed to be plug-and-play, enhancing the performance of existing context selection methods (like VPR and DualSC) and even complementing other prompt-based methods (like InMeMo).
  • Iterative Refinement of Context: The cyclic nature allows for iterative refinement of the query representation through the prompt, leading to better adaptation to the specific in-context examples.

Key Results

  • Improved Segmentation Performance: CCV consistently improved the segmentation performance (measured by Dice Similarity Coefficient - DSC) across various baseline methods (RS, VPR, DualSC, InMeMo) when used with two ICL backbones (UniverSeg and SegGPT).
  • Outperforming Baselines: CCV-equipped methods generally outperformed their non-CCV counterparts, with significant gains observed on several datasets. For example, with UniverSeg, RS+CCV achieved better results than InMeMo.
  • Effectiveness in Limited Context: Ablation studies showed that both the cycle ICL pipeline and the query-specific prompt optimization are essential for the method's success, particularly in limited context scenarios.
  • Qualitative Improvements: Visualizations demonstrated that the learned prompts effectively alter the query image, leading to markedly improved segmentation results compared to original predictions.

Limitations and Future Work

  • Computational Cost: While avoiding full model fine-tuning, the iterative prompt optimization at test time still adds computational overhead. The paper mentions an accuracy threshold and iteration limit to manage this.
  • Generalizability of Prompt Design: The paper focuses on image prompts. Future work could explore other forms of prompts or more sophisticated prompt optimization strategies.
  • Further Exploration of Context Selection: While CCV enhances existing context selection methods, further research could explore how CCV might inform or be integrated with advanced context selection strategies.
  • Broader Modality and Task Coverage: While tested on seven datasets, extending CCV to a wider range of medical imaging modalities and segmentation tasks would be valuable.

Summary updated

BibTeX
@inproceedings{hu2025cycle,
  author = {Shishuai Hu and Zehui Liao and Liangli Zhen and Huazhu Fu and Yong Xia},
  title = {{Cycle Context Verification for In-Context Medical Image Segmentation}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2025},
  doi = {10.1007/978-3-032-04927-8\_14},
}
Figure