Context Matters: Support Set Selection and Failure Detection for In-Context Medical Image Segmentation

Youssef Gehad, Emmanuel Zerefa, Krish Kabra, Guha Balakrishnan
8/5/2026
cs.CV

No confident code implementation found for this paper.

Abstract

In-context learning (ICL) adapts medical image segmentation models to unseen structures and modalities without retraining by conditioning on a task-specific support set of image-mask exemplars. Because this support set is the model's only task-specific signal, its composition directly influences segmentation performance.

Show full abstract

In this work, we investigate the support set as a controllable determinant of ICL reliability. First, we compare random sampling against similarity-based selection, where exemplars are retrieved based on their visual similarity to the query image. Second, we train a transformer-based classifier to predict, from the query and support images alone, whether a segmentation will fall below a specified Intersection-over-Union (IoU) threshold. Using MultiverSeg with DINOv3 embeddings across four benchmarks and three imaging modalities, we show that similarity-based selection consistently matches or outperforms random sampling, with the largest gains at the smallest support set sizes. Furthermore, our classifier predicts segmentation failure above chance on all four benchmarks. Ultimately, these results demonstrate that the reliability of in-context segmentation can be both improved via informed support selection and anticipated before use, providing practical mechanisms for safer clinical deployment.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gehad2026context,
  title  = {Context Matters: Support Set Selection and Failure Detection for In-Context Medical Image Segmentation},
  author = {Youssef Gehad and Emmanuel Zerefa and Krish Kabra and Guha Balakrishnan},
  year   = {2026},
  eprint = {2608.05333},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.05333v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.05333.svg)](https://codeofpaper.com/paper/2608.05333)

Discussion