| Railways are the link connecting large,medium,and small cities in China,and bear the important mission of goods,energy,and population circulation.Ensuring the safety of railway transportation is of great significance to ensuring China’s economic,military,and social security.The continuous development of electrified railways has reduced transportation costs,contributed to environmental protection,and significantly improved the transportation capacity of China’s railways.Railway rails bear the weight of trains,and work in harsh environments such as sunshine and rain all year round.Their surfaces can produce defects of various shapes,posing a threat to the safety of railway traffic.The traditional manual inspection and conventional non-destructive testing methods are inefficient and difficult to meet the current testing needs of large-scale railway lines in China.In recent years,image based detection methods based on deep learning have developed rapidly.Due to the small number of rail surface defect samples,this article uses conventional image amplification methods to expand the rail surface defect samples,and improves the deep convolutional generation adversarial networks(DCGAN)based on deep neural networks to generate defect samples.This article first uses the You Only Look Once Version5(YOLOv5)algorithm to achieve accurate defect localization,and then proposes an improved Unified Perceptual Parsing for Scene Understanding Network(UPerNet)algorithm for accurate segmentation of rail surface defects.Based on semantic segmentation of defects,different defects in the graph are distinguished through connected domain analysis,and the actual length,width,and area of the defects are calculated to roughly determine the extent of damage to the defects.First of all,in response to the problem of fewer surface defects due to timely operation and maintenance of primary and secondary railways,partial defect samples were collected on a poorly maintained fourth level transportation railway line,and were used in this study together with the open source datasets Rail Surface Discrete Defects(RSDDs).The rail surface defect samples were amplified using conventional data amplification methods such as rotation,noise addition,and improved DCGAN.The improved DCGAN in this paper adds self-attention and channel-attention layers to the generator and discriminator,improving the utilization of context information by the network,and appropriately increasing the depth of the network,improving the diversity and complexity of generating rail surface defect images.Secondly,the principles of one stage and two stage object detection algorithms are introduced in detail,and the simple and efficient YOLOv5 algorithm is selected to locate rail surface defects.An improved UPerNet semantic segmentation network is proposed,which uses a Swin-T network with Transformer architecture for defect feature extraction,making full use of global information in images and avoiding inductive preference issues.The rule window self-attention reduces the amount of parameters in the model.Gradient optimization was performed using a cross card synchronized batch normalization method,and Lovászhinge was used as a loss function,incorporating the use of dependencies between pixels.Experimental results show that the improved method in this paper improves the segmentation accuracy of rail surface defects to a certain extent,and can accurately delineate the complex shape features of rail surface defects.Finally,based on the semantic segmentation diagram of rail surface defects,different defect areas are distinguished through connected domain division,and the actual length and area of the defects are calculated based on the number of pixels.According to the Chinese "Railway Line Repair Rules",a rough determination of the damage degree of the peeled off block type defects is achieved,which helps railway maintenance personnel intuitively understand the defect parameters and make corresponding repairs. |