计算机与现代化Issue(8):60-68,9.DOI:10.3969/j.issn.1006-2475.2026.08.008
改进的YOLOv7印刷电路板缺陷检测
An Improved YOLOv7 Method for Printed Circuit Board Defect Detection
摘要
Abstract
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.关键词
YOLOv7s/缺陷检测/特征提取/轻量化/损失函数Key words
YOLOv7/defect detection/feature extraction/lightweight/loss function分类
信息技术与安全科学引用本文复制引用
潘鹏程,孙康宇,杨松林..改进的YOLOv7印刷电路板缺陷检测[J].计算机与现代化,2026,(8):60-68,9.基金项目
国家自然科学基金资助项目(52307109) (52307109)