arXiv:2504.12080cs.CV2025-04TPAMI被引 19

让SAM模型在少量样本下精准分割图像与视频中的物体。

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

  • 通过双一致性机制优化提示编码器,提升模型泛化能力。
  • 在COCO-20i和PASCAL-5i上分别达到55.5和73.0 mIoU,显著优于基线。
  • 首个视频领域in-context分割基准,适合视觉编辑与视频理解研究者。

给定单个标注样本,上下文分割旨在对对应物体进行分割。该设定在少样本学习中称为单样本分割,用于场景理解与图像/视频编辑等任务。尽管近期的Segment Anything Models在交互式分割上表现优异,但无法直接应用于上下文分割。本文提出基于提示调优的双一致性SAM(DC-SAM),适配SAM与SAM2以实现图像与视频的上下文分割。核心思路是通过高质量视觉提示增强提示编码器特征;生成掩码前融合SAM特征以对齐提示编码器;设计循环一致交叉注意力于融合特征与初始提示;采用判别性正负提示的双分支结构;并设计简单掩码管训练策略将双一致性方法引入掩码管。虽主要针对图像,但可无缝扩展至视频域。由于视频领域尚无上下文分割基准,我们手动构建首个基准——In-Context Video Object Segmentation(IC-VOS)。大量实验表明,本方法在COCO-20i上达55.5(+1.4)mIoU,PASCAL-5i上达73.0(+1.1)mIoU,IC-VOS上达71.52 J&F得分。代码与数据集已开源。

原文摘要 · Abstract (English)

Given a single labeled example, in-context segmentation aims to segment corresponding objects. This setting, known as one-shot segmentation in few-shot learning, explores the segmentation model's generalization ability and has been applied to various vision tasks, including scene understanding and image/video editing. While recent Segment Anything Models have achieved state-of-the-art results in interactive segmentation, these approaches are not directly applicable to in-context segmentation. In this work, we propose the Dual Consistency SAM (DC-SAM) method based on prompt-tuning to adapt SAM and SAM2 for in-context segmentation of both images and videos. Our key insights are to enhance the features of the SAM's prompt encoder in segmentation by providing high-quality visual prompts. When generating a mask prior, we fuse the SAM features to better align the prompt encoder. Then, we design a cycle-consistent cross-attention on fused features and initial visual prompts. Next, a dual-branch design is provided by using the discriminative positive and negative prompts in the prompt encoder. Furthermore, we design a simple mask-tube training strategy to adopt our proposed dual consistency method into the mask tube. Although the proposed DC-SAM is primarily designed for images, it can be seamlessly extended to the video domain with the support of SAM2. Given the absence of in-context segmentation in the video domain, we manually curate and construct the first benchmark from existing video segmentation datasets, named In-Context Video Object Segmentation (IC-VOS), to better assess the in-context capability of the model. Extensive experiments demonstrate that our method achieves 55.5 (+1.4) mIoU on COCO-20i, 73.0 (+1.1) mIoU on PASCAL-5i, and a J&F score of 71.52 on the proposed IC-VOS benchmark. Our source code and benchmark are available at https://github.com/zaplm/DC-SAM.

分割少样本视频分割SAM

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。