Skip to main content
QUICK REVIEW

[Paper Review] FasterViT: Fast Vision Transformers with Hierarchical Attention

Ali Hatamizadeh, Greg Heinrich|arXiv (Cornell University)|Jun 9, 2023
Advanced Neural Network ApplicationsComputer Science35 citations
TL;DR

FasterViT is a hybrid CNN–ViT architecture with Hierarchical Attention that achieves higher image throughput and competitive accuracy, forming a new Pareto front for vision models. It uses carrier tokens and windowed local attention to enable global interactions at reduced cost.

ABSTRACT

We design a new family of hybrid CNN-ViT neural networks, named FasterViT, with a focus on high image throughput for computer vision (CV) applications. FasterViT combines the benefits of fast local representation learning in CNNs and global modeling properties in ViT. Our newly introduced Hierarchical Attention (HAT) approach decomposes global self-attention with quadratic complexity into a multi-level attention with reduced computational costs. We benefit from efficient window-based self-attention. Each window has access to dedicated carrier tokens that participate in local and global representation learning. At a high level, global self-attentions enable the efficient cross-window communication at lower costs. FasterViT achieves a SOTA Pareto-front in terms of accuracy and image throughput. We have extensively validated its effectiveness on various CV tasks including classification, object detection and segmentation. We also show that HAT can be used as a plug-and-play module for existing networks and enhance them. We further demonstrate significantly faster and more accurate performance than competitive counterparts for images with high resolution. Code is available at https://github.com/NVlabs/FasterViT.

Motivation & Objective

  • Motivate the need for efficient, high-throughput Vision Transformer architectures for high-resolution CV tasks.
  • Introduce FasterViT, a hybrid CNN–ViT design optimized for throughput without sacrificing accuracy.
  • Develop Hierarchical Attention to enable scalable cross-window communication with lower complexity.
  • Demonstrate FasterViT's effectiveness across image classification, object detection, and semantic segmentation.
  • Show that Hierarchical Attention can serve as a plug-and-play module for existing networks.

Proposed method

  • Propose FasterViT as a four-stage hybrid architecture using CNN blocks in early stages and transformer blocks in later stages.
  • Introduce Hierarchical Attention (HAT) that uses carrier tokens to summarize local windows and enable cross-window interactions.
  • Compute attention in two steps: local window attention with dedicated carrier tokens, then carrier-token attention to propagate global information.
  • Employ absolute 2D positional biases and SwinV2-inspired relative positional bias to enable scalable input resolutions.
  • Provide a complexity analysis showing the overall cost scales near linearly with input resolution due to windowed attention and carrier tokens.
  • Validate through extensive experiments on ImageNet-1K, MS COCO, and ADE20K, including ImageNet-21K pretraining.
Figure 2: Visualization of the proposed Hierarchical Attention in the feature space. By performing local window attention and hierarchical attention we can achieve global information propagation at reduced costs.Best viewed in color.
Figure 2: Visualization of the proposed Hierarchical Attention in the feature space. By performing local window attention and hierarchical attention we can achieve global information propagation at reduced costs.Best viewed in color.

Experimental results

Research questions

  • RQ1Can Hierarchical Attention enable effective long-range modeling while preserving high throughput for high-resolution inputs?
  • RQ2Does the FasterViT architecture offer a better accuracy-throughput trade-off than existing ViT and hybrid models across classification, detection, and segmentation tasks?
  • RQ3Is HAT a viable plug-and-play module to improve existing CNN–ViT architectures?
  • RQ4How does FasterViT scale when pre-trained on large datasets (e.g., ImageNet-21K) and fine-tuned on higher resolutions?

Key findings

  • FasterViT achieves a new Pareto front for image throughput vs. Top-1 accuracy on ImageNet-1K across multiple model sizes.
  • FasterViT-2 to FasterViT-4 demonstrate substantially higher throughput than Swin and ConvNeXt baselines while achieving equal or better accuracy (e.g., FasterViT-2 with 224 input yields 84.2% Top-1 at 3161 Img/Sec).
  • Hierarchical Attention (HAT) substantially improves accuracy vs. throughput compared to alternative attention designs (Twins, EdgeViT) as shown in ablations.
  • Pretraining on ImageNet-21K and fine-tuning on ImageNet-1K yields FasterViT-4 with strong throughput and accuracy (e.g., up to 86.6% Top-1 on 384 input with 36.6 GFlops and 119.2 Img/Sec in Table 2).
  • FasterViT provides competitive or superior results on downstream tasks: MS COCO object detection/instance segmentation and ADE20K semantic segmentation, with higher throughput than comparable ViT-based models.
  • Ablation studies confirm the importance of HAT components (CTs, CT attention, attention bias) for maintaining accuracy while achieving high throughput.
Figure 3: Overview of the FasterViT architecture. We use a multi-scale architecture with CNN and transformer-based blocks in stages 1, 2 and 3, 4, respectively. Best viewed in color.
Figure 3: Overview of the FasterViT architecture. We use a multi-scale architecture with CNN and transformer-based blocks in stages 1, 2 and 3, 4, respectively. Best viewed in color.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.