Rail Light-Strip Abnormality Analysis from Color Inspection Images Using an Improved SegFormer and Geometric Rules
Highlights
- Boundary-enhanced SegFormer improves rail-head and light-strip mask recovery in color inspection images.
- Rail-head-constrained geometric rules identify eccentricity, width mutation and local integrity abnormalities.
- Boundary quality directly affects light-strip centerline and width measurements.
- Mask-derived geometric indicators provide interpretable evidence for rail maintenance analysis.
Abstract
1. Introduction
2. Related Work
3. Materials and Methods
3.1. Overview of the Proposed Method
3.2. Improved SegFormer for Rail-Head and Light-Strip Segmentation
3.3. Geometric Rule-Based Abnormality Analysis
4. Experiments and Results
4.1. Dataset and Experimental Settings
4.2. Segmentation Results
4.3. Abnormality Analysis Results
4.4. Computational Complexity and Deployment Efficiency
5. Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Du, Y.; Zhang, X.; Gao, Y.; Nan, Z. RSDNet: A New Multiscale Rail Surface Defect Detection Model. Sensors 2024, 24, 3579. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Faghih-Roohi, S.; Hajizadeh, S.; Nunez, A.; Babuska, R.; De Schutter, B. Deep Convolutional Neural Networks for Detection of Rail Surface Defects. In Proceedings of the International Joint Conference on Neural Networks; IEEE: New York, NY, USA, 2016; pp. 2584–2589. [Google Scholar] [CrossRef] [Scilit]
- Gan, J.; Li, Q.; Wang, J.; Yu, H. A Hierarchical Extractor-Based Visual Rail Surface Inspection System. IEEE Sens. J. 2017, 17, 7935–7944. [Google Scholar] [CrossRef] [Scilit]
- Gibert, X.; Patel, V.M.; Chellappa, R. Robust Fastener Detection for Autonomous Visual Railway Track Inspection. In Proceedings of the IEEE Winter Conference on Applications of Computer Vision; IEEE: New York, NY, USA, 2015; pp. 694–701. [Google Scholar] [CrossRef] [Scilit]
- Mauz, F.; Wigger, R.; Gota, A.-E.; Kuffa, M. Automatic Detection of the Running Surface of Railway Tracks Based on Laser Profilometer Data and Supervised Machine Learning. Sensors 2024, 24, 2638. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xia, Y.; Han, S.W.; Kwon, H.J. Image Generation and Recognition for Railway Surface Defect Detection. Sensors 2023, 23, 4793. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ming, G.; Zhou, B.; Luo, X.; Ling, R.; Zhou, M. Rail Surface Defect Detection Method Based on Deep Learning Method with 3D Range Image. In Advances in Frontier Research on Engineering Structures; Springer: Singapore, 2023; Volume 286, pp. 45–59. [Google Scholar] [CrossRef] [Scilit]
- Wang, X.; Xu, X.; Mei, X.; Guo, X. Localization and Pixel-Confidence Network for Surface Defect Segmentation. Sensors 2025, 25, 4548. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Leiñena, A.; Saiz, F.; Barandiaran, I. Latent Diffusion Models to Enhance the Performance of Visual Defect Segmentation Networks in Steel Surface Inspection. Sensors 2024, 24, 6016. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhong, Y.; Chen, G. Rail Surface Defect Detection Based on Dual-Path Feature Fusion. Electronics 2024, 13, 2564. [Google Scholar] [CrossRef] [Scilit]
- Gosiewska, A.; Baran, Z.; Baran, M.; Rutkowski, T. Seeking a Sufficient Data Volume for Railway Infrastructure Component Detection with Computer Vision Models. Sensors 2023, 23, 7776. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Long, J.; Shelhamer, E.; Darrell, T. Fully Convolutional Networks for Semantic Segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2015; pp. 3431–3440. [Google Scholar] [CrossRef] [Scilit]
- Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Proceedings of the Medical Image Computing and Computer-Assisted Intervention; IEEE: New York, NY, USA, 2015; pp. 234–241. [Google Scholar] [CrossRef] [Scilit]
- Zhao, H.; Shi, J.; Qi, X.; Wang, X.; Jia, J. Pyramid Scene Parsing Network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2017; pp. 2881–2890. [Google Scholar] [CrossRef] [Scilit]
- Chen, L.C.; Zhu, Y.; Papandreou, G.; Schroff, F.; Adam, H. Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation. In Proceedings of the European Conference on Computer Vision; IEEE: New York, NY, USA, 2018; pp. 801–818. [Google Scholar] [CrossRef] [Scilit]
- Zheng, S.; Lu, J.; Zhao, H.; Zhu, X.; Luo, Z.; Wang, Y.; Fu, Y.; Feng, J.; Xiang, T.; Torr, P.H.S.; et al. Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2021; pp. 6877–6886. [Google Scholar] [CrossRef] [Scilit]
- Strudel, R.; Garcia, R.; Laptev, I.; Schmid, C. Segmenter: Transformer for Semantic Segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: New York, NY, USA, 2021; pp. 7262–7272. [Google Scholar] [CrossRef] [Scilit]
- Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin Transformer: Hierarchical Vision Transformer Using Shifted Windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: New York, NY, USA, 2021; pp. 10012–10022. [Google Scholar] [CrossRef] [Scilit]
- Xie, E.; Wang, W.; Yu, Z.; Anandkumar, A.; Alvarez, J.M.; Luo, P. SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers. In Advances in Neural Information Processing Systems; IEEE: New York, NY, USA, 2021; Volume 34, pp. 12077–12090. [Google Scholar]
- Takikawa, T.; Acuna, D.; Jampani, V.; Fidler, S. Gated-SCNN: Gated Shape CNNs for Semantic Segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 5229–5238. [Google Scholar] [CrossRef] [Scilit]
- Yuan, Y.; Xie, J.; Chen, X.; Wang, J. SegFix: Model-Agnostic Boundary Refinement for Segmentation. In Computer Vision-ECCV 2020; Springer: Cham, Switzerland, 2020; pp. 489–506. [Google Scholar] [CrossRef] [Scilit]
- Cheng, B.; Girshick, R.; Dollar, P.; Berg, A.C.; Kirillov, A. Boundary IoU: Improving Object-Centric Image Segmentation Evaluation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 15334–15342. [Google Scholar] [CrossRef] [Scilit]
- Cheng, B.; Misra, I.; Schwing, A.G.; Kirillov, A.; Girdhar, R. Masked-Attention Mask Transformer for Universal Image Segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2022; pp. 1290–1299. [Google Scholar] [CrossRef] [Scilit]
- Yuan, Y.; Chen, X.; Wang, J. Object-Contextual Representations for Semantic Segmentation. In Proceedings of the European Conference on Computer Vision; IEEE: New York, NY, USA, 2020; pp. 173–190. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Yu, C.; Gao, C.; Wang, J.; Yu, G.; Shen, C.; Sang, N. BiSeNet V2: Bilateral Network with Guided Aggregation for Real-Time Semantic Segmentation. Int. J. Comput. Vis. 2021, 129, 3051–3068. [Google Scholar] [CrossRef] [Scilit]
- Zhu, Y.; Xiao, N. Simple Scalable Multimodal Semantic Segmentation Model. Sensors 2024, 24, 699. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Shu, X.; Zhao, X. Multi-Resolution Learning and Semantic Edge Enhancement for Super-Resolution Semantic Segmentation of Urban Scene Images. Sensors 2024, 24, 4522. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhang, X.; Chen, X.; Gao, X. Semantic Guidance Fusion Network for Cross-Modal Semantic Segmentation. Sensors 2024, 24, 2473. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kirillov, A.; Mintun, E.; Ravi, N.; Mao, H.; Rolland, C.; Gustafson, L.; Xiao, T.; Whitehead, S.; Berg, A.C.; Lo, W.Y.; et al. Segment Anything. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: New York, NY, USA, 2023; pp. 4015–4026. [Google Scholar] [CrossRef] [Scilit]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. In Proceedings of the IEEE International Conference on Computer Vision; IEEE: New York, NY, USA, 2017; pp. 2980–2988. [Google Scholar] [CrossRef] [Scilit]
- DB34/T 3964-2021; Technical Specification for Rail Grinding and Maintenance of Urban Rail Transit. Anhui Provincial Administration for Market Regulation: Hefei, China, 2021.
- National Railway Administration. Rules for Maintenance of High-Speed Railway Lines, Guo Tie She Bei Jian Gui [2023] No. 15; National Railway Administration: Beijing, China, 2023.
- China State Railway Group Co., Ltd., Engineering and Electrical Department. Railway Line Maintenance and Repair; China Railway Publishing House: Beijing, China, 2021; Chapter 3, Section 2. [Google Scholar]
- Russell, B.C.; Torralba, A.; Murphy, K.P.; Freeman, W.T. LabelMe: A Database and Web-Based Tool for Image Annotation. Int. J. Comput. Vis. 2008, 77, 157–173. [Google Scholar] [CrossRef] [Scilit]
- Everingham, M.; Van Gool, L.; Williams, C.K.I.; Winn, J.; Zisserman, A. The Pascal Visual Object Classes Challenge. Int. J. Comput. Vis. 2010, 88, 303–338. [Google Scholar] [CrossRef] [Scilit]
- Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Fei-Fei, L. ImageNet: A Large-Scale Hierarchical Image Database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2009; pp. 248–255. [Google Scholar] [CrossRef] [Scilit]
- Sutskever, I.; Martens, J.; Dahl, G.; Hinton, G. On the Importance of Initialization and Momentum in Deep Learning. In Proceedings of the International Conference on Machine Learning; IEEE: New York, NY, USA, 2013; pp. 1139–1147. [Google Scholar]










