论文标题
ENAS4D:有效的多阶段CNN体系结构搜索动态推理
ENAS4D: Efficient Multi-stage CNN Architecture Search for Dynamic Inference
论文作者
论文摘要
动态推断是降低卷积神经网络(CNN)的计算成本的可行方法,可以动态调整每个输入样本的计算。实现动态推断的方法之一是使用多阶段神经网络,该网络包含一个子网络,每个阶段都具有预测层。如果阶段的预测足够有信心,则输入样本的推断可以从早期退出。但是,设计多阶段CNN体系结构是一项非平凡的任务。在本文中,我们介绍了一个通用框架ENAS4D,该框架可以有效地搜索最佳的多阶段CNN体系结构,以在精心设计的搜索空间中进行动态推断。首先,我们提出了一种用多阶段卷积构建搜索空间的方法。搜索空间包括不同数量的图层,不同的内核大小以及每个阶段的不同数量的通道以及输入样本的分辨率。然后,我们训练一个曾经是全部网络,该网络支持采样多种多阶段CNN体系结构。可以从曾经是所有网络获得专门的多阶段网络,而无需其他培训。最后,我们设计了一种方法来有效地搜索最佳的多阶段网络,该网络可利用一次全部网络的优势从计算成本中进行准确性。 Imagenet分类任务的实验表明,ENAS4D搜索的多阶段CNN始终优于Dyanmic推断的最新方法。特别是,该网络可在平均MAC下达到74.4%的Imagenet TOP-1精度。
Dynamic inference is a feasible way to reduce the computational cost of convolutional neural network(CNN), which can dynamically adjust the computation for each input sample. One of the ways to achieve dynamic inference is to use multi-stage neural network, which contains a sub-network with prediction layer at each stage. The inference of a input sample can exit from early stage if the prediction of the stage is confident enough. However, design a multi-stage CNN architecture is a non-trivial task. In this paper, we introduce a general framework, ENAS4D, which can efficiently search for optimal multi-stage CNN architecture for dynamic inference in a well-designed search space. Firstly, we propose a method to construct the search space with multi-stage convolution. The search space include different numbers of layers, different kernel sizes and different numbers of channels for each stage and the resolution of input samples. Then, we train a once-for-all network that supports to sample diverse multi-stage CNN architecture. A specialized multi-stage network can be obtained from the once-for-all network without additional training. Finally, we devise a method to efficiently search for the optimal multi-stage network that trades the accuracy off the computational cost taking the advantage of once-for-all network. The experiments on the ImageNet classification task demonstrate that the multi-stage CNNs searched by ENAS4D consistently outperform the state-of-the-art method for dyanmic inference. In particular, the network achieves 74.4% ImageNet top-1 accuracy under 185M average MACs.