Hybrid CNN-transformer with adaptive multi-scale fusion for tiny PCB defect identification
摘要
Printed circuit board (PCB) defect detection is essential for industrial quality control, yet it remains challenging due to the tiny size and low contrast of defects, as well as complex backgrounds. Existing detectors still struggle with the loss of fine defect details, inefficient global context modeling in repetitive PCB background patterns, and suboptimal multi-scale feature fusion under defect-size variations. To address these issues, we propose HTA-Det, a hybrid CNN–Transformer detector with three synergistic components. First, we propose a detail-preserving backbone that uses cascaded RepNCSP blocks for progressive feature refinement to mitigate the early-stage loss of fine-grained details crucial for tiny defects. The aggregated features are then passed through an attention refinement stage to selectively enhance defect-relevant features. Second, a hybrid polarity-aware linear-attention encoder, enhanced by three submodules, is developed for efficient global context modeling. Finally, an adaptive fusion strategy is designed to learn content-aware and scale-specific weights for feature maps from different levels. Experiments on the PKU-Market-PCB and DeepPCB datasets show that HTA-Det achieves mAP