Vision transformer (ViT) has recently shown its strong capability in achieving comparable results to convolutional neural networks (CNNs) on image classification. However, vanilla ViT simply inherits the same architecture from the natural language processing directly, which is often not optimized for vision applications. Motivated by this, in this paper, we propose a new architecture that adopts the pyramid structure and employ a novel regional-to-local attention rather than global self-attention in vision transformers. More specifically, our model first generates regional tokens and local tokens from an image with different patch sizes, where each regional token is associated with a set of local tokens based on the spatial location. The regional-to-local attention includes two steps: first, the regional self-attention extract global information among all regional tokens and then the local self-attention exchanges the information among one regional token and the associated local tokens via self-attention. Therefore, even though local self-attention confines the scope in a local region but it can still receive global information. Extensive experiments on four vision tasks, including image classification, object and keypoint detection, semantics segmentation and action recognition, show that our approach outperforms or is on par with state-of-the-art ViT variants including many concurrent works. Our source codes and models are available at https://github.com/ibm/regionvit.
翻译:视觉变异器(ViT)最近展示了在图像分类方面实现与进化神经网络(CNNs)相似结果的强大能力;然而,Vanilla ViT只是直接从自然语言处理中继承同一结构,而自然语言处理往往不是最优化的视觉应用。为此,我们在本文件中提出一个新的结构,采用金字塔结构,在视觉变异器中采用新的区域对地方的关注,而不是全球自我关注。更具体地说,我们的模型首先从具有不同补丁大小的图像中产生区域象征和地方象征(CNNs),其中每个区域象征都与基于空间位置的一套地方象征相联。区域对地方的关注包括两个步骤:第一,区域自用信息在所有区域象征中提取全球信息,然后由地方自用通过自我保存在一种区域象征和相关的本地象征之间交流信息。因此,即使本地自我使用限制了本地区域范围的范围,但它仍然可以接收全球信息。在四种视觉任务上进行广泛的实验,包括图像分类、对象和关键点检测,以及我们现有的变式方法,包括我们现有的图案和变式分析。