Steel rail damage intelligent identification method and system based on YOLOv5
Through the YOLOv5 intelligent identification method, the clutter filtering and data enhancement of the rail damage B image is optimized, and the identification model is solved, which is the problem of low rail damage detection accuracy in complex rail track scenarios, achieving efficient and accurate damage recognition.
Patent Information
- Application Number
- CN202411108673.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-08-13
AI Technical Summary
In the complex scenarios of rail tracks, traditional ultrasonic flaw detection equipment has problems such as high false alarm rate, high false alarm rate and manual analysis dependence, and is disturbed by clutter, resulting in low rail damage detection accuracy.
The intelligent identification method of rail damage based on YOLOv5 is adopted, and the detection accuracy is improved by performing clutter filtering, partitioning damage and non-damage waveforms, data enhancement, model training and result filtering on the rail damage B display image.
It effectively reduces the cost and time consumption of manual analysis, reduces false detection and missed inspection, improves the accuracy and accuracy of rail damage detection, and reduces subjective errors.
Smart Images

Figure CN119107490A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of railway track flaw detection, and in particular to intelligent identification of rail damage based on YOLOv5. Background Art
[0002] Rails are used as a transportation carrier for railways, and their damage is one of the important factors affecting the safety of trains. At present, most of the equipment used for rail flaw detection at home and abroad is based on the traditional piezoelectric ultrasonic principle. According to the detection speed, size, cost and other factors, rail flaw detection equipment can be divided into the following types: hand-pushed rail flaw detectors, double-track flaw detectors, road-rail dual-purpose vehicles and large rail flaw detection vehicles. These ultrasonic flaw detection equipment uses ultrasonic waves to detect internal damage to rails, and judges the location and type of damage by replaying and analyzing the ultrasonic B-display image of the rails. However, the detection data analysis software currently used in flaw detection vehicles has the problems of high false alarm rate and missed alarm. Accurate identification of rail damage still depends on manual analysis of the playback data of the B-display image. The damage detection rate of manual analysis is greatly related to the experience level of the analyst and has certain subjective errors. In addition, when counting the damage of rails within a long mileage, the playback personnel need to watch the playback software for a long time, which is easy to get tired, causing negligence and leading to misjudgment or missed judgment.
[0003] In recent years, the rapid development of deep learning technology has brought new opportunities to the fields of image processing and computer vision. Among them, the YOLOv5 detection algorithm based on deep convolutional neural networks has shown the characteristics of high efficiency and accuracy. The algorithm relies on a large amount of image data annotation and uses deep convolution operators to learn the color, position, shape and other features of each target in the image, thereby automatically calculating the category and position information of the object in the image, and realizing the classification and positioning functions of the object. Using the YOLOv5 detection algorithm to identify damage information in the ultrasonic B-display image of the rail will greatly reduce the labor cost and time consumption brought by manual analysis of ultrasonic data. At the same time, using the YOLOv5 detection algorithm to assist manual analysis can reduce the misdetection and missed detection of some damage, reduce subjective errors, and improve the recognition accuracy of damage. For example, the paper "Rail Surface Defect Detection Based on Improved YOLOv5" (Du Shaocong et al., Southwest Jiaotong University, Journal of Beijing Jiaotong University, April 2023) aims to improve the detection efficiency and anti-interference ability of rail surface defects by embedding a multi-head self-attention layer into the end of the YOLOv5 backbone network and introducing global dependencies for defect features to improve the model's detection effect on dense defects. However, due to the influence of complex rail track scenes, the following problems are often encountered when using the YOLOv5 detection algorithm to detect rail damage:
[0004] (1) Due to the influence of rust on the rail surface and leftover debris, a large number of complex clutter often appear in the B-display of the rail. Some clutter will interfere with the characteristics of the damage waveform and easily cause false detection;
[0005] (2) One type of damage may present various shapes of ultrasonic waveforms, which may easily lead to missed detection;
[0006] (3) The waveforms of non-damaged objects on the track are similar to those of damaged objects, such as thermite welding, factory welding, and wire holes. These are not damage, but they sometimes have the same waveform as damage, which can lead to false detection of damage.
[0007] The existence of the above problems will greatly reduce the accuracy of rail damage detection. Summary of the invention
[0008] The technical problem to be solved by the present invention is how to improve the accuracy of rail damage detection in complex rail track scenarios.
[0009] The present invention solves the above technical problems through the following technical solutions: a rail damage intelligent identification method based on YOLOv5, comprising the following steps:
[0010] Step 1: filtering the clutter in the rail damage B-display image to obtain a rail damage B-display image with clutter removed;
[0011] Step 2: The rail damage B-display image after clutter removal is divided into damaged waveforms and non-damaged waveforms, and data enhancement is performed on the damaged waveforms and non-damaged waveforms respectively to construct a data set for the rail damage recognition model;
[0012] Step 3: Use the data set to train the rail damage recognition model to obtain an optimized rail damage recognition model, input the rail damage B-display image with clutter removed into the optimized rail damage recognition model for recognition, and output the rail damage recognition result;
[0013] Step 4: Filter the rail damage identification results, and display the filtered rail damage identification results in the rail damage B-display image.
[0014] The present invention filters the clutter in the rail damage B-display image, and can first filter out the clutter with smaller waveforms caused by rust on the rail surface, lost debris, etc. The rail damage B-display image with the clutter removed is used for the construction and training of the rail damage recognition model data set, and can avoid the interference of clutter on the rail damage recognition model. The rail damage B-display image without the clutter removed is used for the visualization of damage information in the original clutter scene, and can show the damage results of the B-display image in the real rail scene to the detection personnel, so that the detection personnel can confirm the damage according to the real rail scene and avoid the missed detection and false detection of individual damage.
[0015] The same type of damage will show multiple waveforms, and some non-damage waveforms and damage waveforms have similar characteristics, which may easily lead to missed detection. By dividing the B-display image of rail damage after removing clutter into damaged waveforms and non-damage waveforms, the integrity of the non-damage waveform is ensured, so that the present invention can identify the damage category while also identifying the non-damage waveform, thereby eliminating the situation where part of the non-damage waveform structure is mistakenly identified as damage, thereby solving the problem that one type of damage presents ultrasonic waveforms in multiple shapes, which may easily lead to missed detection. In addition, by filtering the detection results of YOLOv5, the interference of clutter and irregular waveforms can be further eliminated, and the accuracy of rail damage detection in complex rail track scenes can be improved.
[0016] Preferably, in step one, an 8-neighborhood noise reduction method is used to filter clutter in the rail damage B-display image, including: traversing all non-background pixels in the rail damage B-display image, counting the number of non-background pixels in the 8 adjacent pixels around each non-background pixel, and if the number is less than a set threshold, the non-background pixel is considered to be clutter and filtered.
[0017] Preferably, the damage waveforms in step 2 include 6 types of rail head core damage waveforms, 3 types of rail waist damage waveforms, 2 types of hole crack damage waveforms, 2 types of horizontal crack damage waveforms, 2 types of weld damage waveforms, and 1 rail bottom damage waveform; the non-damage waveforms include 3 types of factory welding non-damage waveforms, 1 type of thermite welding non-damage waveform, 2 types of screw hole non-damage waveforms, and 2 types of double-wire guide hole non-damage waveforms.
[0018] The present invention statistically summarizes the waveform features that are easy to misidentify special damages, and designs filtering conditions using information such as the color type and color sequence of the damaged waveform in the B-display image to further filter the detection results of YOLOv5 to further eliminate the interference of clutter and irregular waveforms.
[0019] Preferably, in the step 2, the damaged waveform and the non-damaged waveform are data enhanced respectively by a cut-and-paste method, including: cutting out the damaged waveform and the non-damaged waveform from the rail damage B-display image with clutter removed, randomly selecting 1-3 targets from the damaged waveform and the non-damaged waveform respectively, randomly shrinking and enlarging the targets selected from the damaged waveform and the targets selected from the non-damaged waveform respectively, randomly pasting the shrunken and enlarged damaged waveform in the wave-out region corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform in the wave-out region corresponding to the non-damaged waveform.
[0020] Preferably, the rail damage recognition model in step three includes a backbone network, a neck network and a head network connected in sequence, and the head network includes a four-layer detection head. The sizes of the output feature maps of the four-layer detection head are 20×20, 40×40, 80×80, and 160×160, respectively, corresponding to the detection tasks of the rail damage recognition model for large, medium, small, and smaller-scale targets, respectively.
[0021] The present invention adds a new branch from the trunk network to the neck network of YOLOv5, which can enhance the detection capability of YOLOv5 for small targets.
[0022] Preferably, the filtering of the rail damage identification result in the fourth step is to judge the color type and color sequence in the rectangular area of the rail damage identification result, including: for the "eight" waveform with red in front and green in the rail head core damage waveform and the "eight" waveform with red in front and yellow in the rail bottom damage waveform, first convert the corresponding waveform rectangular area into a grayscale image, and then judge the color type and color sequence according to the grayscale value of each color, and filter out the "eight" waveform with green in front and red in the back and the "eight" waveform with yellow in front and red in the back; for the weld damage waveform, convert the corresponding waveform rectangular area into a grayscale image, and then treat each row of grayscale values in the area as an array, read the subscript values of the first and last occurrences of the same color grayscale value in the array, and calculate the difference between the two subscript values. If the difference is less than the set threshold, filter the waveform.
[0023] The present invention further sets filtering conditions for three types of damage that are easily misdetected by YOLOv5, namely rail head core damage, rail bottom damage, and weld damage. The color type and color order of the damage waveform in the B-display image are used to filter out the results that do not meet the damage conditions, retain the results that meet the damage conditions, and further filter out the clutter and non-damaged waveforms of larger waveforms to avoid misdetection of damaged waveforms and improve the detection accuracy of rail damage.
[0024] The present invention also provides a rail damage intelligent identification system based on YOLOv5, comprising:
[0025] A clutter filtering module is used to filter the clutter in the rail damage B-display image to obtain a rail damage B-display image with clutter removed;
[0026] A data set construction module is used to divide the rail damage B-display image after removing clutter into damaged waveforms and non-damaged waveforms, perform data enhancement on the damaged waveforms and non-damaged waveforms respectively, and construct a data set for the rail damage recognition model;
[0027] The training module is used to train the rail damage recognition model with the data set to obtain the optimized rail damage recognition model, input the rail damage B-display image with clutter removed into the optimized rail damage recognition model for recognition, and output the rail damage recognition result;
[0028] The secondary filtering module is used to filter the rail damage identification results and display the filtered rail damage identification results in the rail damage B-display image.
[0029] Preferably, the clutter filtering module uses an 8-neighborhood noise reduction method to filter clutter in the rail damage B-display image, including: traversing all non-background pixels in the rail damage B-display image, counting the number of non-background pixels in the 8 adjacent pixels around each non-background pixel, and if the number is less than a set threshold, the non-background pixel is considered to be clutter and filtered.
[0030] Preferably, the damage waveforms in the data set construction module include 6 types of rail head core damage waveforms, 3 types of rail waist damage waveforms, 2 types of hole crack damage waveforms, 2 types of horizontal crack damage waveforms, 2 types of weld damage waveforms, and 1 rail bottom damage waveform; the non-damage waveforms include 3 types of factory welding non-damage waveforms, 1 type of thermite welding non-damage waveform, 2 types of screw hole non-damage waveforms, and 2 types of double-line guide hole non-damage waveforms.
[0031] Preferably, the data set construction module adopts a cut-and-paste method to perform data enhancement on the damaged waveform and the non-damaged waveform respectively, including: cutting out the damaged waveform and the non-damaged waveform from the clutter-removed rail damage B-display image, randomly selecting 1-3 targets from the damaged waveform and the non-damaged waveform respectively, randomly shrinking and enlarging the targets selected from the damaged waveform and the targets selected from the non-damaged waveform respectively, randomly pasting the shrunken and enlarged damaged waveform in the wave-out region corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform in the wave-out region corresponding to the non-damaged waveform. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A flowchart of a rail damage intelligent identification method based on YOLOv5 provided in Example 1 of the present invention;
[0033] Figure 2 A flowchart of a data set for constructing a rail damage recognition model in a rail damage intelligent recognition method based on YOLOv5 provided in Example 1 of the present invention;
[0034] Figure 3 A diagram showing interference of non-damaged waveforms on damaged waveform identification in the rail damage intelligent identification method based on YOLOv5 provided in Example 1 of the present invention;
[0035] Figure 4A YOLOv5 algorithm framework diagram in which a small target detection layer is added to the YOLOv5-based rail damage intelligent identification method provided in Example 1 of the present invention;
[0036] Figure 5 This is a diagram showing a situation in which clutter easily causes misidentification of damage in the YOLOv5-based intelligent rail damage identification method provided in Example 1 of the present invention;
[0037] Figure 6 A visualization diagram of some damage identification results in the rail damage intelligent identification method based on YOLOv5 provided in Example 1 of the present invention;
[0038] Figure 7 A schematic diagram of a rail damage intelligent identification system based on YOLOv5 provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in combination with specific embodiments and with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Example 1
[0041] like Figure 1 As shown, this embodiment provides a rail damage intelligent identification method based on YOLOv5, comprising the following steps:
[0042] Step 1: Filter the clutter in the rail damage B-display image to obtain a rail damage B-display image with clutter removed.
[0043] The B-display image is a display method of the results of ultrasonic flaw detection of rails, and can display the longitudinal section of the detected rail and the approximate size and relative position of the ultrasonic reflector in the rail, wherein the horizontal axis represents the mileage position of the damage, and the vertical axis represents the depth of the damage. In this embodiment, the method for obtaining the B-display data of rail damage can use an ultrasonic double-track flaw detection vehicle to collect the rail damage data, and display the rail damage data through a B-display image.
[0044] In actual work, due to the influence of rust on the rail surface, lost debris and the like, a large amount of complex clutter often appears in the collected rail damage B-display image. The presence of clutter will interfere with the characteristics of the damage waveform and easily cause misdetection of the rail damage waveform. In this regard, the present invention filters the clutter in the rail damage B-display image. Considering that the damage waveform in the rail damage B-display image is usually in the shape of one or several larger wave dots, and clutter is usually manifested as smaller wave dots, the present invention filters the clutter according to the size of the wave dots to eliminate the interference of the clutter. It should be noted that, after filtering the clutter in the rail damage B-display image, this step can obtain a rail damage B-display image with clutter removed, and retain the original rail damage B-display image, that is, the rail damage B-display image without clutter removed, so that the original rail damage B-display image can be divided into a rail damage B-display image with clutter removed and a rail damage B-display image without clutter removed, wherein the rail damage B-display image with clutter removed is used for the construction and training of the rail damage recognition model data set, which can avoid the interference of clutter on the rail damage recognition model, and the rail damage B-display image without clutter removed is used for the visualization of damage information in the original clutter scene, which can show the damage results of the B-display image in the real rail scene to the inspection personnel, so as to facilitate the inspection personnel to confirm the damage based on the real rail scene and avoid missed detection and false detection of individual damage.
[0045] The size of the wave spot is represented by the number of pixels in the B-display image. The present invention adopts an 8-neighborhood noise reduction method to filter the clutter in the rail damage B-display image, including: traversing all non-background pixel points in the rail damage B-display image, counting the number of non-background pixel points in the 8 adjacent pixel points around each non-background pixel point, if the number is less than a set threshold, the non-background pixel point is considered to be clutter and filtered. In this embodiment, the threshold can be set to 3.
[0046] Step 2: Divide the rail damage B-display image after removing clutter into damaged waveform and non-damaged waveform, perform data enhancement on the damaged waveform and non-damaged waveform respectively, and construct a data set for the rail damage recognition model.
[0047] Since the same type of damage can show a variety of waveforms, and some non-damage waveforms and damage waveforms have similar characteristics, such as Figure 3As shown, the "eight" waveform in the rail head core damage is consistent with the partial structure of the non-damaged factory welding waveform; the rail bottom damage waveform is similar to the partial structure of the non-damaged single screw hole waveform; another rail head core damage is similar to the lower half structure of the non-damaged thermite welding waveform. In this regard, the present invention classifies 24 waveforms in detail based on damage identification experience, among which the damaged waveforms include 6 rail head core damage waveforms, 3 rail waist damage waveforms, 2 hole crack damage waveforms, 2 horizontal crack damage waveforms, 2 weld damage waveforms, and 1 rail bottom damage waveform. The non-damaged waveforms include 3 factory welding non-damaged waveforms, 1 thermite welding non-damaged waveform, 2 screw hole non-damaged waveforms, and 2 double-wire guide hole non-damaged waveforms. By dividing the damaged waveform and the non-damaged waveform, the integrity of the non-damaged waveform is guaranteed, so that the present invention can identify the damage category while also identifying the non-damaged waveform, thereby eliminating the situation where the partial structure of the non-damaged waveform is mistakenly identified as damaged.
[0048] In order to increase the waveform samples in the B-display image, the present invention adopts a cut-and-paste method to perform data enhancement on the damaged waveform and the non-damaged waveform respectively, including: cutting out the damaged waveform and the non-damaged waveform from the B-display image of the rail damage after removing the clutter, randomly selecting 1-3 targets from the damaged waveform and the non-damaged waveform respectively, randomly reducing and enlarging the targets selected from the damaged waveform and the targets selected from the non-damaged waveform respectively, and the scaling ratio range can be set to 0.9-1.1, and the reduced and enlarged damaged waveform is randomly pasted in the wave-out area corresponding to the damaged waveform, and the reduced and enlarged non-damaged waveform is randomly pasted in the wave-out area corresponding to the non-damaged waveform, and it is required that the pasted waveform target cannot overlap with the waveform target in the original image, and the pasting position cannot exceed the wave-out area.
[0049] like Figure 2 As shown in the figure, the data sets for building the rail damage identification model include:
[0050] According to the divided waveform types, the image is annotated using the preset image annotation tool. In this embodiment, only the B-display image from which clutter has been removed is used to complete the image annotation work. The image annotation tool can use LabelImg to annotate images for target detection tasks. In LabelImg, labels are created according to the 24 waveform categories divided, and the image annotation is completed. The annotation information needs to be converted into the txt file format required for model training. Each image requires a corresponding txt file, which contains the category and bounding box coordinates of the target.
[0051] According to the preset division ratio, the B-display image from which clutter has been removed and its corresponding target category and bounding box coordinates are divided into a training set and a validation set. In this embodiment, the division ratio of the training set and the validation set can be set to 8:2.
[0052] Step 3: Use the data set to train the rail damage recognition model to obtain an optimized rail damage recognition model, input the rail damage B-display image with clutter removed into the optimized rail damage recognition model for recognition, and output the rail damage recognition result.
[0053] like Figure 4 As shown, the rail damage recognition model in the step three includes a backbone network, a neck network and a head network connected in sequence, the backbone network includes a CBS module, a CSP module, and an SPPF module, the neck network includes a CBS module, a CSP module, an Upsample module, and a Concat module, the CBS module includes a convolution layer, a batch normalization, and a SiLU activation function, the CBS module is used to reduce the resolution of the image and learn image features, the CBS module of the neck network is used to learn image features, the CSP module includes a convolution layer, a batch normalization, a SiLU activation function, and a residual component, the CSP module is used to ensure the light weight of the model while deepening the model's learning depth of image features, the SPPF module is composed of continuously connected pooling modules, and is used to enhance the model's learning ability for multi-scale targets, the Concat module is used to splice feature maps and fuse multi-scale features of images, and the Upsample module is used to upsample feature maps and restore image resolution. The head network consists of four layers of detection heads. The sizes of the output feature maps of the four layers of detection heads are 20×20, 40×40, 80×80, and 160×160, respectively, corresponding to the detection tasks of the rail damage recognition model for large, medium, small, and smaller-scale targets.
[0054] Since the waveforms presented by some damaged targets such as rail head damage, rail bottom damage and hole cracks are relatively small, the present invention adds a new branch from the trunk network to the neck network of YOLOv5 to output a feature map with a size of 160×160, which can detect smaller targets and enhance the detection capability of YOLOv5 for small targets.
[0055] Step 4: Filter the rail damage identification results, and display the filtered rail damage identification results in the rail damage B-display image.
[0056] In actual detection work, although the present invention has filtered out the clutter in the rail damage B-display image in step 1, the clutter filtered out is small clutter, and for interference waves with larger waveforms, such as Figure 5As shown in the figure, among the six types of rail head core damage waveforms, one waveform presents a red and green "eight" waveform, with red in front and green in the back, and the rail bottom damage waveform presents a red and yellow "eight" waveform, with red in front and yellow in the back. There are interference waves similar to the above waveforms in the B-display image. These interference waves are usually caused by factors such as rust and debris on the rails. Due to the large waveform, it is difficult to filter in step one, which is very easy to cause false detection of the "eight"-shaped rail head core damage waveform with red in front and green in the back and the "eight"-shaped rail bottom damage waveform with red in front and yellow in the back. It can also be seen from the figure that the weld damage waveform is similar to the non-damaged thermite welding waveform, but it is observed that there are still certain differences between the interference wave and the damage waveform in the figure, which is specifically manifested in the different color types and color sequences. In this regard, the present invention further sets filtering conditions for the three types of damage that are easily misdetected, namely rail head core damage, rail bottom damage, and weld damage. The color type and color sequence of the damage waveform in the B-display image are used to filter out the results that do not meet the damage conditions, and retain the results that meet the damage conditions. Clutter and irregular waveforms are further filtered to avoid misdetection of damage waveforms and improve the detection accuracy of rail damage.
[0057] Specifically, in step 4, the rail damage recognition result is filtered to determine the color type and color sequence in the rectangular area of the rail damage recognition result, including: for the "eight" waveform with red in front and green in the rail head core damage waveform and the "eight" waveform with red in front and yellow in the rail bottom damage waveform, first convert the corresponding waveform rectangular area into a grayscale image to form a two-dimensional grayscale value array, take the maximum value operation in the column direction of the grayscale value array, and obtain a one-dimensional maximum value array in the column direction, and search for the first grayscale value area (70-80) and the first grayscale value area (145-155) in the one-dimensional maximum value array respectively according to the red grayscale value area (70-80) and the green grayscale value area (145-155). The subscript values of the red and green grayscale values appear at the same time. By comparing the size of the subscript values and querying the grayscale values of the corresponding colors, the types of colors and the order of the colors that constitute the damage waveform can be determined, and the "eight" waveform with green in front and red in the back and the "eight" waveform with yellow in front and red in the back are filtered out; for the weld damage waveform, the corresponding waveform rectangular area is converted into a grayscale image to obtain the grayscale value, and each row of grayscale values in the area is regarded as an array, and the subscript values of the first and last appearances of the same color grayscale value in the array are read, and the difference between the two subscript values is calculated. If the difference is less than the set threshold, the waveform is filtered. In this embodiment, the threshold can be set to 6.
[0058] like Figure 6As shown, the present invention displays the detected damage on the original B-display image without removing clutter, and counts the categories and quantities of all damage detected within a certain mileage to form a visual summary report. In the statistics and visualization of damage results, the present invention only counts the categories of 16 types of damage waveforms, and displays and counts these 16 waveforms in the six categories of rail head core damage, rail waist damage, hole crack, horizontal crack, weld damage and rail bottom in sequence according to the digital sequence of 1-6, so as to facilitate the detection personnel to confirm the damage.
[0059] The present invention records the damage detection results by generating a json text file. The json file records the name of the B-display image, the damage category, the total number of damages in the image and the location of the damage in the image, so that the detection personnel can view the image and location information corresponding to the damage, and count the number of various damages within a mileage by reading the json file.
[0060] The present invention is based on the YOLOv5 detection algorithm and realizes intelligent extraction of suspected damage by analyzing the B-display image of rail damage, so that the inspectors do not need to watch the computer screen for a long time, but only need to make a secondary confirmation of the system analysis results, which greatly reduces the workload of the inspectors. In addition, compared with the traditional manual analysis mode, the present invention has a stronger ability to identify damage, and with manual assistance, it can greatly reduce the false detection and missed detection of rail damage.
[0061] Example 2
[0062] like Figure 7 As shown, this embodiment provides a rail damage intelligent identification system based on YOLOv5, including:
[0063] The clutter filtering module is used to filter the clutter in the rail damage B-display image to obtain the rail damage B-display image with the clutter removed.
[0064] The clutter filtering module uses an 8-neighborhood noise reduction method to filter clutter in the rail damage B-display image, including: traversing all non-background pixels in the rail damage B-display image, counting the number of non-background pixels in the 8 adjacent pixels around each non-background pixel, and if the number is less than a set threshold, the non-background pixel is considered to be clutter and filtered.
[0065] The data set construction module is used to divide the rail damage B-display image after removing clutter into damaged waveforms and non-damaged waveforms, perform data enhancement on the damaged waveforms and non-damaged waveforms respectively, and construct a data set for the rail damage recognition model.
[0066] The damage waveforms in the data set construction module include 6 types of rail head core damage waveforms, 3 types of rail waist damage waveforms, 2 types of hole crack damage waveforms, 2 types of horizontal crack damage waveforms, 2 types of weld damage waveforms, and 1 rail bottom damage waveform. The non-damage waveforms include 3 types of factory welding non-damage waveforms, 1 type of thermite welding non-damage waveform, 2 types of screw hole non-damage waveforms, and 2 types of double-line guide hole non-damage waveforms.
[0067] The data set construction module adopts a cut-and-paste method to perform data enhancement on the damaged waveform and the non-damaged waveform respectively, including: cutting out the damaged waveform and the non-damaged waveform from the rail damage B-display image with clutter removed, randomly selecting 1-3 targets from the damaged waveform and the non-damaged waveform respectively, randomly shrinking and enlarging the targets selected from the damaged waveform and the targets selected from the non-damaged waveform respectively, randomly pasting the shrunken and enlarged damaged waveform in the wave-out region corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform in the wave-out region corresponding to the non-damaged waveform.
[0068] The training module is used to train the rail damage recognition model with the data set to obtain the optimized rail damage recognition model, input the rail damage B-display image with clutter removed into the optimized rail damage recognition model for recognition, and output the rail damage recognition result.
[0069] The rail damage recognition model in step three includes a backbone network, a neck network and a head network connected in sequence, and the head network includes a four-layer detection head. The sizes of the output feature maps of the four-layer detection head are 20×20, 40×40, 80×80, and 160×160, respectively, corresponding to the detection tasks of the rail damage recognition model for large, medium, small, and smaller targets of different scales.
[0070] Taking into account that the waveforms presented by some damage targets such as rail head core damage waveform, rail bottom damage waveform, hole crack damage waveform are relatively small, the present invention adds a new branch from the backbone network at the output end of YOLOv5 to detect damage with smaller waveforms. Combined with the original three branches, the fusion of multi-scale information of the model is realized, and the recognition ability of the rail damage recognition model for small targets is enhanced.
[0071] The secondary filtering module is used to filter the rail damage identification results and display the filtered rail damage identification results in the rail damage B-display image.
[0072] The filtering of the rail damage identification result in the secondary filtering module is to judge the color type and color sequence in the rectangular area of the rail damage identification result, including: for the "eight" waveform with red in front and green in the rail head core damage waveform and the "eight" waveform with red in front and yellow in the rail bottom damage waveform, first convert the corresponding waveform rectangular area into a grayscale image, then judge the color type and color sequence according to the grayscale value of each color, and filter out the "eight" waveform with green in front and red in the back and the "eight" waveform with yellow in front and red in the back; for the weld damage waveform, convert the corresponding waveform rectangular area into a grayscale image, then treat each row of grayscale values in the area as an array, read the subscript values of the first and last occurrences of the same color grayscale value in the array, and calculate the difference between the two subscript values. If the difference is less than the set threshold, filter the waveform.
[0073] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A rail damage intelligent identification method based on YOLOv5, characterized by: The following steps are involved: Step 1: filtering the clutter in the rail damage B-display image to obtain a rail damage B-display image with clutter removed; Step 2: The rail damage B-display image after clutter removal is divided into damaged waveforms and non-damaged waveforms, and data enhancement is performed on the damaged waveforms and non-damaged waveforms respectively to construct a data set for the rail damage recognition model; Step 3: Use the data set to train the rail damage recognition model to obtain an optimized rail damage recognition model, input the rail damage B-display image with clutter removed into the optimized rail damage recognition model for recognition, and output the rail damage recognition result; Step 4: Filter the rail damage identification results, and display the filtered rail damage identification results in the rail damage B-display image.
2. The rail damage intelligent identification method based on YOLOv5 according to claim 1 is characterized in that: In the step 1, the 8-neighborhood noise reduction method is used to filter the clutter in the rail damage B-display image, including: traversing all non-background pixels in the rail damage B-display image, counting the number of non-background pixels in the 8 adjacent pixels around each non-background pixel, and if the number is less than a set threshold, the non-background pixel is considered to be clutter and filtered.
3. The rail damage intelligent identification method based on YOLOv5 according to claim 1 is characterized in that: The damage waveforms in step 2 include 6 types of rail head core damage waveforms, 3 types of rail waist damage waveforms, 2 types of hole crack damage waveforms, 2 types of horizontal crack damage waveforms, 2 types of weld damage waveforms, and 1 rail bottom damage waveform. The non-damage waveforms include 3 types of factory welding non-damage waveforms, 1 type of thermite welding non-damage waveform, 2 types of screw hole non-damage waveforms, and 2 types of double-line guide hole non-damage waveforms.
4. The rail damage intelligent identification method based on YOLOv5 according to claim 1 is characterized in that: In the step 2, the damaged waveform and the non-damaged waveform are respectively enhanced by cutting and pasting, including: cutting out the damaged waveform and the non-damaged waveform from the rail damage B-display image after removing clutter, randomly selecting 1-3 targets from the damaged waveform and the non-damaged waveform, respectively, randomly shrinking and enlarging the targets selected from the damaged waveform and the targets selected from the non-damaged waveform, randomly pasting the shrunken and enlarged damaged waveform in the wave-out region corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform in the wave-out region corresponding to the non-damaged waveform.
5. The rail damage intelligent identification method based on YOLOv5 according to claim 1 is characterized in that: The rail damage recognition model in step three includes a backbone network, a neck network and a head network connected in sequence, and the head network includes a four-layer detection head. The sizes of the output feature maps of the four-layer detection head are 20×20, 40×40, 80×80, and 160×160, respectively, corresponding to the detection tasks of the rail damage recognition model for large, medium, small, and smaller-scale targets, respectively.
6. The rail damage intelligent identification method based on YOLOv5 according to claim 1 is characterized in that: The filtering of the rail damage identification result in the step 4 is to judge the color type and color sequence in the rectangular area of the rail damage identification result, including: for the "eight" waveform with red in front and green in the rail head core damage waveform and the "eight" waveform with red in front and yellow in the rail bottom damage waveform, first convert the corresponding waveform rectangular area into a grayscale image, then judge the color type and color sequence according to the grayscale value of each color, and filter out the "eight" waveform with green in front and red in the back and the "eight" waveform with yellow in front and red in the back; for the weld damage waveform, convert the corresponding waveform rectangular area into a grayscale image, then treat each row of grayscale values in the area as an array, read the subscript values of the first and last occurrences of the same color grayscale value in the array, and calculate the difference between the two subscript values. If the difference is less than the set threshold, filter the waveform.
7. A rail damage intelligent identification system based on YOLOv5, characterized by: include: A clutter filtering module is used to filter the clutter in the rail damage B-display image to obtain a rail damage B-display image with clutter removed; A data set construction module is used to divide the rail damage B-display image after removing clutter into damaged waveforms and non-damaged waveforms, perform data enhancement on the damaged waveforms and non-damaged waveforms respectively, and construct a data set for the rail damage recognition model; The training module is used to train the rail damage recognition model with the data set to obtain the optimized rail damage recognition model, input the rail damage B-display image with clutter removed into the optimized rail damage recognition model for recognition, and output the rail damage recognition result; The secondary filtering module is used to filter the rail damage identification results and display the filtered rail damage identification results in the rail damage B-display image.
8. The rail damage intelligent identification system based on YOLOv5 according to claim 7 is characterized in that: The clutter filtering module uses an 8-neighborhood noise reduction method to filter clutter in the rail damage B-display image, including: traversing all non-background pixels in the rail damage B-display image, counting the number of non-background pixels in the 8 adjacent pixels around each non-background pixel, and if the number is less than a set threshold, the non-background pixel is considered to be clutter and filtered.
9. The rail damage intelligent identification system based on YOLOv5 according to claim 7, characterized in that: The damage waveforms in the data set construction module include 6 types of rail head core damage waveforms, 3 types of rail waist damage waveforms, 2 types of hole crack damage waveforms, 2 types of horizontal crack damage waveforms, 2 types of weld damage waveforms, and 1 rail bottom damage waveform. The non-damage waveforms include 3 types of factory welding non-damage waveforms, 1 type of thermite welding non-damage waveform, 2 types of screw hole non-damage waveforms, and 2 types of double-line guide hole non-damage waveforms.
10. The rail damage intelligent identification system based on YOLOv5 according to claim 7, characterized in that: The data set construction module adopts a cut-and-paste method to perform data enhancement on the damaged waveform and the non-damaged waveform respectively, including: cutting out the damaged waveform and the non-damaged waveform from the rail damage B-display image with clutter removed, randomly selecting 1-3 targets from the damaged waveform and the non-damaged waveform respectively, randomly shrinking and enlarging the targets selected from the damaged waveform and the targets selected from the non-damaged waveform respectively, randomly pasting the shrunken and enlarged damaged waveform in the wave-out region corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform in the wave-out region corresponding to the non-damaged waveform.
Citation Information
Patent Citations
Railhead nuclear damage identification method and system based on BP neural network
CN111855825A
Steel rail damage identification method and device
CN116626177A
Internal damage identification method based on steel rail B-display image machine learning
CN116805315A
Intelligent judgment method for damage degree and replacement requirement of aircraft brake disc pair
CN118115776A
Cited By
Steel rail damage judgment method and device based on large model
CN120369814A
Rail damage judgment method and device based on large model
CN120369814B
