高级检索

YOLOv8n-PCB:基于改进YOLOv8n的PCB缺陷检测算法研究

YOLOv8n-PCB: Research on PCB defect detection algorithm based on improved YOLOv8n

  • 摘要: 为解决PCB小型化、精细化造成的PCB表面缺陷检测难度大的问题,本文以YOLOv8n模型为基线模型,提出改进YOLOv8n-PCB模型。首先,将卷积块注意力模块(Convolutional Block Attention Module,CBAM)嵌入到YOLOv8n的backbone和neck中,让缺陷特征在连接前先经过通道注意力和空间注意力机制进行筛选,通过CBAM强化特征重标定,通道注意力筛选重要通道,空间注意力定位关键区域;其次,在neck网络中通过下采样的方式增加P2检测层,通过新增的160×160尺寸检测层实现4倍下采样,直接利用骨干网络更底层的特征图,从而保留更加丰富的特征信息;最后,采用NWD LOSS损失函数,通过将边界框建模为二维高斯分布,提供有意义的梯度,进一步提高检测精度。实验结果表明,与YOLOv8n基线模型相比,YOLOv8n-PCB模型将mAP@0.5 提高了2.79个百分点,达到了94.21%,并且将mAP@0.75/%提高了6.98%。

     

    Abstract: In order to solve the problem of difficulty in detecting PCB surface defects caused by miniaturization and refinement of PCB, this paper takes the YOLOv8n model as the baseline model and proposes an improved YOLOv8n-PCB model. First, add the convolution block attention module (Convolutional Block Attention Module (CBAM) is embedded into the backbone and neck of YOLOv8n, allowing defect features to be screened through channel attention and spatial attention mechanisms before connection. CBAM is used to strengthen feature recalibration, channel attention screens important channels, and spatial attention locates key areas; Secondly, a P2 detection layer is added by downsampling in the neck network, and a new 160×160 size detection layer is used to realize 4 times downsampling, and the feature map at the lower level of the backbone network is directly used to retain richer feature information; Finally, the NWD LOSS loss function is used to model the bounding box as a two-dimensional Gaussian distribution to provide meaningful gradients and further improve the detection accuracy. Experimental results show that compared with the YOLOv8n baseline model, the YOLOv8n-PCB model increases mAP@0.5 by 2.79 percentage points to 94.21%, and increases mAP@0.75/% by 6.98%.

     

/

返回文章
返回