Vision Big Bird: Random Sparsification for Full Attention

Zhemin Zhang, Xun GongarXiv 2023 · DOI

Abstract

Vision Big Bird (VBB) addresses the quadratic complexity bottleneck of standard Vision Transformers (ViTs) by adapting the "Big Bird" architecture from natural language processing to the visual domain. By replacing global self-attention with a parallel combination of convolutional layers, random sampling windows, and pooled global attention, VBB achieves linear complexity $O(n)$ relative to image size. Experimental results on ImageNet-1K, COCO, and ADE20K demonstrate that VBB outperforms state-of-the-art models like Swin Transformer and MaxViT while maintaining superior scalability for high-resolution tasks.

Introduction

The primary challenge in scaling Vision Transformers is the $O(n^2)$ computational and memory cost of global self-attention. While window-based approaches like Swin Transformer mitigate this cost, they often sacrifice the immediate global receptive field characteristic of the original Transformer, requiring deep stacks of blocks to recover non-local dependencies. Vision Big Bird (VBB) introduces a novel architecture that maintains global connectivity from the initial layers with linear complexity.

Methodology

Parallel Block Architecture

Unlike traditional hybrid models that stack convolutional and transformer layers sequentially, VBB utilizes a parallel implementation within each block. This design allows the model to process local and global features simultaneously, using learnable scaling weights ($\alpha, \beta, \lambda$) to adaptively fuse information based on the network depth.

Comparison of sequential and parallel implementations of CNN and Transformer branches.

Three-Branch Attention Mechanism

The core of VBB is its sparsified attention mechanism, which splits attention heads into three distinct functional groups:

  1. Convolutional Branch (Local): A 3x3 depthwise convolution captures fine-grained spatial features and provides necessary inductive bias.
  2. Random Sampling Windows (RS-Win): This branch randomly samples patches across the entire image to form attention windows, introducing stochastic global connections that capture long-range dependencies early in the network.
  3. Global Attention (Pooled): To maintain efficiency, this branch uses average pooling to reduce the resolution of Keys and Values, allowing every patch to attend to a summarized global representation of the image.
Visualization of the sparsified attention pattern, illustrating local, random, and global connectivity.

Key Insights and Results

Architectural Innovations

  • Implicit Positional Information: VBB eliminates the need for explicit positional encodings (PE). The zero-padding in the parallel convolutional branch provides sufficient spatial cues for the model to learn patch locations.
  • Dynamic Feature Prioritization: Analysis of learnable weights reveals that Random Sampling is critical in early layers, while Pooled Global Attention becomes dominant in deeper stages of the network.

Performance Benchmarks

  • ImageNet-1K: VBB-Tiny achieved 83.8% Top-1 accuracy, surpassing Swin-T (81.3%) and MaxViT-T (83.6%) with comparable FLOPs.
  • Data Efficiency: On smaller datasets like Mini-ImageNet, VBB-T reached 86.2%, significantly outperforming pure ViTs which typically require massive pre-training.
  • Downstream Tasks: In object detection (COCO), VBB-B achieved 49.3 box mAP, demonstrating its effectiveness in preserving fine-grained details for localization tasks.

Conclusion

Vision Big Bird successfully bridges the gap between the efficiency of local convolutions and the expressive power of global Transformers. By achieving linear complexity through random sparsification and parallel processing, VBB provides a scalable framework for high-resolution computer vision tasks without the prohibitive costs of standard self-attention.

Summary updated

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
ImageNet-1KVBB-T (tiny)Top-1 accuracy83.8%fine-tuned · epochs=300 · resolution=224×224 · extra-training-data=none
Source quote
L152: Results. Table \ref{ImageNet-Top1} compares the performance of the proposed VBB Transformer with the state-of-the-art CNN and Vision Transformer backbones on ImageNet-1K. Compared to ViT-B, the proposed VBB-T model is +5.9% better and has much lower computation complexity than ViT-B. Compared to other variants of ViT, VBB consistently outperforms competitors under similar parameters and computation costs. Specifically, VBB achieves 83.8% and 84.9% Top-1 Accuracy under tiny and base models, respectively. This compares to 83.6% and 84.9% for MaxViT and 83.2% and 84.7% for SGFormer.
COCO · val2017VBB-TAP^box47.7+0.3 vs baselinesplit: val · fine-tuned · backbone=VBB-T · detector=Mask R-CNN · schedule=1× · pretraining=ImageNet-1K
Source quote
L200: VBB-T (ours) │ 45M │ 286G │ 47.7 │ 69.3 │ 52.1 │ 42.6 │ 66.3 │ 46.3
ADE20KVBB-TSS mIoU50.3+0.4 vs baselinefine-tuned · backbone=VBB-T · segmenter=UperNet · evaluation=single-scale · resolution=224×224 · pretraining=ImageNet-1K
Source quote
L268: VBB-T (ours) │ 57M │ 996G │ 50.3 │ 51.8
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
COCO · val2017SGFormer-S baselineAP^box47.4split: val · fine-tuned · backbone=SGFormer-S · detector=Mask R-CNN · schedule=1× · pretraining=ImageNet-1K
Source quote
L199: SGFormer-S \cite{Ren-2023-ICCV} │ 41M │ 275G │ 47.4 │ 69.0 │ 52.0 │ 42.6 │ 65.9 │ 46.0
ADE20KSGFormer-S baselineSS mIoU49.9fine-tuned · backbone=SGFormer-S · segmenter=UperNet · evaluation=single-scale · resolution=224×224 · pretraining=ImageNet-1K
Source quote
L267: SGFormer-S \cite{Ren-2023-ICCV} │ 53M │ 989G │ 49.9 │ 51.5
BibTeX
@misc{zhang2023vision,
  author = {Zhemin Zhang and Xun Gong},
  title = {{Vision Big Bird: Random Sparsification for Full Attention}},
  year = {2023},
  eprint = {2311.05988},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.05988},
}
Figure