Scaling In-Context Segmentation with Hierarchical Supervision

T. Camaret Ndir, Marco Reisert, Robin T. Schirrmeister
4/14/2026
2 citations
cs.CV
transformer-attention

Official code: tidiane-camaret/ic_segmentation (0 stars, Jupyter Notebook, last commit 2026-04-21).

Abstract

In-context learning (ICL) enables medical image segmentation models to adapt to new anatomical structures from limited examples, reducing the clinical annotation burden. However, standard ICL methods typically rely on dense, global cross-attention, which scales poorly with image resolution.

Show full abstract

While recent approaches have introduced localized attention mechanisms, they often lack explicit supervision on the selection process, leading to redundant computation in non-informative regions. We propose PatchICL, a hierarchical framework that combines selective image patching with multi-level supervision. Our approach learns to actively identify and attend only to the most informative anatomical regions. Compared to UniverSeg, a strong global-attention baseline, PatchICL achieves competitive in-domain CT segmentation accuracy while reducing compute by 44\% at $512\times512$ resolution. On 35 out-of-domain datasets spanning diverse imaging modalities, PatchICL outperforms the baseline on 6 of 13 modality categories, with particular strength on modalities dominated by localized pathology such as OCT and dermoscopy. Training and evaluation code are available at https://github.com/tidiane-camaret/ic_segmentation

View on arXivView PDF

Code Implementations(1)

00Jupyter Notebook, HTMLNov 2, 20247 months ago

Similar Papers

Cite this paper

@article{ndir2026scaling,
  title  = {Scaling In-Context Segmentation with Hierarchical Supervision},
  author = {T. Camaret Ndir and Marco Reisert and Robin T. Schirrmeister},
  year   = {2026},
  eprint = {2604.12752},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.12752v2}
}

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/2604.12752.svg)](https://codeofpaper.com/paper/2604.12752)

Discussion