Please wait a minute...
浙江大学学报(工学版)  2024, Vol. 58 Issue (9): 1811-1821    DOI: 10.3785/j.issn.1008-973X.2024.09.006
计算机与控制工程     
基于改进YOLOv5的锂电池极片缺陷检测方法
冉庆东1(),郑力新2,*()
1. 华侨大学 信息科学与工程学院,福建 厦门 361021
2. 华侨大学 工学院,福建 泉州 362021
Defect detection method of lithium battery electrode based on improved YOLOv5
Qingdong RAN1(),Lixin ZHENG2,*()
1. College of Information Science and Engineering, Huaqiao University, Xiamen 361021, China
2. College of Engineering, Huaqiao University, Quanzhou 362021, China
 全文: PDF(2293 KB)   HTML
摘要:

针对同时存在多种小目标、大长宽比目标缺陷的锂电池极片复杂表面,基于可变形卷积和YOLOv5提出DDCNet-YOLO算法模型. 在主干网络部分构建出可变形下采样卷积主干网络(DDCNet),在特征融合部分引入上下文增强模块(CAM),并使用构造的可变形卷积块(DCB)替换C3模块,在检测头部分设计带有注意力机制的解耦头AD-Head. 提出RIoU方法优化不同长宽比目标的损失计算. 实验表明,DDCNet-YOLO模型相较于YOLOv5s及YOLOv5m模型在mAP50上分别提高了6.2个百分点和3.7个百分点. 仅通过DDCNet和注意力机制解耦头构建了DDCNet-YOLOs轻量化模型,与YOLOv5s模型相比,参数量减少7.2个百分点,mAP50∶95提升8.9个百分点. 对2种模型通过C++的方式进行了部署. 本研究所提出的2种算法模型分别侧重于精度和轻量化,都能够在满足一定实际检测速度的条件下,达到较高的检测精度.

关键词: 极片缺陷可变形卷积小目标大长宽比目标YOLOv5    
Abstract:

The DDCNet-YOLO algorithm model was proposed based on the deformable convolution and YOLOv5, aiming at the complex lithium battery electrode surface with multiple small object defects and large aspect ratio object defects at the same time. The deformable downsampling convolution network (DDCNet) was constructed in the backbone. The context augmentation module (CAM) was introduced in the feature fusion part and the deformable convolution block (DCB) was used to replace the C3 module. AD-Head, a decoupling head with an attention mechanism, was designed in the head part. The RIoU method was proposed to optimize the loss calculation for different aspect ratio objects. Experiments showed that the DDCNet-YOLO model improved the mAP50 by 6.2 percentage points compared to YOLOv5s model and by 3.7 percentage points compared to YOLOv5m model. The lightweight model DDCNet-YOLOs, constructed by DDCNet and a decoupling head with an attention mechanism. The DDCNet-YOLOs improved the mAP50:95 by 8.9 percentage points and reduced the number of parameters by 7.2 percentage points, compared with the YOLOv5s model. In addition, both models were deployed based on the C++. The two algorithmic models focus on accuracy and speed respectively, but both can achieve high accuracy under the condition of meeting the actual detection speed requirement.

Key words: electrode defect    deformable convolution    small object    large aspect ratio object    YOLOv5
收稿日期: 2023-07-29 出版日期: 2024-08-30
CLC:  TP 391  
基金资助: 福建省科技计划资助项目(2020Y0039).
通讯作者: 郑力新     E-mail: jlu_rqd@163.com;zlx@hqu.edu.cn
作者简介: 冉庆东(1997—),男,硕士生,从事计算机视觉与深度学习研究. orcid.org/0009-0005-4072-3558. E-mail:jlu_rqd@163.com
服务  
把本文推荐给朋友
加入引用管理器
E-mail Alert
作者相关文章  
冉庆东
郑力新

引用本文:

冉庆东,郑力新. 基于改进YOLOv5的锂电池极片缺陷检测方法[J]. 浙江大学学报(工学版), 2024, 58(9): 1811-1821.

Qingdong RAN,Lixin ZHENG. Defect detection method of lithium battery electrode based on improved YOLOv5. Journal of ZheJiang University (Engineering Science), 2024, 58(9): 1811-1821.

链接本文:

https://www.zjujournals.com/eng/CN/10.3785/j.issn.1008-973X.2024.09.006        https://www.zjujournals.com/eng/CN/Y2024/V58/I9/1811

