DGFN-DETR: Lightweight Dual-Stream Gated Transformer for Real-Time PCB Defect Detection
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Surface defects on printed circuit boards significantly affect product quality and device reliability. Lightweight and efficient PCB defect detection methods are essential for reducing dependence on manual inspection and enabling deployment on resource-constrained industrial systems. Existing approaches struggle to achieve an optimal balance between model complexity and detection accuracy, particularly when identifying small defects embedded within complex circuit patterns. In this paper, we propose DGFN-DETR (Dual-Stream Gated Feature Network Detection Transformer), a lightweight detection framework specifically designed to address PCB defect detection challenges with minimal computational overhead. Our method introduces several key innovations for model compression and efficiency: a novel Dual-Stream Gated Backbone (DSG) that adaptively fuses lightweight and enhanced pathways for efficient multi-scale feature extraction; an enhanced encoder incorporating polarized linear attention and spatially-enhanced feedforward networks that achieve linear complexity; dilated reparameterized convolution blocks that enable multi-scale receptive fields without additional inference cost through structural reparameterization; weighted stride downsampling that preserves fine-grained features while reducing computational burden; and an improved loss function for bounding box regression of irregular defect geometries. Experiments on the PKU-PCB dataset demonstrate that our method achieves 97.3\% mAP50 with only 10.2M parameters and 19.4 GFLOPs computational cost, representing a 48.7\% reduction in parameters and 66.0\% reduction in GFLOPs compared with the baseline RT-DETR-R18. The lightweight design yields improved inference speed of 112 FPS with 8.9\,ms average latency and 11.2\,ms 95th percentile latency, meeting real-time requirements for production line deployment. Comprehensive evaluation including memory footprint (39.2\,MB) and power consumption (68W) validates practical deployability on edge devices. Cross-dataset evaluation on DeepPCB further validates the generalization capability of the proposed lightweight architecture.