Foreign Object Recognition in Railway Switches via Masked Autoencoder and Hypersphere-Constrained Feature Learning
Chaoming Li, Huacan Lin, Weian Zhu, Junyi Li · 2025
The intrusion of foreign objects into railway switches will seriously affect railway traffic safety. In the absence of foreign object intrusion data, it is a difficult problem to construct a model that can accurately identify the presence of unknown foreign objects through computer vision technology. This paper proposes a foreign object recognition method for railway switches based on masked autoencoder (MAE) and hypersphere-constrained feature learning. Only video frame data captured during normal operation of railway switches are employed for model construction. The ViT-based autoencoder is pre-trained via the MAE framework to build a feature vector extraction model. The copy-paste data augmentation is used to automatically generate railway switch images with pseudo- foreign objects to participate in model training. The model projects the feature vectors into a hypersphere space under the constraints defined by the objective function, and uses the hypersphere as a decision boundary to determine the presence of foreign objects in railway switches. Experimental results on real-world datasets demonstrate that the proposed method achieves accurate foreign object recognition with only normal operation images of railway switches and a small amount of pseudo-abnormal data during training. The proposed method provides an effective solution for foreign object recognition in railway switches.