With the continuous construction of high-speed railways,the main form of transportation in my country is railway transportation.However,the long-term high-load operation of railways will cause defects such as cracks,which may even affect the operation of railway transportation.Currently,the detection of railway tracks is still in the stage of manual inspection,with low efficiency,false detection and high false detection rate,which cannot meet the current needs.Therefore,there is an urgent need for a method with strong reliability and high accuracy to detect the surface cracks of rails.Aiming at the problem of rail surface crack detection,this paper analyzes the shortcomings of target detection algorithms in rail crack identification,improves the original YOLOv4 algorithm,and finally completes the research on the target detection algorithm for rail cracks,and to achieve high-precision identification of rail surface cracks in complex scenes.The main research contents of this paper are as follows:Firstly,the target detection algorithm and related theoretical basis based on deep learning are deeply studied,and the single-stage and multi-stage target detection algorithms are compared and analyzed.The effect is not ideal in complex scenes.Then,three data sets of different severity are produced by the method of "online collection+data enhancement",and the SSD algorithm and YOLOv4 algorithm that take into account the detection accuracy and speed are selected for experimental verification on this data set.The experimental results show that for the detection of large cracks,the average detection accuracy of the SSD algorithm is 42.89%,and that of the YOLOv4 algorithm is 52.92%;for the detection of medium cracks,the average detection accuracy of the two algorithms is 34.30%and 46.31%respectively;detection,the average detection accuracy is 48.45%and 66.30%,respectively.In addition,the detection speed of the SSD algorithm is 36fps,and the detection speed of the YOLOv4 algorithm reaches 38fps.Therefore,the accuracy and speed of YOLOv4 are better than SSD,but both algorithms have lower detection accuracy for cracks.Finally,for the problem of low crack detection accuracy,the YOLOv4 algorithm is improved.First,the accumulation operation is added to the feature fusion module,and the shallow feature map and downsampling are added to increase the depth of the detection layer,and the feature map of the lower layer is directly extracted.More small target information,so as to obtain more comprehensive information;secondly,based on the idea of Focal Loss,a YOLOv4+FL rail crack detection method is proposed to solve the problems of unbalanced positive and negative samples and difficulty in mining difficult samples,and further improve the accuracy of target detection.Finally,the channel attention mechanism CAM is added before the spatial attention mechanism SAM to capture the information of local and global features to optimize the algorithm accuracy.The performance of the improved YOLOv4 algorithm was verified on the rail surface crack data set.Compared with the original YOLOv4 algorithm,the improved algorithm maintained the same speed and the mAP was increased by 7.01%compared with the previous one. |