A rail damage intelligent identification method and system based on YOLOv5

By filtering clutter and enhancing data on rail damage B-display images, combined with the YOLOv5 model and color filtering, the problems of false detection and missed detection in complex rail track scenarios are solved, and the precision and accuracy of rail damage detection are improved.

CN119107490BActive Publication Date: 2025-09-12NINGBO RAIL TRANSIT GRP CO LTD SMART OPERATION BRANCH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411108673.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2025-09-12
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

Existing technologies for rail damage detection in complex rail track scenarios have problems with false detection and missed detection, mainly due to interference from noise such as rust on the rail surface and fallen debris, as well as low detection accuracy caused by the multiple waveforms of the same damage and the similarity between the non-damaged waveform and the damaged waveform.

Method used

By filtering the clutter of the rail damage B-display image, dividing the damaged and non-damaged waveforms, building a data set and performing data enhancement, using the YOLOv5 model for training and recognition, and combining the color type and sequence for secondary filtering, the detection accuracy is improved.

Benefits of technology

It effectively removes clutter interference, reduces false detections and missed detections, improves the precision and accuracy of rail damage detection, and reduces reliance on manual analysis and subjective errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119107490B_ABST
    Figure CN119107490B_ABST
Patent Text Reader

Abstract

The present invention provides a YOLOv5-based intelligent rail damage identification method and system, which belong to the field of railway track flaw detection. The method and system include: filtering clutter in a rail damage B-display image to obtain a clutter-free rail damage B-display image; dividing the clutter-free rail damage B-display image into a damage waveform and a non-damage waveform, performing data enhancement on the damage waveform and the non-damage waveform respectively, and constructing a data set for a rail damage identification model; training the rail damage identification model with the data set to obtain an optimized rail damage identification model; inputting the clutter-free rail damage B-display image into the optimized rail damage identification model for identification, and outputting a rail damage identification result; filtering the rail damage identification result, and displaying the filtered rail damage identification result in the rail damage B-display image. The method can improve the accuracy of rail damage detection in complex rail track scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of railway track flaw detection, and particularly to intelligent identification of rail damage based on YOLOv5. Background Art

[0002] Rails, the primary means of transport on railways, are subject to significant damage, a factor that impacts train safety. Currently, most rail flaw detection equipment, both domestically and internationally, is based on the traditional piezoelectric ultrasonic principle. Based on factors such as detection speed, size, and cost, these devices can be categorized into the following types: hand-pushed rail flaw detectors, dual-track flaw detectors, road-rail vehicles, and large rail flaw detection vehicles. These ultrasonic flaw detection devices use ultrasound to detect internal rail flaws, determining the location and type of flaws by replaying and analyzing the ultrasonic B-ray images. However, the data analysis software currently used by flaw detection vehicles suffers from high false positive rates and missed detections. Accurate identification of rail flaws still relies on manual analysis of B-ray image playback data. The detection rate of manual analysis is highly dependent on the analyst's experience and is subject to subjective errors. Furthermore, when analyzing rail flaws over a long distance, the reviewer must spend extended periods watching the software, which can lead to fatigue and negligence, resulting in misjudgments or missed detections.

[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 a deep convolutional neural network, has demonstrated high efficiency and accuracy. This algorithm relies on extensive image data annotation and uses deep convolution operators to learn features such as the color, position, and shape of each target in the image. This algorithm automatically calculates the category and position of objects in the image, enabling object classification and location. Using the YOLOv5 detection algorithm to identify damage in ultrasonic B-display images of rails will significantly reduce the labor cost and time associated with manual analysis of ultrasonic data. Furthermore, using the YOLOv5 detection algorithm to assist manual analysis can reduce false and missed damage detections, reduce subjective errors, and improve damage identification accuracy. 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) addresses the issues of low rail surface defect detection efficiency and poor anti-interference ability by embedding a multi-head self-attention layer at the end of the YOLOv5 backbone network and introducing global dependencies for defect features to improve the model's detection of 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 left debris, a large number of complex clutters often appear in the rail B display image. Some clutters will interfere with the characteristics of the damage waveform and easily cause false detection.

[0005] (2) One type of damage may present various 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, wire holes, etc. They are not damage, but they sometimes have the same waveform as damage, which may 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 the clutter removed;

