Please wait a minute...
浙江大学学报(工学版)  2024, Vol. 58 Issue (1): 71-77    DOI: 10.3785/j.issn.1008-973X.2024.01.008
计算机技术     
面向垃圾分类场景的轻量化目标检测方案
陈健松(),蔡艺军*()
厦门理工学院 光电与通信工程学院,福建 厦门 361024
Lightweight object detection scheme for garbage classification scenario
Jiansong CHEN(),Yijun CAI*()
School of Opto-electronic and Communication Engineering, Xiamen University of Technology, Xiamen 361024, China
 全文: PDF(1542 KB)   HTML
摘要:

针对边缘端进行垃圾检测分类实时性差的问题,提出轻量化的Yolov5垃圾检测解决方案. 引入Stem模块,增强模型对输入图像的特征提取能力. 将backbone的C3模块进行改进,提高特征提取能力. 使用深度可分离卷积替换网络中的3×3降采样卷积,实现模型轻量化. 使用K-means++算法重新计算物体的锚框值,使模型在训练过程中能够更好地预测目标框的大小. 通过实验研究对比可知,改进模型相比于Yolov5s模型,mAP_0.5提升了0.8%,mAP_0.5:0.95提升了3%,模型参数量减少到原来的77.9%,推理速度提升了21.9%,极大地提高了模型的检测性能.

关键词: 垃圾分类Yolov5深度可分离卷积K-means++算法Stem模块    
Abstract:

A lightweight Yolov5 garbage detection solution was proposed aiming at the issue of poor real-time performance in garbage detection classification on edge devices. The Stem module was introduced to enhance the model’s ability to extract features from input images. The C3 module of the backbone was improved to increase feature extraction capabilities. Depthwise separable convolution was used to replace the 3×3 downsampling convolutions in the network, achieving model lightweighting. The K-means++ algorithm was employed to recompute anchor box values for objects, enabling the model to better predict target box sizes during training. Experimental research and comparisons show that the improved model achieves a 0.8% increase in mAP_0.5 and a 3% increase in mAP_0.5:0.95, while reducing model parameters by 77.9% and improving inference speed by 21.9% compared with the Yolov5s model, significantly enhancing the detection performance of the model.

Key words: garbage classification    Yolov5    depthwise separable convolution    K-means++ algorithm    Stem module
收稿日期: 2023-01-17 出版日期: 2023-11-07
CLC:  TP 391  
基金资助: 国家自然科学基金青年资助项目(62005232);福建省自然科学基金面上项目(2020J01294)
通讯作者: 蔡艺军     E-mail: 1425633559@qq.com;yijuncai@foxmail.com
作者简介: 陈健松(1998—),男,硕士生,从事嵌入式AI的研究. orcid.org/0000-0002-9557-233X. E-mail: 1425633559@qq.com
服务  
把本文推荐给朋友
加入引用管理器
E-mail Alert
作者相关文章  
陈健松
蔡艺军

引用本文:

陈健松,蔡艺军. 面向垃圾分类场景的轻量化目标检测方案[J]. 浙江大学学报(工学版), 2024, 58(1): 71-77.

Jiansong CHEN,Yijun CAI. Lightweight object detection scheme for garbage classification scenario. Journal of ZheJiang University (Engineering Science), 2024, 58(1): 71-77.

链接本文:

https://www.zjujournals.com/eng/CN/10.3785/j.issn.1008-973X.2024.01.008        https://www.zjujournals.com/eng/CN/Y2024/V58/I1/71

