A Real-time PCB Defect Detector Based on Supervised and Semi-supervised Learning

Fan He, Sanli Tang, Siamak Mehrkanoon, Xiaolin Huang, Jie Yang

Introduction

In the high-precision world of Printed Circuit Board (PCB) manufacturing, detecting minute defects is critical for ensuring product reliability. Flaws such as "mousebites," "spurs," or "pinholes" can lead to catastrophic failures. Traditional Automated Optical Inspection (AOI) systems often rely on rigid image subtraction or hand-crafted computer vision rules, which are frequently sensitive to minor mechanical misalignments and irregular distortions. While deep learning models like YOLO or Faster R-CNN offer improved generalization, they are often hindered by the high cost of labeling industrial data and the difficulty of detecting defects across varying scales in real-time.

This paper presents a high-speed, deep-learning-based system designed to overcome these hurdles. By utilizing a novel architectural approach and a semi-supervised learning framework, the proposed method achieves state-of-the-art accuracy while maintaining the frame rates required for industrial assembly lines.

Proposed Architecture

The core of the system is a specialized architecture designed for pair-wise input, comparing a "perfect" template image against a tested image.

Twin Backbone and Feature Subtraction

The model employs a "Twin Backbone" consisting of two identical VGG16-tiny networks with shared weights. Instead of performing subtraction at the raw pixel level—which is prone to noise from alignment errors—the system performs subtraction in the high-level feature space. This abstraction makes the detector significantly more robust to minor offsets between the template and the test sample.

Group Pyramid Pooling (GPP)

To address the challenge of scale variation, the authors introduce the Group Pyramid Pooling (GPP) module. Unlike computationally intensive Feature Pyramid Networks (FPN), GPP utilizes parallel pooling layers of various sizes (ranging from 2x2 to 24x24). This allows the model to capture multi-resolution features simultaneously, enabling the efficient detection of both tiny pinholes and large trace shorts.

The proposed architecture utilizes a Twin Backbone for feature extraction and a Group Pyramid Pooling (GPP) module to handle multi-scale defect detection.

Semi-supervised Learning with Mean Teacher

To mitigate the "data scarcity" problem, the authors adopt a semi-supervised "Mean Teacher" framework. A "Teacher" model generates pseudo-labels for a large volume of unlabeled PCB images, which are then used to train a "Student" model alongside a smaller set of human-labeled data. This approach allows the system to leverage the vast amount of unlabeled data typically available in a factory setting, providing a significant performance boost without additional manual labeling effort.

The DeepPCB Dataset

A key contribution of this work is the release of the DeepPCB dataset. It contains 1,500 aligned image pairs at 640x640 resolution, covering six common defect types: open, short, mousebite, spur, pin hole, and spurious copper. The dataset is split into 1,000 pairs for training and 500 for testing, and has been made publicly available to foster further research.

Experimental Results

The proposed model, particularly the version using Max-Pooling (ours-MP), demonstrates exceptional performance. It achieves a mean Average Precision (mAP) of 98.6%, outperforming established detectors such as SSD (95.9%) and YOLO (92.6%). Notably, it maintains a processing speed of 62 FPS, making it suitable for real-time industrial applications.

Comparison of the proposed method against standard object detection frameworks across various defect categories and inference speeds.

The results indicate that Max-Pooling is generally superior to Average-Pooling in the GPP module, likely because it better preserves the sharp "signal" of a defect against the uniform background of a PCB trace. Furthermore, the semi-supervised approach proved highly effective; with only 50 labeled samples, the inclusion of unlabeled data raised the mAP from 86.5% to 89.3%.

Conclusion

By combining feature-space subtraction, a parallelized Group Pyramid Pooling module, and a semi-supervised learning strategy, this work provides a robust and efficient solution for PCB defect detection. While the current system relies on pre-aligned image pairs, its high accuracy and real-time performance mark a significant step forward for automated industrial inspection. Future work may focus on developing "alignment-free" architectures to further simplify the deployment of these models in high-speed manufacturing environments.

Summary updated

BibTeX
@inproceedings{he2020real,
  author = {Fan He and Sanli Tang and Siamak Mehrkanoon and Xiaolin Huang and Jie Yang},
  title = {{A Real-time PCB Defect Detector Based on Supervised and Semi-supervised Learning}},
  booktitle = {ESANN},
  year = {2020},
}
Figure