paper-with-me

홈 › Papers

Vision Transformers with Hierarchical Attention

2021-06-06 · Yun Liu, Yu-Huan Wu, Guolei Sun, Le Zhang, Ajad Chhatkuli, Luc van Gool

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.

📄 PDF Abstract BibTeX arXiv:2106.03180

Code (3)

yun-liu/hat-net 공식 구현 pytorch
mindspore-courses/External-Attention-MindSpore/blob/main/model/backbone/HATNet.py mindspore
yuranusduke/TransCNN pytorch

Tasks

image-classificationImage ClassificationInstance Segmentationobject-detectionObject DetectionScene UnderstandingSemantic Segmentation

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Residual Connection 설명 없음
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Vision Transformer The Vision Transformer, or ViT, is a model for image classification that employs a Transformer-like architecture over…

Similar Papers 제목 키워드 기반

Less is More: Pay Less Attention in Vision Transformers

2021-05-29 · Zizheng Pan, Bohan Zhuang, Haoyu He, Jing Liu 외

Transformers have become one of the dominant architectures in deep learning, particularly as a powerful alternative to convolutional neural networks (CNNs) in computer vision. However, Transformer training and inference …

image-classificationImage ClassificationInstance Segmentationobject-detection+2

HiViT: Hierarchical Vision Transformer Meets Masked Image Modeling

2022-05-30 · Xiaosong Zhang, Yunjie Tian, Wei Huang, Qixiang Ye 외

Recently, masked image modeling (MIM) has offered a new methodology of self-supervised pre-training of vision transformers. A key idea of efficient implementation is to discard the masked image patches (or tokens) throug…

Transfer Learning

Fusion of regional and sparse attention in Vision Transformers

2024-06-13 · Nabil Ibtehaz, Ning Yan, Masood Mortazavi, Daisuke Kihara

Modern vision transformers leverage visually inspired local interaction between pixels through attention computed within window or grid regions, in contrast to the global attention employed in the original ViT. Regional …

DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification

2021-06-03 · NeurIPS 2021 12 · Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu 외

Attention is sparse in vision transformers. We observe the final prediction in vision transformers is only based on a subset of most informative tokens, which is sufficient for accurate image recognition. Based on this o…

BlockingEfficient ViTsImage Classification

Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patterns

2023-10-03 · Brian DuSell, David Chiang

Attention, specifically scaled dot-product attention, has proven effective for natural language, but it does not have a mechanism for handling hierarchical patterns of arbitrary nesting depth, which limits its ability to…

Language ModelingLanguage ModellingMachine Translation