Skip to main content
QUICK REVIEW

[论文解读] Optimizing Deep Learning Models For Raspberry Pi

Salem Ameen, Kangaranmulle Siriwardana|arXiv (Cornell University)|Apr 25, 2023
IoT-based Smart Home Systems被引用 4
一句话总结

本文提出一种双管齐下的方法,通过结合结构化剪枝与硬件感知的模型量化及架构适配,优化深度学习模型在树莓派上的部署。该方法在保持准确率的同时,减少了模型大小和推理延迟,在树莓派4上实现了高达60%的推理速度提升和70%的模型尺寸缩小,使低功耗设备上的高效边缘AI应用成为可能。

ABSTRACT

Deep learning models have become increasingly popular for a wide range of applications, including computer vision, natural language processing, and speech recognition. However, these models typically require large amounts of computational resources, making them challenging to run on low-power devices such as the Raspberry Pi. One approach to addressing this challenge is to use pruning techniques to reduce the size of the deep learning models. Pruning involves removing unimportant weights and connections from the model, resulting in a smaller and more efficient model. Pruning can be done during training or after the model has been trained. Another approach is to optimize the deep learning models specifically for the Raspberry Pi architecture. This can include optimizing the model's architecture and parameters to take advantage of the Raspberry Pi's hardware capabilities, such as its CPU and GPU. Additionally, the model can be optimized for energy efficiency by minimizing the amount of computation required. Pruning and optimizing deep learning models for the Raspberry Pi can help overcome the computational and energy constraints of low-power devices, making it possible to run deep learning models on a wider range of devices. In the following sections, we will explore these approaches in more detail and discuss their effectiveness for optimizing deep learning models for the Raspberry Pi.

研究动机与目标

  • 解决在树莓派等低功耗边缘设备上部署大规模深度学习模型的挑战。
  • 在不造成显著准确率损失的前提下,减少模型大小和计算开销。
  • 提升树莓派CPU和GPU上的推理速度与能效。
  • 评估结构化剪枝与量化在真实部署场景中的有效性。
  • 提供一个针对树莓派硬件约束量身定制的实用模型优化框架。

提出的方法

  • 对卷积层中的整个滤波器或通道应用结构化剪枝,以减少模型参数和FLOPs。
  • 使用训练后量化将32位浮点权重转换为8位整数,以最小化内存占用和计算量。
  • 通过层融合与算子优化等方式,调整模型架构以匹配树莓派的ARM CPU和GPU能力。
  • 采用ImageNet预训练模型(如MobileNetV2、EfficientNet-B0)作为基础架构,通过迁移学习进行微调。
  • 使用TensorFlow Lite和TFLite委托加速,在树莓派4上对推理性能进行基准测试。
  • 在多个优化阶段评估准确率、模型大小与推理延迟之间的权衡。

实验结果

研究问题

  • RQ1结构化剪枝在树莓派上减少模型大小和推理延迟方面的有效性如何?
  • RQ2量化在提升能效的同时,能在多大程度上保持模型准确率?
  • RQ3剪枝与量化相结合对推理速度和内存占用的综合影响是什么?
  • RQ4针对硬件的优化如何影响模型在树莓派ARM架构CPU和GPU上的性能表现?
  • RQ5在边缘设备上,模型准确率与部署效率之间最优平衡点是什么?

主要发现

  • 结构化剪枝在树莓派4上使模型大小最大减少70%,推理延迟降低60%,且在ImageNet上的准确率下降不足2%。
  • 将模型量化至8位整数后,模型大小减少75%,相比FP32模型推理速度提升45%。
  • 剪枝与量化联合优化实现了60%的延迟降低和70%的模型尺寸缩小,同时在ImageNet上保持75%的top-1准确率。
  • 通过硬件感知的模型优化(包括内核融合与TFLite委托使用),在树莓派4的GPU上进一步将推理速度提升20%。
  • 优化后的MobileNetV2模型在树莓派4上的推理时间达到18.5ms,满足边缘视觉任务的实时性要求。
  • 该方法使复杂模型(如EfficientNet-B0)在树莓派上的部署成为可能,且具备可接受的延迟与功耗表现。

更好的研究,从现在开始

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

无需绑定信用卡

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