Surface defect detection for Printed Circuit Board, known as PCB is crucial for the manufacturing of PCBs. However, certain defects are challenging to identify due to their subtle characteristics and are often either missed or incorrectly detected, posing significant challenges for accurate defect recognition. To address this issue, an improved YOLOv5 algorithm, named CSN-YOLOv5s, is proposed. Firstly, a 160 × 160 detection layer for small-scale objects is added to the YOLOv5s architecture, while the 20 × 20 detection layer for large-scale objects has been eliminated, enhancing the model’s capability to identify small-sized defects. Secondly, integrating Convolutional Block Attention Module namely CBAM into C3 module within the Backbone and the attention mechanism of Squeeze and Excitation namely SE is appended at the end of the Backbone, optimizing feature extraction efficiency. Finally, Normalized Wasserstein Distance (NWD) is designed as the loss function to further elevate detection performance, and the constant C is ultimately set to 20 to achieve optimal overall detection performance. Experiments conducted on public PCB defect datasets demonstrate that CSN-YOLOv5s achieves 98.1% Precision and 97.3% mAP. Compared to other methods (SSD, YOLOX, YOLOv5s, YOLOv8s, YOLOv11s, etc.), the approach greatly enhances both accuracy and parameter efficiency, demonstrating its effectiveness in detecting surface defects on PCBs, thus making it more applicable for engineering purposes.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

CSN-YOLOv5s:A Novel Detection Algorithm for PCB Surface Defects

  • Yanyan Wu,
  • Faxiang Chen,
  • Yajie Wang

摘要

Surface defect detection for Printed Circuit Board, known as PCB is crucial for the manufacturing of PCBs. However, certain defects are challenging to identify due to their subtle characteristics and are often either missed or incorrectly detected, posing significant challenges for accurate defect recognition. To address this issue, an improved YOLOv5 algorithm, named CSN-YOLOv5s, is proposed. Firstly, a 160 × 160 detection layer for small-scale objects is added to the YOLOv5s architecture, while the 20 × 20 detection layer for large-scale objects has been eliminated, enhancing the model’s capability to identify small-sized defects. Secondly, integrating Convolutional Block Attention Module namely CBAM into C3 module within the Backbone and the attention mechanism of Squeeze and Excitation namely SE is appended at the end of the Backbone, optimizing feature extraction efficiency. Finally, Normalized Wasserstein Distance (NWD) is designed as the loss function to further elevate detection performance, and the constant C is ultimately set to 20 to achieve optimal overall detection performance. Experiments conducted on public PCB defect datasets demonstrate that CSN-YOLOv5s achieves 98.1% Precision and 97.3% mAP. Compared to other methods (SSD, YOLOX, YOLOv5s, YOLOv8s, YOLOv11s, etc.), the approach greatly enhances both accuracy and parameter efficiency, demonstrating its effectiveness in detecting surface defects on PCBs, thus making it more applicable for engineering purposes.