Abstract
To address the trade-off between detection accuracy and real-time inference in rail surface defect detection, this paper proposes a lightweight algorithm named Slim-MRM. Built upon YOLOv5s, the framework adopts a collaborative ‘structural enhancement and deep compression’ strategy and is evaluated on a self-constructed field-captured dataset. At the structural level, a Mixed-domain modulation mechanism is designed to construct a spectral-spatial dual-branch topology, which reduces background-dominated interference through learnable spectral-spatial reweighting. A Morphological reparameterization (MR) module is further introduced to enhance minute and elongated defect features via asymmetric convolutions, while being converted into an equivalent single-path structure during inference. For model compression, BN-layer sparsity-based structured pruning is combined with knowledge distillation to reduce redundancy and recover part of the accuracy loss. Experimental results show that Slim-MRM improves mAP@0.5 and recall by 3.9 and 6.3 percentage points, respectively, compared with the YOLOv5s baseline. Meanwhile, the parameters and GFLOPs are reduced by 26.5% and 25.9%, respectively, and the forward-inference speed reaches 200.7 FPS under the unified GPU protocol. Comparative evaluations on external test datasets further indicate that the proposed algorithm achieves a favorable balance between detection accuracy and computational efficiency, providing a lightweight solution for real-time rail surface defect detection.

This publication has 30 references indexed in Scilit: