Sleeper crack identification method and device
Through the semantic segmentation model combined with contour and skeleton extraction technology, the number, location, length and width of sleeper cracks can be accurately identified, which solves the problem of the inability to accurately identify the length and width of sleeper cracks in the existing technology and improves the safety of railway lines.
Patent Information
- Application Number
- CN202310395198.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, the deep learning SSD target detection network can only determine the approximate location of the sleeper crack, but cannot accurately determine the length and width of the crack, which affects the safety of railway lines.
Using a semantic segmentation model combined with contour extraction and skeleton extraction technology, the sleeper image is processed through the trained sleeper crack semantic segmentation model to extract the number, location, length and width of the cracks.
It achieves accurate identification of sleeper cracks, provides data support required for railway line maintenance and repair, and effectively ensures railway line safety.
Smart Images

Figure CN118799245A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of sleeper crack detection, and in particular to a sleeper crack identification method and device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] The sleeper is a structure that directly supports the railway rails. It is usually made of wood or specially reinforced concrete. It is used to keep the rails in the correct position and transmit the pressure of the train to the roadbed and subgrade. The sleeper will crack over time and due to temperature, stress, crustal movement and other reasons, which will affect driving safety.
[0004] When detecting cracks on sleepers, a camera mounted on a detection vehicle is usually used to dynamically capture images of sleeper status while the vehicle is driving, and then the cracks on the sleepers are found by identifying the images. In the prior art, a deep learning SSD (Single Shot MultiBox Detector) target detection network is usually used to identify sleeper crack areas from images, but the SSD network is a target detection network, and its recognition results can only determine the approximate location of the crack, but cannot accurately determine the length and width of the crack. Summary of the invention
[0005] The embodiment of the present invention provides a sleeper crack recognition method for accurately recognizing sleeper cracks in an image and effectively ensuring the safety of railway lines. The method includes:
[0006] Get the sleeper image;
[0007] Inputting the sleeper image into the trained sleeper crack semantic segmentation model to obtain a mask image containing the sleeper crack; the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on the sleeper image with cracks that has been pixel-annotated;
[0008] Extracting the contour pixel position and contour outer frame of the sleeper crack from the mask image, and obtaining the number and position of the sleeper crack according to the contour pixel position and contour outer frame;
[0009] Perform skeleton extraction on the mask image to obtain the skeleton line of the sleeper crack, and calculate the length of the sleeper crack according to the skeleton line of the sleeper crack;
[0010] Extracting the normal line of the skeleton line of the sleeper crack, and calculating the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack;
[0011] Output the number, location, length and width of sleeper cracks.
[0012] The embodiment of the present invention further provides a sleeper crack identification device, which is used to accurately identify sleeper cracks in an image and effectively ensure the safety of railway lines. The device includes:
[0013] An acquisition module, used for acquiring sleeper images;
[0014] A segmentation module is used to input the sleeper image into a trained sleeper crack semantic segmentation model to obtain a mask image containing the sleeper crack, wherein the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on the sleeper image with cracks that has been pixel-annotated;
[0015] A contour extraction module is used to extract the contour pixel position and contour outer frame of the sleeper crack from the mask image, and obtain the number and position of the sleeper crack according to the contour pixel position and contour outer frame;
[0016] The length calculation module is used to extract the skeleton of the mask image to obtain the skeleton line of the sleeper crack, and calculate the length of the sleeper crack according to the skeleton line of the sleeper crack;
[0017] A width calculation module is used to extract the normal line of the skeleton line of the sleeper crack and calculate the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack;
[0018] Output module, used to output the number, location, length and width of sleeper cracks.
[0019] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned sleeper crack identification method when executing the computer program.
[0020] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the sleeper crack identification method described above is implemented.
[0021] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the sleeper crack identification method described above is implemented.
[0022] In an embodiment of the present invention, a sleeper image is obtained; the sleeper image is input into a trained sleeper crack semantic segmentation model to obtain a mask image containing sleeper cracks; the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on a sleeper image with cracks that has been pixel-annotated; the contour pixel position and contour outer frame of the sleeper crack are extracted from the mask image, and the number and position of the sleeper cracks are obtained based on the contour pixel position and contour outer frame; the mask image is subjected to skeleton extraction to obtain the skeleton line of the sleeper crack, and the length of the sleeper crack is calculated based on the skeleton line of the sleeper crack; the normal of the skeleton line of the sleeper crack is extracted, and the width of the sleeper crack is calculated based on the normal of the skeleton line of the sleeper crack; and the number, position, length and width of the sleeper cracks are output. In this way, by performing semantic segmentation, contour extraction, skeleton extraction and normal extraction on the sleeper image, the number, position, length and width of the sleeper cracks in the sleeper image can be identified, providing data support for railway line maintenance and repair, and effectively ensuring railway line safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0024] Figure 1 A flowchart of a sleeper crack identification method provided in an embodiment of the present invention;
[0025] Figure 2 A flowchart of a sleeper crack semantic segmentation model training provided in an embodiment of the present invention;
[0026] Figure 3 A flowchart of skeleton extraction of a mask image provided in an embodiment of the present invention;
[0027] Figure 4 A schematic diagram of a sleeper crack identification device provided in an embodiment of the present invention;
[0028] Figure 5 An example diagram of a sleeper crack identification device provided in an embodiment of the present invention;
[0029] Figure 6 Another example diagram of a sleeper crack identification device provided in an embodiment of the present invention;
[0030] Figure 7 It is a structural block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0032] In the existing sleeper crack recognition method, a deep learning SSD target detection network is used to identify the sleeper crack area from the sleeper image, but its recognition result can only determine the approximate location of the crack, and cannot accurately determine the length and width of the crack.
[0033] In order to solve this problem, an embodiment of the present invention provides a sleeper crack identification method, such as Figure 1 As shown, including:
[0034] Step 101: Acquire a sleeper image;
[0035] Step 102: inputting the sleeper image into a trained sleeper crack semantic segmentation model to obtain a mask image containing sleeper cracks; the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on the sleeper image with cracks that has been pixel-annotated;
[0036] Step 103: extracting the contour pixel positions and contour outer frame of the sleeper cracks from the mask image, and obtaining the number and positions of the sleeper cracks according to the contour pixel positions and contour outer frame;
[0037] Step 104: performing skeleton extraction on the mask image to obtain the skeleton line of the sleeper crack, and calculating the length of the sleeper crack according to the skeleton line of the sleeper crack;
[0038] Step 105: extracting the normal line of the skeleton line of the sleeper crack, and calculating the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack;
[0039] Step 106: Output the number, location, length and width of the sleeper cracks.
[0040] In a specific implementation, a sleeper image is obtained; the sleeper image is input into a trained sleeper crack semantic segmentation model to obtain a mask image containing sleeper cracks; the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on a sleeper image with cracks that has been pixel-annotated; the contour pixel position and contour outer frame of the sleeper crack are extracted from the mask image, and the number and position of the sleeper cracks are obtained based on the contour pixel position and contour outer frame; the mask image is subjected to skeleton extraction to obtain the skeleton line of the sleeper crack, and the length of the sleeper crack is calculated based on the skeleton line of the sleeper crack; the normal of the skeleton line of the sleeper crack is extracted, and the width of the sleeper crack is calculated based on the normal of the skeleton line of the sleeper crack; and the number, position, length and width of the sleeper cracks are output.
[0041] The embodiment of the present invention combines the basis of recent research on sleeper crack recognition technology and proposes a concept of processing sleeper images through semantic segmentation, contour extraction, skeleton extraction and normal extraction to solve the problem of accurate sleeper crack recognition.
[0042] Figure 2 Flow chart of the sleeper crack semantic segmentation model training provided in an embodiment of the present invention, such as Figure 2 As shown, in the embodiment of the present invention, the sleeper crack semantic segmentation model is trained in the following manner:
[0043] Step 201: obtaining a cracked sleeper image, and marking each pixel in the cracked sleeper image to distinguish between background pixels and crack pixels;
[0044] Step 202: Using a combined loss function of Cross Entropy Loss and Dice Loss to construct a deep learning semantic segmentation network;
[0045] Step 203: iteratively training the deep learning semantic segmentation network according to the image of the sleeper with cracks that has been pixel-annotated, until the accuracy of the segmentation result reaches a preset value;
[0046] Step 204: The deep learning semantic segmentation network whose segmentation result accuracy reaches a preset value is determined as the trained sleeper crack semantic segmentation model.
[0047] In the specific implementation, each pixel in the image is labeled, and the background pixel can be marked as 0 and the crack pixel can be marked as 1. Since the proportion of crack pixels in the track image is extremely low and the samples are in an unbalanced state, the combined loss function of Cross Entropy Loss and Dice Loss is used when constructing the network loss function to solve the imbalance problem and improve the accuracy of segmentation.
[0048] In specific implementation, the Cross Entropy Loss formula is as follows:
[0049]
[0050] Among them, y is the true result, is the network output result, n is the total category, Loss is the cross entropy loss value, i is the category to be segmented, and the value of i in crack segmentation is 0 and 1.
[0051] The Dice Loss formula is as follows:
[0052]
[0053] Among them, |X∩Y| represents the intersection between X and Y, |X| and |Y| represent the number of elements in X and Y respectively, the coefficient 2 in the numerator is because the denominator repeatedly counts the common elements between X and Y, and dice is the loss value. Y represents the real result, and X represents the network output result.
[0054] After constructing a deep learning semantic segmentation network using the combined loss function of Cross Entropy Loss and Dice Loss, the deep learning semantic segmentation network is iteratively trained according to the pixel-annotated cracked sleeper images until the accuracy of the segmentation result reaches the preset value. The deep learning semantic segmentation network whose segmentation result accuracy reaches the preset value is determined as the trained sleeper crack semantic segmentation model.
[0055] Here is an example:
[0056] The BiSeNetV2 semantic network is used as the sleeper crack semantic segmentation network.
[0057] The BiSeNetV2 semantic network mainly consists of three parts:
[0058] Detail branch: It has fewer network layers and a large feature map size, and is used to extract spatial detail information. Semantic branch: It is relatively deep, has a small feature map size, and a large receptive field, and is used to extract high-level semantic information. Feature fusion module: It is used to fuse the features of the Detail branch and the Semantic branch.
[0059] The Detail branch is responsible for extracting low-level spatial detail information. It contains 3 stages in total. Each convolution operation is followed by BN and activation functions. The stride of the first convolution layer in each stage is 2, and the stride of the remaining convolution layers is 1. Therefore, the output feature map size of the Detail branch is 1 / 8 of the original image. The network structure design of this branch follows the design guidelines of VGG and avoids the use of residual links.
[0060] The Semantic branch is used to extract high-level semantic information, including Stem Block, GE layer and CE layer. Stem Block uses two different downsampling operations in two branches, and the outputs of the two branches are fused through the concat (function) operation; the GE layer uses 3*3 convolution for dimension increase when the stride is 1, uses depthwise convolution for feature extraction in high dimensions, and uses 1X1 convolution for dimension reduction. When the stride is 2, the GE layer uses two 3*3 depthwise convolutions for feature extraction, and uses one 3*3 depthwise convolution in the shortcut; the CE layer uses global average pooling and residual connection to extract global context features.
[0061] The feature fusion module is used to fuse the features extracted by the Detail branch and the Semantic branch. Since the Semantic branch contains more downsampling operations, the output feature map size of this branch is small, so the feature map output by the Semantic branch needs to be upsampled to make it consistent with the feature map size output by the Detail branch.
[0062] During network training, the loss function uses a combination of Cross Entropy Loss and Dice Loss, and the weighted ratio of the two functions is 8:2.
[0063] In the training data preparation stage, 2000 images with cracks were annotated at the pixel level, with crack pixels marked as 1 and background pixels marked as 0. The sleeper crack segmentation model was obtained by training the network for 300 epochs.
[0064] In one embodiment, after inputting the sleeper image into a trained sleeper crack semantic segmentation model to obtain a mask image containing the sleeper crack, the method further includes:
[0065] Binarize the mask image;
[0066] Extracting the contour pixel position and the contour outer frame of the sleeper crack from the mask image, including: extracting the contour pixel position and the contour outer frame of the sleeper crack from the binary mask image;
[0067] The skeleton of the mask image is extracted, including: the skeleton of the binary mask image is extracted.
[0068] In one embodiment, the contour pixel positions and contour perimeter frames of the sleeper cracks are extracted from the mask image, and the number and positions of the sleeper cracks are obtained according to the contour pixel positions and contour perimeter frames, including:
[0069] Find the contour of the sleeper crack in the mask image using the findContours contour extraction algorithm;
[0070] Determine the contour pixel position and contour outer frame of the sleeper crack;
[0071] According to the contour pixel position and the contour outer frame of the sleeper crack, the number and coordinates of the contour outer frame are determined;
[0072] The number of the contour outer boxes is determined as the number of the sleeper cracks, and the coordinates of the contour outer boxes are determined as the positions of the sleeper cracks.
[0073] In specific implementation, after the mask image is obtained, the mask image is binarized, and the number and coordinates of the outer contour frames of the sleeper cracks are obtained by using the findContours contour extraction algorithm.
[0074] Among them, the findContours contour extraction algorithm extraction process is as follows:
[0075] In the binary mask image, each pixel can be searched from left to right and from top to bottom to determine the connected domain and contour type in the image, and the contour can be extracted step by step in a hierarchical manner to finally obtain the contour pixel position and contour outer frame of the crack area. The number of outer frames obtained is the number of cracks in the image, and the coordinates of the outer frames are the positions of the cracks.
[0076] After the mask image is binarized, the skeleton of the mask image can be extracted to obtain the skeleton line of the sleeper crack. By counting the number of pixels of the skeleton line, the length of the sleeper crack can be obtained. Figure 3 The flowchart of skeleton extraction of the mask image provided in the embodiment of the present invention is as follows: Figure 3 As shown, in the embodiment of the present invention, skeleton extraction is performed on the mask image, including:
[0077] Step 301: Obtain the first address of the mask image and the width and height of the mask image;
[0078] Step 302: Execute the following steps in a loop until the mask image is corroded into an empty set, and use the obtained skeleton as the skeleton line of the extracted sleeper crack:
[0079] Step 311: Eroding the mask image through the structural element and saving the etching result;
[0080] Step 312: when there is a point with 255 pixels in the erosion result, the eroded mask image is opened using the structure element, and the difference between the erosion operation and the opening operation is calculated;
[0081] Step 313: performing a union operation on the difference between the erosion operation and the opening operation and the eroded mask image to obtain the skeleton of this loop operation;
[0082] Step 314: Replace the mask image with the skeleton of this loop operation.
[0083] In the specific implementation, the first address of the mask image and the width and height of the image are obtained, and the loop flag is set to 1; the following steps are executed in a loop until the mask image is corroded into an empty set, and the obtained skeleton is used as the skeleton line of the extracted sleeper crack: the mask image is corroded with a structural element, and the corrosion result is saved; the loop flag is set to 0, and if there is a point of 255 in the corrosion result, that is, the original mask image has not been completely corroded into an empty set, the loop flag is set to 1; the corroded image is opened with the structural element, and the difference between the corrosion operation and the opening operation is obtained; the difference between the corrosion operation and the opening operation is used to perform a union operation with the current mask image to obtain the skeleton obtained in this loop; the original mask image is replaced with the corrosion result saved in this loop.
[0084] In one embodiment, calculating the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack includes:
[0085] Find the nearest neighbor point of each point in the skeleton line of the sleeper crack, and determine the normal vector direction of each point in the skeleton line of the sleeper crack according to each point in the skeleton line of the sleeper crack and the nearest neighbor point of the point;
[0086] According to the normal vector direction of each point in the skeleton line of the sleeper crack, the intersection point of the normal vector of each point in the skeleton line of the sleeper crack and the contour of the sleeper crack is determined, and the normal vector length within the contour of the sleeper crack is obtained according to the intersection point;
[0087] The width of the sleeper crack is calculated based on the length of the normal vector within the contour of the sleeper crack.
[0088] In specific implementation, the KD-tree (k-dimensional tree) algorithm can be used to obtain the nearest neighbor point of each point on the crack skeleton line, and then the singular value decomposition algorithm can be used to obtain the normal vector, and the normal line can be drawn along the normal vector. The length of the normal line in the crack contour area of the sleeper is calculated, and the width of each position of the sleeper crack can be calculated.
[0089] The present invention also provides a sleeper crack identification device, as described in the following embodiments. Since the principle of the device to solve the problem is similar to that of the sleeper crack identification method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 4 FIG. 1 is a schematic diagram of a sleeper crack identification device provided in an embodiment of the present invention, the device comprising:
[0090] An acquisition module 401 is used to acquire a sleeper image;
[0091] The segmentation module 402 is used to input the sleeper image into the trained sleeper crack semantic segmentation model to obtain a mask image containing the sleeper crack, wherein the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on the sleeper image with cracks that has been pixel-annotated;
[0092] The contour extraction module 403 is used to extract the contour pixel position and contour outer frame of the sleeper crack from the mask image, and obtain the number and position of the sleeper crack according to the contour pixel position and contour outer frame;
[0093] The length calculation module 404 is used to perform skeleton extraction on the mask image to obtain the skeleton line of the sleeper crack, and calculate the length of the sleeper crack according to the skeleton line of the sleeper crack;
[0094] A width calculation module 405 is used to extract the normal line of the skeleton line of the sleeper crack and calculate the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack;
[0095] The output module 406 is used to output the number, location, length and width of the sleeper cracks.
[0096] In one embodiment, the contour extraction module 403 is specifically used to: extract the contour pixel position and the contour outer frame of the sleeper crack from the binary mask image;
[0097] The length calculation module 404 is specifically used to perform skeleton extraction on the binary mask image.
[0098] In one embodiment, the contour extraction module 403 is specifically used for:
[0099] Find the contour of the sleeper crack in the mask image using the findContours contour extraction algorithm;
[0100] Determine the contour pixel position and contour outer frame of the sleeper crack;
[0101] According to the contour pixel position and the contour outer frame of the sleeper crack, the number and coordinates of the contour outer frame are determined;
[0102] The number of the contour outer boxes is determined as the number of the sleeper cracks, and the coordinates of the contour outer boxes are determined as the positions of the sleeper cracks.
[0103] In one embodiment, the length calculation module 404 is specifically used for:
[0104] Get the first address of the mask image and the width and height of the mask image, and set the loop flag to 1;
[0105] The following steps are executed repeatedly until the mask image is corroded into an empty set, and the obtained skeleton is used as the skeleton line of the extracted sleeper crack:
[0106] Erode the mask image through the structural element and save the erosion result;
[0107] When there is a point of 255 pixels in the erosion result, the eroded mask image is opened using the structure element, and the difference between the erosion operation and the opening operation is calculated;
[0108] Perform a union operation using the difference between the erosion operation and the opening operation and the eroded mask image to obtain the skeleton of this loop operation;
[0109] Replace the mask image with the skeleton of this loop operation.
[0110] In one embodiment, the width calculation module 405 is specifically used for:
[0111] Find the nearest neighbor point of each point in the skeleton line of the sleeper crack, and determine the normal vector direction of each point in the skeleton line of the sleeper crack according to each point in the skeleton line of the sleeper crack and the nearest neighbor point of the point;
[0112] According to the normal vector direction of each point in the skeleton line of the sleeper crack, the intersection point of the normal vector of each point in the skeleton line of the sleeper crack and the contour of the sleeper crack is determined, and the normal vector length within the contour of the sleeper crack is obtained according to the intersection point;
[0113] The width of the sleeper crack is calculated based on the length of the normal vector within the contour of the sleeper crack.
[0114] like Figure 5 The figure shows an example of a sleeper crack identification device in an embodiment of the present invention. In one embodiment, it also includes a model training module 501 for:
[0115] Acquire a cracked sleeper image, and mark each pixel in the cracked sleeper image to distinguish between background pixels and crack pixels;
[0116] A combined loss function of Cross Entropy Loss and Dice Loss is used to construct a deep learning semantic segmentation network;
[0117] Based on the pixel-annotated images of cracked sleepers, the deep learning semantic segmentation network is iteratively trained until the accuracy of the segmentation result reaches a preset value;
[0118] The deep learning semantic segmentation network whose segmentation result accuracy reaches a preset value is determined as the trained sleeper crack semantic segmentation model.
[0119] like Figure 6 Another example of a sleeper crack identification device according to an embodiment of the present invention is shown. In one embodiment, a binarization module 601 is used to:
[0120] Binarize the mask image.
[0121] In one embodiment, the contour extraction module is specifically used to: extract the contour pixel position and contour outer frame of the sleeper crack from the binary mask image;
[0122] The length calculation module is specifically used to extract the skeleton of the binary mask image.
[0123] Based on the above invention concept, Figure 7 As shown, the present invention also proposes a computer device 700, including a memory 710, a processor 720, and a computer program 730 stored in the memory 710 and executable on the processor 720, wherein the processor 720 implements the aforementioned rail flaw detection vehicle B-type image display method when executing the computer program 730.
[0124] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the sleeper crack identification method described above is implemented.
[0125] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the sleeper crack identification method described above is implemented.
[0126] In summary, in an embodiment of the present invention, a sleeper image is obtained; the sleeper image is input into a trained sleeper crack semantic segmentation model to obtain a mask image containing sleeper cracks; the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on a sleeper image with cracks that has been pixel-annotated; the contour pixel position and contour outer frame of the sleeper crack are extracted from the mask image, and the number and position of the sleeper cracks are obtained based on the contour pixel position and contour outer frame; the mask image is subjected to skeleton extraction to obtain the skeleton line of the sleeper crack, and the length of the sleeper crack is calculated based on the skeleton line of the sleeper crack; the normal of the skeleton line of the sleeper crack is extracted, and the width of the sleeper crack is calculated based on the normal of the skeleton line of the sleeper crack; and the number, position, length and width of the sleeper cracks are output. In this way, by performing semantic segmentation, contour extraction, skeleton extraction and normal extraction on the sleeper image, the number, position, length and width of the sleeper cracks in the sleeper image can be identified, providing data support for railway line maintenance and repair, and effectively ensuring the safety of the railway line.
[0127] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0128] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0131] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A sleeper crack identification method, characterized in that: include: Get the sleeper image; Input the sleeper image into the trained sleeper crack semantic segmentation model to obtain a mask image containing the sleeper crack; The sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on a sleeper image with cracks that has been pixel-annotated; Extracting the contour pixel position and contour outer frame of the sleeper crack from the mask image, and obtaining the number and position of the sleeper crack according to the contour pixel position and contour outer frame; Perform skeleton extraction on the mask image to obtain the skeleton line of the sleeper crack, and calculate the length of the sleeper crack according to the skeleton line of the sleeper crack; Extracting the normal line of the skeleton line of the sleeper crack, and calculating the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack; Output the number, location, length and width of sleeper cracks.
2. The method according to claim 1, characterized in that The sleeper crack semantic segmentation model is trained as follows: Acquire a cracked sleeper image, and mark each pixel in the cracked sleeper image to distinguish between background pixels and crack pixels; A combined loss function of Cross Entropy Loss and Dice Loss is used to construct a deep learning semantic segmentation network; Based on the pixel-annotated images of cracked sleepers, the deep learning semantic segmentation network is iteratively trained until the accuracy of the segmentation result reaches a preset value; The deep learning semantic segmentation network whose segmentation result accuracy reaches a preset value is determined as the trained sleeper crack semantic segmentation model.
3. The method according to claim 1, characterized in that After inputting the sleeper image into the trained sleeper crack semantic segmentation model to obtain the mask image containing the sleeper crack, it also includes: Binarize the mask image; Extracting the contour pixel position and the contour outer frame of the sleeper crack from the mask image, including: extracting the contour pixel position and the contour outer frame of the sleeper crack from the binary mask image; The skeleton of the mask image is extracted, including: the skeleton of the binary mask image is extracted.
4. The method according to claim 1, characterized in that The contour pixel position and contour outer frame of the sleeper crack are extracted from the mask image, and the number and position of the sleeper crack are obtained according to the contour pixel position and contour outer frame, including: Find the contour of the sleeper crack in the mask image using the findContours contour extraction algorithm; Determine the contour pixel position and contour outer frame of the sleeper crack; According to the contour pixel position and the contour outer frame of the sleeper crack, the number and coordinates of the contour outer frame are determined; The number of the contour outer boxes is determined as the number of the sleeper cracks, and the coordinates of the contour outer boxes are determined as the positions of the sleeper cracks.
5. The method according to claim 1, characterized in that Perform skeleton extraction on the mask image, including: Get the first address of the mask image and the width and height of the mask image; The following steps are executed repeatedly until the mask image is corroded into an empty set, and the obtained skeleton is used as the skeleton line of the extracted sleeper crack: Erode the mask image through the structural element and save the erosion result; When there is a point of 255 pixels in the erosion result, the eroded mask image is opened using the structure element, and the difference between the erosion operation and the opening operation is calculated; Perform a union operation using the difference between the erosion operation and the opening operation and the eroded mask image to obtain the skeleton of this loop operation; Replace the mask image with the skeleton of this loop operation.
6. The method according to claim 1, characterized in that According to the normal line of the skeleton line of the sleeper crack, the width of the sleeper crack is calculated, including: Find the nearest neighbor point of each point in the skeleton line of the sleeper crack, and determine the normal vector direction of each point in the skeleton line of the sleeper crack according to each point in the skeleton line of the sleeper crack and the nearest neighbor point of the point; According to the normal vector direction of each point in the skeleton line of the sleeper crack, the intersection point of the normal vector of each point in the skeleton line of the sleeper crack and the contour of the sleeper crack is determined, and the normal vector length within the contour of the sleeper crack is obtained according to the intersection point; The width of the sleeper crack is calculated based on the length of the normal vector within the contour of the sleeper crack.
7. A sleeper crack identification device, characterized in that: include An acquisition module, used for acquiring sleeper images; A segmentation module is used to input the sleeper image into a trained sleeper crack semantic segmentation model to obtain a mask image containing the sleeper crack, wherein the sleeper crack semantic segmentation model is obtained by training a deep learning semantic segmentation network based on the sleeper image with cracks that has been pixel-annotated; A contour extraction module is used to extract the contour pixel position and contour outer frame of the sleeper crack from the mask image, and obtain the number and position of the sleeper crack according to the contour pixel position and contour outer frame; The length calculation module is used to extract the skeleton of the mask image to obtain the skeleton line of the sleeper crack, and calculate the length of the sleeper crack according to the skeleton line of the sleeper crack; A width calculation module is used to extract the normal line of the skeleton line of the sleeper crack and calculate the width of the sleeper crack according to the normal line of the skeleton line of the sleeper crack; Output module, used to output the number, location, length and width of sleeper cracks.
8. The device according to claim 7, characterized in that Also includes model training modules for: Acquire a cracked sleeper image, and mark each pixel in the cracked sleeper image to distinguish between background pixels and crack pixels; A combined loss function of Cross Entropy Loss and Dice Loss is used to construct a deep learning semantic segmentation network; Based on the pixel-annotated images of cracked sleepers, the deep learning semantic segmentation network is iteratively trained until the accuracy of the segmentation result reaches a preset value; The deep learning semantic segmentation network whose segmentation result accuracy reaches a preset value is determined as the trained sleeper crack semantic segmentation model.
9. The device according to claim 7, characterized in that Also includes a binarization module for: Binarize the mask image; The contour extraction module is specifically used to: extract the contour pixel position and contour outer frame of the sleeper crack from the binary mask image; The length calculation module is specifically used to extract the skeleton of the binary mask image.
10. The device according to claim 7, characterized in that The contour extraction module is specifically used for: Find the contour of the sleeper crack in the mask image using the findContours contour extraction algorithm; Determine the contour pixel position and contour outer frame of the sleeper crack; According to the contour pixel position and the contour outer frame of the sleeper crack, the number and coordinates of the contour outer frame are determined; The number of the contour outer boxes is determined as the number of the sleeper cracks, and the coordinates of the contour outer boxes are determined as the positions of the sleeper cracks.
11. The device according to claim 7, characterized in that The length calculation module is specifically used for: Get the first address of the mask image and the width and height of the mask image; The following steps are executed repeatedly until the mask image is corroded into an empty set, and the obtained skeleton is used as the skeleton line of the extracted sleeper crack: Erode the mask image through the structural element and save the erosion result; When there is a point of 255 pixels in the erosion result, the eroded mask image is opened using the structure element, and the difference between the erosion operation and the opening operation is calculated; Perform a union operation using the difference between the erosion operation and the opening operation and the eroded mask image to obtain the skeleton of this loop operation; Replace the mask image with the skeleton of this loop operation.
12. The device according to claim 7, characterized in that The width calculation module is specifically used for: Find the nearest neighbor point of each point in the skeleton line of the sleeper crack, and determine the normal vector direction of each point in the skeleton line of the sleeper crack according to each point in the skeleton line of the sleeper crack and the nearest neighbor point of the point; According to the normal vector direction of each point in the skeleton line of the sleeper crack, the intersection point of the normal vector of each point in the skeleton line of the sleeper crack and the contour of the sleeper crack is determined, and the normal vector length within the contour of the sleeper crack is obtained according to the intersection point; The width of the sleeper crack is calculated based on the length of the normal vector within the contour of the sleeper crack.
13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Automatic bridge crack detection system fusing cyclic residual convolution and context extractor network
CN112884747A
Bridge surface crack detection method and system based on semantic segmentation
CN113610778A
Underground structure crack disease discrimination method based on deep learning algorithm
CN114581764A
Crack detection method and device, terminal equipment and storage medium
CN115239733A
Cited By
Railway track crack identification method based on machine identification
CN119513722A
Railway sleeper crack detection method and system based on three-dimensional feature construction
CN120147315A
Railway Sleeper Crack Detection Method and System Based on Three-Dimensional Features
CN120147315B
Visual detection method, system and device for breakage of elastic strip of track fastener
CN120765943A
Crack identification method and electronic equipment
CN121032900A
