Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2024, Vol. 58 Issue (9): 1811-1821    DOI: 10.3785/j.issn.1008-973X.2024.09.006
    
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
Download: HTML     PDF(2293KB) HTML
Export: BibTeX | EndNote (RIS)      

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 wordselectrode defect      deformable convolution      small object      large aspect ratio object      YOLOv5     
Received: 29 July 2023      Published: 30 August 2024
CLC:  TP 391  
Fund:  福建省科技计划资助项目(2020Y0039).
Corresponding Authors: Lixin ZHENG     E-mail: jlu_rqd@163.com;zlx@hqu.edu.cn
Cite this article:

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.

URL:

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


基于改进YOLOv5的锂电池极片缺陷检测方法

针对同时存在多种小目标、大长宽比目标缺陷的锂电池极片复杂表面,基于可变形卷积和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 
Fig.1 Structure of DDCNet-YOLO model
Fig.2 Deformable downsampling convolution module
Fig.3 Diagram of sampling positions of conventional and deformable convolution
Fig.4 Context augmentation module
Fig.5 Structure of decoupled head with attention
Fig.6 Schematic diagrams of ground truth box and predicted box with different aspect ratios
Fig.7 Influence of large aspect ratio objects on calculation of loss function
Fig.8 Eleven classes of defective images
检测分支锚框尺寸
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)
Tab.1 Anchor size generated by each detection branch
方法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
Tab.2 Comparison of different fusion methods for 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
Tab.3 Comparison of six attention detection heads
模型
序号
方法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
Tab.4 Results of ablation experiments
方法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
Tab.5 Comparative experimental results of different algorithms on lithium battery electrode dataset
Fig.9 Curve of mAP50 during training
Fig.10 Curve of mAP50∶95 during training
Fig.11 Curve of loss during training
Fig.12 Visualization comparison of model feature maps
GPUtd
DDCNet-YOLOsDDCNet-YOLO
NVIDIA GeForce GTX 965M0.71 s1.19 s
NVIDIA GeForce RTX 3080Ti22.99 ms28.88 ms
Tab.6 Comparison of average detection time between two models on different hardwares
Fig.13 Deployment results of DDCNet-YOLOs and 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] Jiansong CHEN,Yijun CAI. Lightweight object detection scheme for garbage classification scenario[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(1): 71-77.
[2] Xin JIN,Jian-jun ZHUANG,Zi-heng XU. Lightweight YOLOv5s network-based algorithm for identifying hazardous objects under vehicles[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(8): 1516-1526.
[3] Hao-jie FANG,Hong-zhao DONG,Shao-xuan LIN,Jian-yu LUO,Yong FANG. Driver fatigue state detection method based on multi-feature fusion[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(7): 1287-1296.
[4] Qing-lu MA,Jia-ping LU,Xiao-yao TANG,Xue-feng DUAN. Improved YOLOv5s flame and smoke detection method in road tunnels[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(4): 784-794.
[5] Yao ZENG,Fa-qin GAO. Surface defect detection algorithm of electronic components based on improved YOLOv5[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(3): 455-465.
[6] Shu-qin YANG,Yu-hao MA,Ming-yu FANG,Wei-xing QIAN,Jie-xuan CAI,Tong LIU. Lane detection method in complex environments based on instance segmentation[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(4): 809-815, 832.
[7] Tian-le YUAN,Ju-long YUAN,Yong-jian ZHU,Han-chen ZHENG. Surface defect detection algorithm of thrust ball bearing based on improved YOLOv5[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(12): 2349-2357.
[8] Yun-zuo ZHANG,Wei GUO,Zhao-quan CAI,Wen-bo LI. Remote sensing image target detection combining multi-scale and attention mechanism[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(11): 2215-2223.
[9] Hong-zhao DONG,Hao-jie FANG,Nan ZHANG. Multi-scale object detection algorithm for recycled objects based on rotating block positioning[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(1): 16-25.
[10] Yao JIN,Wei ZHANG. Real-time fire detection algorithm with Anchor-Free network architecture[J]. Journal of ZheJiang University (Engineering Science), 2020, 54(12): 2430-2436.
[11] BO Xiang, ZHOU Ji, LI Jian-Long, et al. Time reversal detection of small bottom object in oceanic shallow water[J]. Journal of ZheJiang University (Engineering Science), 2009, 43(7): 1187-1191.