| As an important part of the railway,the rail has the function of guiding the train to travel in a specific direction and preventing the train from deviating from the track.However,the surface of the rail is easily affected by the natural environment,material aging,and other factors,resulting in defects that pose a major safety hazard to railway transportation.Therefore,the detection of rail surface defects is of great significance to maintaining the safe operation of trains and ensuring the safety of passengers’ lives and property.Traditional detection methods need to consume a lot of resources,and the detection accuracy is low.At present,the detection method based on deep learning has the advantages of high precision and speed and is widely used in industrial production.This thesis focuses on the practical problem of rail surface defect detection,and studies the rail surface defect detection model based on You Only Look Once version 5 small(YOLOv5s).The specific research contents are as follows:(1)Aiming at the problem that it is difficult to effectively detect the edge defects of the rail surface,a rail surface edge defect detection model based on the attention mechanism and transposed convolution is proposed.First,a rail surface image extraction algorithm Bilateral Gray Threshold Extraction(BGTE)is proposed,and the rail surface defect dataset required in this paper is constructed.Second,a sharpening attention mechanism and upsampling via transposed convolution are designed to improve the detection performance of rail surface edge defects.Sharpening Attention Mechanism for Enhanced Localization of Rail Surface Edge Defects.Using the transposed convolution upsampling method can reduce the information loss during the upsampling process of small target defects on the edge of the rail surface.Finally,the sharpened attention mechanism,transposed convolution and YOLOv5 s target detection model are combined,and named YOLOv5s-Edge(YOLOv5s-E).Experimental results show that YOLOv5s-E achieves an average category accuracy of 92.6%.(2)Aiming at the low accuracy of multi-scale defect detection on rail surface,a multi-scale defect detection model on rail surface based on feature fusion and loss function is proposed.First,Microscale Adaptively Spatial Feature Fusion(M-ASFF)is designed to enhance the underlying feature details of micro-scale defects and reduce semantic conflicts when multi-scale feature fusion is performed.Second,an area sensitive SIOU(A-SIOU)loss function(Area sensitive SIOU,A-SIOU)is proposed to solve the problem that multi-scale defects cannot distinguish partial prediction boxes during training.Finally,combine M-ASFF,A-SIOU with the YOLOv5 s target detection model and name it YOLOv5s-Multiscale(YOLOv5s-M).Experimental results show that YOLOv5s-M achieves an average category accuracy of 93.5%.(3)In order to improve the detection performance of rail surface edge defects and multi-scale defects at the same time,a rail surface defect detection model based on YOLO is designed,and a rail surface defect detection system is realized by combining this model.First,integrate the YOLOv5s-E model with the YOLOv5s-M model and name it YOLOv5s-Edge and Multiscale(YOLOv5s-EM).Experimental results show that YOLOv5s-EM achieves an average category accuracy of 95.4% and a detection speed of 112.6FPS,outperforming existing rail surface defect detection methods.Secondly,using the Spring Boot framework and combining the YOLOv5s-EM detection model,a rail surface defect detection system is designed.This system realizes the automatic operation of rail image acquisition,image processing,and defect detection,and can meet the needs of railway bureaus for non-destructive inspection of rail information.Finally,the practical application value of the system is comprehensively considered through benefit analysis. |