HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Understanding Gaussian Attention Bias of Vision Transformers Using Effective Receptive Fields

Bum Jun Kim Hyeyeon Choi Hyeonah Jang Sang Woo Kim

Understanding Gaussian Attention Bias of Vision Transformers Using Effective Receptive Fields

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.

Code Repositories

Benchmarks

BenchmarkMethodologyMetrics
fine-grained-image-classification-on-caltechViT-S/16 (RPE w/ GAB)
Top-1 Error Rate: 9.798%
fine-grained-image-classification-on-stanford-1ViT-B/16 (RPE w/ GAB)
Accuracy: 90.185%
image-classification-on-imagenetViT-B/16 (RPE w/ GAB)
Top 1 Accuracy: 81.484%
image-classification-on-stanford-carsViT-M/16 (RPE w/ GAB)
Accuracy: 83.89
image-classification-on-stanford-carsViT-B/16 (RPE w/ GAB)
Accuracy: 93.743
object-detection-on-cocoSwin-S (RPE w/ GAB)
box mAP: 48.23
semantic-segmentation-on-ade20k-valSwin-S (RPE w/ GAB)
mIoU: 46.41

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp