《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (S2): 223-228.DOI: 10.11772/j.issn.1001-9081.2023020258

• 多媒体计算与计算机仿真 • 上一篇    

基于改进YOLOv7的太阳能电池片表面缺陷检测

周启宸1, 王伯超2()   

  1. 1.新疆师范大学 计算机科学技术学院,乌鲁木齐 830054
    2.新疆维吾尔自治区自然资源规划研究院,乌鲁木齐 830011
  • 收稿日期:2023-03-14 修回日期:2023-04-13 接受日期:2023-04-18 发布日期:2024-01-09 出版日期:2023-12-31
  • 通讯作者: 王伯超
  • 作者简介:周启宸(1998—),男,重庆人,硕士研究生,主要研究方向:计算机视觉
    王伯超(1980—),男,新疆乌苏人,高级工程师,硕士,主要研究方向:自然资源管理、空间数据库建设。

Solar cell surface defect detection based on improved YOLOv7

Qichen ZHOU1, Bochao WANG2()   

  1. 1.College of Computer Science and Technology,Xinjiang Normal University,Urumqi Xinjiang 830011,China
    2.Planning and Research Institute of Xinjiang Natural Resources,Urumqi Xinjiang 830011,China
  • Received:2023-03-14 Revised:2023-04-13 Accepted:2023-04-18 Online:2024-01-09 Published:2023-12-31
  • Contact: Bochao WANG

摘要:

为解决传统太阳能电池片表面缺陷检测方法存在的检测精度低、速度慢、检测缺陷类型单一的问题,提出一种基于改进YOLOv7的太阳能电池片表缺陷检测算法。首先,在YOLOv7网络模型的基础上引入Swin Transformer 模块,以增强模型的全局信息建模;其次,引入Shuffle Attention机制,有效融合空间注意力和通道注意力机制,以增强模型的特征提取能力;再次,使用SIoU(Scylla Intersection over Union)损失函数替换原模型中的CIoU(Complete Intersection over Union)损失函数,提高模型的收敛速度与效率;最后,采用K-means++聚类算法优化先验框。实验结果表明,改进算法具有较好的检测效果,在测试集上的mAP@50%达到86.6%,相较于原始YOLOv7提升了4.8%,且检测速度并未大幅降低,能较为快速、准确地对太阳能电池片表面缺陷进行检测。

关键词: YOLOv7, 注意力机制, 表面缺陷检测, 深度学习, 损失函数, 太阳能电池片

Abstract:

In order to solve the problems of low detection accuracy, slow speed and single type of detection defects existing in traditional surface defect detection methods for solar cells, a surface defect detection algorithm for solar cells based on improved YOLOv7 was proposed. Firstly, the Swin Transformer block was introduced into the YOLOv7 network model to enhance the global information modeling of the model. Secondly, the Shuffle Attention mechanism, integrating spatial attention with channel attention mechanism efficiently, was added to the original network module to enhance the feature extraction ability. Thirdly, the CIoU (Complete Intersection over Union) loss function in the original module was replaced with the SIoU (Scylla Intersection over Union) loss function to improve the convergence speed and efficiency. Finally, K-means++ clustering algorithm was used to optimize the prior anchor boxes. The experimental results show that the improved algorithm has good detection effect,the mAP@50% on the test set reaches 86.6%, which is 4.8% higher than that of the original YOLOv7, but the detection speed is not significantly reduced, so that the improved algorithm can detect the surface defects of solar cells more quickly and accurately.

Key words: YOLOv7, attention mechanism, surface defect detection, deep learning, loss function, solar cell

中图分类号: