Understanding Gaussian Attention Bias of Vision Transformers Using Effective Receptive Fields

Bum Jun Kim, Hyeyeon Choi, Hyeonah Jang, Sang Woo Kim
5/8/2023
cs.CV

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Vision transformers (ViTs) that model an image as a sequence of partitioned patches have shown notable performance in diverse vision tasks. Because partitioning patches eliminates the image structure, to reflect the order of patches, ViTs utilize an explicit component called positional embedding. However, we claim that the use of positional embedding does not simply guarantee the order-awareness of ViT. To support this claim, we analyze the actual behavior of ViTs using an effective receptive field. We demonstrate that during training, ViT acquires an understanding of patch order from the positional embedding that is trained to be a specific pattern. Based on this observation, we propose explicitly adding a Gaussian attention bias that guides the positional embedding to have the corresponding pattern from the beginning of training. We evaluated the influence of Gaussian attention bias on the performance of ViTs in several image classification, object detection, and semantic segmentation experiments. The results showed that proposed method not only facilitates ViTs to understand images but also boosts their performance on various datasets, including ImageNet, COCO 2017, and ADE20K.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kim2023understanding,
  title  = {Understanding Gaussian Attention Bias of Vision Transformers Using Effective Receptive Fields},
  author = {Bum Jun Kim and Hyeyeon Choi and Hyeonah Jang and Sang Woo Kim},
  year   = {2023},
  eprint = {2305.04722},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.04722v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.04722.svg)](https://codeofpaper.com/paper/2305.04722)

Discussion