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.
翻译:最近,基于纯变压器的模型展示了图像分类和探测等视觉任务的巨大潜力。 然而, 变压器网络的设计具有挑战性。 人们观察到, 变压器网络的深度、 嵌入维度和头数可以在很大程度上影响变压器的性能。 先前的模型根据手工制作配置这些维度。 在此工作中, 我们提议一个新的一次性架构搜索框架, 即AutoFormer, 专门用于视觉变压器搜索。 自动格式在超级网络培训期间将不同区块的重量放在同一层中。 受益于该战略, 受过训练的超级网络使数千个子网受到非常严格的训练。 具体地说, 这些具有从超级网络继承的重量的子网的性能可以与从零开始重新训练的功能相仿。 此外, 我们提到的AutoForormerFormers, 超越了ViT 和 DeiT等最新艺术。 特别是, AutoFormer-tiny/ smal/ base, 在图像网上实现了74. 7/84.4% 最高精确度的精确度, 通过5.M//53/7M/ 7M/ declimusbolbal 参数, 最后, 我们核查数据数据库的性测试, 和可转让性测试。