arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.03180cs.CV
收藏

具有分层注意力的Vision Transformers

Vision Transformers with Hierarchical Attention

Institute for Infocomm Research (I2R)(信息通信研究院(I2R));Institute of High Performance Computing (IHPC)(高性能计算研究院(IHPC));ETH Zürich(苏黎世联邦理工学院);School of Information and Communication Engineering, UESTC(电子科技大学信息与通信工程学院)

Yun Liu, Yu-Huan Wu, Guolei Sun, Le Zhang, Ajad Chhatkuli, Luc Van Gool

AI总结:

本文提出分层多头自注意力H-MHSA,通过局部与全局分层建模降低vision transformers的计算复杂度,构建HAT-Net并在多项视觉任务上验证其优越性。

摘要:

本文解决了原始vision transformers中Multi-Head Self-Attention (MHSA)带来的高计算/空间复杂度问题。为此,我们提出了Hierarchical MHSA (H-MHSA),一种以分层方式计算自注意力的新方法。具体而言,我们首先按常规方式将输入图像划分为patches,每个patch视为一个token。然后,所提出的H-MHSA学习局部patches内的token关系,作为局部关系建模。接着,将小patches合并为更大的patches,H-MHSA对少量合并后的tokens进行全局依赖建模。最后,聚合局部和全局注意力特征,获得具有强大表示能力的特征。由于我们在每一步仅对有限数量的tokens计算注意力,计算负荷大幅降低。因此,H-MHSA能在不牺牲细粒度信息的情况下高效建模tokens间的全局关系。通过引入H-MHSA模块,我们构建了一系列基于分层注意力的Transformer Networks,即HAT-Net。为证明HAT-Net在场景理解中的优越性,我们在图像分类、语义分割、目标检测和实例分割等基础视觉任务上进行了大量实验。因此,HAT-Net为vision transformers提供了新的视角。代码和预训练模型可在https://github.com/yun-liu/HAT-Net获取。

英文摘要:

This paper tackles the high computational/space complexity associated with Multi-Head Self-Attention (MHSA) in vanilla vision transformers. To this end, we propose Hierarchical MHSA (H-MHSA), a novel approach that computes self-attention in a hierarchical fashion. Specifically, we first divide the input image into patches as commonly done, and each patch is viewed as a token. Then, the proposed H-MHSA learns token relationships within local patches, serving as local relationship modeling. Then, the small patches are merged into larger ones, and H-MHSA models the global dependencies for the small number of the merged tokens. At last, the local and global attentive features are aggregated to obtain features with powerful representation capacity. Since we only calculate attention for a limited number of tokens at each step, the computational load is reduced dramatically. Hence, H-MHSA can efficiently model global relationships among tokens without sacrificing fine-grained information. With the H-MHSA module incorporated, we build a family of Hierarchical-Attention-based Transformer Networks, namely HAT-Net. To demonstrate the superiority of HAT-Net in scene understanding, we conduct extensive experiments on fundamental vision tasks, including image classification, semantic segmentation, object detection, and instance segmentation. Therefore, HAT-Net provides a new perspective for vision transformers. Code and pretrained models are available at https://github.com/yun-liu/HAT-Net.

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

↑