# Enhanced Detection of Subway Insulator Defects Based on Improved YOLOv5
###### Abstract  
Insulators, pivotal to the integrity of railway catenaries, demand impeccable functioning to prevent system failures. Their consistent assessment is vital for railway safety. Current insulator evaluations in subways predominantly involve human intervention, a method fraught with inefficiencies, inaccuracies, and oversights, exacerbated by the complex backdrop of subway tunnels and minuscule defect dimensions. This study introduces an enhanced algorithm, anchored in the YOLOv5 framework, to refine insulator defect identification. Challenges in defect detection include limited, imbalanced data samples and adaptability. Addressing this, an accurate catenary model mirrors the subway line's architecture, facilitating the creation of synthetic instances of both intact and impaired insulators. An atomization technique augments the dataset volume, fortifying the algorithm's resilience in reduced visibility conditions, such as fog. Tackling sample equilibrium, the study introduces an equilibrium loss function, assigning disparate weights to various sample categories during training, thereby sharpening the algorithm's focus on positive instances, particularly those that are challenging to discern, and rectifying the disproportion in sample categories. Incorporating lightweight structures like GhostNet and the Efficient Channel Attention Network (ECA-Net) channel attention scheme not only diminishes the network's computational demands, thereby elevating the detection capabilities, but also minimizes superfluous data processing, enhancing the accuracy in identifying smaller targets. Empirical analyses indicate substantial model optimization: a size reduction to 60 pp of its original (from 15 MB to 9 MB), a near 1.4 pp increase in mean average precision (mAP) to 96.57%, and a tripling of the detection speed (from 30 to 90 FPS). Real-world image assessments further reveal a mAP improvement of approximately 2.5 pp (reaching 98.43%), confirming the model's suitability for real-time applications. YOLOv5; railway; insulator; sample scarcity; atomization; lightweight; attention mechanism +
Footnote †: journal: Applied Sciences  
of these electrified railway lines, provide crucial mechanical support and electrical insulation. Nevertheless, these insulators are subject to degradation and defects owing to prolonged exposure to outdoor environments, with challenges stemming from variations in temperature, humidity, and other natural elements. Compromised insulators can lead to substantial service disruptions, triggering not only significant economic setbacks but also detrimental societal consequences [1]. Given these potential impacts, the rigorous inspection of insulators constitutes a critical measure in ensuring the uninterrupted functionality of contact line transmission systems [2]. Traditional inspection methodologies typically involve manual examinations or conventional image inspections. However, manual inspection is both hazardous and inefficient, relying primarily on non-motorized vehicles such as railroad flatcars that require multiple individuals to push them along the track. An inspector sits on the herringbone ladder of the flatbed truck and utilizes a flashlight and other light sources to observe and inspect the insulators and other components on the line. After detecting at a certain distance, the inspector is replaced to continue the inspection. This maintenance process is characterized by poor working conditions, high labor intensity, low detection efficiency, and a high risk of misdetection and omission, which can result in operational safety accidents. whereas conventional image processing techniques, which employ edge detection and color features, tend to be sluggish and lack accuracy in defect identification [3]. For open-air railway settings, drones have emerged as an efficient mechanism to capture insulator images over extensive areas.