DC-SAM: In-Context Segment Anything in Images and Videos via Dual Consistency

In-context segmentation, also known as one-shot segmentation, aims to segment objects based on a single labeled example. While the Segment Anything Model (SAM) excels in interactive segmentation, it is not inherently designed for in-context tasks. To bridge this gap, we propose a new Dual Consistency SAM (DC-SAM), a prompt-tuning framework that adapts SAM and SAM2 for both image and video in-context segmentation. Instead of relying solely on pre-trained backbones, DC-SAM enhances the prompt encoder by generating high-quality visual prompts through feature fusion. Furthermore, we introduce a novel cycle-consistent cross-attention mechanism to enforce alignment between fused features and visual prompts, complemented by a dual-branch design incorporating discriminative positive and negative prompts. Additionally, we extend DC-SAM to the video domain via a novel mask-tube training strategy. To facilitate research, we curate the first In-Context Video Object Segmentation (IC-VOS) benchmark. Extensive experiments demonstrate that DC-SAM achieves state-of-the-art performance, yielding 55.5 mIoU (+1.4) on COCO-20$^{i}$i, 73.0 (+1.1) mIoU on PASCAL-5$^{i}$i, and a $\mathcal {J} { \& amp;} \mathcal{F}$J&F score of 71.52 on IC-VOS.

Authors

Institutions

Publication Details

Journal
IEEE Transactions on Pattern Analysis and Machine Intelligence
Published
2025-12-22
DOI
https://doi.org/10.1109/tpami.2025.3646919
Primary Topic
Visual Attention and Saliency Detection
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

DC-SAM: In-Context Segment Anything in Images and Videos via Dual Consistency

Pengfei Zhu, Mengshi Qi, Xiangtai Li, Lu Qi et al.
IEEE Transactions on Pattern Analysis and Machine Intelligence
Visual Attention and Saliency Detection
article

DC-SAM: In-Context Segment Anything in Images and Videos via Dual Consistency

Pengfei Zhu, Mengshi Qi, Xiangtai Li, Lu Qi, Ming-Hsuan Yang, Xiaoyang Bi, Huadong Ma
article en

Abstract

In-context segmentation, also known as one-shot segmentation, aims to segment objects based on a single labeled example. While the Segment Anything Model (SAM) excels in interactive segmentation, it is not inherently designed for in-context tasks. To bridge this gap, we propose a new Dual Consistency SAM (DC-SAM), a prompt-tuning framework that adapts SAM and SAM2 for both image and video in-context segmentation. Instead of relying solely on pre-trained backbones, DC-SAM enhances the prompt encoder by generating high-quality visual prompts through feature fusion. Furthermore, we introduce a novel cycle-consistent cross-attention mechanism to enforce alignment between fused features and visual prompts, complemented by a dual-branch design incorporating discriminative positive and negative prompts. Additionally, we extend DC-SAM to the video domain via a novel mask-tube training strategy. To facilitate research, we curate the first In-Context Video Object Segmentation (IC-VOS) benchmark. Extensive experiments demonstrate that DC-SAM achieves state-of-the-art performance, yielding 55.5 mIoU (+1.4) on COCO-20$^{i}$i, 73.0 (+1.1) mIoU on PASCAL-5$^{i}$i, and a $\mathcal {J} { \& amp;} \mathcal{F}$J&F score of 71.52 on IC-VOS.

IEEE Transactions on Pattern Analysis and Machine IntelligenceVol. 48(4)
Beijing University of Posts and Telecommunications (CN), University of California, Merced (US), Nanyang Technological University (SG)
Reduced inequalities
Openalex Percentile: Top 37%
Visual Attention and Saliency Detection
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

DC-SAM: In-Context Segment Anything in Images and Videos via Dual Consistency — Pengfei Zhu, Mengshi Qi, et al. · IEEE Transactions on Pattern Analysis and Machine Intelligence (2025) | TGRS Research Map | TGRS