Lightweight PCB defect detection method based on SCF-YOLO

Yazhou Li, Yuanyuan Wang, Jiange Liu, William Ka Kei Wu, Hauwa Suieiman Abdullahi, Pinrong Lv, Haiyan ZhangPLoS 2025

TL;DR

This paper introduces SCF-YOLO, a lightweight model for detecting defects on Printed Circuit Boards (PCBs) that significantly reduces model size and speeds up inference without sacrificing accuracy. By combining MobileNet, a novel feature fusion module, and an enhanced SCF module, SCF-YOLO offers a practical and efficient solution for real-time industrial PCB inspection.

What Problem Does This Paper Address?

Traditional methods for detecting defects on PCBs, such as electrical and X-ray inspection, are often costly, slow, or prone to errors. While deep learning models have shown promise, many existing solutions suffer from large model sizes and slow inference speeds, making them unsuitable for real-time applications on resource-constrained industrial equipment. This paper aims to bridge this gap by developing a lightweight, fast, and accurate PCB defect detection model.

Methods

The core of SCF-YOLO is built upon the YOLOv8 architecture but with several key modifications:

  • Lightweight Backbone: MobileNet (specifically, a compact edition) replaces the original backbone network. This significantly reduces the number of parameters and improves inference speed.
  • Learnable Weighted Feature Fusion Module: This module is introduced in the "neck" of the network to effectively fuse features from different scales and levels, enhancing the model's ability to capture subtle details and semantic information.
  • Novel SCF Module (Synthesis C2f): Inspired by C3 and ELAN modules, the SCF module is designed to improve the capture of high-level semantic features and focus on important semantic information across different feature map channels.
  • Combined Loss Function: A combination of CIoU and GIoU loss functions is used to balance the optimization of bounding box regression and localization, leading to more precise defect identification, especially for anomalies with subtle characteristics.

Datasets

The primary dataset used for training and evaluation is the PKU-Market-PCB dataset, released by the Peking University Human-Computer Interaction Open Laboratory. This dataset contains 10,668 defects across 6 categories: missing-holes, mouth-bite, open-circuit, short, spur, and spurious-copper. The authors also mention constructing a self-dataset by cropping images to 320x320 resolution and retaining adjacent subimages to preserve defect information. The dataset was partitioned into training, validation, and testing sets with a ratio of 7:1:2. Data augmentation techniques such as random flipping, enlargement/reduction, and MaxUp were employed.

Key Insights and Ideas

  • MobileNet is a viable lightweight backbone: Replacing heavier backbones with MobileNet is an effective strategy for reducing model size and increasing inference speed in object detection tasks, even for complex industrial applications like PCB defect detection.
  • Feature fusion is crucial for subtle defects: The learnable weighted feature fusion module demonstrates the importance of intelligently combining features from different network layers to better capture the nuances of small or subtle defects.
  • A hybrid loss function offers better localization: Combining CIoU and GIoU loss functions provides a more robust approach to bounding box regression, improving accuracy for defects with varying shapes and sizes.
  • Lightweight models can achieve high performance: The study shows that it's possible to achieve a good balance between model size, speed, and detection accuracy, making deep learning models more accessible for real-world industrial deployment.

Key Results

  • Parameter Reduction: SCF-YOLO reduces the number of parameters by 25% compared to the original YOLOv8 model.
  • Speed Improvement: The detection speed is improved by up to 60%, achieving 1600 FPS.
  • Accuracy: The model achieves a precision of 91.59% and a recall of 90.16% with an [email protected] of 92.9%.
  • Comparative Performance: Compared to YOLOv8, SCF-YOLO shows a significant reduction in parameters and a substantial increase in FPS, while maintaining competitive accuracy. Against other lightweight models like YOLOv5-Lite and YOLOX-nano, SCF-YOLO demonstrates superior recall and [email protected].

Limitations and Future Work

  • Detection of Subtle Defects: The authors acknowledge that SCF-YOLO still has room for improvement in detecting "mouse-bite" and "spurious-copper" defects, which are similar to other defect types or normal routes, respectively. The small size and subtle features of some defects also pose a challenge.
  • Model Depth and Confidence: The detection confidence for some subtle defects is noted as low, suggesting potential for improving model depth and width.
  • Knowledge Distillation: While an attempt was made with YOLOv8-1 for knowledge distillation, it led to a performance decline. Future work will explore alternative knowledge distillation techniques.
  • Further Optimization: Future research directions include investigating advanced feature enhancement mechanisms, multi-scale fusion strategies, efficient deployment on embedded devices and edge computing platforms, structural pruning, and weight quantization to further enhance performance and reduce resource requirements. The authors also plan to explore deploying the algorithm in other domains.

Summary updated

BibTeX
@inproceedings{li2025lightweight,
  author = {Yazhou Li and Yuanyuan Wang and Jiange Liu and William Ka Kei Wu and Hauwa Suieiman Abdullahi and Pinrong Lv and Haiyan Zhang},
  title = {{Lightweight PCB defect detection method based on SCF-YOLO}},
  booktitle = {PLoS},
  year = {2025},
  doi = {10.1371/journal.pone.0318033},
}
Figure