A lightweight YOLOv8n-based method for rail surface defect detection in complex railway environments
Rail surface defect detection faces significant challenges, including class imbalance, small-scale defect detection, and interference from complex backgrounds. To address these issues, this study proposes a lightweight rail surface defect detection method based on YOLOv8n. First, a K-means + + -based defect scale prior optimization strategy is introduced to better characterize the scale distribution of rail surface defects and improve the representation of small targets. Second, a local-global collaborative attention module, named CloAtt, is embedded into the C2f. structure to enhance fine-grained defect feature representation while suppressing complex background noise. Third, an Attention-Guided Bidirectional Feature Pyramid Network, named ABiFPN, is designed to improve multi-scale feature fusion and reduce redundant feature propagation. Furthermore, a Focal-Efficient Intersection over Union loss, named Focal-EIoU, is adopted to improve bounding box regression and enhance the learning of difficult samples. Experimental results on the ProRail dataset show that the proposed YOLOv8n-ours achieves an [email protected] of 85.7%, with only 2.13M parameters and 7.5 GFLOPs. Compared with the baseline YOLOv8n, the proposed method improves detection accuracy while reducing model complexity. These results demonstrate that the proposed model provides an effective lightweight solution for rail surface defect detection. Edge-device deployment and real-time inference validation will be investigated in future work.
Authors
- Weimeng Wang (ORCID: https://orcid.org/0009-0007-1027-1380)
- Weifeng Shi (ORCID: https://orcid.org/0000-0002-8717-2942)
- Weiqiao Zhu
- Zhe Wang
- Yang Yang
Institutions
- China Academy of Railway Sciences (CN)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-06-29
- DOI
- https://doi.org/10.1038/s41598-026-58883-3
- Primary Topic
- Railway Engineering and Dynamics
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China