首页|期刊导航|计算机与现代化|改进的YOLOv7印刷电路板缺陷检测

改进的YOLOv7印刷电路板缺陷检测OA

An Improved YOLOv7 Method for Printed Circuit Board Defect Detection

中文摘要英文摘要

针对印刷电路板缺陷检测中存在的检测准确率低、计算量大及类别不平衡等问题,本文提出一种基于改进YOLOv7的高精度缺陷检测算法.本文的改进主要包括4个方面,首先,在骨干网络部分引入EfficientNet-SC结构,以提升特征提取能力并降低参数冗余;其次,设计AKHead解耦检测头,实现分类与定位任务的分离,减少多任务间的干扰;再次,在Neck部分将传统ELAN结构替换为ELAN-CoTAttention模块,以增强模型对微小缺陷的感知及上下文信息建模能力;最后,采用Focal-GIoU Loss作为损失函数,减轻类别不平衡对模型训练的影响,从而提升小目标检测性能.实验结果表明,在6种典型PCB缺陷数据集上,改进后的算法平均精度均值(mAP@0.5)达到91.8%,较原YOLOv7提升9.2%;检测速度提高16.1%,参数量减少47.6%,实现了模型轻量化与性能优化的平衡.实验结果表明,本文改进的YOLOv7算法在保证实时性的同时,显著提升了PCB缺陷检测的准确率和稳定性,具有良好的应用前景.

A high-precision defect detection algorithm based on the improved YOLOv7 is proposed to address the problems of low detection accuracy,high computational cost,and class imbalance in Printed Circuit Board(PCB)defect detection.The pro-posed method included four major improvements.First,the EfficientNet-SC structure is introduced into the backbone to enhance feature extraction ability and reduce parameter redundancy.Second,an AKHead decoupled detection head is designed to sepa-rate classification and localization tasks,reducing interference between them.Third,the traditional ELAN structure in the neck is replaced with an ELAN-CoTAttention module to strengthen the perception of small defects and contextual modeling ability.Fi-nally,the Focal-GIoU Loss is adopted as the loss function to mitigate the influence of class imbalance and improve small-object detection performance.Experimental results show that the improved algorithm achieved a mean average precision(mAP@0.5)of 91.8%on six typical PCB defect datasets,which is 9.2%higher than that of the original YOLOv7.Detection speed increases by 16.1%,and the number of parameters decreases by 47.6%,achieving a balance between model lightweight design and perfor-mance optimization.The results indicate that the improved YOLOv7 significantly enhanced the accuracy and stability of PCB de-fect detection while maintaining real-time performance,showing strong application potential.

潘鹏程;孙康宇;杨松林

三峡大学电气与新能源学院,湖北 宜昌 443002||新能源微电网湖北省协同创新中心,湖北 宜昌 443002三峡大学电气与新能源学院,湖北 宜昌 443002||新能源微电网湖北省协同创新中心,湖北 宜昌 443002国网河南省电力公司三门峡供电公司,河南 三门峡 472000

信息技术与安全科学

YOLOv7s缺陷检测特征提取轻量化损失函数

YOLOv7defect detectionfeature extractionlightweightloss function

《计算机与现代化》 2026 (8)

60-68,9

国家自然科学基金资助项目(52307109)

10.3969/j.issn.1006-2475.2026.08.008

评论