Semi-Supervised Defect Detection Method with Data-Expanding Strategy for PCB Quality Inspection

Yusen Wan, Liang Gao, Xinyu Li, Yiping Gao2022 · DOI

TL;DR

This paper introduces DE-SSD, a novel semi-supervised learning method for detecting defects on Printed Circuit Boards (PCBs). By combining a batch-adding strategy for unlabeled data and a data-expanding strategy using auxiliary datasets, DE-SSD significantly improves defect detection accuracy, especially when labeled data is scarce, achieving state-of-the-art results.

What Problem Does This Paper Address?

The quality control of Printed Circuit Boards (PCBs) is crucial for the reliability of electronic products. Traditional manual inspection is time-consuming and error-prone. While deep learning methods have shown great promise for automated PCB defect detection, they typically require vast amounts of meticulously labeled data. Acquiring such large, high-quality datasets is expensive and labor-intensive. Semi-supervised learning (SSL) offers a solution by leveraging both labeled and unlabeled data, but existing SSL methods for PCB defect detection can be negatively impacted by the noise and disturbance introduced by unlabeled samples, especially when the proportion of labeled data is very small. Furthermore, combining data from different sources (e.g., different sensors) for training is challenging due to variations in backgrounds and sample characteristics, limiting the ability to expand datasets effectively. This paper aims to bridge the gap in detection accuracy between models trained with abundant labeled data and those with limited labeled data by developing a robust semi-supervised approach.

Methods

The proposed method, DE-SSD (Semi-Supervised Defect Detection with Data-Expanding Strategy), is built upon a single-stage object detection model, YOLOv5, chosen for its balance of accuracy and speed. The core innovations lie in two main components:

  • BA-SSL Framework (Batch-Adding Semi-Supervised Learning): This framework addresses the disturbance from unlabeled data. It employs a dynamic threshold strategy for generating pseudo-labels for unlabeled samples, ensuring more reliable labels. Crucially, it uses a batch-adding strategy where unlabeled data is introduced incrementally in small batches. This prevents a sudden influx of potentially noisy unlabeled data from overwhelming the training process, especially in the early stages. The training proceeds in three steps: initial training on labeled data, gradual introduction of unlabeled data, and finally, stable training with both labeled and unlabeled data.
  • DE Strategy (Data-Expanding Strategy): This strategy tackles the challenge of integrating data from auxiliary datasets. It aims to make samples from auxiliary datasets (which might have different backgrounds or characteristics) usable as negative samples (defect-free) to augment the target dataset. The process involves:
  • Clipping: Auxiliary images are cropped into smaller pitches matching the target dataset's image size.
  • Filtration: Color images are converted to grayscale, and a mean blur filter is applied to reduce noise.
  • Sharpening: An unsharp mask technique is used to enhance image details and counteract the blurriness introduced by the mean filter.
  • Binarization and Smoothing: Images are binarized and then processed with erosion and dilation to smooth edges, making them more consistent with the target dataset's appearance.

By combining these strategies, DE-SSD aims to effectively utilize both unlabeled data from the target dataset and labeled data from auxiliary datasets to improve the robustness and accuracy of PCB defect detection, particularly in low-data regimes.

Datasets

  • Target Dataset: DeepPCB - A widely used public benchmark dataset for PCB defect detection. It contains 1500 samples, with 1000 for training and 500 for testing. It includes six common defect types: open, short, mouse bite, spur, spurious copper, and pinhole.
  • Auxiliary Dataset: PKU-PCB - A synthetic PCB defect detection dataset from Peking University. It contains 1386 samples with similar defect types to DeepPCB but differs in background (color vs. black-and-white) and defect density. This dataset is primarily used to generate negative samples for the DE strategy.

Key Insights and Ideas

  • Incremental Learning for Unlabeled Data is Key: Simply dumping all unlabeled data into training can severely degrade performance. Introducing it gradually via batch-adding is crucial for stability and effective learning.
  • Dynamic Thresholding for Pseudo-Labels: Relying on a fixed confidence threshold for pseudo-labeling is problematic. A dynamic threshold that adapts to the model's current confidence is more robust and prevents the model from generating too few or too many unreliable labels.
  • Auxiliary Data as Negative Samples: Leveraging defect-free samples from other datasets, even with different visual characteristics, can significantly expand the training data and improve robustness, provided a suitable preprocessing strategy (like the DE strategy) is employed to bridge the domain gap.
  • Synergy Between SSL and Data Expansion: The BA-SSL framework and the DE strategy are not just additive; they complement each other. BA-SSL helps manage unlabeled data noise, while DE strategy provides more reliable negative samples, mitigating each other's limitations.

Key Results

The proposed DE-SSD method achieved state-of-the-art performance on the DeepPCB dataset.

  • Semi-Supervised Performance: With only 50 labeled samples, DE-SSD achieved an mAP of 98.4%, outperforming existing methods even when they used significantly more labeled data (e.g., 1000 samples).
  • Comparison with Baseline (YOLOv5): DE-SSD consistently showed higher precision and recall than the baseline YOLOv5 across different numbers of labeled samples. For instance, with 50 labeled samples, DE-SSD's recall was 7.8% higher and precision was 5.1% higher.
  • Overall Improvement: The method demonstrated significant improvements in mAP, precision, and recall, especially in low-data scenarios, effectively reducing both false positives and false negatives. The paper reports an improvement of at least 4.7 mAP compared to previous methods.

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • DE Strategy Adaptability: The DE strategy needs to be tailored to the specific characteristics of the auxiliary dataset. A more generalizable DE strategy would be beneficial.
  • Label Noise in Pseudo-Labels: Despite efforts, pseudo-labels can still contain noise, which can limit the ultimate detection accuracy. Developing more effective label-denoising techniques for semi-supervised learning is a promising avenue.
  • Defect Type Coverage: The datasets used primarily focus on a limited number of defect types. Future work should aim to develop methods that can handle a wider variety of defects (e.g., dotted defects, line defects) and potentially explore new types of defects.
  • Generalization: Further research is needed to develop more general methods for DE and label denoising that are not dataset-specific. Collecting more diverse sample types and further refining the method for new defect categories are also important future steps.

Summary updated

BibTeX
@misc{wan2022semi,
  author = {Yusen Wan and Liang Gao and Xinyu Li and Yiping Gao},
  title = {{Semi-Supervised Defect Detection Method with Data-Expanding Strategy for PCB Quality Inspection}},
  year = {2022},
  doi = {10.3390/s22207971},
}
Figure