## 4 Experiments
### Experimental Setup and Dataset
\begin{table}
\begin{tabular}{c c c} \hline
**Environment** & **Parameters** & **Value** \\ \hline \multirow{4}{*}{Hardware} & CPU & AMD R9 9900X \\  & GPU & NVIDIA RTX 4090 \\  & Memory & DDRS 6000 MHz 64 G \\ \hline \multirow{4}{*}{Software} & Operating system & Windows 10 \\  & Development language & Python 3.9 \\ \cline{1-1}  & Deep learning framework & Pytorch 2.6.0 \\ \cline{1-1}  & Computing platform & CUDA 12.7 + cuDNN 9.5.1 \\ \hline \end{tabular}
\end{table} 
Table 1: Hardware and software environment. \begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Value** \\ \hline Epoch & 300 \\ Batch size & 16 \\ Workers & 8 \\ Lr0 & 0.01 \\ Lrf & 0.01 \\ Momentum & 0.937 \\ Weight decay & 0.0005 \\ Warmup epochs & 3.0 \\ Warmup momentum & 0.8 \\ Warmup bias lr & 0.1 \\ Optimizer & SGD \\ Data augmentation & Mosaic, Close mosaic = 10 \\ \hline \end{tabular}
\end{table} 
Table 2: Model training hyperparameters. Consequently, the collected railway surface defect dataset can be utilized to perform eight-category defect detection tasks. Every label in the dataset has been precisely annotated, ensuring clear identification and classification of each defect type. Examples of both the dataset and its annotations can be found in Figure 8.  
To guarantee the model's generalizability and accuracy, defects were meticulously labeled and distributed so that each category is adequately represented. The dataset is divided into training, validation, and testing sets with a ratio of 7:2:1, thereby maximizing data utility during training while ensuring robust performance assessment and model resilience at validation and testing. Evaluation of model performance in this research draws upon a comprehensive set of commonly used metrics, each examining various aspects of system capability on complex tasks. First, precision (P) measures the accuracy of positive (defect) predictions, as shown in Equation (12):  
\[P=\frac{TP}{TP+FP} \tag{12}\]  
where TP (True Positive) denotes the number of real defects correctly identified by the model, and FP (False Positive) indicates non-defective instances incorrectly labeled as defective. Higher precision reflects a model's ability to reduce false alarms, which is especially relevant when minimizing over-detection is critical. Figure 7: Dataset annotation overview. The **upper-left** corner shows a bar chart reflecting the frequency or proportion of each target (defect) category in the dataset. The **upper-right** corner is a visualization of all bounding boxes overlaid in a normalized coordinate system, enabling a direct view of where boxes are located in the image space, as well as their sizes, shapes, and center distributions. The **lower-left** corner is a scatter plot of center coordinates, indicating the positions at which targets appear within the image. The **lower-right** corner is a scatter plot of target width and height (both normalized), which allows us to observe the distribution of target sizes. In contrast, recall (R), or sensitivity, quantifies the model's capacity to capture actual defects, as expressed in Equation (13):  
\[R=\frac{TP}{TP+FN} \tag{13}\]  
where FN (False Negative) represents actual defects overlooked by the model. A higher recall suggests improved coverage of existing defects, although it may introduce more false positives. Consequently, recall serves as an essential gauge of defect coverage in scenarios where overlooking flaws carries significant risk. Average Precision (AP) offers a unified view of the trade-off between precision and recall by integrating precision over multiple recall thresholds, typically via an integral-based approach. Its computation is outlined in Equation (14):  
\[AP=\int_{0}^{1}p(r)\,dr \tag{14}\]  
where \(p(r)\) is the precision value at a particular recall r. AP gauges model performance comprehensively under varied detection thresholds, ensuring thorough evaluation.