Convolutional Neural Networks (CNNs) have dominated computer vision for years, due to its ability in capturing locality and translation invariance. Recently, many vision transformer architectures have been proposed and they show promising performance. A key component in vision transformers is the fully-connected self-attention which is more powerful than CNNs in modelling long range dependencies. However, since the current dense self-attention uses all image patches (tokens) to compute attention matrix, it may neglect locality of images patches and involve noisy tokens (e.g., clutter background and occlusion), leading to a slow training process and potentially degradation of performance. To address these problems, we propose a sparse attention scheme, dubbed k-NN attention, for boosting vision transformers. Specifically, instead of involving all the tokens for attention matrix calculation, we only select the top-k similar tokens from the keys for each query to compute the attention map. The proposed k-NN attention naturally inherits the local bias of CNNs without introducing convolutional operations, as nearby tokens tend to be more similar than others. In addition, the k-NN attention allows for the exploration of long range correlation and at the same time filter out irrelevant tokens by choosing the most similar tokens from the entire image. Despite its simplicity, we verify, both theoretically and empirically, that $k$-NN attention is powerful in distilling noise from input tokens and in speeding up training. Extensive experiments are conducted by using ten different vision transformer architectures to verify that the proposed k-NN attention can work with any existing transformer architectures to improve its prediction performance.


翻译:多年来,由于能够捕捉地点和翻译差异, Convolution Neal Network (CNNs) 一直主导着计算机视野。 最近,许多视觉变压器结构被提出来,它们表现出有希望的性能。 视觉变压器中的一个关键组成部分是完全连接的自我注意,在模拟长期依赖性关系时比CNN更强大。 然而,由于当前密度浓厚的自我注意使用所有图像补丁(tokes)来计算关注矩阵,因此它可能忽视图像补丁的位置,并涉及噪音的象征(例如,模糊的背景和隐蔽),导致培训进程缓慢,并可能出现业绩退化。为了解决这些问题,我们提出了一种微弱的注意机制,即完全连接的自我注意机制,即完全连接的自我注意。 具体地说,我们只从键中选择了每个调控点的顶级的类似符号(tokets) 来计算注意地图。 拟议的 k-NNNE 将本地的偏重度继承了CNN的偏向,而没有引入革命性的动作,因为近处的加速的变压过程往往选择其直观的直观, 直观性的直观性的图像在模拟的模拟中进行。 平等的模拟的模拟的模拟的模拟的模拟的模拟的模拟的模拟的模拟的模拟的模拟中, 。

1
下载
关闭预览

相关内容

Attention机制最早是在视觉图像领域提出来的,但是真正火起来应该算是google mind团队的这篇论文《Recurrent Models of Visual Attention》[14],他们在RNN模型上使用了attention机制来进行图像分类。随后,Bahdanau等人在论文《Neural Machine Translation by Jointly Learning to Align and Translate》 [1]中,使用类似attention的机制在机器翻译任务上将翻译和对齐同时进行,他们的工作算是是第一个提出attention机制应用到NLP领域中。接着类似的基于attention机制的RNN模型扩展开始应用到各种NLP任务中。最近,如何在CNN中使用attention机制也成为了大家的研究热点。下图表示了attention研究进展的大概趋势。
最新《Transformers模型》教程,64页ppt
专知会员服务
274+阅读 · 2020年11月26日
Transformer文本分类代码
专知会员服务
116+阅读 · 2020年2月3日
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
ICLR2019最佳论文出炉
专知
11+阅读 · 2019年5月6日
弱监督语义分割最新方法资源列表
专知
9+阅读 · 2019年2月26日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【推荐】视频目标分割基础
机器学习研究会
9+阅读 · 2017年9月19日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Arxiv
9+阅读 · 2021年5月17日
Arxiv
3+阅读 · 2020年9月30日
Universal Transformers
Arxiv
5+阅读 · 2019年3月5日
VIP会员
相关VIP内容
最新《Transformers模型》教程,64页ppt
专知会员服务
274+阅读 · 2020年11月26日
Transformer文本分类代码
专知会员服务
116+阅读 · 2020年2月3日
相关资讯
Top
微信扫码咨询专知VIP会员