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
Most Neural Architecture Search (NAS) methods aim to find a single "one-size-fits-all" model that performs well across all possible classes and deployment scenarios. However, real-world applications are often more specialized. For instance, a mobile application might only need to classify specific species of animals, making the model's ability to recognize unrelated categories like cars or furniture redundant and wasteful of computational resources.
Existing "once-for-all" approaches allow for hardware adaptation but still assume the model must predict all classes simultaneously. If a truly specialized model for a specific subset of classes is required, traditional methods typically necessitate searching from scratch or retraining, which is computationally expensive. The EAS framework addresses this by enabling instant specialization: finding an accurate, compact architecture for a specific superclass (e.g., "animals" or "plants") under a specific resource budget at runtime.
Methods
The EAS framework introduces two primary innovations to bridge the gap between general training and specialized inference.
Superclass Dropout
During the training of a large, "over-parameterized" mother network, the authors implement a superclass dropout strategy. By randomly dropping the output logits of non-target superclasses, the network is forced to become robust to the absence of certain classes. This ensures that sub-networks extracted later maintain high accuracy when their non-target class heads are removed at inference time.
Architecture Generator
To avoid slow evolutionary search algorithms, EAS utilizes an LSTM-based architecture generator. This generator takes a superclass label and a resource budget as input and predicts the optimal depth, width, and kernel sizes for a sub-network in a single forward pass. By employing a single-path encoding with binary gates and the Gumbel-Softmax trick, the architecture search becomes differentiable and highly efficient.
Experiments and Results
The authors evaluated EAS on three image classification benchmarks: ImageNet-10, ImageNet-12, and Car-20. These datasets were grouped into superclasses to test the framework's specialization capabilities.
- Superior Accuracy: On ImageNet-10, EAS outperformed the state-of-the-art "Once-for-All" (OFA) method by 1.3% in Top-1 accuracy at a similar computational budget (~361M Multiply-Adds).
- Extreme Speed: EAS can find optimal architectures for 50 different deployment scenarios in under 0.1 seconds. This is orders of magnitude faster than traditional NAS methods that require hundreds of GPU hours.
- Specialization Efficiency: The results demonstrate that the optimal architecture for identifying specific superclasses is structurally unique. By tailoring the architecture to the task, EAS achieves higher accuracy with fewer parameters compared to general-purpose models.
Conclusion and Future Work
EAS presents a significant advancement toward "on-the-fly" architecture adaptation for mobile and edge devices. By moving the search logic into a trained generator, the cost of finding a new model drops from hours to milliseconds. Future work may address scenarios where superclasses overlap or are not known a priori. Additionally, extending EAS to more complex tasks like object detection or semantic segmentation could provide further benefits in resource-constrained environments.
Summary updated