[论文解读] BranchyNet: Fast Inference via Early Exiting from Deep Neural Networks
BranchyNet 通过在标准网络中加入侧边退出分支,使易于分类的样本提早退出,从而在保持准确率的同时减少推理时间和能量消耗;联合训练时,使用熵阈值来决定早退出。
Deep neural networks are state of the art methods for many learning tasks due to their ability to extract increasingly better features at each network layer. However, the improved performance of additional layers in a deep network comes at the cost of added latency and energy usage in feedforward inference. As networks continue to get deeper and larger, these costs become more prohibitive for real-time and energy-sensitive applications. To address this issue, we present BranchyNet, a novel deep network architecture that is augmented with additional side branch classifiers. The architecture allows prediction results for a large portion of test samples to exit the network early via these branches when samples can already be inferred with high confidence. BranchyNet exploits the observation that features learned at an early layer of a network may often be sufficient for the classification of many data points. For more difficult samples, which are expected less frequently, BranchyNet will use further or all network layers to provide the best likelihood of correct prediction. We study the BranchyNet architecture using several well-known networks (LeNet, AlexNet, ResNet) and datasets (MNIST, CIFAR10) and show that it can both improve accuracy and significantly reduce the inference time of the network.
研究动机与目标
- 随着模型变得越来越深,激发对更快、更节能推理的需求。
- 引入带有侧出口分支的 BranchyNet 架构,以实现早期预测。
- 提出对所有退出点的联合损失优化以实现正则化并提升性能。
- 展示在标准网络和数据集上的运行时和准确率收益。
- 讨论退出点与阈值的超参数敏感性以及设计注意事项。
提出的方法
- 在基线网络的选定点添加一个或多个侧边分支(出口)。
- 使用对所有退出点的联合加权损失来训练网络,优化退出点特定分类器。
- 推理时,在每个出口计算 softmax 和熵,并在熵低于所学习的阈值时退出。
- 使用 Adam 优化来训练 BranchyNet。
- 通过将 LeNet、AlexNet、ResNet 适配为 BranchyNet 变体并在 MNIST 与 CIFAR-10 上评估来演示性能。
实验结果
研究问题
- RQ1通过 BranchyNet 的分支提前退出是否能够在不牺牲准确率的情况下降低推理延迟和能量消耗?
- RQ2如何选择退出阈值和分支位置以在不同网络和数据集上平衡速度和准确性?
- RQ3联合训练的分支分类器是否比单独训练的整体性能更好?
- RQ4分支特性(深度/宽度)和阈值设置对最终准确率和加速的影响是什么?
主要发现
- BranchyNet 在经测试的网络上实现了显著的推理加速,同时保持或略有提升的准确率。
- B-LeNet 在第一退出点退出约 94% 的样本,CPU 约实现 5.4x 的加速,GPU 约 4.7x。
- B-AlexNet 在第一退出点退出约 65.6% 的样本,在第二退出点退出约 25.2%,总体在 CPU 上约 1.5x、在 GPU 上约 2.4x 的加速。
- B-ResNet 在第一退出点退出约 41.5%,在第二退出点退出约 13.8%,在第三退出点退出约 44.7%,在 CPU 和 GPU 上均实现大约 1.9x 的加速。
- 在各网络之间,BranchyNet 通常在准确率上优于基线,同时降低推理时间,并在保持准确率的前提下找到加速的拐点。
- 退出损失的联合优化提供了正则化效果,有助于缓解梯度消失问题,提升低层的判别能力。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。