AutoFormer: Searching Transformers for Visual Recognition

Minghao Chen, Houwen Peng, Jianlong Fu, Haibin Ling
7/1/2021
376 citations
cs.CV
transformer-attention

Official code: microsoft/Cream (1,843 stars, Python, MIT, last commit 2024-07-25).

Abstract

Recently, pure transformer-based models have shown great potentials for vision tasks such as image classification and detection. However, the design of transformer networks is challenging.

Show full abstract

It has been observed that the depth, embedding dimension, and number of heads can largely affect the performance of vision transformers. Previous models configure these dimensions based upon manual crafting. In this work, we propose a new one-shot architecture search framework, namely AutoFormer, dedicated to vision transformer search. AutoFormer entangles the weights of different blocks in the same layers during supernet training. Benefiting from the strategy, the trained supernet allows thousands of subnets to be very well-trained. Specifically, the performance of these subnets with weights inherited from the supernet is comparable to those retrained from scratch. Besides, the searched models, which we refer to AutoFormers, surpass the recent state-of-the-arts such as ViT and DeiT. In particular, AutoFormer-tiny/small/base achieve 74.7%/81.7%/82.4% top-1 accuracy on ImageNet with 5.7M/22.9M/53.7M parameters, respectively. Lastly, we verify the transferability of AutoFormer by providing the performance on downstream benchmarks and distillation experiments. Code and models are available at https://github.com/microsoft/AutoML.

View on arXivView PDF

Code Implementations(1)

microsoft/CreamOfficial100%
MIT

This is a collection of our NAS and Vision Transformer work.

1,843239Python, CudaOct 12, 20202 years agoMIT
automlefficiencyknowledge-distillationnasrpe+2 more

Similar Papers

Cite this paper

@article{chen2021autoformer,
  title  = {AutoFormer: Searching Transformers for Visual Recognition},
  author = {Minghao Chen and Houwen Peng and Jianlong Fu and Haibin Ling},
  year   = {2021},
  eprint = {2107.00651},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.00651}
}

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

Discussion