References & Citations
Computer Science > Computer Vision and Pattern Recognition
Title: Vision Transformers with Hierarchical Attention
(Submitted on 6 Jun 2021 (v1), last revised 26 Mar 2024 (this version, v5))
Abstract: 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 this https URL
Submission history
From: Yun Liu [view email][v1] Sun, 6 Jun 2021 17:01:13 GMT (167kb,D)
[v2] Wed, 9 Jun 2021 07:23:14 GMT (167kb,D)
[v3] Wed, 15 Jun 2022 15:15:28 GMT (114kb,D)
[v4] Fri, 12 Jan 2024 12:07:31 GMT (62kb,D)
[v5] Tue, 26 Mar 2024 07:44:45 GMT (321kb,D)
Link back to: arXiv, form interface, contact.