首页|期刊导航|计算机与现代化|基于多层感知注意力和多尺度特征融合的PCB表面小目标缺陷检测方法

基于多层感知注意力和多尺度特征融合的PCB表面小目标缺陷检测方法OA

Detection of Small Target Defects on PCB Surface Based on Fusion of Multi-level Perceptual Attention and Multi-scale Features

中文摘要英文摘要

针对印刷电路板(PCB)表面小目标缺陷检测中存在的漏检率高、定位精度不足等问题,提出一种基于多层次感知注意力(MLPA)与多尺度特征融合(MSFF)的检测模型MMNet,旨在解决现有方法因多尺度特征融合不足、注意力机制粗粒度及损失函数局限性导致的性能瓶颈.通过设计MLPA模块,结合局部与全局注意力协同机制增强模型对微小缺陷的聚焦能力,利用卷积与全局平均池化提取多层次特征,并通过非线性变换优化注意力权重;构建MSFF模块,采用分组卷积与通道拼接策略动态调整不同尺度特征的权重,提升多尺度特征表达的鲁棒性;提出Ratio-IoU损失函数,引入比例因子优化边界框的宽高覆盖范围以提升定位精度.在公开数据集PKU-Market-PCB上的实验结果表明,MMNet的检测精度达97.28%,较YOLOv8提升4.49百分点,综合评估指标平均精度均值(mAP@0.5:0.95)为68.14%,较YOLOv8提升4.73百分点,同时模型推理速度达95 fps,满足工业实时检测需求.消融实验验证了各模块的有效性:MLPA使mAP@0.5提升3.87百分点,MSFF优化了特征融合效率,Ratio-IoU损失函数将定位精度提升4.73百分点.本文方法通过多层次注意力机制与动态特征融合,显著提升了小目标缺陷的检测性能,为高密度PCB的自动化质检提供了高效可靠的解决方案.

To address the challenges of high missed detection rates and insufficient localization accuracy for small target defects on printed circuit board(PCB)surfaces,a detection model named MMNet is proposed based on Multi-Level Perceptual Atten-tion(MLPA)and Multi-Scale Feature Fusion(MSFF).This model aims to overcome performance bottlenecks caused by inad-equate multi-scale feature fusion,coarse-grained attention mechanisms,and limitations of loss functions in existing methods.The MLPA module is designed to enhance the model's focus on subtle defects through a synergistic mechanism combining local and global attention.Convolutional operations and global average pooling are utilized to extract multi-level features,and atten-tion weights are optimized through nonlinear transformations.The MSFF module is constructed to dynamically adjust the weights of multi-scale features using grouped convolutions and channel concatenation strategies,improving the robustness of feature rep-resentation.The Ratio-IoU loss function is proposed,and a ratio factor is introduced to optimize the width and height coverage range of the bounding box to improve the positioning accuracy.Experiments are conducted on the public dataset PKU-Market-PCB.The results show that MMNet achieves a detection accuracy of 97.28%,which is 4.49 percentage points higher than YOLOv8 and the mean Average Precision(mAP@0.5:0.95)reaches 68.14%,surpassing YOLOv8 by 4.73 percentage points.The infer-ence speed of the model is measured at 95 fps,meeting real-time industrial detection requirements.Ablation experiments are performed to validate the effectiveness of each module:MLPA improves mAP@0.5 by 3.87 percentage points,MSFF optimizes feature fusion efficiency,and the Ratio-IoU loss increases localization accuracy by 4.73 percentage points.By integrating multi-level attention mechanisms and dynamic feature fusion,the proposed method significantly enhances the detection performance for small target defects.It provides an efficient and reliable solution for the automated quality inspection of high-density PCBs.

魏浩

盐城工学院信息工程学院,江苏 盐城 224000

信息技术与安全科学

PCB缺陷检测多层次感知注意力多尺度特征融合IoU损失函数

PCB defect detectionmulti-level perceptual attentionmulti-scale feature fusionIoU loss function

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

47-53,7

10.3969/j.issn.1006-2475.2026.04.007

评论