让ViT关注物体内部区域,提升识别准确率与泛化能力
Learning Object Focused Attention
- 在注意力层加入物体聚焦损失,引导模型专注同一物体内的图像块
- 在分类、分布外数据和对抗样本上均优于基线模型,提升1.8%以上
- 适合追求模型可解释性与鲁棒性的视觉任务研究者
我们提出一种针对视觉变换器(ViTs)的训练改进方法,通过在部分注意力层添加辅助损失——物体聚焦注意力(OFA)损失,显式建模物体结构。该方法限制注意力仅作用于同类别图像块,使模型更关注物体内部而非背景等无关区域,从而更好理解整体物体形状。此归纳偏置仅增加一个辅助损失,不引入推理开销。我们还探索多尺度掩码以进一步提升性能,并为自监督学习提供路径。实验表明,采用OFA的ViT在分类精度上优于基线模型,对分布外(OOD)及对抗扰动图像具有更强泛化能力,学习到基于物体形状的表示,而非依赖纹理等虚假相关。我们在COCO数据集上结合Stable Diffusion修复生成新数据集,计划开源共享。
原文摘要 · Abstract (English)
We propose an adaptation to the training of Vision Transformers (ViTs) that allows for an explicit modeling of objects during the attention computation. This is achieved by adding a new branch to selected attention layers that computes an auxiliary loss which we call the object-focused attention (OFA) loss. We restrict the attention to image patches that belong to the same object class, which allows ViTs to gain a better understanding of configural (or holistic) object shapes by focusing on intra-object patches instead of other patches such as those in the background. Our proposed inductive bias fits easily into the attention framework of transformers since it only adds an auxiliary loss over selected attention layers. Furthermore, our approach has no additional overhead during inference. We also experiment with multiscale masking to further improve the performance of our OFA model and give a path forward for self-supervised learning with our method. Our experimental results demonstrate that ViTs with OFA achieve better classification results than their base models, exhibit a stronger generalization ability to out-of-distribution (OOD) and adversarially corrupted images, and learn representations based on object shapes rather than spurious correlations via general textures. For our OOD setting, we generate a novel dataset using the COCO dataset and Stable Diffusion inpainting which we plan to share with the community.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。