Skip to main content
QUICK REVIEW

[论文解读] S2DNAS:Transforming Static CNN Model for Dynamic Inference via Neural Architecture Search

Zhihang Yuan, Bingzhe Wu|arXiv (Cornell University)|Nov 16, 2019
Advanced Neural Network Applications参考文献 45被引用 8
一句话总结

S2DNAS 提出了一种通用框架,通过神经架构搜索将静态 CNN 模型转换为动态推理网络,通过通道级多阶段架构实现对简单样本的早期退出。其性能与 SOTA 模型(如 MSDNet)相当,同时避免了不规则计算和复杂控制器,使得在资源受限硬件上使用现有深度学习框架实现高效部署成为可能。

ABSTRACT

Recently, dynamic inference has emerged as a promising way to reduce the computational cost of deep convolutional neural network (CNN). In contrast to static methods (e.g. weight pruning), dynamic inference adaptively adjusts the inference process according to each input sample, which can considerably reduce the computational cost on "easy" samples while maintaining the overall model performance. In this paper, we introduce a general framework, S2DNAS, which can transform various static CNN models to support dynamic inference via neural architecture search. To this end, based on a given CNN model, we first generate a CNN architecture space in which each architecture is a multi-stage CNN generated from the given model using some predefined transformations. Then, we propose a reinforcement learning based approach to automatically search for the optimal CNN architecture in the generated space. At last, with the searched multi-stage network, we can perform dynamic inference by adaptively choosing a stage to evaluate for each sample. Unlike previous works that introduce irregular computations or complex controllers in the inference or re-design a CNN model from scratch, our method can generalize to most of the popular CNN architectures and the searched dynamic network can be directly deployed using existing deep learning frameworks in various hardware devices.

研究动机与目标

  • 解决在资源受限环境中静态 CNN 推理带来的高计算成本问题。
  • 在不引入不规则计算或复杂控制器的前提下实现动态推理,以避免影响硬件效率。
  • 开发一种可泛化的框架,将现有 CNN 架构无需重新设计即可转换为多阶段动态模型。
  • 在减少平均 FLOPs 的同时保持高模型准确率,通过自适应的、样本特定的推理阶段实现。
  • 支持在多种硬件平台上使用标准深度学习框架进行实际部署。

提出的方法

  • S2DNAS 通过在给定静态 CNN 上应用预定义变换,生成 CNN 架构空间,创建通道宽度在早期阶段减少的多阶段变体。
  • 采用基于强化学习的神经架构搜索(NAS)从生成的空间中自动识别最优多阶段架构。
  • 该框架沿通道宽度而非深度进行网络拆分,确保所有分类器均可访问深层的语义特征。
  • 每个阶段包含一个分类器,当置信度超过学习到的阈值时即预测并提前退出,从而实现对简单样本的早期退出。
  • 搜索过程通过在训练期间调整各阶段的置信度阈值,优化准确率-计算量之间的权衡。
  • 生成的动态模型由于计算图结构规则、清晰,与现有深度学习框架和硬件加速器兼容。

实验结果

研究问题

  • RQ1能否开发一种通用框架,将任意预训练的静态 CNN 无需架构重设计即转换为动态推理模型?
  • RQ2如何在不引入不规则计算或复杂控制器的前提下实现动态推理,以避免阻碍硬件部署?
  • RQ3基于置信度阈值的早期退出能否在不同数据集和模型上维持高准确率,同时降低平均 FLOPs?
  • RQ4该方法在不同 CNN 架构(如 ResNet、VGG 和 MobileNet)上的泛化能力如何?
  • RQ5不同阶段的阈值设置如何影响准确率-计算量之间的权衡?

主要发现

  • S2DNAS 将 ResNet-20、ResNet-56、ResNet-110、VGG-16BN 和 MobileNetV2 有效转换为动态模型,在 CIFAR-10 和 CIFAR-100 数据集上仅造成极小的准确率下降。
  • 在 CIFAR-10 上,S2DNAS 转换的 ResNet-110 中,61.66% 的测试样本从第一阶段退出,显著降低了平均 FLOPs。
  • 对于 CIFAR-10 上的 ResNet-20,50% 的样本在第二阶段前退出,第一阶段分类器准确率达 98.44%,表明对简单样本的早期检测效果显著。
  • 该方法在准确率-计算量权衡方面与 MSDNet 相当,尤其在低 FLOP 水平下表现优异,且无需手动架构设计。
  • 该框架与剪枝和量化技术正交,结合使用可进一步降低计算开销。
  • S2DNAS 生成的动态模型由于计算图结构规则、清晰,可使用标准深度学习框架在现有硬件上高效部署。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。