With the rapid development of modern electronic manufacturing industry, an improved lightweight YOLOv11 circuit board defect detection method was proposed in order to solve the problems of low precision and low detection efficiency of small target defect detection on the surface of printed circuit board. Firstly, a new lightweight network StarNet was used as the feature extraction network, which had significant computational complexity. At the same time, FasterNet was introduced to construct the C3k2_Faster module to achieve lightweight neck network, effective model calculation cost, and improve feature extraction capabilities and fusion speed. In addition, the loss function was replaced by Inner-SIoU, and a scale factor was introduced to control the auxiliary bounding boxes of different sizes to speed up the convergence of the model and improve the regression accuracy. Finally, in order to realize the lightweight application requirements of the algorithm in mobile and embedded scenarios, layer-adaptive magnitude-based pruning (LAMP) pruning was used to compress the model while ensuring the accuracy of the model, and the parameters and sizes of the model were further improved. The experimental results show that the weighted file size of the improved model is only 1.5 MB, which is 72.7% lower than that of the baseline model, while the calculation amount is 76.7% lower, and the accuracy is 3.4% higher. The proposed improved algorithm performs well in defect detection tasks and is easy to deploy in practical applications.
WAN Ying-ying, CHEN Rui.
High-precision and Lightweight Detection Method for Printed Circuit Board Defects Based on Improved YOLOv11[J].
Science Technology and Engineering, 2026, 26(12): 5172-5180 DOI:10.12404/j.issn.1671-1815.2503361
在目标检测模型中,损失函数[16]是至关重要的组件,它的设计直接关系到模型的检测效果。在 YOLOv11模型中,CIoU(complete-IoU) 损失函数[17]作为其基础回归损失函数,有效解决了传统IoU(intersection over union)损失函数在处理不规则形状目标时可能遇到的梯度消失问题。CIoU损失在定义边界框长宽比时采用硬性耦合建模,在几何度量时,其定义的宽高比惩罚项可能会对低置信度样本过度惩罚,缺乏对样本质量的动态判别能力,制约着模型的泛化能力。其计算过程为
ChenY, DingY, ZhaoF, et al. Surface defect detection methods for industrial products: a review[J]. Applied Sciences, 2021, 11(16): 7657.
[2]
DongJ Y, LüW T, BaoX M, et al. Research progress of the PCB surface defect detection method based on machine vision[J]. Journal of Zhejiang Sci-Tech University (Natural Sciences Edition), 2021, 45(3): 379-389.
[3]
HeK, GkioxariG, DollárP, et al. Mask R-CNN[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42: 386-397.
[4]
RenS, HeK, GirshickR, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis & Machine Intelligence, 2017, 39(6): 1137-1149.
[5]
WangC Y, BochkovskiyA, LiaoH Y, et al. YOLOv7: trainable bag-of-freebies sets new state-ofthe-art for real-time object detectors[J]. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New York: IEEE, 2022: 7464-7475.
[6]
ReisD, KupecJ, HongJ, et al. Real-time flying object detection with YOLOv8[J]. arXiv Preprint, arXiv: 230509972, 2023.
[7]
GeZ, LiuS, WangF, et al. YOLOx: Exceeding YOLO series in 2021[J]. arXiv Preprint, arXiv:210708430, 2021.
[8]
LüZ, JinH, ZhenT, et al. Small object recognition algorithm of grain pests based on SSD feature fusion[J]. IEEE Access, 2021, 9: 43202-43213.
WangLongye, HuangJun, ZengXiaoli. Bare board defect detection of PCB based on YOLO-PCB[J]. Science Technology and Engineering, 2024, 24(15): 6338-6345.
LiuChunlei, LiZhihua, WangChao, et al. A pedestrian detection method of integrated RepVGG and YOLOv5[J]. Science Technology and Engineering, 2023, 23(7): 2945-2951.
QinZixin, JiangYannan, XuLi, et al. Automatic detection of anomalies in GPR images based on YOLO algorithm[J]. Science Technology and Engineering, 2023, 23(27): 11505-11512.
[20]
ChenJ, KaoS, HeH, et al. Run, Don't walk: chasing higher FLOPS for faster neural networks[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Vancouver, BC: IEEE, 2023: 12021-12031.
[21]
HuD, YuM, WuX, et al. DGW-YOLOv8: a small insulator target detection algorithm based on deformable attention backbone and WIoU loss function[J]. IET Image Processing, 2023, 18(4): 1096-1108.
[22]
ZhengZ, WangP, RenD, et al. Enhancing geometric factors in model learning and inference for object detection and instance segmentation[J]. IEEE Transactions on Cybernetics, 2021, 52(8): 8574-8586.
[23]
ZhangH, XuC, ZhangS. Inner-IoU: more effective intersection over union loss with auxiliary bounding box[J]. arXiv Preprint, arXiv: 2311.02877, 2023.
WangJian, XiaoDi, FengLihang, et al. PCB small target defect detection model based on improved YOLOv8s[J]. Computer Engineering and Applications, 2025, 61(15): 288-297.