让ViT学会区分物体实例,提升检测与分割性能。
CoViT: Instance-Correspondence Contrastive Learning for Vision Transformer

- 通过几何引导的对比学习,利用注意力图生成实例掩码。
- 在多个任务中提升超2个AP点,无需额外解码器或标签。
- 适合需要实例级感知的视觉任务研究者使用。
视觉变压器(ViT)在语义理解上表现优异,但在区分物体实例方面表现不足(例如两只狗生成相同嵌入),限制了其在目标检测和实例分割等任务中的应用。本文提出对比视觉变压器(CoViT),一种通过几何引导对比学习注入实例感知能力的自监督学习框架。CoViT通过三元组机制协调ViT的注意力图与嵌入:(1) 注意力引导掩码:通过自适应阈值和形态学操作优化多头注意力,生成实例掩码,定位前景锚点;(2) 最难样本挖掘:对每个锚点计算成对嵌入相似度,选取同实例中最不相似的正样本(掩码内)、跨实例中最相似的负样本(掩码外),负样本搜索时屏蔽同实例区域。这些三元组驱动对比损失,同时压缩实例内方差、扩大实例间距离,促使ViT识别实例间的细微几何与外观差异。实验表明,以ViT为骨干时,CoViT在多个实例级感知任务中稳定提升超过2个AP点。尤为关键的是,CoViT无需额外解码器或标注,证明纯ViT可通过内在注意力先验与定向对比约束学习实例感知表示。代码与模型将公开。
原文摘要 · Abstract (English)
Vision Transformers (ViT) excel in semantic understanding but fail to discriminate between object instances (e.g., identical embeddings for two dogs), limiting their use in instance-level tasks such as object detection and instance segmentation. We propose Contrastive Vision Transformer (CoViT), a self-supervised learning framework that injects instance-awareness into ViT through geometry-guided contrastive learning. CoViT uniquely coordinates ViT's attention maps and embeddings by constructing triplets: (1) Attention-guided masking: Refine multi-head attention via adaptive thresholding and morphological operations to generate instance masks, identifying foreground anchors; (2) Hardest contrastive mining: For each anchor, computing pairwise embedding similarities to select the intra-instance hardest positive (least similar patch within its mask) and inter-instance hardest negative (most similar patch from other instances), with intra-instance regions masked during negative search. These triplets drive a contrastive loss that simultaneously compresses intra-instance variance and expands inter-instance margins, forcing ViT to discern subtle geometric and appearance differences between instances. CoViT consistently achieves stable performance gains of over 2 AP points across multiple instance-level perception tasks by using ViT as backbone architecture. Notably, CoViT requires no extra decoders or labels, demonstrating that a pure ViT can learn instance-aware representations via inherent attention priors and targeted contrastive constraints. Code and models will be released.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。