Optimization of YOLOv12 for Steel Surface Defect Detection Under Class Imbalance
摘要
Steel surface defect detection plays a critical role in industrial quality control, where rare but high-risk defects must be accurately identified under imbalanced data conditions. As a subtask of object detection, defect detection also suffers from long-tailed class distributions, which hinder the learning of minority-class features. To address this issue, we propose a series of training-level enhancements to the YOLOv12 algorithm, including a Minority-Class Re-Learning Strategy and a Stability-Aware Loss Function. The former reinforces feature learning for underrepresented classes via a multi-stage fine-tuning and fusion process, while the latter improves localization robustness by penalizing uncertain predictions. Experimental results on the GC10-DET dataset demonstrate a 3.6% improvement in mAP@50 and 2.4% in mAP@50–95, confirming that our approach significantly improves detection performance for minority classes without compromising accuracy on majority classes, providing a practical and effective solution for industrial defect detection.