Decoder-only transformer with multi-scale attention for efficient printed circuit board defect inspection

Chi Kien Ha, Hoanh Nguyen

Abstract


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.

Keywords


Defect detection; Deformable attention; Encoder-decoder; Multi-scale features; Transformer structure

Full Text:

PDF


DOI: https://doi.org/10.11591/eei.v15i4.10873

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Bulletin of EEI Statistics

Bulletin of Electrical Engineering and Informatics (BEEI)
ISSN: 2089-3191 , e-ISSN: 2302-9285
This journal is published by the Institute of Advanced Engineering and Science (IAES) .