[论文解读] BatchFormerV2: Exploring Sample Relationships for Dense Representation Learning
BatchFormerV2 提出了一种即插即用的批量 Transformer 模块,通过在小批量样本之间建模关系,用于视觉 Transformer 的密集表示学习。采用双流训练策略,在训练过程中实现跨 patch 和图像的信息流动,且不增加推理成本,显著提升了基于 DETR 的模型在图像分类、目标检测和实例分割任务上的性能,准确率最高提升 1.3%。
Attention mechanisms have been very popular in deep neural networks, where the Transformer architecture has achieved great success in not only natural language processing but also visual recognition applications. Recently, a new Transformer module, applying on batch dimension rather than spatial/channel dimension, i.e., BatchFormer [18], has been introduced to explore sample relationships for overcoming data scarcity challenges. However, it only works with image-level representations for classification. In this paper, we devise a more general batch Transformer module, BatchFormerV2, which further enables exploring sample relationships for dense representation learning. Specifically, when applying the proposed module, it employs a two-stream pipeline during training, i.e., either with or without a BatchFormerV2 module, where the batchformer stream can be removed for testing. Therefore, the proposed method is a plug-and-play module and can be easily integrated into different vision Transformers without any extra inference cost. Without bells and whistles, we show the effectiveness of the proposed method for a variety of popular visual recognition tasks, including image classification and two important dense prediction tasks: object detection and panoptic segmentation. Particularly, BatchFormerV2 consistently improves current DETR-based detection methods (e.g., DETR, Deformable-DETR, Conditional DETR, and SMCA) by over 1.3%. Code will be made publicly available.
研究动机与目标
- 为解决当前视觉 Transformer 在训练过程中难以利用样本间关系的局限性,尤其是针对密集预测任务。
- 通过将批量注意力扩展至图像级之外的像素/patch 级表示,实现鲁棒的密集表示学习。
- 解决应用参数化批量注意力模块时带来的训练与测试不一致问题。
- 开发一种即插即用的模块,在不增加推理成本的前提下提升性能。
- 在多种视觉任务中验证方法的有效性,包括图像分类、目标检测和实例分割。
提出的方法
- 提出 BatchFormerV2,一种通用的批量 Transformer 模块,通过在批量维度上应用自注意力机制,建模小批量中样本之间的关系。
- 采用双流训练流程:一条路径包含 BatchFormerV2 模块,另一条不包含,两条路径共享网络层/块。
- 在 BatchFormerV2 模块前后使用共享分类器头,以确保批量不变的表示学习。
- 在训练过程中,实现不仅在图像之间,也在不同样本的 patch 和像素之间传播信息。
- 可在推理阶段移除 BatchFormerV2 模块,确保无额外计算开销。
- 在视觉 Transformer 架构的不同网络块中应用该模块,以支持多层级表示学习。
实验结果
研究问题
- RQ1在小批量中建模样本间关系是否能提升视觉 Transformer 的密集表示学习?
- RQ2如何有效将批量注意力应用于像素/patch 级别,而不仅限于图像级别?
- RQ3是否可以训练一种即插即用的批量 Transformer 模块,而不会引入推理开销?
- RQ4所提出的方法是否能在包括分类、检测和分割在内的多种视觉任务中提升性能?
- RQ5在数据稀缺或小数据集设置下,该方法表现如何?
主要发现
- 从零开始训练时,BatchFormerV2 在 CIFAR-100 上将 DeiT-Ti 的准确率提升 9.5%(从 49.2% 提升至 58.7%),将 DeiT-B 的准确率提升 14.4%(从 52.2% 提升至 66.6%)。
- 在 ImageNet 上,BatchFormerV2 将 DeiT-Ti 的准确率提升 0.5%(72.2% 提升至 72.7%),DeiT-S 提升 0.6%(79.8% 提升至 80.4%),DeiT-B 提升 0.5%(81.7% 提升至 82.2%)。
- 在目标检测任务中,BatchFormerV2 使所有测试的基于 DETR 的模型在 AP 上提升超过 1.3%。
- 在实例分割任务中,BatchFormerV2 在多种主干网络架构上均实现了稳定提升。
- 该方法在小样本数据集(如 CIFAR-100)上表现尤为突出,而强数据增强可能限制了在 ImageNet 上的增益。
- 双流训练策略成功避免了训练与测试不一致问题,实现了即插即用的部署,且无推理成本。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。