HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

AutoFormer: Searching Transformers for Visual Recognition

Minghao Chen Houwen Peng Jianlong Fu Haibin Ling

AutoFormer: Searching Transformers for Visual Recognition

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. 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.

Code Repositories

microsoft/AutoML
Official
pytorch
Mentioned in GitHub
microsoft/cream
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
fine-grained-image-classification-on-oxfordAutoFormer-S | 384
Top 1 Accuracy: 98.8
fine-grained-image-classification-on-oxford-1AutoFormer-S | 384
Accuracy: 94.9%
fine-grained-image-classification-on-stanfordAutoFormer-S | 384
Accuracy: 93.4%
image-classification-on-cifar-10AutoFormer-S | 384
Percentage correct: 99.1
image-classification-on-imagenetAutoFormer-small
GFLOPs: 5.1
Number of params: 22.9M
Top 1 Accuracy: 81.7%
image-classification-on-imagenetAutoFormer-tiny
GFLOPs: 1.3
Number of params: 5.7M
Top 1 Accuracy: 74.7%
image-classification-on-imagenetAutoFormer-base
GFLOPs: 11
Number of params: 54M
Top 1 Accuracy: 82.4%

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
AutoFormer: Searching Transformers for Visual Recognition | Papers | HyperAI