CrossFormer++: A Versatile Vision Transformer Hinging on Cross-scale Attention

Wenxiao Wang, Wei Chen, Qibo Qiu, Long Chen, Boxi Wu +3 more
3/13/2023
cs.CV

Official code: cheerss/CrossFormer (404 stars, MIT, PyTorch, last commit 2024-01-14).

Abstract

While features of different scales are perceptually important to visual inputs, existing vision transformers do not yet take advantage of them explicitly. To this end, we first propose a cross-scale vision transformer, CrossFormer. It introduces a cross-scale embedding layer (CEL) and a long-short distance attention (LSDA). On the one hand, CEL blends each token with multiple patches of different scales, providing the self-attention module itself with cross-scale features. On the other hand, LSDA splits the self-attention module into a short-distance one and a long-distance counterpart, which not only reduces the computational burden but also keeps both small-scale and large-scale features in the tokens. Moreover, through experiments on CrossFormer, we observe another two issues that affect vision transformers' performance, i.e., the enlarging self-attention maps and amplitude explosion. Thus, we further propose a progressive group size (PGS) paradigm and an amplitude cooling layer (ACL) to alleviate the two issues, respectively. The CrossFormer incorporating with PGS and ACL is called CrossFormer++. Extensive experiments show that CrossFormer++ outperforms the other vision transformers on image classification, object detection, instance segmentation, and semantic segmentation tasks. The code will be available at: https://github.com/cheerss/CrossFormer.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

The official code for the paper: https://openreview.net/forum?id=_PHymLIxuI

40449Shell, PythonJul 27, 20212 years agoMIT
classificationdeep-learninginstance-segmentationobject-detectionpytorch+2 more

Similar Papers

Cite this paper

@article{wang2023crossformer,
  title  = {CrossFormer++: A Versatile Vision Transformer Hinging on Cross-scale Attention},
  author = {Wenxiao Wang and Wei Chen and Qibo Qiu and Long Chen and Boxi Wu and Binbin Lin and Xiaofei He and Wei Liu},
  year   = {2023},
  eprint = {2303.06908},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.06908v2}
}

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/2303.06908.svg)](https://codeofpaper.com/paper/2303.06908)

Discussion