| The rapid development of China’s rail transportation industry,the total length of the line is the highest in the world;at the same time,due to the long-term high-intensity service of the rail line,a variety of damage,disease increasing,resulting in a sharp increase in the repair and maintenance tasks of the rail components.As the core of the rail components,under the effect of long-term extrusion,the surface of the rail often produces light to moderate damage,which adversely affects the stable operation of trains and even endangers the safety of traffic.In order to make intelligent identification of rail surface defects and provide efficient maintenance means for rails,three parts are designed in this paper in terms of algorithms:First,a rail surface extraction algorithm based on improved Canny-LSD is designed.This paper first uses the improved Canny operator to extract the rail edge image,then input to the LSD algorithm to extract straight lines,and then cropped out the rail surface area,eliminating the interference of other rail surface components from the self-collected rail image,to improve the efficiency of the subsequent defect detection.Second,a rail surface image enhancement algorithm based on improved Retinex is designed.In order to highlight the rail surface defects and improve the accuracy of subsequent defect detection,the rail surface image is processed in HSV space after homomorphic filtering for brightness and saturation respectively;where the brightness component is processed by improved Retinex and CLAHE;the saturation component is adaptively adjusted according to the brightness component.It is experimentally verified that it can effectively improve the contrast of the track surface image and make its detail information enhanced.Thirdly,a rail surface defect detection algorithm based on the improved YOLOV7 is designed.Combining the characteristics of rail surface defects and detection requirements,this paper adds Swin Transformer block in the backbone network based on the YOLOV7framework;uses more efficient and fast Bi FPN for feature fusion in the neck structure;and adds NAM attention mechanism to increase the expression capability of image features.In order to obtain better training results,this paper uses K-Means++ clustering for anchor frame setting based on the improved network;uses EIOU loss function to increase the localization effect of anchor frame.After experimental comparison and verification,the target detection algorithm in this paper has high accuracy while being able to adapt to the demand of real-time detection of rail surface defects.On the basis of the above algorithm,combined with machine vision technology,the intelligent detection system for rail surface defects of rail trains is designed.Combined with the actual maintenance requirements,the hardware aspect mainly focuses on the image acquisition module selection design;the software aspect includes algorithm deployment and user interface design;the modules are experimentally verified to work well and have strong engineering practicality. |