| Variant | BG IoU | RH IoU | LS IoU | mIoU | BF1 | CL-MAE | W-MAE |
|---|---|---|---|---|---|---|---|
| SegFormer | 95.00% | 89.70% | 93.88% | 92.86% | 64.72% | 1.80 px | 5.61 px |
| +Boundary enhancement | 96.10% | 91.60% | 94.12% | 93.94% | 65.43% | 1.15 px | 4.63 px |
| +Focal Loss | 96.35% | 91.25% | 94.76% | 94.12% | 64.96% | 1.38 px | 5.27 px |
| +Boundary enhancement + Focal Loss | 97.18% | 93.52% | 96.31% | 95.67% | 65.75% | 1.11 px | 4.50 px |
| Model | mIoU | Recall | Precision | F1-Score |
|---|---|---|---|---|
| DeepLab v3+ | 90.52% | 87.67% | 85.91% | 86.78% |
| Segmenter | 91.31% | 91.10% | 85.81% | 88.38% |
| OCRNet | 91.67% | 93.15% | 88.31% | 90.67% |
| BiSeNetV2 | 92.12% | 93.61% | 90.11% | 91.83% |
| SegFormer | 92.86% | 94.98% | 88.51% | 91.63% |
| Improved SegFormer | 95.67% | 96.46% | 89.23% | 92.70% |
| Abnormality Type | Ground-Truth Positive Units | TP | FP | FN | Recall | Precision | F1-Score |
|---|---|---|---|---|---|---|---|
| Width mutation | 438 | 430 | 42 | 8 | 98.17% | 91.10% | 94.51% |
| Eccentricity abnormality | 292 | 279 | 38 | 13 | 95.55% | 88.01% | 91.63% |
| Local integrity abnormality | 146 | 136 | 22 | 10 | 93.15% | 86.08% | 89.47% |
| Overall | 876 | 845 | 102 | 31 | 96.46% | 89.23% | 92.70% |
| Model | Params | FLOPs | Model Size | FPS | Peak Memory | Post-Process |
|---|---|---|---|---|---|---|
| SegFormer-B2 | 27.4 M | 121.1 G | 109.6 MB | 38.7 | 7.11 GB | 2.58 ms |
| Improved SegFormer | 27.9 M | 122.5 G | 111.6 MB | 38.3 | 7.17 GB | 2.58 ms |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Song, H.; Gou, Y.; Wang, N.; Wang, L.; Liu, J.; Wang, S.; Xia, C.; Han, Q.; Gu, Z. Rail Light-Strip Abnormality Analysis from Color Inspection Images Using an Improved SegFormer and Geometric Rules. Sensors 2026, 26, 5292. https://doi.org/10.3390/s26165292
Song H, Gou Y, Wang N, Wang L, Liu J, Wang S, Xia C, Han Q, Gu Z. Rail Light-Strip Abnormality Analysis from Color Inspection Images Using an Improved SegFormer and Geometric Rules. Sensors. 2026; 26(16):5292. https://doi.org/10.3390/s26165292
Chicago/Turabian StyleSong, Haoran, Yuntao Gou, Ning Wang, Le Wang, Junbo Liu, Shengchun Wang, Chengliang Xia, Qiang Han, and Zichen Gu. 2026. "Rail Light-Strip Abnormality Analysis from Color Inspection Images Using an Improved SegFormer and Geometric Rules" Sensors 26, no. 16: 5292. https://doi.org/10.3390/s26165292
APA StyleSong, H., Gou, Y., Wang, N., Wang, L., Liu, J., Wang, S., Xia, C., Han, Q., & Gu, Z. (2026). Rail Light-Strip Abnormality Analysis from Color Inspection Images Using an Improved SegFormer and Geometric Rules. Sensors, 26(16), 5292. https://doi.org/10.3390/s26165292

