Computer Engineering and Applications ›› 2024, Vol. 60 ›› Issue (15): 336-343.DOI: 10.3778/j.issn.1002-8331.2312-0089

• Engineering and Applications • Previous Articles     Next Articles

Solar Cell Defect Detection Algorithm Based on Improved YOLOv7-tiny

XU Wei, LI Weixiang, FANG Zhi, SUN Yuan, CHEN Chuang   

  1. Colloge of Electrical Engineering and Control Science, Nanjing Tech University, Nanjing 211816, China
  • Online:2024-08-01 Published:2024-07-30

基于改进YOLOv7-tiny的光伏电池缺陷检测算法

徐威,李为相,方志,孙圆,陈闯   

  1. 南京工业大学 电气工程与控制科学学院,南京 211816

Abstract: To address the issue of unstable solar energy conversion efficiency in photovoltaic cells and improve the quality of photovoltaic cells, this article proposes a photovoltaic cell defect detection algorithm, PSD-YOLO, based on the improved YOLOv7-tiny with the introduction of the lightweight convolution module PSDConv. Initially, the DW (Depthwise) convolution in GSConv is replaced with Partial convolution, reducing memory access and improving detection speed. Additionally, the decoupled fully connected attention (DFC) mechanism from GhostNetv2 is incorporated, enhancing the capability of lightweight algorithms to detect complex defect types in photovoltaic cells while maintaining deployability. In the loss function section, CIoU is replaced with EIoU, accelerating convergence and improving regression accuracy. Experimental results demonstrate that the PSD-YOLO model reduces parameter and computational complexity by 18.3% and 16.7%, respectively, compared to the YOLOv7-tiny model. With a model size of only 4.9 million, it achieves a 5.3 percentage points improvement in mAP@0.5, attaining higher detection performance while achieving a smaller model size.

Key words: YOLOv7-tiny, solar cell, defect detection, attention mechanism, loss function

摘要: 针对光伏电池对于太阳能转化效率不稳定的问题,提高光伏电池的质量,提出基于改进YOLOv7-tiny的光伏电池缺陷检测算法PSD-YOLO,在YOLOv7-tiny中引入轻量化卷积模块PSDConv。将GSConv中的DW卷积替换为Partial卷积,降低了内存访问量并提高了检测速度;并且引入了GhostNetv2中的解耦全连接注意力(DFC)机制,在保持其可部署性的同时提高了轻量级算法对光伏电池复杂缺陷类型的检测能力;在损失函数部分,将原本的CIoU替换为EIoU,加速了收敛且提高了回归精度。实验结果表明,PSD-YOLO模型在参数量和计算量方面分别相较于YOLOv7-tiny模型下降了18.3%和16.7%,模型大小仅有4.9×106,mAP@0.5提升了5.3个百分点,在实现更小模型体积的同时,达到了更高的检测性能。

关键词: YOLOv7-tiny, 光伏电池, 缺陷检测, 注意力机制, 损失函数