OVO: One-shot Vision Transformer Search with Online distillation

Dongsheng LiarXiv 2022 · DOI

TL;DR

This paper introduces OVO, a novel one-shot neural architecture search (NAS) framework for Vision Transformers (ViTs). OVO leverages online distillation, where both teacher and student networks are sampled and trained simultaneously, to efficiently discover high-performing ViT architectures without extensive retraining. This approach achieves state-of-the-art results on ImageNet and CIFAR-100, demonstrating its effectiveness in finding optimal ViTs for various dataset sizes.

What Problem Does This Paper Address?

Vision Transformers (ViTs) have shown immense promise in computer vision, but their performance can be suboptimal when trained from scratch on medium or small datasets. Traditional methods for improving ViT performance often involve knowledge distillation from pre-trained convolutional neural networks (CNNs). However, the inherent gap between CNN and ViT architectures can lead to sub-optimal distillation results. Furthermore, searching for optimal ViT architectures is computationally expensive. This paper tackles these challenges by proposing a unified framework that simultaneously searches for the best ViT architectures and optimal distillation strategies, making the training process more efficient and effective.

Methods

The core of OVO is its One-shot Vision Transformer search framework with Online distillation. Key aspects include:

  • Large Search Space: OVO defines a comprehensive search space covering crucial ViT dimensions like embedding dimension, number of heads, MLP ratio, and network depth.
  • Supernet Construction: A supernet is built, encompassing all possible sub-architectures within the defined search space.
  • Online Distillation: This is the central innovation. Instead of a fixed teacher-student relationship, OVO dynamically samples both a teacher (a lightweight ResNet) and a student (a ViT subnet) from the supernet during training. The student ViT learns from the teacher CNN through distillation, and importantly, the teacher network is also trained mutually with the student. This "online" aspect allows for the discovery of the best-matched teacher-student pairs for distillation, leading to better-trained subnets.
  • Weight Sharing: Similar to other one-shot NAS methods, OVO utilizes weight sharing across all subnets within the supernet to avoid training each architecture from scratch.
  • Evolutionary Search: After the supernet is trained, an evolutionary search algorithm is employed to select the best-performing sub-architectures based on the inherited weights. This involves crossover and mutation operations to generate new candidate architectures.

Datasets

  • ImageNet: Used for training the supernet and evaluating the performance of the searched ViT architectures.
  • CIFAR-100: Used to validate the effectiveness of OVO on smaller datasets.

Key Insights and Ideas

  • Dynamic Teacher-Student Pairing: The most significant insight is that the optimal distillation strategy is not static. By sampling and training teacher and student networks simultaneously online, OVO can discover the most effective pairings, leading to improved subnet performance.
  • Efficient Supernet Training: Online distillation acts as a strong inductive bias, accelerating the convergence of the supernet training process compared to traditional methods.
  • Bridging the Gap: OVO effectively bridges the gap between CNN teachers and ViT students by allowing them to co-evolve during training, leading to better knowledge transfer.
  • High-Quality Architectures from One-Shot: The framework demonstrates that high-performing ViT architectures can be discovered efficiently through a one-shot NAS approach, without requiring extensive retraining of individual subnets.

Key Results

  • ImageNet Performance: OVO-Ti achieved 73.32% top-1 accuracy on ImageNet, outperforming other state-of-the-art handcrafted and automatically searched transformer models.
  • CIFAR-100 Performance: OVO-Ti achieved 75.2% top-1 accuracy on CIFAR-100, demonstrating its effectiveness on smaller datasets and surpassing recent methods.
  • The paper highlights that OVO can produce thousands of high-quality transformers on tiny or medium datasets.

Limitations and Future Work

  • Computational Cost of Supernet Training: While more efficient than training individual subnets, supernet training can still be computationally intensive. The paper mentions that traditional one-shot NAS methods can be unstable and require long training periods (e.g., 500 epochs) for ViTs. OVO aims to mitigate this, but it's an area for continued improvement.
  • Search Space Design: The performance of NAS methods is heavily dependent on the defined search space. Future work could explore expanding or refining the search space to discover even more diverse and powerful architectures.
  • Teacher Network Choice: While a lightweight ResNet is used as a teacher, exploring different teacher architectures or even other types of models could be a direction for future research.

Summary updated

BibTeX
@misc{li2022ovo,
  author = {Dongsheng Li},
  title = {{OVO: One-shot Vision Transformer Search with Online distillation}},
  year = {2022},
  eprint = {2212.13766},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.13766},
}
Figure