基于CFSC-DETR的PCB缺陷检测算法

PCB Defect Detection Algorithm Based on CFSC-DETR

  • 摘要: 印刷电路板(Printed Circuit Board,PCB)缺陷检测是电子制造质量控制中的关键环节,其检测精度与实时性直接影响产品可靠性和生产效率。然而,PCB缺陷通常具有尺度微小且易与复杂线路背景混淆等特点,导致现有检测方法在微小目标表征、背景干扰抑制和精确定位方面仍存在不足。为此,本文在RT-DETR基础上构建一种跨尺度特征融合与状态空间协同建模的检测模型(CFSC-DETR)。在骨干网络ResNet18中引入DualConv模块,降低计算冗余并增强局部纹理提取能力;在编码阶段,提出注意力状态空间推理模块(DASM),通过窗口注意力与状态空间建模的协同作用增强对PCB拓扑结构和长距离上下文信息的表达能力,减弱背景信息干扰;在颈部网络中,构建3D自适应跨尺度融合颈部网络(L3D-AFFN)以提升微小缺陷跨尺度融合过程中的细粒度语义保留能力;同时提出Wasserstein-几何协同损失函数(WGS-IoU),联合分布相似性与几何一致性约束,提高微小及异形缺陷的边界框回归精度。实验结果表明,该模型在PKU-Market-PCB数据集上较RT-DETR在mAP50、精确率和召回率上分别提升3.29、4.06和4.71个百分点,同时模型参数量与计算复杂度进一步降低,并在DsPCBSD+和DeepPCB数据集上表现出较好的跨场景泛化能力。与其他主流目标检测模型相比,该方法在复杂背景下PCB微小缺陷检测任务中表现出更强的综合性能。

     

    Abstract: Printed Circuit Board (PCB) defect detection is a critical link in the quality control of electronic manufacturing, and its detection accuracy and real-time performance directly determine product reliability and production efficiency. Since PCB defects are generally tiny in size and easily blended into complex circuit backgrounds, existing detection methods still have shortcomings in small object feature representation, background interference suppression and precise localization. Accordingly, this paper proposes CFSC-DETR, a detection model with cross-scale feature fusion and state-space collaborative modeling based on RT-DETR. The DualConv module is integrated into the backbone network ResNet18 to reduce computational redundancy and improve the capability of local texture extraction; in the encoding stage, a Dual Attention State-space Inference Module (DASM) is presented, which combines window attention and state-space modeling to enhance the representation of PCB topological structures and long-range contextual information and alleviate background interference; a Lightweight 3D Adaptive Cross-scale Fusion Neck Network (L3D-AFFN) is constructed in the neck network to preserve fine-grained semantics during the cross-scale fusion of tiny defects. Meanwhile, a Wasserstein-Geometric Synergistic IoU loss function (WGS-IoU) is proposed, which applies joint constraints of distribution similarity and geometric consistency to boost the bounding box regression accuracy for tiny and irregular defects. Experimental results reveal that compared with RT-DETR, the proposed model achieves improvements of 3.29, 4.06 and 4.71 percentage points in mAP50, precision and recall on the PKU-Market-PCB dataset while reducing model parameters and computational complexity, and it also exhibits favorable cross-scene generalization ability on the DsPCBSD+ and DeepPCB datasets. Compared with other mainstream object detection models, this method achieves superior overall performance for tiny PCB defect detection under complex backgrounds.

     

/

返回文章
返回