基于YOLOv8优化改进的太阳能电池片缺陷检测模型

彭自然,王思远,肖伸平. 基于YOLOv8优化改进的太阳能电池片缺陷检测模型[J]. 光电工程,2024,51(11): 240220. doi: 10.12086/oee.2024.240220
引用本文: 彭自然,王思远,肖伸平. 基于YOLOv8优化改进的太阳能电池片缺陷检测模型[J]. 光电工程,2024,51(11): 240220. doi: 10.12086/oee.2024.240220
Peng Z R, Wang S Y, Xiao S P. A solar cell defect detection model optimized and improved based on YOLOv8[J]. Opto-Electron Eng, 2024, 51(11): 240220. doi: 10.12086/oee.2024.240220
Citation: Peng Z R, Wang S Y, Xiao S P. A solar cell defect detection model optimized and improved based on YOLOv8[J]. Opto-Electron Eng, 2024, 51(11): 240220. doi: 10.12086/oee.2024.240220

基于YOLOv8优化改进的太阳能电池片缺陷检测模型

  • 基金项目:
    国家重点研发计划基金资助项目(2019YFE0122600);湖南省教育厅重点科研项目(22A0423); 湖南省自科基金项目(2023JJ60267, 2022JJ50073)
详细信息
    作者简介:
    *通讯作者: 彭自然, pengziran@hut.edu.cn。
  • 中图分类号: TP391

  • CSTR: 32245.14.oee.2024.240220

A solar cell defect detection model optimized and improved based on YOLOv8

  • Fund Project: Project supported by National Key Research and Development Program of China (2019YFE0122600), Key Scientific Research Project of the Hunan Provincial Department of Education (22A0423), and Hunan Provincial Natural Science Foundation of China (2023JJ60267, 2022JJ50073)
