Printed circuit boards (PCBs) are critical components in modern electronics, detecting defects rapidly, and accurately is crucial in manufacturing. We propose a novel real-time PCB defect detection model based on a Transformer decoder-only architecture. The framework first extracts multi-scale features via a backbone with a feature pyramid network (FPN) and generates candidate regions using a region proposal network (RPN). These region proposals are encoded as query embeddings that drive an adaptive multi-scale deformable attention (AMDA) module in the Transformer decoder, replacing the standard encoder-decoder attention. By dynamically weighting multi-scale feature maps for each query, AMDA emphasizes the feature scale most relevant to each defect’s size and texture, and yielding enhanced discriminative representations for subtle defect detection. The decoder-only design drastically reduces computational overhead compared to full encoder-decoder Transformers, enabling real-time inference, and faster training convergence. Experiments on benchmark PCB defect datasets demonstrate that our approach outperforms state-of-the-art methods in both accuracy and speed. The proposed model’s efficiency and high precision make it well suited for deployment in fast-paced PCB manufacturing lines that demand stringent real-time performance and reliable defect detection.
Copyrights © 2026