图 1  Yolov5算法的改进树状图
图 2  改进后的Yolov5模型结构图
图 3  Stem模块的结构图
图 4  深度可分离卷积模块的结构图
图 5  C3改进模块的结构图
训练参数 参数值 训练参数 参数值
动量 0.937 循环学习率 0.1
权重衰减率 0.0005 预热学习轮次 3
批量大小 32 预热学习动量 0.8
迭代次数 100 预热初始学习率 0.1
初始学习率 0.01
表 1  超参数设置
图 6  Yolov5s模型和改进模型的性能对比图
模型 P R mAP@0.5 mAP@0.5:0.95 Np/106 t/ms
Yolov5s 0.834 0.792 0.861 0.529 7.026307 135.9
Yolov5s+K-means++ 0.855 0.836 0.883 0.555 7.026307 135.9
改进模型 0.859 0.777 0.849 0.532 5.421475 106.1
改进模型+K-means++ 0.897 0.811 0.869 0.559 5.421475 106.1
表 2  Yolov5s模型和改进模型的实验结果对比
图 7  Yolov5s模型和改进模型的检测结果对比图
1 GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Columbus: IEEE, 2014: 580-587.
2 HE K M, ZHANG X, REN S, et al Spatial pyramid pooling in deep convolutional networks for visual recognition[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015, 37 (9): 1904- 1916
doi: 10.1109/TPAMI.2015.2389824
3 GIRSHICK R. Fast R-CNN [C]// 2015 IEEE International Conference on Computer Vision. Santiago: IEEE, 2015: 1440-1448.
4 REN S, HE K, GIRSHICK R, et al Faster R-CNN: towards real time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39 (6): 1137- 1149
doi: 10.1109/TPAMI.2016.2577031
5 REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection [C]// 2015 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2015: 6517-6525.
6 LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multi-box detector [C]// 14th European Conference on Computer Vision. [S. l. ]: Springer, 2016: 21-37.
7 李小波, 李阳贵, 郭宁, 等 融合注意力机制的Yolov5口罩检测算法[J]. 图学学报, 2023, 44 (1): 16- 25
LI Xiaobo, LI Yanggui, GUO ning, et al Yolov5 mask detection algorithm integrating attention mechanism[J]. Journal of Graphics, 2023, 44 (1): 16- 25
8 代牮, 赵旭, 李连鹏, 等 基于改进Yolov5的复杂背景红外弱小目标检测算法[J]. 红外技术, 2022, 44 (5): 504- 512
DAI Xuan, ZHAO Xu, LI Lianpeng, et al Infrared dim small target detection algorithm based on improved Yolov5 in complex background[J]. Infrared Technology, 2022, 44 (5): 504- 512
9 李仁鹰, 钱慧芳, 郭佳豪, 等 基于M-Yolov4模型的轻量化目标检测算法[J]. 国外电子测量技术, 2022, 41 (4): 15- 21
LI Renying, QIAN Huifang, GUO Jiahao, et al Lightweight target detection algorithm based on M-Yolov4 model[J]. Foreign Electronic Measurement Technology, 2022, 41 (4): 15- 21
doi: 10.19652/j.cnki.femt.2103482
10 王晨, 袁庆霓, 白欢, 等 面向仓储货物的轻量化目标检测算法[J]. 激光与光电子学进展, 2022, 59 (24): 74- 80
WANG Chen, YUAN Qingni, BAI Huan, et al Lightweight object detection algorithm for warehousing goods[J]. Progress in Laser and Optoelectronics, 2022, 59 (24): 74- 80
11 秦伟伟, 宋泰年, 刘洁瑜 基于轻量化 Yolov3的遥感军事目标检测算法[J]. 计算机工程与应用, 2021, 57 (21): 263- 269
QIN Weiwei, SONG Tainian, LIU Jieyu Remote sensing military target detection algorithm based on lightweight Yolov3[J]. Computer Engineering and Application, 2021, 57 (21): 263- 269
doi: 10.3778/j.issn.1002-8331.2106-0026
12 王相友, 李晏兴, 杨振宇, 等 基于改进Yolov4模型的马铃薯中土块石块检测方法[J]. 农业机械学报, 2021, 52 (8): 241- 247
WANG Xiangyou, LI Yanxing, YANG Zhenyu, et al Detection method of soil and stone in potato based on improved Yolov4 model[J]. Journal of Agricultural Machinery, 2021, 52 (8): 241- 247
13 陈田, 黄家才, 张铎, 等 基于深度学习的移动机器人障碍物检测研究[J]. 南京工程学院学报: 自然科学版, 2022, 20 (2): 8- 12
CHEN Tian, HUANG Jiacai, ZHANG Duo, et al Research on obstacle detection of mobile robots based on deep learning[J]. Journal of Nanjing Institute of Engineering: Natural Science Edition, 2022, 20 (2): 8- 12
14 杨小冈, 高凡, 卢瑞涛, 等 基于改进Yolov5的轻量化航空目标检测方法[J]. 信息与控制, 2022, 51 (3): 361- 368
YANG Xiaogang, GAO Fan, LU Ruitao, et al A lightweight aerial target detection method based on improved Yolov5[J]. Information and Control, 2022, 51 (3): 361- 368
doi: 10.13976/j.cnki.xk.2021.1240
15 李志刚, 张娜. 一种轻量型Yolov5交通标志识别方法[J]. 电讯技术, 2022, 62(9): 1201-1206.
LI Zhigang, ZHANG Na. A lightweight Yolov5 traffic sign recognition method [J/OL]. Tel-Ecommunication Technology, 2022, 62(9): 1201-1206.
16 倪伟健, 秦会斌 GSDCPeleeNet: 基于PeleeNet的高效轻量化卷积神经网络[J]. 电子技术应用, 2021, 47 (3): 22- 26
NI Weijian, QIN Huibin GSDCPeleeNet: efficient lightweight convolutional neural network based on PeleeNet[J]. Electronic Technology Application, 2021, 47 (3): 22- 26
17 刘宇宸, 石刚, 崔青, 等 改进MobileNetv3-Yolov3交通标志牌检测算法[J]. 东北师大学报: 自然科学版, 2022, 54 (2): 53- 60
LIU Yuchen, SHI Gang, CUI Qing, et al Improved MobileNetv3-Yolov3 traffic sign detection algorithm[J]. Journal of Northeast Normal University: Natural Science Edition, 2022, 54 (2): 53- 60
18 王静, 白云 基于改进Yolov5s的车辆目标检测算法[J]. 信息与电脑(理论版), 2022, 34 (10): 80- 83
WANG Jing, BAI Yun Vehicle target detection algorithm based on improved Yolov5s[J]. Information and Computer (Theoretical Edition), 2022, 34 (10): 80- 83
19 罗安能, 万海斌, 司志巍, 等 基于改进Yolov5s的可回收垃圾的检测算法[J]. 激光与光电子学进展, 2023, 60 (10): 130- 137
LUO Anneng, WAN Haibin, SI Zhiwei, et al Detection algorithm of recyclable garbage based on improved Yolov5s[J]. Progress in Laser and Optoelectronics, 2023, 60 (10): 130- 137
20 闫彬, 樊攀, 王美茸, 等 基于改进Yolov5m的采摘机器人苹果采摘方式实时识别[J]. 农业机械学报, 2022, 53 (9): 28- 38
YAN Bin, FAN Pan, WANG Meirong, et al Real time recognition of apple picking method based on improved YoloV5m picking robot[J]. Journal of Agricultural Machinery, 2022, 53 (9): 28- 38
21 邢晋超, 潘广贞 改进Yolov5s的手语识别算法研究[J]. 计算机工程与应用, 2022, 58 (16): 194- 203
XING Jinchao, PAN Guangzhen Research on improved Yolov5s sign language recognition algorithm[J]. Computer Engineering and Application, 2022, 58 (16): 194- 203
22 龙赛, 宋晓凤, 张苏, 等 改进Yolov5s的航拍图像车辆检测研究[J]. 激光杂志, 2022, 43 (10): 22- 29
LONG Sai, SONG Xiaofeng, ZHANG Su, et al Research on improving Yolov5s aerial image vehicle detection[J]. Laser Magazine, 2022, 43 (10): 22- 29
doi: 10.14016/j.cnki.jgzz.2022.10.022
23 王晓雯, 梁博, 刘芳芳 基于注意力机制与加权盒函数的Yolov5的行人摔倒检测算法[J]. 山西大学学报: 自然科学版, 2023, 46 (2): 334- 341
WANG Xiaowen, LIANG Bo, LIU Fang-fang Yolov5 pedestrian fall detection algorithm based on attention mechanism and weighted box function[J]. Journal of Shanxi University: Natural Science Edition, 2023, 46 (2): 334- 341
24 王文胜, 李继旺, 吴波, 等 基于Yolov5交通标志识别的智能车设计[J]. 国外电子测量技术, 2021, 40 (10): 158- 164
WANG Wensheng, LI Jiwang, WU Bo, et al Intelligent vehicle design based on Yolov5 traffic sign recognition[J]. Foreign Electronic Measurement Technology, 2021, 40 (10): 158- 164
[1] 金鑫,庄建军,徐子恒. 轻量化YOLOv5s网络车底危险物识别算法[J]. 浙江大学学报(工学版), 2023, 57(8): 1516-1526.
[2] 方浩杰,董红召,林少轩,罗建宇,方勇. 多特征融合的驾驶员疲劳状态检测方法[J]. 浙江大学学报(工学版), 2023, 57(7): 1287-1296.
[3] 马庆禄,鲁佳萍,唐小垚,段学锋. 改进YOLOv5s的公路隧道烟火检测方法[J]. 浙江大学学报(工学版), 2023, 57(4): 784-794.
[4] 曾耀,高法钦. 基于改进YOLOv5的电子元件表面缺陷检测算法[J]. 浙江大学学报(工学版), 2023, 57(3): 455-465.
[5] 柳长源,何先平,毕晓君. 融合注意力机制的高效率网络车型识别[J]. 浙江大学学报(工学版), 2022, 56(4): 775-782.
[6] 袁天乐,袁巨龙,朱勇建,郑翰辰. 基于改进YOLOv5的推力球轴承表面缺陷检测算法[J]. 浙江大学学报(工学版), 2022, 56(12): 2349-2357.
[7] 张云佐,郭威,蔡昭权,李文博. 联合多尺度与注意力机制的遥感图像目标检测[J]. 浙江大学学报(工学版), 2022, 56(11): 2215-2223.
[8] 董红召,方浩杰,张楠. 旋转框定位的多尺度再生物品目标检测算法[J]. 浙江大学学报(工学版), 2022, 56(1): 16-25.