Skip to content

ReSA: Preserving Reference-Specified Foreground in In-Context Segmentation

Dezhao Su, Bingxu Hou, Jingdi Lei, Lin Qian, Likai Wang, Yunyun Wan

cs.CVarXiv:2611.27341

Abstract

In-context segmentation uses annotated references to specify the target and its extent in a query image. Accurately transferring this reference-specified foreground requires recovering target regions while suppressing irrelevant predictions. We propose ReSA, a reference-guided framework that unifies query adaptation and mask selection through a shared reference kernel. ReSA leverages foreground and background reference prototypes to constrain prediction changes during adaptation and guide foreground selection through reference-weighted reconstruction. This shared guidance promotes consistent use of reference information across prediction refinement and mask formation. ReSA further selects among adapted predictions and aligns boundary refinement with the selected foreground threshold. We establish a theoretical bound connecting reference-response changes during adaptation and soft reconstruction. With a frozen visual encoder and lightweight test-time adaptation, ReSA requires no offline task training. Ablation studies demonstrate improved foreground retention and effective suppression of false-positive regions, while qualitative results show more complete masks with fewer isolated artifacts. Across ten object, part, and cross-domain segmentation benchmarks, ReSA achieves the highest average mIoU among the evaluated methods, reaching 62.6% in 1-shot and 71.8% in 5-shot.

Create a lesson