We propose a method to efficiently equip the Segment Anything Model (SAM) with the ability to generate regional captions. SAM presents strong generalizability to segment anything while is short for semantic understanding. By introducing a lightweight query-based feature mixer, we align the region-specific features with the embedding space of language models for later caption generation. As the number of trainable parameters is small (typically in the order of tens of millions), it costs less computation, less memory usage, and less communication bandwidth, resulting in both fast and scalable training. To address the scarcity problem of regional caption data, we propose to first pre-train our model on objection detection and segmentation tasks. We call this step weak supervision pretraining since the pre-training data only contains category names instead of full-sentence descriptions. The weak supervision pretraining allows us to leverage many publicly available object detection and segmentation datasets. We conduct extensive experiments to demonstrate the superiority of our method and validate each design choice. This work serves as a stepping stone towards scaling up regional captioning data and sheds light on exploring efficient ways to augment SAM with regional semantics. The project page, along with the associated code, can be accessed via https://xk-huang.github.io/segment-caption-anything/.
翻译:我们提出一种方法,高效赋予分割任意模型(SAM)生成区域描述的能力。SAM在分割任何物体方面展现出强大的泛化能力,但在语义理解方面存在不足。通过引入轻量级基于查询的特征混合器,我们将区域特定特征与语言模型的嵌入空间对齐,以便后续生成描述。由于可训练参数较少(通常数量级为数千万),该方法计算成本低、内存占用少、通信带宽需求小,从而实现了快速且可扩展的训练。为解决区域描述数据的稀缺性问题,我们提出先在目标检测和分割任务上预训练模型。我们将此步骤称为弱监督预训练,因为预训练数据仅包含类别名称,而非完整句子描述。弱监督预训练使我们能够利用许多公开的目标检测和分割数据集。我们通过大量实验证明了该方法的优越性,并验证了每个设计选择。这项工作为扩展区域描述数据规模奠定了基础,并为探索高效增强SAM区域语义能力提供了新思路。项目页面及相关代码可访问 https://xk-huang.github.io/segment-caption-anything/。