More Information
  • 针对太阳能电池片缺陷检测中存在检测精度低、误检和漏检率高的问题,本文在深度学习模型YOLOv8的基础上进行优化与改进,提出了一种太阳能电池片电致成像(electroluminescent, EL)缺陷检测模型。首先,采用自校准光照学习(self-calibrated illumination, SCI)方法对低光照图像进行预处理,以增强太阳能电池片缺陷的有效特征信息。然后,引入一个空间到深度的注意力模块(space-to-depth, SPD),替换主干网络的第二个跨步卷积层,避免跨步卷积导致的信息丢失,扩大感受野,减少计算量,从而在特征提取时保留更多特征信息。其次,构建了空间双向要素金字塔网络(spatial-BiFPN, S-BFPN),通过多尺度特征融合,解决因太阳能电池片缺陷形状多样性而造成缺陷识别率不稳定的问题。最后,本文改进了损失函数,使用MPDIoU作为损失函数,解决了原有的CIoU损失函数中惩罚项失效的问题。实验结果显示,改进后的YOLOv8模型的mAP达到了96.9%,比原始YOLOv8提升了2.2%,计算量减少了0.2 GFlops,检测速度最高达155 f/s,实现了高精度与高实时性,更适合工业部署。

  • Overview: As the global demand for renewable energy grows, solar power has become an essential source of clean energy. However, solar cells often develop defects, such as microcracks, hotspots, and black spots, during production, which significantly impact their conversion efficiency and lifespan. Traditional manual inspection methods are inefficient and limited by lighting conditions, resulting in low detection accuracy with high false-positive and false-negative rates. To meet the need for efficient and precise automated inspection in industrial production, this study aims to develop a high-accuracy, real-time solar cell defect detection model suitable for practical industrial environments. In response, this paper proposes an optimized solar cell electroluminescent (EL) defect detection model based on the YOLOv8 deep learning framework. First, a self-calibrated illumination (SCI) method is applied to preprocess low-light images, enhancing the effective feature information for detecting solar cell defects. Next, a space-to-depth (SPD) attention module is introduced, replacing the second stride convolution layer in the backbone network to prevent information loss caused by stride convolution, expand the receptive field, and reduce computational load, ensuring more comprehensive feature retention. Additionally, a spatial-BiFPN (S-BFPN) network is constructed to perform multi-scale feature fusion, stabilizing recognition rates even when defect shapes vary. Finally, the loss function is improved with the adoption of MPDIoU, addressing the inadequate penalty issues in the original CIoU loss function. Experimental results show that the improved YOLOv8 model achieves an mAP of 96.9%, marking a 2.2% increase over the original YOLOv8, while reducing computational load by 0.2 GFlops. The detection speed reaches a maximum of 155 FPS, demonstrating high accuracy and real-time performance, making it more suitable for industrial applications.

  • 加载中
  • 图 1  YOLOv8n网络结构图

    Figure 1.  YOLOv8n network structure

    图 2  SCI的结构

    Figure 2.  Structure of SCI

    图 3  具体算法实现流程

    Figure 3.  Specific algorithm implementation flow

    图 4  scale为2的SPD示意图

    Figure 4.  Schematic diagram of SPD with scale=2

    图 5  Backbone部分不同位置的Conv模块

    Figure 5.  Conv modules in different positions of the Backbone part

    图 6  四种特征融合结构示意图

    Figure 6.  Schematic diagram of four features of fusion structure

    图 7  MPDIOU损失函数的计算

    Figure 7.  Calculation of MPDIOU loss function

    图 8  改进后的EL-YOLO模型

    Figure 8.  Improved EL-YOLO model

    图 9  三种主要缺陷种类图

    Figure 9.  Diagram of three major defect types

    图 10  不同增强方法的视觉对比

    Figure 10.  Visual comparison of different enhancement methods

    图 11  本文算法与YOLOv8n检测效果对比

    Figure 11.  Comparison of detection effect between the proposed algorithm and YOLOv8n

    图 12  本文算法与YOLOv8n的PRPR曲线对比

    Figure 12.  Comparison of P, R, and PR curves between the algorithm in this paper and YOLOv8n

    图 13  损失函数对比

    Figure 13.  Comparison of loss functions

    图 14  热力图效果对比

    Figure 14.  Comparison of thermal map effects

    表 1  多个位置添加注意力机制对比实验结果

    Table 1.  Comparative experimental results of adding attention mechanisms at multiple locations

    替换位置 权重/MB 参数量/(106) GFlops mAP/%
    YOLOv8n 6.3 3.006 8.1 94.7
    2,3,4,5 5.7 2.818 7.4 95.1
    2,5 5.8 2.890 7.8 95.3
    5 5.8 2.894 8.0 95
    4 6.2 3.066 8.0 94.5
    3 6.3 3.109 8.0 94.7
    2 (本文) 6.2 3.002 7.9 96.0
    下载: 导出CSV

    表 2  增强算法对比实验

    Table 2.  Enhancement algorithm comparison experiment

    算法 准确率/% 召回率/% 平均精度/%
    RAW 93.1 91.0 91.0
    AGT 93.5 90.4 91.8
    ZERO-DCE 95.6 90.7 93.2
    SCI (本文) 96.5 91.1 94.7
    下载: 导出CSV

    表 3  消融实验结果

    Table 3.  Results of the ablation experiment

    算法模型 S SB M 权重/MB 参数量/106 计算量/GFlops FPS mAP@(0.5)/%
    YOLOv8n 6.3 3.006 8.1 153 94.7
    YOLOv8n-S 6.2 3.002 7.9 155 96.0
    YOLOv8n-SB 6.3 3.006 8.1 147 95.4
    YOLOv8n-M 6.3 3.006 8.1 154 95.5
    YOLOv8n-S+SB 6.2 3.002 7.9 148 96.2
    YOLOv8n-S+M 6.2 3.002 7.9 158 96.4
    YOLOv8n-SB+M 6.3 3.006 8.1 150 96.0
    EL-YOLO (本文) 6.2 3.002 7.9 155 96.9
    下载: 导出CSV

    表 4  多种检测算法结果对比

    Table 4.  Comparison of results of multiple detection algorithms

    算法模型 权重/MB 参数量/106 计算量/GFlops FPS mAP@(0.5)/%
    YOLOv5s 14.5 7.018 15.8 118 89.8
    YOLOv7 74.8 37.194 105.1 71 84.6
    YOLOv8n 6.3 3.006 8.1 153 94.7
    YOLOv8s 22.5 11.137 28.8 104 95.3
    YOLOv8m 52.0 25.902 79.3 73 93.6
    YOLOv10s 31.4 7.2 21.6 119 96.2
    RT-DETR 63.1 32.8 108.2 46 96.0
    Gold-YOLO 43.1 21.5 46.0 82 96.4
    Faster-R-CNN 112.7 41.325 24.2 8 94.6
    SSD 99.1 35.873 12.7 44 81.3
    EL-YOLO(本文) 6.2 3.019 7.9 155 96.9
    下载: 导出CSV
  • [1]

    彭自然, 许怀顺, 肖伸平. 一种基于CatBoost优化的光伏阵列故障诊断模型[J]. 电子学报, 2024, 52(7): 2418−2428. doi: 10.12263/DZXB.20240236

    Peng Z R, Xu H S, Xiao S P. A CatBoost optimization-based fault diagnosis model for photovoltaic arrays[J]. Acta Electron Sin, 2024, 52(7): 2418−2428. doi: 10.12263/DZXB.20240236

    [2]

    时亚涛, 戴芳, 杨畅民. 太阳能光伏电池缺陷检测[J]. 电子测量与仪器学报, 2020, 34(4): 157−164. doi: 10.13382/j.jemi.B1902656

    Shi Y T, Dai F, Yang C M. Defect detection of solar photovoltaic cell[J]. J Electron Meas Instrum, 2020, 34(4): 157−164. doi: 10.13382/j.jemi.B1902656

    [3]

    Bedrich K, Bokalič M, Bliss M, et al. Electroluminescence imaging of PV devices: advanced vignetting calibration[J]. IEEE J Photovoltaics, 2018, 8(5): 1297−1304. doi: 10.1109/JPHOTOV.2018.2848722

    [4]

    Chen X, Karin T, Jain A. Automated defect identification in electroluminescence images of solar modules[J]. Solar Energy, 2022, 242: 20−29. doi: 10.1016/j.solener.2022.06.031

    [5]

    彭自然, 张颖清, 肖伸平. 基于YOLOv5的太阳电池表面缺陷检测[J]. 太阳能学报, 2024, 45(6): 368−375. doi: 10.19912/j.0254-0096.tynxb.2023-0335

    Peng Z R, Zhang Y Q, Xiao S P. Research on surface defect detection of solar cell with improved YOLOv5 algorithm[J]. Acta Energ Sol Sin, 2024, 45(6): 368−375. doi: 10.19912/j.0254-0096.tynxb.2023-0335

    [6]

    Ren S Q, He K M, Girshick R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Trans Pattern Anal Mach Intell, 2017, 39(6): 1137−1149. doi: 10.1109/TPAMI.2016.2577031

    [7]

    裴少通, 张行远, 胡晨龙, 等. 基于ER-YOLO算法的跨环境输电线路缺陷识别方法[J]. 电工技术学报, 2024, 39(9): 2825−2840. doi: 10.19595/j.cnki.1000-6753.tces.232073

    Pei S T, Zhang H Y, Hu C L, et al. The defect detection method for cross-environment power transmission line based on ER-YOLO algorithm[J]. Trans China Electrotech Soc, 2024, 39(9): 2825−2840. doi: 10.19595/j.cnki.1000-6753.tces.232073

    [8]

    钱晓亮, 张鹤庆, 张焕龙, 等. 基于视觉显著性的太阳能电池片表面缺陷检测[J]. 仪器仪表学报, 2017, 38(7): 1570−1578. doi: 10.3969/j.issn.0254-3087.2017.07.002

    Qian X L, Zhang H Q, Zhang H L, et al. Solar cell surface defect detection based on visual saliency[J]. Chin J Sci Instrum, 2017, 38(7): 1570−1578. doi: 10.3969/j.issn.0254-3087.2017.07.002

    [9]

    Tsai D M, Wu S C, Li W C. Defect detection of solar cells in electroluminescence images using Fourier image reconstruction[J]. Solar Energy Mater Solar Cells, 2012, 99: 250−262. doi: 10.1016/j.solmat.2011.12.007

    [10]

    刘磊, 王冲, 赵树旺, 等. 基于机器视觉的太阳能电池片缺陷检测技术的研究[J]. 电子测量与仪器学报, 2018, 32(10): 47−52. doi: 10.13382/j.jemi.2018.10.007

    Liu L, Wang C, Zhao S W, et al. Research on solar cells defect detection technology based on machine vision[J]. J Electron Meas Instrum, 2018, 32(10): 47−52. doi: 10.13382/j.jemi.2018.10.007

    [11]

    Wei S Q, Li X X, Ding S H, et al. Hotspots infrared detection of photovoltaic modules based on Hough line transformation and Faster-RCNN approach[C]//Proceedings of the 2019 6th international conference on control, decision and information technologies, Paris, 2019: 1266–1271. https://doi.org/10.1109/CoDIT.2019.8820333.

    [12]

    张文彪, 马永华, 白晓静, 等. 基于改进Faster R-CNN的太阳能电池板缺陷识别[J]. 电网技术, 2022, 46(7): 2593−2600. doi: 10.13335/j.1000-3673.pst.2021.2373

    Zhang W B, Ma Y H, Bai X J, et al. Defect identification of solar panels using improved Faster R-CNN[J]. Power Syst Technol, 2022, 46(7): 2593−2600. doi: 10.13335/j.1000-3673.pst.2021.2373

    [13]

    Lu S, Wu K X, Chen J X. Solar cell surface defect detection based on optimized YOLOv5[J]. IEEE Access, 2023, 11: 71026−71036. doi: 10.1109/ACCESS.2023.3294344

    [14]

    周启宸, 王伯超. 基于改进YOLOv7的太阳能电池片表面缺陷检测[J]. 计算机应用, 2023, 43(S2): 223−228 doi: 10.11772/j.issn.1001-9081.2023020258

    Zhou Q C, Wang B C. Solar cell surface defect detection based on improved YOLOv7[J]. J Comput Appl, 2023, 43(S2): 223−228 doi: 10.11772/j.issn.1001-9081.2023020258

    [15]

    Fu H, Cheng G Q. Convolutional neural network based efficient detector for multicrystalline photovoltaic cells defect detection[J]. Energy Sources Part A Recovery Util Environ Eff, 2023, 45(3): 8686−8702. doi: 10.1080/15567036.2023.2230935

    [16]

    张烨, 李博涛, 尚景浩, 等. 基于多尺度卷积注意力机制的输电线路防振锤缺陷检测[J]. 电工技术学报, 2024, 39(11): 3522−3537. doi: 10.19595/j.cnki.1000-6753.tces.231155

    Zhang Y, Li B T, Shang J H, et al. Defect detection of transmission line damper based on multi-scale convolutional attention mechanism[J]. Trans China Electrotech Soc, 2024, 39(11): 3522−3537. doi: 10.19595/j.cnki.1000-6753.tces.231155

    [17]

    Wang Z, Hua Z X, Wen Y C, et al. E-YOLO: recognition of estrus cow based on improved YOLOv8n model[J]. Expert Syst Appl, 2024, 238: 122212. doi: 10.1016/j.eswa.2023.122212

    [18]

    Ma L, Ma T Y, Liu R S, et al. Toward fast, flexible, and robust low-light image enhancement[C]//Proceedings of 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, 2022: 5627–5636. https://doi.org/10.1109/CVPR52688.2022.00555.

    [19]

    刘皓皎, 刘力双, 张明淳. 基于YOLOv5改进的红外目标检测算法[J]. 激光技术, 2024, 48(4): 534−541. doi: 10.7510/jgjs.issn.1001-3806.2024.04.011

    Liu H J, Liu L S, Zhang M C. An improved infrared object detection algorithm based on YOLOv5[J]. Laser Technol, 2024, 48(4): 534−541. doi: 10.7510/jgjs.issn.1001-3806.2024.04.011

    [20]

    张润梅, 肖钰霏, 贾振楠, 等. 改进YOLOv7的无人机视角下复杂环境目标检测算法[J]. 光电工程, 2024, 51(5): 240051. doi: 10.12086/oee.2024.240051

    Zhang R M, Xiao Y F, Jia Z N, et al. Improved YOLOv7 algorithm for target detection in complex environments from UAV perspective[J]. Opto-Electron Eng, 2024, 51(5): 240051. doi: 10.12086/oee.2024.240051

    [21]

    王鹏峰, 李运堂, 黄永勇, 等. 基于改进YOLOv5s网络的斜拉桥拉索表面缺陷检测[J]. 光电工程, 2024, 51(5): 240028. doi: 10.12086/oee.2024.240028

    Wang P F, Li Y T, Huang Y Y, et al. Defects detection for cable surface of cable-stayed bridge based on improved YOLOv5s network[J]. Opto-Electron Eng, 2024, 51(5): 240028. doi: 10.12086/oee.2024.240028

    [22]

    Zhao Y A, Lv W Y, Xu S L, et al. DETRs beat YOLOs on real-time object detection[C]//Proceedings of 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, 2024: 16965–16974. https://doi.org/10.1109/CVPR52733.2024.01605.

    [23]

    Wang A, Chen H, Liu L H, et al YOLOv10: real-time end-to-end object detection[Z]. arXiv: 2405.14458, 2024. https://doi.org/10.48550/arXiv.2405.14458.

    [24]

    Wang C C, He W, Nie Y, et al. Gold-YOLO: efficient object detector via gather-and-distribute mechanism[C]//Proceedings of the 37th Conference on Neural Information Processing Systems, New Orleans, 2023: 36.

  • 加载中

(15)

(4)

计量
  • 文章访问数: 
  • PDF下载数: 
  • 施引文献:  0
出版历程
收稿日期:  2024-09-16
修回日期:  2024-11-04
录用日期:  2024-11-04
刊出日期:  2024-11-25

目录

/

返回文章
返回