journal article·2025-06-01Open access

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

Xupeng Yin, Zikai Zhao, Liguo Weng

Applied Sciences· Volume 15· Issue 11

Abstract

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.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Industrial Vision Systems and Defect Detection · Advanced Neural Network Applications · Image and Object Detection Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Jiangsu Key Laboratory of Big Data Analysis Technology, Nanjing University of Information Science and Technology, Nanjing 210044, China

Collaborative Innovation Center on Atmospheric Environment and Equipment Technology, Nanjing University of Information Science and Technology, Nanjing 210044, China

Funding

National Natural Science Foundation of PR China

References (40)

Show source-provided references
1. Chen, I., and Hwang, R. (2023). PCB defect detection based on Deep Learning algorithm. Processes, 11.10.3390/pr11030775 ↗
2. Improving PCB defect detection using selective feature attention and pixel shuffle pyramid10.1016/j.rineng.2024.101992 ↗
3. Liu, B., Chen, D., and Qi, X. (2024). YOLO-pdd: A Novel Multi-scale PCB Defect Detection Method Using Deep Representations with Sequential Images. arXiv.10.1109/AIIM64537.2024.10934579 ↗
4. Computer vision system for printed circuit board inspection
5. Printed circuit board defect detection and sorting using image processing techniques
6. Review of vision-based defect detection research and its perspectives for printed circuit board10.1016/j.jmsy.2023.08.019 ↗
7. Trejo-Morales, A., Bautista-Ortega, M., Barriga-Rodríguez, L., Cruz-González, C.E., and Franco-Urquiza, E.A. (2024). Development of an Image Processing Application for Element Detection in a Printed Circuit Board Manufacturing Cell. Appl. Sci., 14.10.3390/app14135679 ↗
8. Wan, Y., Gao, L., Li, X., and Gao, Y. (2022). Semi-supervised defect detection method with data-expanding strategy for PCB Quality Inspection. Sensors, 22.10.3390/s22207971 ↗
9. Rich feature hierarchies for accurate object detection and semantic segmentation
10. Ni, Y.-S., Chen, W.-L., Liu, Y., Wu, M.-H., and Guo, J.-I. (2024). Optimizing Automated Optical Inspection: An Adaptive Fusion and Semi-Supervised Self-Learning Approach for Elevated Accuracy and Efficiency in Scenarios with Scarce Labeled Data. Sensors, 24.10.3390/s24175737 ↗
11. Deep learning based solder joint defect detection on industrial printed circuit board X-ray images10.1007/s40747-021-00600-w ↗
12. Jiang, S., Lin, H., Ren, H., Hu, Z., Weng, L., and Xia, M. (2024). Mdanet: A high-resolution city change detection network based on difference and attention mechanisms under multi-scale feature fusion. Remote Sens., 16.10.3390/rs16081387 ↗
13. Chung, S.-T., Hwang, W.-J., and Tai, T.-M. (2023). Keypoint-Based Automated Component Placement Inspection for Printed Circuit Boards. Appl. Sci., 13.10.20944/preprints202307.0814.v1 ↗
14. Zhan, Z., Ren, H., Xia, M., Lin, H., Wang, X., and Li, X. (2024). Amfnet: Attention-guided multi-scale fusion network for bi-temporal change detection in remote sensing images. Remote Sens., 16.10.3390/rs16101765 ↗
15. Cheng, P., Xia, M., Wang, D., Lin, H., and Zhao, Z. (2025). Transformer Self-Attention Change Detection Network with Frozen Parameters. Appl. Sci., 15.10.3390/app15063349 ↗
16. Liu, G., Li, J., Yan, S., and Liu, R. (2023). A Novel Small Target Detection Strategy: Location Feature Extraction in the Case of Self-Knowledge Distillation. Appl. Sci., 13.10.3390/app13063683 ↗
17. Ran, G., Lei, X., Li, D., and Guo, Z. (2020, January 22–25). Research on PCB Defect Detection Using Deep Convolutional Neural Network. Proceedings of the 2020 5th International Conference on Mechanical, Control and Computer Engineering (ICMCCE), Harbin, China.10.1109/ICMCCE51767.2020.00287 ↗
18. Anitha, D., and Rao, M. (2018, January 22–24). A survey on defect detection in bare pcb and assembled pcb using image processing techniques. Proceedings of the International Conference on Wireless Communications, Signal Processing and NETWORKING, Chennai, India.10.1109/WiSPNET.2017.8299715 ↗
19. Printed circuit board defect detection methods based on image processing, machine learning and Deep Learning: A survey10.1109/ACCESS.2023.3245093 ↗
20. CS-ResNet: Cost-sensitive residual convolutional neural network for PCB cosmetic defect detection10.1016/j.eswa.2021.115673 ↗
21. Şimşek, M.A., Sertbaş, A., Sasani, H., and Dinçel, Y.M. (2025). Automatic Meniscus Segmentation Using YOLO-Based Deep Learning Models with Ensemble Methods in Knee MRI Images. Appl. Sci., 15.10.3390/app15052752 ↗
22. Yılmaz, A., Yurtay, Y., and Yurtay, N. (2025). AYOLO: Development of a Real-Time Object Detection Model for the Detection of Secretly Cultivated Plants. Appl. Sci., 15.10.3390/app15052718 ↗
23. Félix-Jiménez, A.F., Sánchez-Lee, V.S., Acuña-Cid, H.A., Ibarra-Belmonte, I., Arredondo-Morales, E., and Ahumada-Tello, E. (2025). Integration of YOLOv8 Small and MobileNet V3 Large for Efficient Bird Detection and Classification on Mobile Devices. AI, 6.10.3390/ai6030057 ↗
24. Wang, J., Ma, L., Li, Z., Cao, Y., and Zhang, H. (2025). SSHP-YOLO: A High Precision Printed Circuit Board (PCB) Defect Detection Algorithm with a Small Sample. Electronics, 14.10.3390/electronics14020217 ↗
25. Du, B., Wan, F., Lei, G., Xu, L., Xu, C., and Xiong, Y. (2023). YOLO-MBBi: PCB Surface Defect Detection Method Based on Enhanced YOLOv5. Electronics, 12.10.3390/electronics12132821 ↗
26. Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016, January 27–30). You only look once: Unified, real-time object detection. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.10.1109/CVPR.2016.91 ↗
27. Applying deep learning to defect detection in printed circuit boards via a newest model of you-only-look-once10.3934/mbe.2021223 ↗
28. Yuan, T., Jiao, Z., and Diao, N. (2025). YOLO-SSW: An Improved Detection Method for Printed Circuit Board Surface Defects. Mathematics, 13.10.3390/math13030435 ↗
29. Shi, P., Zhang, Y., Cao, Y., Sun, J., Chen, D., and Kuang, L. (2024). DVCW-YOLO for Printed Circuit Board Surface Defect Detection. Appl. Sci., 15.10.3390/app15010327 ↗
30. Chen, L., Su, L., Chen, W., Chen, Y., Chen, H., and Li, T. (2024). YOLO-DHGC: Small Object Detection Using Two-Stream Structure with Dense Connections. Sensors, 24.10.3390/s24216902 ↗
31. Alif, M.A.R., and Hussain, M. (2025). YOLOv12: A Breakdown of the Key Architectural Features. arXiv.
32. Tian, Y., Ye, Q., and Doermann, D. (2025). YOLOv12: Attention-Centric Real-Time Object Detectors. arXiv.
33. Vasu, S., Ma, Y., Singh, S., Tuzel, O., and Ranjan, A. (2023, January 17–24). MobileOne: An Improved One Millisecond Mobile Backbone. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada. Available online: https://openaccess.thecvf.com/content/CVPR2023/papers/Vasu_MobileOne_An_Improved_One_Millisecond_Mobile_Backbone_CVPR_2023_paper.pdf.10.1109/CVPR52729.2023.00764 ↗
34. MFDNN: Multi-Scale Feature-Weighted Dual-Neck Network for Underwater Object Detection10.1117/1.JEI.33.2.023056 ↗
35. Wang, C., and Yi, H. (2025). DGBL-YOLOv8s: An Enhanced Object Detection Model for Unmanned Aerial Vehicle Imagery. Appl. Sci., 15.10.3390/app15052789 ↗
36. Li, H., Wang, Z., Qiu, L., and Wei, X. (2025). Method for Detecting Tiny Defects on Machined Surfaces of Mechanical Parts Based on Object Recognition. Appl. Sci., 15.10.3390/app15052484 ↗
37. Pan, C., Zhang, Y., Zhang, H., and Xu, J. (2025). Lateral Displacement and Distance of Vehicles in Freeway Overtaking Scenario Based on Naturalistic Driving Data. Appl. Sci., 15.10.3390/app15052370 ↗
38. FTA-Net: Frequency-Temporal-Aware Network for Remote Sensing Change Detection10.1109/JSTARS.2025.3525595 ↗
39. Woo, S., Park, J., Lee, J.-Y., and Kweon, I.S. (2018, January 8–14). CBAM: Convolutional Block Attention Module. Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany.10.1007/978-3-030-01234-2_1 ↗
40. Bitemporal attention sharing network for remote sensing image change detection10.1109/JSTARS.2024.3400925 ↗