Skip to main content
QUICK REVIEW

[Paper Review] CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

Chun-Fu Chen, Quanfu Fan|arXiv (Cornell University)|Mar 27, 2021
Advanced Neural Network ApplicationsComputer Science22 citations
TL;DR

CrossViT proposes a dual-branch Vision Transformer that fuses features from small and large image patches using cross-attention mechanisms to improve multi-scale representation learning. It achieves a 2% accuracy gain over DeiT on ImageNet1K with only a moderate increase in FLOPs and parameters, demonstrating strong performance and efficiency.

ABSTRACT

The recently developed vision transformer (ViT) has achieved promising results on image classification compared to convolutional neural networks. Inspired by this, in this paper, we study how to learn multi-scale feature representations in transformer models for image classification. To this end, we propose a dual-branch transformer to combine image patches (i.e., tokens in a transformer) of different sizes to produce stronger image features. Our approach processes small-patch and large-patch tokens with two separate branches of different computational complexity and these tokens are then fused purely by attention multiple times to complement each other. Furthermore, to reduce computation, we develop a simple yet effective token fusion module based on cross attention, which uses a single token for each branch as a query to exchange information with other branches. Our proposed cross-attention only requires linear time for both computational and memory complexity instead of quadratic time otherwise. Extensive experiments demonstrate that our approach performs better than or on par with several concurrent works on vision transformer, in addition to efficient CNN models. For example, on the ImageNet1K dataset, with some architectural changes, our approach outperforms the recent DeiT by a large margin of 2\% with a small to moderate increase in FLOPs and model parameters. Our source codes and models are available at \url{https://github.com/IBM/CrossViT}.

Motivation & Objective

  • To improve multi-scale feature representation in Vision Transformers for image classification.
  • To reduce computational cost while maintaining or improving performance through efficient cross-attention fusion.
  • To enable effective interaction between small and large patch features without increasing quadratic complexity.
  • To achieve state-of-the-art performance comparable to or better than concurrent methods on ImageNet1K and other benchmarks.
  • To provide a lightweight, efficient architecture that balances accuracy and computational efficiency.

Proposed method

  • The model uses a dual-branch architecture to process small-patch and large-patch tokens separately, each with different computational complexity.
  • Cross-attention is used to fuse features between branches, enabling iterative cross-modality information exchange.
  • A single-query token per branch is used to query the other branch, reducing computation to linear time in both FLOPs and memory.
  • The cross-attention module replaces standard self-attention in feature fusion, avoiding quadratic complexity.
  • The architecture is trained end-to-end with standard optimization and data augmentation techniques.
  • The method is applied to ImageNet1K and evaluated on transfer learning benchmarks.

Experimental results

Research questions

  • RQ1Can cross-attention between dual-branch patch features improve multi-scale representation in Vision Transformers?
  • RQ2Can efficient cross-attention fusion maintain high performance while reducing computational complexity compared to standard self-attention?
  • RQ3How does the proposed CrossViT compare to state-of-the-art Vision Transformers like DeiT on ImageNet1K?
  • RQ4Can the model achieve high accuracy with only a moderate increase in FLOPs and parameters?
  • RQ5Does the dual-branch, multi-scale design generalize well to transfer learning settings?

Key findings

  • CrossViT outperforms DeiT by 2% top-1 accuracy on ImageNet1K with only a small to moderate increase in FLOPs and model parameters.
  • The cross-attention fusion mechanism achieves linear computational and memory complexity, avoiding the quadratic cost of standard self-attention.
  • The dual-branch design effectively combines multi-scale features, leading to stronger representations than single-scale or naive concatenation.
  • The model achieves competitive performance on transfer learning benchmarks, indicating strong generalization ability.
  • The method demonstrates that efficient cross-attention can be a powerful alternative to self-attention in feature fusion for vision transformers.
  • The ablation studies confirm that both the dual-branch design and cross-attention fusion are essential for performance gains.

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.