作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2022, Vol. 48 ›› Issue (3): 181-188. doi: 10.19678/j.issn.1000-3428.0060948

• 体系结构与软件技术 • 上一篇    下一篇

基于改进YOLOv4算法的轻量化网络设计与实现

孔维刚1, 李文婧2, 王秋艳1, 曹鹏程3, 宋庆增1   

  1. 1. 天津工业大学 计算机科学与技术学院, 天津 300387;
    2. 天津工业大学 电气工程与自动化学院, 天津 300387;
    3. 中国电子科技集团公司信息科学研究院, 北京 100086
  • 收稿日期:2021-02-26 修回日期:2021-04-15 发布日期:2021-04-27
  • 作者简介:孔维刚(1997-),男,硕士研究生,主研方向为FPGA开发、嵌入式系统开发、深度学习;李文婧,硕士研究生;王秋艳,副教授、博士;曹鹏程,博士;宋庆增(通信作者),副教授、博士。
  • 基金资助:
    国家自然科学基金(61802281,61702366);天津市自然科学基金(18JCQNJC70300,19JCYBJC15800);天津市教委科研计划项目(2018KJ215,2020KJ112,KYQD1817)。

Design and Implementation of Lightweight Network Based on Improved YOLOv4 Algorithm

KONG Weigang1, LI Wenjing2, WANG Qiuyan1, CAO Pengcheng3, SONG Qingzeng1   

  1. 1. School of Computer Science and Technology, Tiangong University, Tianjin 300387, China;
    2. School of Electrical Engineering and Automation, Tiangong University, Tianjin 300387, China;
    3. Information Science Academy of China Electronics Technology Group Corporation, Beijing 100086, China
  • Received:2021-02-26 Revised:2021-04-15 Published:2021-04-27

摘要: 在嵌入式设备上进行目标检测时易受能耗和功耗等限制,使得传统目标检测算法效果不佳。为此,对YOLOv4算法进行优化,设计YOLOv4-Mini网络结构,将其特征提取网络由CSPDarkNet53改为MobileNetv3-large并进行INT8量化处理,其中网络结构利用PW和DW卷积操作代替传统卷积操作以大幅减少计算量。采用SE模块为通道施加注意力机制,激活函数层运用h-swish非线性激活函数,在保证精度的情况下降低网络计算量。同时,通过量化感知训练将权重转为INT8类型,以实现模型轻量化,进一步降低网络参数量和计算量,从而在嵌入式设备上完成无人机数据集的目标检测任务。在NVIDIA Jetson Xavier NX设备上进行测试,结果显示,YOLOv4-MobileNetv3网络的mAP为34.3%,FPS为30,YOLOv4-Mini网络的mAP为32.5%,FPS为73,表明YOLOv4-Mini网络能够在低功耗、低能耗的嵌入式设备上完成目标实时检测任务。

关键词: 目标检测, 模型压缩, 嵌入式设备, 轻量化神经网络, 模型量化, Jetson Xavier NX设备

Abstract: Target detection using embedded devices is limited by energy and power consumption, deteriorating the performance of traditional target detection algorithms.Therefore, to address this issue, the YOLOv4 algorithm is optimized;the YOLOv4-Mini network structure is designed;the feature extraction network is changed from CSPDarkNet53 to MobileNetv3-large;and INT8 quantization processing is carried out.The network structure uses PW and DW convolution operations to replace the traditional convolution operation to greatly reduce the amount of calculation.The SE module is used to apply attention mechanism to the channel, and h-swish nonlinear activation function is used in the activation function layer to reduce the amount of network calculation while ensuring accuracy. Concurrently, the weight is transformed into INT8 type through quantitative perception training to realize the lightweight of the model and further reduce the amount of network parameters and computation, in addition to completing the target detection task of UAV data set on embedded devices.The test results on NVIDIA Jetson Xavier NX show that the mAP of YOLOv4-MobileNetv3 network is 34.3%, the FPS is 30, the mAP of YOLOv4-Mini network is 32.5%, and the FPS is 73 indicating that the YOLOv4-Mini network can complete the target real-time detection task on the embedded device with low power consumption and low energy consumption.

Key words: target detection, model compression, embedded device, lightweight neural network, model quantification, Jetson Xavier NX equipment

中图分类号: