ResFormer: Scaling ViTs with Multi-Resolution Training

Rui Tian, Zuxuan Wu, Qi Dai, Han Hu, Yu Qiao +1 more
12/1/2022
cs.CV
transformer-attention

Official code: ruitian12/resformer (30 stars, Python, MIT, last commit 2023-06-22).

Abstract

Vision Transformers (ViTs) have achieved overwhelming success, yet they suffer from vulnerable resolution scalability, i.e., the performance drops drastically when presented with input resolutions that are unseen during training. We introduce, ResFormer, a framework that is built upon the seminal idea of multi-resolution training for improved performance on a wide spectrum of, mostly unseen, testing resolutions.

Show full abstract

In particular, ResFormer operates on replicated images of different resolutions and enforces a scale consistency loss to engage interactive information across different scales. More importantly, to alternate among varying resolutions effectively, especially novel ones in testing, we propose a global-local positional embedding strategy that changes smoothly conditioned on input sizes. We conduct extensive experiments for image classification on ImageNet. The results provide strong quantitative evidence that ResFormer has promising scaling abilities towards a wide range of resolutions. For instance, ResFormer-B-MR achieves a Top-1 accuracy of 75.86% and 81.72% when evaluated on relatively low and high resolutions respectively (i.e., 96 and 640), which are 48% and 7.49% better than DeiT-B. We also demonstrate, moreover, ResFormer is flexible and can be easily extended to semantic segmentation, object detection and video action recognition. Code is available at https://github.com/ruitian12/resformer.

View on arXivView PDF

Code Implementations(1)

MIT

Official PyTorch implementation of ResFormer: Scaling ViTs with Multi-Resolution Training, CVPR2023

308Python, ShellApr 3, 20233 years agoMIT

Similar Papers

Cite this paper

@article{tian2022resformer,
  title  = {ResFormer: Scaling ViTs with Multi-Resolution Training},
  author = {Rui Tian and Zuxuan Wu and Qi Dai and Han Hu and Yu Qiao and Yu-Gang Jiang},
  year   = {2022},
  eprint = {2212.00776},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.00776}
}

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

Discussion