## 4 Experiments  
### Experimental Setup and Dataset  
This study establishes a multidimensional experimental validation system for track surface defect detection, encompassing hardware platforms, software frameworks, dataset construction, and model training strategies. The experimental configuration is shown in Table 1, employing a high-performance computing platform equipped with an NVIDIA RTX 4090 GPU (NVIDIA Corporation, Santa Clara, CA, USA), an AMD R9 9900X CPU (Advanced Micro Devices, Inc., Santa Clara, CA, USA), and 64 GB DDR5 6000 MHz memory (Asgard, a brand of Power Electronic Technology Co., Limited, Shenzhen, China), enabling large-scale parallel data processing. The software environment is built upon the PyTorch 2.2.1 deep learning framework, utilizing CUDA 12.7 and cuDNN 8.7.0 for GPU operator optimization, while the operating system is Windows 10 Professional to ensure hardware driver compatibility. To ensure training stability and efficiency, the training hyperparameters are set as shown in Table 2.  
These parameter settings contribute to achieving optimal convergence speed and accuracy during training. The SGD optimizer effectively adjusts the learning rate, enabling the model to gradually minimize errors over prolonged training periods. The learning rate decay and warm-up strategies effectively mitigate early training instability, ensuring balanced training results at various stages. Figure 6: Implementation of perceptual loss. In this study, the dataset used is the railway surface defect dataset collected on a 9 km railway test loop built by the National Academy of Railway Sciences Test Center. These data were acquired using a line-scan camera installed on a high-speed train [43]. Throughout the data collection process, a total of 400 images containing defects were gathered. After annotation, all images were utilized for model training, validation, and testing. The annotation details are illustrated in Figure 7.  
The dataset employed in this study specifically focuses on detecting and classifying defects on rail surfaces, encompassing various typical types of rail damage. During the construction of this dataset, special attention was paid to the diversity and representativeness of the samples, striving to capture different morphologies and variations of rail surface defects. This approach enhances the model's adaptability to real-world scenarios. In total, the dataset contains eight defect categories, each representing a potential typical rail surface defect. These categories include dent, crush, scratch, slant, damage, dirt, gap, and unknown. Each defect category is defined and classified in detail based on its specific visual characteristics. A dent typically appears as an elliptical depression in a localized area, whereas a crush is a deeper depression across the rail surface and may be accompanied by irregular black pits. Scratches and slants usually manifest as linear scrapes or patterns along the longitudinal direction of the rail, both of which can affect the rail's load-bearing capacity and operational safety. The damage category refers to defects whose specific type is indeterminate but still jeopardizes the rail's structural integrity. Dirt indicates relatively shallow and orderly stains on the rail surface and often preserves some surface texture. Gap refers to fissures or voids that appear on the rail surface due to joint gaps. The unknown category comprises features that cannot be recognized as any of the aforementioned defects, nor can they be identified as stains or gaps. Since such unknown defects typically require additional manual inspection, they can also be viewed as a special type of defect.