arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2112.05080cs.CVcs.AI
收藏

早期全球一体化的本地转移注意力

Locally Shifted Attention With Early Global Integration

Tel Aviv University(特拉维夫大学);Facebook AI Research(Facebook人工智能研究院)

Shelly Sheynin, Sagie Benaim, Adam Polyak, Lior Wolf

摘要:

最近的工作已经显示了Transformers在计算机视觉应用中的潜力。首先将图像分割成小块,然后将小块用作注意力机制的输入令牌。由于注意力机制的昂贵的二次成本,要么使用大的补丁大小,导致粗粒度的全局交互,或者可选地,注意力仅应用于图像的局部区域,以长距离交互为代价。在这项工作中,我们提出了一种方法,允许粗的全球相互作用和细粒度的本地相互作用已经在早期层的视觉Transformer。我们方法的核心是局部和全局注意力层的应用。在局部注意力层中,我们将注意力应用于每个补丁及其局部偏移,从而产生虚拟定位的局部补丁,这些补丁不限于单个特定位置。这些虚拟定位的补丁,然后在一个全球关注层中使用。将注意力层分离为局部和全局对应物允许在补丁数量上的低计算成本,同时仍然支持已经在第一层处的数据依赖定位,而不是其他视觉Transformers中的静态定位。我们的方法被证明是优于卷积和基于变换的图像分类的CIFAR10,CIFAR100和ImageNet的方法。代码可在:https://github.com/shellysheynin/Locally-SAG-Transformer.

英文摘要:

Recent work has shown the potential of transformers for computer vision applications. An image is first partitioned into patches, which are then used as input tokens for the attention mechanism. Due to the expensive quadratic cost of the attention mechanism, either a large patch size is used, resulting in coarse-grained global interactions, or alternatively, attention is applied only on a local region of the image, at the expense of long-range interactions. In this work, we propose an approach that allows for both coarse global interactions and fine-grained local interactions already at early layers of a vision transformer. At the core of our method is the application of local and global attention layers. In the local attention layer, we apply attention to each patch and its local shifts, resulting in virtually located local patches, which are not bound to a single, specific location. These virtually located patches are then used in a global attention layer. The separation of the attention layer into local and global counterparts allows for a low computational cost in the number of patches, while still supporting data-dependent localization already at the first layer, as opposed to the static positioning in other visual transformers. Our method is shown to be superior to both convolutional and transformer-based methods for image classification on CIFAR10, CIFAR100, and ImageNet. Code is available at: https://github.com/shellysheynin/Locally-SAG-Transformer.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