[0011] Step 2: The rail damage B-display image after clutter removal is divided into damage waveform and non-damage waveform, and data enhancement is performed on the damage waveform and non-damage waveform 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 clutter-free rail damage B-display image 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 clutter in rail damage B-display images, and can first filter out clutter with smaller waveforms caused by rust on the rail surface, lost debris, etc. The rail damage B-display images with clutter removed are used for constructing and training a rail damage recognition model data set, which can avoid interference of clutter on the rail damage recognition model. The rail damage B-display images without clutter removed are used for visual display of damage information in the original clutter scene, which can show inspectors the damage results of the B-display images in the real rail scene, making it easier for inspectors to confirm damage based on the real rail scene and avoiding missed detection and false detection of individual damage.

[0015] The same type of damage can manifest as multiple waveforms, and some non-damage waveforms and damage waveforms have similar characteristics, which can easily lead to missed detections. By dividing the rail damage B-display image after removing clutter into damage waveforms and non-damage waveforms, the integrity of the non-damage waveform is ensured. This allows the present invention to identify both the damage category and the non-damage waveform, thereby eliminating the situation where partial structures of the non-damage waveform are mistakenly identified as damage. This solves the problem of a single damage type presenting multiple ultrasonic waveform shapes, which can easily lead to missed detections. In addition, by filtering the detection results of YOLOv5, the interference of clutter and irregular waveforms can be further eliminated, improving the accuracy of rail damage detection in complex rail track scenarios.

[0016] Preferably, in step 1, an 8-neighborhood noise reduction method is used to filter out 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 damage 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, a cut-and-paste method is used 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 on the wave-out region corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform on 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 backbone network to the neck network of YOLOv5, which can enhance YOLOv5's detection ability 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, the waveform is filtered.

[0023] The present invention further sets filtering conditions for three types of damage that are easily misdetected by YOLOv5: 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 results that do not meet the damage conditions, retain results that meet the damage conditions, and further filter out larger waveforms of clutter and non-damage waveforms to avoid misdetection of damage 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] The noise filtering module is used to filter the noise in the rail damage B-display image to obtain the rail damage B-display image with the noise removed;

[0026] The dataset 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 the dataset of the rail damage recognition model;

[0027] The training module is used to train the rail damage recognition model using the data set to obtain an optimized rail damage recognition model. The clutter-free rail damage B-display image is input into the optimized rail damage recognition model for recognition, and the rail damage recognition result is output;

