# Enhanced Detection of Subway Insulator Defects Based on Improved YOLOv5
## 4 Experimental Results and Analysis  
### Dataset Configuration and Experimental Environment  
In conventional machine learning workflows, a dataset is typically segregated into three distinct subsets: a training set, a validation set, and a test set. The training set's primary function is to facilitate the initial model learning process and the fine-tuning of its intrinsic parameters. Concurrently, the validation set serves as a benchmark for periodically assessing the model's iterative performance, thereby guiding parameter optimization for enhanced model stability. The test set, however, is reserved for the ultimate evaluation of the model's generalizability, post-training. To mitigate the risk of model overfitting and to foster a more comprehensive learning process, it is pivotal to ensure a uniform distribution of image samples within these subsets. This precaution helps to avoid the  
Figure 6: Visual Representation of the results after atomization treatment. (**a**) Original image; (**b**) Image at L = 0.2 D = 0.01; (**c**) Image at L = 0.4 D = 0.02; (**d**) Image at L = 0.6 D = 0.03.  
model's overexposure to redundant images from identical locations, thereby bolstering both the training efficacy and the evaluation accuracy. Adhering to this principle, the study employs a random stratification approach to partition the dataset into an 8:1:1 ratio across the training, validation, and test sets, respectively. The main configuration of the experimental platform is shown in Table 2.  
This study employs a dataset comprising 1000 images compiled within a controlled experimental setting. A common issue during the model training phase is overfitting, where the model exhibits high accuracy on the training set but fails to generalize effectively to new, unseen data. To counteract this and bolster the dataset's robustness, this study implemented data augmentation strategies. Techniques including rotation, stitching, flipping, brightness modulation, and fogging were utilized to diversify and expand the dataset, culminating in a total of 3000 insulator images. Annotation of the dataset was executed using the Labellmg software version 1.3.0, adhering to the annotation standards set by the Visual Object Classes (VOCs) dataset. Within this framework, insulators and their respective defects were distinctly marked and categorized as Insulator and Defect. As illustrated in Figure 7, insulators are demarcated with green bounding boxes, whereas defects are highlighted with yellow boxes, ensuring clear visual distinction and accuracy in subsequent model training.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Configuration Category** & **Version** \\ \hline Operating system & Ubuntu 18.04 \\ CPU & Intel Core 19-10900K \\ Image processor & NVIDIA RTX3090 \\ Programming language & Python 3.8 \\ Programming language compilers & PyCharm 2023.1 \\ GPU computing framework & CUDA 11.0 \\ GPU computing acceleration library version & CUDNN 8.3 \\ Deep learning framework & Pytorch 1.7.1 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Configuration details of experimental platform.  
Figure 7: Visual representation of insulators and defects.  
Upon finalizing the experimental environment, the study progressed to the model training stage, characterized by specific parameter configurations: the training model selected was YOLOv5s, input image dimensions were standardized to \(640\times 640\) pixels, the batch size was established at 64, a learning rate of 0.01 was applied, and the training was designed to span 300 epochs.