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

视觉Transformer如何工作?

How Do Vision Transformers Work?

Yonsei University(延世大学);NAVER AI Lab(NAVER人工智能实验室)

Namuk Park, Songkuk Kim

摘要:

多头自注意(MSA)在计算机视觉中的成功是无可争议的。然而,人们对管理事务协定的工作原理知之甚少。我们提出了基本的解释,以帮助更好地理解MSA的性质。特别地,我们证明了MSA和视觉Transformer(ViTs)的以下性质:(1)MSA不仅提高了准确性,而且通过平坦化损失景观来提高泛化能力。这种改进主要归因于其数据的特异性,而不是长期依赖性。另一方面,ViT遭受非凸损失。大数据集和损失景观平滑方法缓解了这个问题;(2)MSA和Conv表现出相反的行为。例如,MSA是低通滤波器,而Conv是高通滤波器。因此,MSA和Conv是互补的;(3)多级神经网络表现得像一个串联的小个体模型。此外,在一个阶段结束时的MSA在预测中起着关键作用。基于这些见解,我们提出了AlterNet,一个模型,其中在一个阶段结束时的Conv块被替换为MSA块。AlterNet不仅在大数据领域而且在小数据领域都优于CNN。该代码可在https://github.com/xxxnell/how-do-vits-work上获得。

英文摘要:

The success of multi-head self-attentions (MSAs) for computer vision is now indisputable. However, little is known about how MSAs work. We present fundamental explanations to help better understand the nature of MSAs. In particular, we demonstrate the following properties of MSAs and Vision Transformers (ViTs): (1) MSAs improve not only accuracy but also generalization by flattening the loss landscapes. Such improvement is primarily attributable to their data specificity, not long-range dependency. On the other hand, ViTs suffer from non-convex losses. Large datasets and loss landscape smoothing methods alleviate this problem; (2) MSAs and Convs exhibit opposite behaviors. For example, MSAs are low-pass filters, but Convs are high-pass filters. Therefore, MSAs and Convs are complementary; (3) Multi-stage neural networks behave like a series connection of small individual models. In addition, MSAs at the end of a stage play a key role in prediction. Based on these insights, we propose AlterNet, a model in which Conv blocks at the end of a stage are replaced with MSA blocks. AlterNet outperforms CNNs not only in large data regimes but also in small data regimes. The code is available at https://github.com/xxxnell/how-do-vits-work.

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

↑