| In recent years,railway construction in China has developed rapidly,and railway transportation has been continuously advancing towards high-speed and heavy-duty directions,posing new challenges to railway operation safety.As an important component of the railway system,the railway clip plays a crucial role,and its missing or damaged state can cause significant safety hazards to the railway system,making it an essential item in railway inspections.Currently,China mainly adopts a combination of manual inspection and inspection vehicles to detect clip defects.However,manual inspection is inefficient and relies on the experience of inspectors,lacking objectivity.Therefore,automated detection of railway clip defects is a worthy research topic,and deep learning-based railway clip defect detection is a cutting-edge and emerging research direction that has attracted significant attention.This paper conducts an in-depth study on the deep learning-based algorithm for detecting railway clip defects,and proposes a railway clip defect detection algorithm based on YOLOv5s.A railway clip defect detection system is designed and implemented.The specific work content of the paper is as follows:(1)The deep learning-based object detection algorithm is applied to the field of railway clip defect detection.A railway clip defect dataset is created,and the SSD,YOLOv3,YOLOv4,YOLOv5s,and Faster R-CNN algorithms are applied to railway clip defect detection.Experiments are conducted on the railway clip defect dataset in the same environment,and the experimental results are obtained.The results show that the YOLOv5s algorithm performs the best in railway clip defect detection,with a precision rate of 96.8%,recall rate of 97.4%,and average precision of 97.8%.(2)A lightweight modification was made to the YOLOv5s algorithm.Although YOLOv5s showed high detection accuracy in railway fastener defect detection,its network structure is complex,with a large number of parameters,making it difficult to deploy easily.In this paper,based on the YOLOv5s network model,the Ghost Net network was introduced,and the Ghost module was used to replace the original convolution operation.The Ghost bottleneck module was introduced into the original network C3 module,resulting in an improved C3Ghost module.The network structure was analyzed,and the total number of model parameters was reduced from 7.02*10~6to 3.69*10~6,representing a 48%reduction in total parameter size.The model size was reduced from 13.8MB to 7.5MB,representing a 45.6%reduction in model size.However,some accuracy was lost in the process,with precision at 89.9%,recall at87.1%,and average precision at 90.9%.The main reason for the accuracy reduction was the increased false detection rate for fastener displacement defects.(3)Improved YOLOv5s_Ghost algorithm with attention mechanism.Through analysis,the use of smaller convolution kernels in Ghost module can cause the model to miss some important location features,resulting in a decrease in detection rate for shift defects of rail clips.Shift defect is caused by the normal clip being deflected,and maintains the integrity of the clip structure,making it more sensitive to location information.Therefore,on the basis of YOLOv5s_Ghost network,we introduced CA attention mechanism module,which integrates location information into channel attention to improve the quality of focus on the target,capture location feature information,and improve the detection accuracy of the model.After adding the attention mechanism,the model achieved a precision rate of 96.5%,a recall rate of97.3%,and an average precision of 97.6%,achieving a balance between detection accuracy and model size.(4)Design and implementation of a railway fastener defect detection system.The trained model was deployed rapidly onto Intel’s CPU platform through OpenVINO,and optimized using the optimization tools provided by OpenVINO to improve performance and response speed.The system was integrated into a QT application,allowing for interaction and display through a graphical user interface.The system realizes real-time and automated detection of railway fastener defects in both image and video formats. |