Rapid Elastic Architecture Search under Specialized Classes and Resource Constraints

Jing Liu, Bohan Zhuang, Mingkui Tan, Xu Liu, Dinh Phung, Yuanqing Li, Jianfei Cai · DOI

Abstract

In many real-world applications, we often need to handle various deployment scenarios, where the resource constraint and the superclass of interest corresponding to a group of classes are dynamically specified. How to efficiently deploy deep models for diverse deployment scenarios is a new challenge. Previous NAS approaches seek to design architectures for all classes simultaneously, which may not be optimal for some individual superclasses. A straightforward solution is to search an architecture from scratch for each deployment scenario, which however is computation-intensive and impractical. To address this, we present a novel and general framework, called Elastic Architecture Search (EAS), permitting instant specializations at runtime for diverse superclasses with various resource constraints. To this end, we first propose to effectively train an over-parameterized network via a superclass dropout strategy during training. In this way, the resulting model is robust to the subsequent superclasses dropping at inference time. Based on the well-trained over-parameterized network, we then propose an efficient architecture generator to obtain promising architectures within a single forward pass. Experiments on three image classification datasets show that EAS is able to find more compact networks with better performance while remarkably being orders of magnitude faster than state-of-the-art NAS methods, e.g., outperforming OFA (once-for-all) by 1.3% on Top-1 accuracy at a budget around 361M #MAdds on ImageNet-10. More critically, EAS is able to find compact architectures within 0.1 second for 50 deployment scenarios.

Introduction

AI deployment in the real world is rarely a static process. A single device may need to switch between specialized tasks—such as identifying specific animal species versus plant types—while simultaneously adapting to fluctuating hardware constraints like battery levels or background processing loads. Traditional Neural Architecture Search (NAS) methods typically produce a single "generalist" model designed for all classes, which often results in sub-optimal performance for specific subsets (superclasses) of interest.

The EAS framework enables instant specialization of an over-parameterized network into sub-networks tailored for specific superclasses and resource budgets.

Searching for a new architecture from scratch for every possible scenario is computationally prohibitive. The Elastic Architecture Search (EAS) framework addresses this by enabling instant specialization at runtime, finding optimal sub-networks in milliseconds rather than hours.

Methodology

EAS introduces two primary technical innovations to achieve rapid specialization:

Superclass Dropout

To ensure that a large "supernet" (an over-parameterized network) can be effectively pruned at inference time, the authors propose superclass dropout. During training, the output logits of non-target superclasses are randomly "dropped." This forces the network to learn features that are robust to the absence of other classes, preventing interference between sub-tasks and ensuring that specialized sub-networks remain accurate when isolated.

Architecture Generator

Rather than relying on iterative search algorithms like evolution or reinforcement learning, EAS utilizes an Architecture Generator. This LSTM-based module takes the Target Superclass ID and the Resource Budget as inputs. In a single forward pass, it predicts the optimal configuration—including depth, width, and kernel sizes—for the specialized sub-network.

Technical components of EAS: (a) the superclass dropout mechanism and (b) the LSTM-based architecture generator for rapid configuration.

To make these discrete architectural choices differentiable, the framework employs a single-path encoding scheme and the Gumbel-Softmax trick, allowing for end-to-end training of the generator to minimize loss within specified computational bounds.

Experimental Results

The researchers evaluated EAS on benchmarks including ImageNet-10, ImageNet-12, and Car-20. The results demonstrate significant improvements in both efficiency and accuracy:

  • Inference Speed: EAS can generate optimal architectures for 50 different deployment scenarios in less than 0.1 seconds.
  • Accuracy Gains: On ImageNet-10, EAS achieved a 1.3% higher Top-1 accuracy than the state-of-the-art Once-for-All (OFA) method at a comparable budget of ~361M Multiply-Adds (#MAdds).
  • Training Efficiency: Training the architecture generator requires only 0.9 GPU hours, a fraction of the time required by traditional specialized search methods.

Conclusion

Elastic Architecture Search (EAS) represents a significant step toward truly dynamic AI. By transforming architecture search into a simple inference task and utilizing superclass dropout for robustness, EAS allows models to adapt to their environment and task in real-time. Future work may extend this framework to more complex domains such as object detection and semantic segmentation, where resource-aware specialization is equally critical.

Summary updated

Abstract

In many real-world applications, we often need to handle various deployment scenarios, where the resource constraint and the superclass of interest corresponding to a group of classes are dynamically specified. How to efficiently deploy deep models for diverse deployment scenarios is a new challenge. Previous NAS approaches seek to design architectures for all classes simultaneously, which may not be optimal for some individual superclasses. A straightforward solution is to search an architecture from scratch for each deployment scenario, which however is computation-intensive and impractical. To address this, we present a novel and general framework, called Elastic Architecture Search (EAS), permitting instant specializations at runtime for diverse superclasses with various resource constraints. To this end, we first propose to effectively train an over-parameterized network via a superclass dropout strategy during training. In this way, the resulting model is robust to the subsequent superclasses dropping at inference time. Based on the well-trained over-parameterized network, we then propose an efficient architecture generator to obtain promising architectures within a single forward pass. Experiments on three image classification datasets show that EAS is able to find more compact networks with better performance while remarkably being orders of magnitude faster than state-of-the-art NAS methods, e.g., outperforming OFA (once-for-all) by 1.3% on Top-1 accuracy at a budget around 361M #MAdds on ImageNet-10. More critically, EAS is able to find compact architectures within 0.1 second for 50 deployment scenarios.
BibTeX
@misc{liu2021rapid,
  author = {Jing Liu and Bohan Zhuang and Mingkui Tan and Xu Liu and Dinh Phung and Yuanqing Li and Jianfei Cai},
  title = {{Rapid Elastic Architecture Search under Specialized Classes and Resource Constraints}},
  year = {2021},
  eprint = {2108.01224},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.01224},
}
Figure