An Unsupervised Anomaly Detection Method for Railway Fasteners Based on Knowledge-Distilled Generative Adversarial Networks
Abstract
1. Introduction
1.1. Motivations and Related Works
1.2. Contributions of This Article
- (1)
- A knowledge-distilled generative adversarial network for unsupervised rail fastener anomaly detection is proposed. During training, the teacher–student framework collaboratively learns normal sample distributions, and the teacher network generates high-fidelity normal images as supervisory signals, while the student network minimizes reconstruction errors through joint knowledge distillation and adversarial training. For inference, the student generator produces significant feature discrepancies when encountering anomalous samples due to reconstruction failure, enabling the discriminator to calculate anomaly scores without labeled defects. The core innovation is the distillation-adversarial co-optimization framework, which achieves precise anomaly localization using only normal samples. The framework is specifically designed for railway operation and maintenance scenarios to address the critical challenge of anomalous data scarcity. Compared to conventional approaches, it achieves a substantial reduction in dependence on manual inspection processes.
- (2)
- A multi-scale attention coupling feature enhancement mechanism (MSAC) is proposed to effectively address complex interference in railway environments such as illumination variations and foreign object occlusions. This mechanism integrates feature maps from three encoder levels through skip connections within the teacher network. This architecture synergistically represents hierarchical semantic information while mitigating feature degradation caused by downsampling in encoder–decoder structures. Furthermore, the mechanism incorporates both channel and positional information, enabling it to emphasize key channel features and significantly suppress background noise.
- (3)
- An enhanced anomaly discriminator is proposed, incorporating an enhanced joint pyramid upsampling module to preserve fine-grained details through multi-scale feature map fusion within the student network. The proposed discriminator enhancement improves cross-level feature representation capability, thereby significantly boosting detection sensitivity for small-scale anomalies. This design enables maintenance personnel to identify incipient anomalies prior to their escalation into critical failures, thereby facilitating the implementation of predictive maintenance protocols.
2. The Proposed Method
2.1. Overall Framework
2.2. Multi-Scale Attention-Coupling Feature-Enhancement Mechanism
2.3. Enhanced Anomaly Discriminator
2.4. Loss Function
2.5. Data Preprocessing and Implementation Details
2.5.1. Data Preprocessing
2.5.2. Implementation Details
3. Experiments and Results
3.1. Experimental Setup
3.1.1. Experimental Dataset
3.1.2. Experimental Parameters
3.1.3. Evaluation Indicators
3.2. Comparative Experiments
3.2.1. Experimental Results on the MNIST Dataset
3.2.2. Experimental Results on the Rail Fastener Dataset
3.2.3. Methodological Comparison and Discussion
3.3. Ablation Experiments
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Cheng, Y.-S.; Loo, B.P.Y.; Vickerman, R. High-Speed Rail Networks, Economic Integration and Regional Specialisation in China and Europe. Travel Behav. Soc. 2015, 2, 1–14. [Google Scholar] [CrossRef]
- Gutiérrez, J.; González, R.; Gomez, G. The European High-Speed Train Network: Predicted Effects on Accessibility Patterns. J. Transp. Geogr. 1996, 4, 227–238. [Google Scholar] [CrossRef]
- Perl, A.D.; Goetz, A.R. Corridors, Hybrids and Networks: Three Global Development Strategies for High Speed Rail. J. Transp. Geogr. 2015, 42, 134–144. [Google Scholar] [CrossRef]
- Givoni, M. Development and Impact of the Modern High-Speed Train: A Review. Transp. Rev. 2006, 26, 593–611. [Google Scholar] [CrossRef]
- Takatsu, T. The History and Future of High-Speed Railways in Japan. Jpn. Railw. Transp. Rev. 2007, 48, 6–21. [Google Scholar]
- Li, Y.; Meng, Z. Design and Implementation of a Coal-Dust Removal Device for Heavy-Haul Railway Tunnels. Transp. Saf. Environ. 2020, 2, 283–291. [Google Scholar] [CrossRef]
- Lachowicz, M.B.; Lachowicz, M.M. Influence of corrosion on fatigue of the fastening bolts. Materials 2021, 14, 1485. [Google Scholar] [CrossRef]
- Zhong, H.; Liu, L.; Wang, J.; Fu, Q.; Yi, B. A Real-Time Railway Fastener Inspection Method Using the Lightweight Depth Estimation Network. Measurement 2022, 189, 110613. [Google Scholar] [CrossRef]
- Ou, Y.; Luo, J.; Li, B.; He, B. A Classification Model of RailwayFasteners Based on Computer Vision. Neural Comput. Appl. 2019, 31, 9307–9319. [Google Scholar] [CrossRef]
- Huang, Y.; Wang, J.; Le, W.; Su, J. Study on Mechanical Behaviours of Rail Fasteners and Effects on Seismic Performance of Urban Rail Viaduct. Structures 2021, 33, 3822–3834. [Google Scholar] [CrossRef]
- Shang, Z.; Li, L.; Zheng, S.; Mao, Y.; Shi, R. FIQ: A Fastener Inspection and Quantization Method Based on Mask FRCN. Appl. Sci. 2024, 14, 5267. [Google Scholar] [CrossRef]
- Song, W.; Liao, B.; Ning, K.; Yan, X. Improved Real-Time Detection Transformer-Based Rail Fastener Defect Detection Algorithm. Mathematics 2024, 12, 3349. [Google Scholar] [CrossRef]
- Liu, J.; Yuan, J.; Jia, Y. A New Method for Railway Fastener Detection Using the Symmetrical Image and Its EA-HOG Feature. Int. J. Pattern Recognit. Artif. Intell. 2020, 34, 2055006. [Google Scholar] [CrossRef]
- Cao, X.; Zuo, M.; Chen, G. Visual Localization Method for Fastener-Nut Disassembly and Assembly Robot Based on Improved Canny and HOG-SED. Appl. Sci. 2025, 15, 1645. [Google Scholar] [CrossRef]
- Chen, S.; Zhong, S.; Xue, B.; Li, X.; Zhao, L.; Chang, C.I. Iterative Scale-Invariant Feature Transform for Remote Sensing Image Registration. IEEE Trans. Geosci. Remote Sens. 2020, 59, 3244–3265. [Google Scholar] [CrossRef]
- Liu, Z.; He, Y.; Wang, C.; Song, R. Analysis of the Influence of Foggy Weather Environment on the Detection Effect of Machine Vision Obstacles. Sensors 2020, 20, 349. [Google Scholar] [CrossRef]
- Han, Q.; Wang, S.; Fang, Y.; Wang, L.; Du, X.; Li, H.; He, Q.; Feng, Q. A Rail Fastener Tightness Detection Approach Using Multi-Source Visual Sensor. Sensors 2020, 20, 1367. [Google Scholar] [CrossRef]
- Wang, M.; Deng, W. Deep Face Recognition: A Survey. Neurocomputing 2021, 429, 215–244. [Google Scholar] [CrossRef]
- Nemavhola, A.; Chibaya, C.; Viriri, S. A Systematic Review of CNN Architectures, Databases, Performance Metrics, and Applications in Face Recognition. Information 2025, 16, 107. [Google Scholar] [CrossRef]
- Ali, W.; Tian, W.; Din, S.U.; Iradukunda, D.; Khan, A.A. Classical and Modern Face Recognition Approaches: A Complete Review. Multimed. Tools Appl. 2021, 80, 4825–4880. [Google Scholar] [CrossRef]
- Sun, T.; Li, Z.; Xiao, X.; Guo, Z.; Ning, W.; Ding, T. Cascaded Detection Method for Surface Defects of Lead Frame Based on High-Resolution Detection Images. J. Manuf. Syst. 2024, 72, 180–195. [Google Scholar] [CrossRef]
- Song, J.; Tian, Y.; Wan, X. Multi-Channel Fusion Decision-Making Online Detection Network for Surface Defects in Automotive Pipelines Based on Transfer Learning VGG16 Network. Sensors 2024, 24, 7914. [Google Scholar] [CrossRef] [PubMed]
- Pang, G.; Shen, C.; Cao, L.; Hengel, A.V. Deep Learning for Anomaly Detection: A Review. ACM Comput. Surv. 2021, 54, 1–38. [Google Scholar] [CrossRef]
- Liu, J.; Liu, H.; Chakraborty, C.; Yu, K.; Shao, X.; Ma, Z. Cascade Learning Embedded Vision Inspection of Rail Fastener by Using a Fault Detection IoT Vehicle. IEEE Internet Things J. 2021, 10, 3006–3017. [Google Scholar] [CrossRef]
- Zheng, D.; Li, L.; Zheng, S.; Chai, X.; Zhao, S.; Tong, Q.; Wang, J.; Guo, L. A Defect Detection Method for Rail Surface and Fasteners Based on Deep Convolutional Neural Network. Comput. Intell. Neurosci. 2021, 2021, 2565500. [Google Scholar] [CrossRef]
- Cao, Y.; Chen, Z.; Wen, T.; Roberts, C.; Sun, Y.; Su, S. Rail Fastener Detection of Heavy Railway Based on Deep Learning. High-Speed Railw. 2023, 1, 63–69. [Google Scholar] [CrossRef]
- Bai, T.; Yang, J.; Xu, G.; Yao, D. An Optimized Railway Fastener Detection Method Based on Modified Faster R-CNN. Measurement 2021, 182, 109742. [Google Scholar] [CrossRef]
- Hu, J.; Qiao, P.; Lv, H.; Yang, L.; Ouyang, A.; He, Y.; Liu, Y. High Speed Railway Fastener Defect Detection by Using Improved YoLoX-Nano Model. Sensors 2022, 22, 8399. [Google Scholar] [CrossRef]
- Gibert, X.; Patel, V.M.; Chellappa, R. Deep Multitask Learning for Railway Track Inspection. IEEE Trans. Intell. Transp. Syst. 2016, 18, 153–164. [Google Scholar] [CrossRef]
- Kent, M.; Huynh, N.K.; Schiavon, S.; Selkowitz, S. Using Support Vector Machine to Detect Desk Illuminance Sensor Blockage for Closed-Loop Daylight Harvesting. Energy Build. 2022, 274, 112443. [Google Scholar] [CrossRef]
- Yu, Z.; Xu, Y.; Wang, Y.; Sheng, X. Unsupervised Fabric Defect Detection Based on Multiscale Image Reconstruction and Structural Similarity Assessment. Color. Technol. 2024, 140, 827–842. [Google Scholar] [CrossRef]
- Alex, V.; Safwan, K.P.M.; Chennamsetty, S.S.; Krishnamurthi, G. Generative Adversarial Networks for Brain Lesion Detection. In Proceedings of the 2017 Medical Imaging and Image Processing, Orlando, FA, USA, 12–14 February 2017; pp. 121–131. [Google Scholar]
- Shon, H.S.; Batbaatar, E.; Cho, W.S.; Choi, S.G. Unsupervised pre-training of imbalanced data for identification of wafer map defect patterns. IEEE Access 2021, 9, 52352–52363. [Google Scholar] [CrossRef]
- Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the 2015 Medical Image Computing and Computer-Assisted Intervention, Munich, Germany, 5–9 October 2015; pp. 234–241. [Google Scholar]
- Schlegl, T.; Seeböck, P.; Waldstein, S.M. Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery. In Proceedings of the International Conference on Information Processing in Medical Imaging, Cham, Switzerland, 21–24 May 2017; Springer: Cham, Switzerland, 2017; pp. 146–157. [Google Scholar]
- Gong, D.; Liu, L.; Le, V.; Saha, B.; Mansour, M.R.; Venkatesh, S.; Hengel, A.V.D. Memorizing Normality to Detect Anomaly: Memory-Augmented Deep Autoencoder for Unsupervised Anomaly Detection. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (CVPR), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1705–1714. [Google Scholar]
- Xiang, T.; Zhang, Y.; Lu, Y.; Yuille, A.L.; Zhang, C.; Cai, W.; Zhou, Z. SQUID: Deep Feature In-painting for Unsupervised Anomaly Detection. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 18–22 June 2023; pp. 23890–23901. [Google Scholar]
- Wu, W.; Liu, S.; Xia, Y.; Zhang, Y. Dual residual attention network for image denoising. Pattern Recognit. 2024, 149, 110291. [Google Scholar] [CrossRef]
- Chen, Y.; Xia, R.; Yang, K.; Zou, K. DNNAM: Image inpainting algorithm via deep neural networks and attention mechanism. Appl. Soft Comput. 2024, 154, 111392. [Google Scholar] [CrossRef]
- Bai, Y.; Zhang, J.; Chen, Z.; Dong, Y.; Cao, Y.; Tian, G. Dual-path frequency discriminators for few-shot anomaly detection. Knowl.-Based Syst. 2024, 302, 112397. [Google Scholar] [CrossRef]
- Zhao, P.; Ding, Z.; Li, Y.; Tian, Y.; Tang, H.; Guo, X. SGAD-GAN: Simultaneous generation and anomaly detection for time-series sensor data with generative adversarial networks. Mech. Syst. Signal Process. 2024, 210, 111141. [Google Scholar] [CrossRef]
- Zhang, Y.; Guo, Z.; Wu, J.; Liu, Y.; Ding, J. Real-Time Vehicle Detection Based on Improved YOLOv5. Sustainability 2022, 14, 12274. [Google Scholar] [CrossRef]
- Wang, Z.; Yang, S.; Qin, H.; Liu, Y.; Ding, J. CCW-YOLO: A Modified YOLOv5s Network for Pedestrian Detection in Complex Traffic Scenes. Information 2024, 15, 762. [Google Scholar] [CrossRef]
- Li, X.; Wang, Q.; Yang, X.; Wang, K.; Zhang, H. Track Fastener Defect Detection Model Based on Improved YOLOv5s. Sensors 2023, 23, 6457. [Google Scholar] [CrossRef]
- Hou, Q.; Zhou, D.; Feng, J. Coordinate Attention for Efficient Mobile Network Design. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 19–25 June 2021; pp. 13708–13717. [Google Scholar]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 7132–7141. [Google Scholar]
- Akcay, S.; Atapour-Abargoue, A.; Breckon, T.P. Ganomaly: Semi-Supervised Anomaly Detection via Adversarial Training. In Proceedings of the 14th Asian Conference on Computer Vision (ACCV 2018), Perth, Australia, 2–6 December 2018; pp. 622–637. [Google Scholar]
- Schlegl, T.; Seeböck, P.; Waldstein, S.M.; Langs, G.; Schmidt-Erfurth, U. f-AnoGAN: Fast Unsupervised Anomaly Detection with Generative Adversarial Networks. Med. Image Anal. 2019, 54, 30–44. [Google Scholar] [CrossRef]
Level | Channels | Resolution |
---|---|---|
Input | 1 | (2 × 2) × (64 × 64) |
1 | 32 | (2 × 2) × (32 × 32) |
2 | 64 | (2 × 2) × (16 × 16) |
3 | 128 | (2 × 2) × (8 × 8) |
4 | 256 | (2 × 2) × (4 × 4) |
Level | Channels | Resolution |
---|---|---|
4 | 256 | (2 × 2) × (4 × 4) |
3 | 128 | (2 × 2) × (8 × 8) |
2 | 64 | 32 × 32 |
1 | 32 | 64 × 64 |
Input | 1 | 128 × 128 |
Level | Channels | Resolution |
---|---|---|
Input | 1 | 128 × 128 |
1 | 16 | 64 × 64 |
2 | 64 | 32 × 32 |
3 | 128 | 16 × 16 |
4 | 128 | 8 × 8 |
5 | 128 | 4 × 4 |
Output | 1 | 1 × 1 |
Category | Training Set | Validation Set | Testing Set |
---|---|---|---|
Normal samples | 1200 | 600 | 200 |
Broken spring strip | 0 | 15 | 22 |
Missing bolt | 0 | 12 | 18 |
Foreign object occlusion | 0 | 13 | 20 |
Model | AUC/% | ACC/% | F1/% |
---|---|---|---|
GANomaly | 89.5 | 87.3 | 86.2 |
f-AnoGAN | 90.1 | 88.5 | 87.4 |
MemAE | 91.2 | 89.8 | 88.1 |
SQUID | 92.5 | 91.3 | 90.2 |
Proposed method | 94.0 | 92.5 | 91.6 |
Model | AUC/% | ACC/% | F1/% |
---|---|---|---|
GANomaly | 73.6 | 73.3 | 69.9 |
f-AnoGAN | 76.9 | 76.1 | 71.4 |
MemAE | 85.3 | 81.9 | 78.5 |
SQUID | 87.2 | 83.8 | 84.3 |
Proposed method | 94.7 | 90.1 | 87.8 |
Model | MSAC | E-JPU | AUC/% | ACC/% | Recall/% | F1/% |
---|---|---|---|---|---|---|
BaseLine | × | × | 87.2 | 83.8 | 83.2 | 84.3 |
Method1 | √ | × | 92.1 | 89.2 | 86.5 | 86.9 |
Method2 | × | √ | 88.9 | 87.2 | 89.3 | 86.3 |
Proposed method | √ | √ | 94.7 | 90.1 | 93.5 | 87.8 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chen, H.; Li, Z.; Xiao, X. An Unsupervised Anomaly Detection Method for Railway Fasteners Based on Knowledge-Distilled Generative Adversarial Networks. Appl. Sci. 2025, 15, 5933. https://doi.org/10.3390/app15115933
Chen H, Li Z, Xiao X. An Unsupervised Anomaly Detection Method for Railway Fasteners Based on Knowledge-Distilled Generative Adversarial Networks. Applied Sciences. 2025; 15(11):5933. https://doi.org/10.3390/app15115933
Chicago/Turabian StyleChen, Hongyan, Zhiwei Li, and Xinjie Xiao. 2025. "An Unsupervised Anomaly Detection Method for Railway Fasteners Based on Knowledge-Distilled Generative Adversarial Networks" Applied Sciences 15, no. 11: 5933. https://doi.org/10.3390/app15115933
APA StyleChen, H., Li, Z., & Xiao, X. (2025). An Unsupervised Anomaly Detection Method for Railway Fasteners Based on Knowledge-Distilled Generative Adversarial Networks. Applied Sciences, 15(11), 5933. https://doi.org/10.3390/app15115933