图 1  DDCNet-YOLO模型结构
图 2  可变形下采样卷积模块
图 3  常规卷积和可变形卷积采样位置示意图
图 4  上下文增强模块
图 5  融合注意力机制的解耦头结构
图 6  不同长宽比的真实目标框和预测目标框示意图
图 7  大长宽比目标对损失函数计算的影响
图 8  十一类缺陷图像示例
检测分支锚框尺寸
P3(14,12),(22,19),(25,69)
P4(35,199),(64,118),(31,598)
P5(371,61),(82,295),(49,494)
P6(1215,41),(809,92),(1226,131)
表 1  各检测分支生成锚框尺寸
方法P/106mAP50/%mAP50S/%mAP50S(val)/%
baseline7. 0470.973.470.1
+加权融合7.5371.973.571.4
+自适应融合7.5672. 072.470.7
+拼接融合7.5372.973.972.7
表 2  CAM不同融合方式对比
方法P/106mAP50/%mAP50∶95/%
baseline7. 0470.936.3
+SimAM[24]7. 0469.137. 0
+SA[25]7. 0469.137.3
+ECA[26]7. 0472.741.7
+SE[27]7. 0870.540.8
+CoT[28]10. 0670.937.7
+ParNet[29]10.8374.241.1
表 3  6种注意力机制检测头对比
模型
序号
方法P/106mAP50/
%
mAP50S/
%
mAP50L/
%
mAP50∶95/
%
Abaseline7. 0470.973.467.936.3
BA+DDCNet6. 0271.670.772.741.5
CB+AD-Heads6.5372.474.470. 045.2
DB+CAM6.5171.274.267.545.4
ED+DCB6.6172.671. 074.644.7
FE+AD-Head14.1473.972.475.945.3
GF+P622.7676.875.478.443.8
HG+RIoU22.7677.175.679. 045.7
表 4  消融实验结果
方法P/106t/
ms
mAP50/
%
mAP50S/
%
mAP50L/
%
mAP50∶95/
%
Swin-Transformer[30]37. 0356.846.437.157.722.3
RetinaNet[5]36.3144.653.446.961.125.4
文献[10]9.3323.552.263.938.227.3
YOLOv5s7. 0422. 070.973.467.936.3
文献[11]7. 0824.170.472. 068.537.4
DDCNet-YOLOs
(本研究)
6.5322.872.474.470. 045.2
YOLOv5m20.8927.673.472.674.342.6
DDCNet-YOLO
(本研究)
22.7626.577.175.679. 045.7
表 5  不同算法在锂电池极片数据集中的实验结果对比
图 9  训练过程mAP50曲线
图 10  训练过程mAP50∶95曲线
图 11  训练过程损失曲线
图 12  模型特征图可视化对比
GPUtd
DDCNet-YOLOsDDCNet-YOLO
NVIDIA GeForce GTX 965M0.71 s1.19 s
NVIDIA GeForce RTX 3080Ti22.99 ms28.88 ms
表 6  2种模型在不同硬件上平均检测时间对比
图 13  DDCNet-YOLOs和DDCNet-YOLO部署结果
1 朱贺, 杨华, 尹周平 纹理表面缺陷机器视觉检测方法综述[J]. 机械科学与技术, 2023, 42 (8): 1293- 1315
ZHU He, YANG Hua, YIN Zhouping Review of machine vision detection methods for texture surface defects[J]. Mechanical Science and Technology for Aerospace Engineering, 2023, 42 (8): 1293- 1315
2 黄梦涛, 连一鑫 基于改进Canny算子的锂电池极片表面缺陷检测[J]. 仪器仪表学报, 2021, 42 (10): 199- 209
HUANG Mengtao, LIAN Yixin Lithium battery electrode plate surface defect detection based on improved Canny operator[J]. Chinese Journal of Scientific Instrument, 2021, 42 (10): 199- 209
3 黄梦涛, 王露 锂电池极片缺陷特征融合与分类[J]. 制造业自动化, 2021, 43 (10): 61- 63
HUANG Mengtao, WANG Lu Defect feature fusion and classification of lithium battery pole pieces[J]. Manufacturing Automation, 2021, 43 (10): 61- 63
doi: 10.3969/j.issn.1009-0134.2021.10.013
4 LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multibox detector [C]// European Conference on Computer Vision . Heideberg: Springer, 2016: 21−37.
5 LIN T, GOYAL P, GIRSHICK R, et al Focal loss for dense object detection[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 42 (2): 318- 327
6 REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition . Las Vegas: IEEE, 2016: 779−788.
7 REDMON J, FARHADI A. YOLO9000: better, faster, stronger [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition . Honolulu: IEEE, 2017: 6517−6525.
8 REDMON J, FARHADI A. YOLOv3: an incremental improvement [EB/OL]. (2018-04-08) [2023-07-23]. https://arxiv. org/abs/1804.02767.
9 BOCHKOVSKIY A, WANG C Y, LIA O H. YOLOv4: optimal speed and accuracy of object detection [EB/OL]. (2020-04-23) [2023-07-25]. https://arxiv. org/abs/2004.10934.
10 刘国栋. 基于深度学习的锂电池极片表面缺陷检测方法研究[D]. 广州:广东工业大学, 2022.
LIU Guodong. Research on surface defect detection method of lithium battery electrode based on deep learning [D]. Guangzhou: Guangdong University of Technology, 2022.
11 葛钊明, 胡跃明 基于改进YOLOv5的锂电池极片缺陷检测[J]. 激光杂志, 2023, 44 (2): 25- 29
GE Zhaoming, HU Yueming Lithium battery electrode defect detection method based on improved YOLOv5[J]. Laser Journal, 2023, 44 (2): 25- 29
12 董刚, 谢维成, 黄小龙, 等 深度学习小目标检测算法综述[J]. 计算机工程与应用, 2023, 59 (11): 16- 27
DONG Gang, XIE Weicheng, HUANG Xiaolong, et al Review of small object detection algorithms based on deep learning[J]. Computer Engineering and Applications, 2023, 59 (11): 16- 27
doi: 10.3778/j.issn.1002-8331.2211-0377
13 张艳, 张明路, 吕晓玲, 等 深度学习小目标检测算法研究综述[J]. 计算机工程与应用, 2022, 58 (15): 1- 17
ZHANG Yan, ZHANG Minglu, LU Xiaoling, et al Review of research on small target detection based on deep learning[J]. Computer Engineering and Applications, 2022, 58 (15): 1- 17
doi: 10.3778/j.issn.1002-8331.2112-0176
14 陈航. 基于深度学习的小目标检测算法研究[D]. 绵阳:西南科技大学, 2023.
CHEN Hang. Research on the small object detection algorithm based on deep learning [D]. Mianyang: Southwest University of Science and Technology, 2023.
15 沈翔. 基于RetinaNet的小目标检测提升方法研究[D]. 南京:南京邮电大学, 2023.
SHEN Xiang. Research on the improvement methods for small object detection based on RetinaNet [D]. Nanjing: Nanjing University of Posts and Telecommunications, 2023.
16 吴陈尧. 遥感图像中旋转目标检测方法的设计与实现[D]. 成都:电子科技大学, 2023.
WU Chenyao. Design and implementation of rotating object detection method in remote sensing images [D]. Chengdu: University of Electronic Science and Technology of China, 2023.
17 陈凯. 基于改进级联R-CNN的瓷砖表面瑕疵检测算法[D]. 杭州:浙江理工大学, 2023.
CHEN Kai. Tile surface defect detection algorithm based on improved Cascaded R-CNN [D]. Hangzhou: Zhejiang Sci-Tech University, 2023.
18 张锟. 高分辨率遥感图像目标检测方法研究[D]. 广州:华南理工大学, 2023.
ZHANG Kun. Study on objects detection algorithm in high-resolution remote sensing image [D]. Guangzhou: South China University of Technology, 2023.
19 肖进胜, 赵陶, 周剑, 等 基于上下文增强和特征提纯的小目标检测网络[J]. 计算机研究与发展, 2023, 60 (2): 465- 474
XIAO Jinsheng, ZHAO Tao, ZHOU Jian, et al Small target detection network based on context augmentation and feature refinement[J]. Journal of Computer Research and Development, 2023, 60 (2): 465- 474
doi: 10.7544/issn1000-1239.202110956
20 DAI J, QI H, XIONG Y, et al. Deformable convolutional networks [C]// Proceedings of the 2017 IEEE International Conference on Computer Vision . Washington: IEEE, 2017: 764−773.
21 ZHU X Z, HU H, LIN S, et al. Deformable ConvNets v2: more deformable, better results [C]// Proceedings of the 2019 IEEE Conference on Computer Vision and Pattern Recognition . Piscataway: IEEE, 2019: 9308−9316.
22 WANG W, DAI J, CHEN Z, et al. InternImage: exploring large-scale vision foundation models with deformable Convolutions [EB/OL]. (2023-04-17) [2023-07-25]. https://arxiv.org/abs/2211.05778.
23 GE Z, LIU S, WANG F, et al. YOLOX: exceeding YOLO series in 2021 [EB/OL]. (2021-08-06) [2023-07-25]. https://arxiv.org/abs/2107.08430.
24 YANG L, ZHANG R, LI L, et al. SimAM: a simple, parameter-free attention module for convolutional neural networks [C]// International Conference on Machine Learning . San Diego: JMLR, 2021: 11863−11874.
25 ZHANG Q L, YANG Y B. SA-Net: shuffle attention for deep convolutional neural networks [C]// IEEE International Conference on Acoustics, Speech and Signal Processing . Toronto: IEEE, 2021: 2235−2239.
26 WANG Q, WU B, ZHU P, et al. ECA-Net: efficient channel attention for deep convolutional neural networks [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition . Seattle: IEEE, 2020: 11531−11539.
27 HU J, SHEN L, SUN G. Squeeze-and-excitation networks [C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition . Salt Lake City: IEEE, 2018: 7132−7141.
28 LI Y, YAO T, PAN Y, et al Contextual transformer networks for visual recognition[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 45 (2): 1489- 1500
29 GOYAL A, BOCHKOVSKIY A, DENG J, et al. Non-deep networks [EB/OL]. (2021-10-14) [2023-07−25]. https://arxiv. org/abs/2110.07641.
[1] 张会娟,李坤鹏,姬淼鑫,刘振江,刘建娟,张弛. 基于空间相关性增强的无人机检测算法[J]. 浙江大学学报(工学版), 2024, 58(3): 468-479.
[2] 陈健松,蔡艺军. 面向垃圾分类场景的轻量化目标检测方案[J]. 浙江大学学报(工学版), 2024, 58(1): 71-77.
[3] 金鑫,庄建军,徐子恒. 轻量化YOLOv5s网络车底危险物识别算法[J]. 浙江大学学报(工学版), 2023, 57(8): 1516-1526.
[4] 方浩杰,董红召,林少轩,罗建宇,方勇. 多特征融合的驾驶员疲劳状态检测方法[J]. 浙江大学学报(工学版), 2023, 57(7): 1287-1296.
[5] 韩俊,袁小平,王准,陈烨. 基于YOLOv5s的无人机密集小目标检测算法[J]. 浙江大学学报(工学版), 2023, 57(6): 1224-1233.
[6] 马庆禄,鲁佳萍,唐小垚,段学锋. 改进YOLOv5s的公路隧道烟火检测方法[J]. 浙江大学学报(工学版), 2023, 57(4): 784-794.
[7] 曾耀,高法钦. 基于改进YOLOv5的电子元件表面缺陷检测算法[J]. 浙江大学学报(工学版), 2023, 57(3): 455-465.
[8] 艾青林,杨佳豪,崔景瑞. 基于自适应增殖数据增强与全局特征融合的小目标行人检测[J]. 浙江大学学报(工学版), 2023, 57(10): 1933-1944.
[9] 杨淑琴,马玉浩,方铭宇,钱伟行,蔡洁萱,刘童. 基于实例分割的复杂环境车道线检测方法[J]. 浙江大学学报(工学版), 2022, 56(4): 809-815, 832.
[10] 袁天乐,袁巨龙,朱勇建,郑翰辰. 基于改进YOLOv5的推力球轴承表面缺陷检测算法[J]. 浙江大学学报(工学版), 2022, 56(12): 2349-2357.
[11] 张云佐,郭威,蔡昭权,李文博. 联合多尺度与注意力机制的遥感图像目标检测[J]. 浙江大学学报(工学版), 2022, 56(11): 2215-2223.
[12] 董红召,方浩杰,张楠. 旋转框定位的多尺度再生物品目标检测算法[J]. 浙江大学学报(工学版), 2022, 56(1): 16-25.
[13] 徐利锋,黄海帆,丁维龙,范玉雷. 基于改进DenseNet的水果小目标检测[J]. 浙江大学学报(工学版), 2021, 55(2): 377-385.
[14] 林志洁,罗壮,赵磊,鲁东明. 特征金字塔多尺度全卷积目标检测算法[J]. 浙江大学学报(工学版), 2019, 53(3): 533-540.
[15] 潘翔, 周洁, 李建龙, 等. 浅海沉底小目标时的反探测研究[J]. J4, 2009, 43(7): 1187-1191.