### Motivations and Related Works
Through multi-level fusion operations, they significantly improved the detection sensitivity for small fastener targets. [PERSON] et al. [27] established an anomaly fastener classification model based on Faster R-CNN and SVDD, which avoided inaccurate fastener classification. [PERSON] et al. [28] proposed an improved YOLOX-Nanorail fastener defect detection method feature extraction part to add a coordinate attention mechanism, which enhances the model's detection accuracy in defective fasteners. [PERSON] et al. [29] proposed multi-task learning models for rail and fastener classification, where the models trained on the rail classification and fastener coarse classification tasks are migrated to fastener anomaly classification models, and then fine-tuning the models is performed. However, these methods rely heavily on large-scale annotated anomaly samples, which are extremely scarce in real-world scenarios, leading to the poor generalization capability of supervised learning models. While supervised approaches (e.g., support vector machine used in [PERSON] et al. [30], using a support vector machine to detect desk illuminance sensor blockage for closed-loop daylight harvesting) perform well when labeled data are sufficient, they struggle in railway fastener inspection due to the scarcity of defective samples. To address scarce anomalous samples, researchers have proposed unsupervised methods based on generative adversarial networks and autoencoders. [PERSON] et al. [31] proposed an unsupervised fabric anomaly detection method employing an image reconstruction network, which determines anomalies by calculating reconstruction errors between input and output images. [PERSON] et al. [32] developed a generative adversarial network for brain lesion detection, where adversarial training between the generator and discriminator enables learning of normal brain image feature distributions, thereby identifying lesion regions deviating from normal patterns. [PERSON] et al. [33] proposed a wafer anomaly detection method. The framework integrates a convolutional variational autoencoder (VAE), which is pre-trained in an unsupervised manner on large-scale training data. Through its deep architecture, the VAE learns discriminative features directly from wafer maps to identify structural anomalies. Although these unsupervised methods demonstrate satisfactory performance in datasets with uniform textures, railway fastener anomaly detection faces distinct challenges from such regular patterns. The complex operational environment introduces multiple interference factors, including illumination variations and occlusions, making existing methods unreliable for railway fastener inspection scenarios. Rail fasteners inherently possess limited semantic information and are particularly vulnerable to environmental interference in complex operational scenarios. This characteristic diminishes target saliency, substantially increasing the difficulty of anomaly detection. Additionally, in encoder-decoder architectures, the feature degradation caused by successive downsampling operations persists [34], even with the incorporation of skip connections. To address feature degradation, researchers have proposed several improvements: AnoGAN [35] optimizes the mapping strategy from image space to latent space, learning a more representative latent distribution to partially compensate for information loss; MemAE [36] introduces a memory module in autoencoders, leveraging attention mechanisms to retrieve normal sample features and suppress feature degradation; and SQUID [37] employs a teacher-student framework where the teacher network guides the student network's training, while an embedded image restoration module in the student network alleviates feature degradation in unsupervised anomaly detection. Although these solutions partially mitigate feature degradation, they fail to fully compensate for the progressive loss of cross-scale global contextual features [38; 39].