Abstract:To address the issues of low detection accuracy and missed or false detections of small defects in aluminum profile production, this paper proposes an improved YOLOv12n-based method, termed YOLO-PCSU, for surface defect detection. First, a novel A2C2f-PConv structure is designed by integrating PartialConv into the A2C2f module of YOLOv12n, enhancing feature extraction while reducing redundant computation and memory access. Second, CoordAttention is introduced into the backbone to improve detection accuracy without increasing computational cost. Third, the SEAM attention module is added to the detection head to mitigate missed and false detections of small targets. Finally, the U-IoU loss replaces the original CIoU loss to accelerate convergence and enhance prediction precision. Experiments on an aluminum profile defect dataset demonstrate a detection accuracy of 90.3%, with a 2.3% mAP@0.5 improvement over the baseline YOLOv12n, a 9% reduction in parameters, and a 14% reduction in computation. Additional evaluations on the VOC2012 and Northeastern University hot-rolled strip steel surface defect datasets confirm the robustness of the proposed approach.