MAS-YOLO: A Lightweight Detection Algorithm for PCB Defect Detection Based on Improved YOLOv12

As the performance requirements for printed circuit boards (PCBs) in electronic devices continue to increase, reliable defect detection during PCB manufacturing is vital. However, due to the small size, complex categories, and subtle differences in defect features, traditional detection methods are...

Full description

Saved in:
Bibliographic Details
Main Authors: Xupeng Yin, Zikai Zhao, Liguo Weng
Format: Article
Language:English
Published: MDPI AG 2025-06-01
Series:Applied Sciences
Subjects:
Online Access:https://www.mdpi.com/2076-3417/15/11/6238
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:As the performance requirements for printed circuit boards (PCBs) in electronic devices continue to increase, reliable defect detection during PCB manufacturing is vital. However, due to the small size, complex categories, and subtle differences in defect features, traditional detection methods are limited in accuracy and robustness. To overcome these challenges, this paper proposes MAS-YOLO, a lightweight detection algorithm for PCB defect detection based on improved YOLOv12 architecture. In the Backbone, a Median-enhanced Channel and Spatial Attention Block (MECS) expands the receptive field through median enhancement and depthwise convolution to generate attention maps that effectively capture subtle defect features. In the Neck, an Adaptive Hierarchical Feature Integration Network (AHFIN) adaptively fuses multi-scale features through weighted integration, enhancing feature utilization and focus on defect regions. Moreover, the original YOLOv12 loss function is replaced with the Slide Alignment Loss (SAL) to improve bounding box localization and detect complex defect types. Experimental results demonstrate that MAS-YOLO significantly improves mean average precision (mAP) and frames per second (FPS) compared to the original YOLOv12, fulfilling real-time industrial detection requirements.
ISSN:2076-3417