[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 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.

[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 on the wave-out area corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform on the wave-out area corresponding to the non-damaged waveform. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 Flowchart of the 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 the YOLOv5-based rail damage intelligent recognition method provided in Example 1 of the present invention;

[0034] Figure 3 This is a diagram showing the interference of non-damaged waveforms on damaged waveform identification in the YOLOv5-based rail damage intelligent identification method provided in Example 1 of the present invention;

[0035] Figure 4A YOLOv5 algorithm framework diagram showing an added small target detection layer in 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 YOLOv5-based rail damage intelligent identification method provided in Example 1 of the present invention;

[0038] Figure 7 This is a schematic diagram of a rail damage intelligent identification system based on YOLOv5 provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0039] To make the objectives, technical solutions, and advantages of the present invention more clearly understood, the following describes the technical solutions of the present invention clearly and completely with reference to specific embodiments and the accompanying drawings. It is obvious that the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort 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, including 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 the clutter removed.

[0043] A B-display image is a method for displaying the results of ultrasonic flaw detection of rails. It can show the longitudinal cross-section of the inspected rail and the approximate size and relative position of the ultrasonic reflectors in the rail. The horizontal axis represents the mileage location of the damage, and the vertical axis represents the depth of the damage. In this embodiment, the B-display data of rail damage can be obtained by using an ultrasonic dual-track flaw detection vehicle to collect rail damage data and displaying the rail damage data through a B-display image.

[0044] In actual work, due to the influence of rust on the rail surface, fallen debris, etc., a large amount of complex noise often appears in the collected rail damage B-display image. The presence of noise will interfere with the characteristics of the damage waveform and easily cause false detection of the rail damage waveform. To this end, the present invention filters the noise in the rail damage B-display image. Considering that the damage waveform in the rail damage B-display image is usually composed of one or several large wave points, while noise usually appears as smaller wave points, the present invention filters the noise according to the size of the wave points to eliminate the interference of the noise. 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 the clutter removed, and retain the original rail damage B-display image, that is, the rail damage B-display image without the clutter removed. As a result, the original rail damage B-display image can be divided into the rail damage B-display image with the clutter removed and the rail damage B-display image without the clutter removed. The rail damage B-display image with the clutter removed is used for the construction and training of the rail damage recognition model dataset, which 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, which can show the damage results of the B-display image in the real rail scene to the inspector, making it convenient for the inspector to confirm the damage based on the real rail scene and avoiding missed detection and false detection of individual damage.

[0045] The size of the wave point is represented by the number of pixels in the B-display image. The present invention uses an 8-neighborhood noise reduction method to filter out 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 out. 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 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.

[0047] Since the same 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 of 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, based on the experience of damage identification, the present invention has classified 24 waveforms in detail, among which the damage 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-line guide hole non-damaged waveforms. By dividing the damage waveforms into non-damaged waveforms, the integrity of the non-damaged waveforms 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 damage.

[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, randomly pasting the reduced and enlarged damaged waveform on the outgoing wave area corresponding to the damaged waveform, and randomly pasting the reduced and enlarged non-damaged waveform on the outgoing wave area corresponding to the non-damaged waveform. It is required that the pasted waveform targets cannot overlap with the waveform targets in the original image, and the pasting position cannot exceed the outgoing wave area.

[0049] like Figure 2 As shown in Figure 2, the data sets for building the rail damage identification model include:

[0050] The image is annotated using a pre-set image annotation tool according to the waveform classification. In this embodiment, only the clutter-free B-display image is used to complete the image annotation. The image annotation tool can use LabelImg to annotate images for target detection tasks. In LabelImg, labels are created based on the 24 waveform classifications. After completing the image annotation, the annotation information needs to be converted into the txt file format required for model training. Each image requires a corresponding txt file containing the target category and bounding box coordinates.

[0051] According to a preset division ratio, the clutter-free B-display image 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 to 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 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, 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, batch normalization, a SiLU activation function and a residual component. The CSP module is used to ensure the lightweight of the model while deepening the learning depth of the model for image features. The SPPF module consists of continuously connected pooling modules to enhance the model's learning ability for multi-scale targets. The Concat module is used to splice the feature maps and fuse the multi-scale features of the image. The Upsample module is used to upsample the feature maps and restore the resolution of the image. 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] Because some damaged targets such as rail head scratches, rail bottom scratches, and hole cracks have relatively small waveforms, the present invention adds a new branch from the backbone network to the neck network of YOLOv5 to output a feature map with a size of 160×160. This can detect smaller targets and enhance YOLOv5's detection capability 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 rail head core damage waveforms, one waveform presents a red and green "eight" waveform, with red in front and green in the back. The rail base damage waveform presents a red and yellow "eight" waveform, with red in front and yellow in the back. Interference waves similar to the above waveforms exist 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 waveforms, they are difficult to filter in step 1, which can easily lead to 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 base 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 relatively 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 are 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. The noise and irregular waveforms are further filtered to avoid misdetection of the damage waveform and improve the detection accuracy of rail damage.

[0057] Specifically, in step 4, the rail damage recognition result is filtered to judge 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. According to the red grayscale value area (70-80) and the green grayscale value area (145-155), respectively search for the first two values ​​in the one-dimensional maximum value array. 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. Each row of grayscale values ​​in the area is regarded as an array, and the subscript values ​​of the first and last occurrences 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 detected damage on the original, uncluttered B-display image and compiles statistics on the categories and quantities of all damage detected within a certain distance, creating a visual summary report. In the damage statistics and visualization, the present invention only counts 16 types of damage waveforms. These 16 waveforms are then displayed and counted numerically from 1 to 6 according to the six categories of rail head core damage, rail waist damage, hole cracks, horizontal cracks, weld damage, and rail bottom, to facilitate damage identification by inspectors.

[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 inspector can easily view the image and location information corresponding to the damage. By reading the JSON file, the number of various damages within a certain mileage can be counted.

[0060] Based on the YOLOv5 detection algorithm, the present invention analyzes rail damage B-display images to achieve intelligent extraction of suspected damage. This eliminates the need for inspectors to watch computer screens for extended periods of time, requiring only secondary confirmation of system analysis results. This significantly reduces the workload of inspectors. Furthermore, compared with traditional manual analysis methods, the present invention has a stronger ability to identify damage, and combined with manual assistance, it can significantly reduce false and missed detections 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 a 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 damage waveforms and non-damage waveforms, perform data enhancement on the damage waveforms and non-damage waveforms respectively, and construct a data set for the rail damage recognition model.

[0066] The damage waveforms in the dataset construction module 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-damage waveforms include 3 factory welding non-damage waveforms, 1 thermite welding non-damage waveform, 2 screw hole non-damage waveforms, and 2 double-line guide hole non-damage waveforms.

[0067] The dataset construction module uses 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 non-damaged waveform respectively, randomly pasting the shrunken and enlarged damaged waveform on the outgoing wave area corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform on the outgoing wave area 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 an optimized rail damage recognition model, input the clutter-removed rail damage B-display image 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. The head network includes a four-layer detection head. The sizes of the feature maps output by 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 even smaller targets.

[0070] Considering that the waveforms of some damage targets such as rail head core damage waveforms, rail bottom damage waveforms, and hole crack damage waveforms 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. Combining the original three branches, the multi-scale information of the model is integrated, thereby enhancing the rail damage recognition model's ability to recognize small targets.

[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 secondary filtering module filters the rail damage identification results by judging the color type and color sequence in the rectangular area of ​​the rail damage identification results, 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, the waveform is filtered.

[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 they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 various 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 the clutter removed; Step 2: The rail damage B-display image after clutter removal is divided into damage waveforms and non-damage waveforms. Data enhancement is performed on the damage waveforms and non-damage waveforms respectively to construct a data set for the rail damage recognition model. The damage waveforms 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 type of 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 pilot hole non-damage waveforms. Step 3: Use the data set to train the rail damage recognition model to obtain an optimized rail damage recognition model. Input the clutter-free rail damage B-display image 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; Filtering the rail damage identification results involves judging the color type and color sequence within the rectangular area of ​​the rail damage identification results. 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 foot damage waveform, the corresponding waveform rectangular area is first converted into a grayscale image. Then, the color type and color sequence are determined based on the grayscale value of each color, 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. Then, the grayscale values ​​of each row in the area are treated as an array. The subscript values ​​of the first and last occurrences 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.

2. The YOLOv5-based intelligent rail damage identification method according to claim 1 is characterized by: In the step 1, the clutter in the rail damage B-display image is filtered using an 8-neighborhood noise reduction method, which includes: 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 YOLOv5-based intelligent rail damage identification method according to claim 1 is characterized by: In the second step, data enhancement is performed on the damaged waveform and the non-damaged waveform respectively using a cut-and-paste method, 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.

4. The YOLOv5-based intelligent rail damage identification method according to claim 1 is characterized by: The rail damage recognition model in step three includes a backbone network, a neck network, and a head network connected in sequence. The head network includes a four-layer detection head. The sizes of the feature maps output by 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.

5. A rail damage intelligent identification system based on YOLOv5, characterized by: include: The noise filtering module is used to filter the noise in the rail damage B-display image to obtain the rail damage B-display image with the noise removed; The dataset construction module is used to divide the rail damage B-display images after removing clutter into damage waveforms and non-damage waveforms, perform data enhancement on the damage waveforms and non-damage waveforms respectively, and construct a dataset for the rail damage recognition model. The damage waveforms 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 type of 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 pilot hole non-damage waveforms. The training module is used to train the rail damage recognition model using the data set to obtain an optimized rail damage recognition model. The clutter-free rail damage B-display image is input into the optimized rail damage recognition model for recognition, and the rail damage recognition result is output; A 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; Filtering the rail damage identification results involves judging the color type and color sequence within the rectangular area of ​​the rail damage identification results. 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 foot damage waveform, the corresponding waveform rectangular area is first converted into a grayscale image. Then, the color type and color sequence are determined based on the grayscale value of each color, 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. Then, the grayscale values ​​of each row in the area are treated as an array. The subscript values ​​of the first and last occurrences 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.

6. The YOLOv5-based intelligent rail damage identification system according to claim 5 is characterized by: 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.

7. The YOLOv5-based rail damage intelligent identification system according to claim 5, characterized in that: The dataset construction module uses 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 non-damaged waveform respectively, randomly pasting the shrunken and enlarged damaged waveform on the outgoing wave area corresponding to the damaged waveform, and randomly pasting the shrunken and enlarged non-damaged waveform on the outgoing wave area corresponding to the non-damaged waveform.

8. The YOLOv5-based intelligent rail damage identification system according to claim 5, characterized in that: The rail damage recognition model includes a backbone network, a neck network, and a head network connected in sequence. The head network includes a four-layer detection head. The sizes of the feature maps output by the four-layer detection head are 20×20, 40×40, 80×80, and 160×160, respectively, corresponding to the rail damage recognition model's detection tasks for large, medium, small, and even smaller-scale targets.

Citation Information

Patent Citations

  • 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