Vision Transformers with Hierarchical Attention

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Liu, Yun, Wu, Yu-Huan, Sun, Guolei, Zhang, Le, Chhatkuli, Ajad, Van Gool, Luc
Natura: Preprint
Pubblicazione: 2021
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916175750889472
author Liu, Yun
Wu, Yu-Huan
Sun, Guolei
Zhang, Le
Chhatkuli, Ajad
Van Gool, Luc
author_facet Liu, Yun
Wu, Yu-Huan
Sun, Guolei
Zhang, Le
Chhatkuli, Ajad
Van Gool, Luc
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2106_03180
institution arXiv
publishDate 2021
record_format arxiv
spellingShingle Vision Transformers with Hierarchical Attention
Liu, Yun
Wu, Yu-Huan
Sun, Guolei
Zhang, Le
Chhatkuli, Ajad
Van Gool, Luc
Computer Vision and Pattern Recognition
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.
title Vision Transformers with Hierarchical Attention
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2106.03180