Rail surface defect segmentation via strip-aware deformable convolution and spectral deformable transformer
Tong Wang, Qinzhou Mao, Yixuan Shi, Haoxuan Xu, Cuijun Dong, Wei Hu, Zongming ZhangAbstract
Accurate segmentation of rail surface defect regions is critical to the safe operation of railway systems. To achieve precise rail defect segmentation, a segmentation approach that integrates deformable convolution with a spectral–deformable transformer was proposed. A multi-scale strip-aware orientation-constrained deformable convolution was employed in the upper encoder block, while a Spectral Deformable Transformer (SDT) was introduced in the deepest encoder block. In the decoder network, a feature-gated fusion module was constructed by combining an Efficient Up-Convolution Block (EUCB) with a Mixed Local Channel Attention (MLCA) module. In the training stage, the pixel-wise classification loss was calculated by a label smoothing weighted cross-entropy function, while the object-level loss was calculated by a weighted generalized dice function. On this basis, a unified quality score was introduced to enable coordinated optimization of the two independent loss functions. Based on a self-developed railway inspection platform, rail surface defect images were collected from in-service railway lines and a defect segmentation dataset was constructed. Experimental results on the test dataset show that the proposed method achieved 74.89% mIoU and 85.38% F1. These results demonstrate that the proposed framework can accurately and robustly segment slender rail surface defects under complex inspection conditions, showing practical potential for intelligent railway inspection and maintenance.