Bogie bolt looseness detection method based on series steel wires

Through the improved YOLOv8 model and U-net network, and combined with skeleton extraction and curvature fitting, the problems of low bolt loose detection efficiency and insufficient accuracy in the prior art are solved, and bolt loose detection with high accuracy and reliability are achieved.

CN119540209AActive Publication Date: 2025-02-28SOUTHWEST JIAOTONG UNIV

Patent Information

Application Number
CN202411695967.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-28
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

In the prior art, bolt loosening detection relies on manual inspection, which has problems such as high workload, low efficiency, and susceptibility to environmental interference. The detection accuracy of traditional deep learning methods is low, so it is impossible to detect the looseness when the bolt rotation angle is one week.

Method used

The bogie bolt loosening detection method based on tandem wire is used, and the improved YOLOv8 bolt area detection model is used to identify the area where the tandem bolt is connected to the 8-word tandem anti-loose wire is located, and images containing both sides of the 8-word anti-loose wire are identified through the U-net network. Combined with skeleton extraction, angle calculation and curvature fitting, it is used to determine whether the bolt is loose.

Benefits of technology

It significantly improves the accuracy and accuracy of bolt area identification, reduces missed and missed detection, improves the reliability and robustness of detection, and ensures strong stability and high recognition rate in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540209A_ABST
    Figure CN119540209A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of rail transit detection, and discloses a bogie bolt looseness detection method based on a series steel wire, which comprises the following steps: identifying an area where 8-shaped series anti-looseness steel wire series bolts are located by using an improved YOLOv8 bolt area detection model, and inputting a trained U-net network for identification, judging whether the output result is an image containing two sides of the 8-shaped anti-loosening steel wire or not; carrying out binarization on the image containing the two sides of the 8-shaped anti-loosening steel wire, and then carrying out skeleton extraction to obtain a first single pixel line and a second single pixel line; calculating an included angle between the first single pixel line and the second single pixel line, and judging whether the included angle is smaller than a set threshold value or not; extracting interval pixel points of the first single pixel line, performing rectangular coordinate conversion, and performing fitting to obtain an interval pixel point fitting curve; a first curve section and a second curve section are selected, the curvature of each interval pixel point in the curve sections is calculated, and whether bolt looseness exists or not is judged through the maximum curvature value; the method improves the bolt detection precision and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of rail transit detection, and in particular to a bogie bolt loosening detection method based on series steel wires. Background Art

[0002] Bogies are an important part of trains and play a vital role in the safe operation, stability and ride comfort of trains. Bolts are important components that connect the various parts of the bogie. Once they are loose or lost, they will directly affect the stability and running smoothness of the train. However, the current detection of loose bolts still mostly relies on manual inspection. This inspection method has the problems of large workload, low efficiency, and susceptibility to environmental interference. Therefore, it is necessary to propose a method that can replace manual loosening detection, improve the efficiency of bolt detection, and improve the reliability of train operation and maintenance. The existing non-manual detection method of bolt loosening is a method of using deep learning to detect bolt loosening. Most of them are based on anti-loosening wires. When the angles of the two anti-loosening wires deviate, the bolt is considered to be loose. However, this method has a problem, that is, when the bolt rotation angle is exactly one circle and the two anti-loosening wires overlap again, the bolt loosening cannot be detected. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a bogie bolt loosening detection method based on series steel wire, which is used to solve the problems in the prior art of large workload, low efficiency and susceptibility to environmental interference in manual inspection, as well as the problem of low detection accuracy of traditional deep learning methods.

[0004] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0005] A method for detecting loose bolts of a bogie based on a series steel wire comprises the following steps:

[0006] S1. Use the improved YOLOv8 bolt area detection model to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located;

[0007] S2, input the area where the 8-shaped series anti-loosening steel wire series bolt is located into the trained U-net network for identification, and determine whether the output result of the trained U-net network is an image containing both sides of the 8-shaped anti-loosening steel wire. If so, execute step S3, otherwise, the output is abnormal;

[0008] Among them, the two sides of the 8-shaped anti-loosening steel wire are two lines of different colors, namely the first color line and the second color line;

[0009] S3, performing a binarization operation on the image including both sides of the 8-shaped anti-loosening steel wire to obtain a binarized image including both sides of the 8-shaped anti-loosening steel wire, and performing skeleton extraction to obtain a first single pixel line and a second single pixel line by removing the edge portion of the color line;

[0010] S4, calculating the angle between the first single pixel line and the second single pixel line, and determining whether the angle is less than a set threshold, if so, outputting an abnormality, otherwise, executing step S5;

[0011] S5, extracting the spaced pixel points in the first single pixel line and performing rectangular coordinate conversion, and obtaining a fitting curve of the spaced pixel points by fitting the spaced pixel points under the rectangular coordinates;

[0012] S6. Select the curve segments of the interval pixel point fitting curve in the first curve coordinate value interval and the second curve coordinate value interval to obtain the first curve segment and the second curve segment, and calculate the curvature of each interval pixel point in the first curve segment and the second curve segment to obtain the curvature value of each interval pixel point, and determine whether the maximum curvature value is greater than the standard curvature. If so, the bolt is loose, otherwise, the bolt is not loose.

[0013] Furthermore, step S1 specifically includes:

[0014] S11, obtaining a series of steel wire subway bogie bolt image data sets, and using annotation software to annotate the label data of the series of steel wire subway bogie bolt image data sets to obtain a series of steel wire subway bogie bolt image data sets with labels;

[0015] Among them, the label data is the area where the 8-shaped series anti-loosening steel wire series bolts are located;

[0016] S12. Introduce the structural re-parameterized feature reuse module and downsampling convolution layer at the backbone network end to build an improved YOLOv8 bolt area detection model;

[0017] Among them, the structural re-parameterization feature reuse module is used to fuse feature maps of different layers or different scales to achieve feature reuse;

[0018] Downsampling convolution layer, used to reduce the width and height of the feature map and reduce the image resolution;

[0019] S13. Inputting the labeled tandem steel wire subway bogie bolt image dataset into the improved YOLOv8 bolt area detection model for training, and obtaining a trained improved YOLOv8 bolt area detection model for identifying the area where the 8-shaped tandem anti-loosening steel wire tandem bolts are located.

[0020] Furthermore, the improved YOLOv8 bolt area detection model includes a backbone network end, a neck network end, and a head network end;

[0021] The backbone network end includes a first convolution layer, a second convolution layer, a first structure re-parameterized feature reuse module, a first down-sampling convolution layer, a second structure re-parameterized feature reuse module, a second down-sampling convolution layer, a third structure re-parameterized feature reuse module, a third down-sampling convolution layer, a fourth structure re-parameterized feature reuse module and a multi-scale feature aggregation pyramid module;

[0022] The neck network end includes a first upsampling module, a first connection module, a first residual connection module, a second upsampling module, a second connection module, a second residual connection module, a third convolutional layer, a third connection module, a third residual connection module, a fourth convolutional layer, a fourth connection module, and a fourth residual connection module;

[0023] The head network end includes a large detection head, a medium detection head and a small detection head.

[0024] Furthermore, step S13 specifically includes:

[0025] S131, inputting the labeled tandem steel wire subway bogie bolt image dataset into the backbone network of the improved YOLOv8 bolt area detection model for feature extraction to obtain feature maps of different scales;

[0026] S132, inputting feature maps of different scales into the neck network end of the improved YOLOv8 bolt area detection model for feature fusion to obtain fusion features of different scales;

[0027] S133. Input the fusion features of different scales into the head network end of the improved YOLOv8 bolt area detection model to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located, and obtain a trained improved YOLOv8 bolt area detection model, which is used to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located.

[0028] Furthermore, step S3 specifically includes:

[0029] S31, using the Ostu threshold segmentation method to perform a binarization operation on the image containing both sides of the 8-shaped anti-loosening steel wire, to obtain a binarized image containing both sides of the 8-shaped anti-loosening steel wire;

[0030] S32, performing skeleton extraction on the binary image including both sides of the 8-shaped anti-loosening steel wire, and obtaining a first single-pixel line and a second single-pixel line by removing the edge portion of the color line.

[0031] Furthermore, step S31 specifically includes:

[0032] S311, calculate the zero-order matrix of the grayscale histogram of the images on both sides of the 8-shaped anti-loosening wire, that is:

[0033]

[0034] Where k represents the grayscale value range of the pixel points in the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening wire, i represents the grayscale value of the pixel point, zeroCM represents the zero-order matrix, and zeroCM(k) represents the cumulative sum of the zero-order matrix, that is, the cumulative sum of the normalized grayscale histogram from grayscale value 0 to k. I Represents the normalized grayscale histogram of the image on both sides of the 8-shaped anti-loosening wire. I (i) represents the proportion of pixels with gray value i in the normalized gray histogram;

[0035] S312, calculating the first-order cumulative matrix of the grayscale histogram of the image on both sides of the 8-shaped anti-loosening wire, that is:

[0036]

[0037] Among them, oneCM represents the first-order cumulative matrix, oneCM(k) represents the cumulative sum of the first-order cumulative matrix;

[0038] S313, calculating the grayscale average value of the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening steel wire, that is:

[0039] mean=oneCM(255)

[0040] Among them, mean represents the average value;

[0041] S314, calculating the variance of the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening wire, that is:

[0042]

[0043] Among them, σ 2 represents variance;

[0044] S315. Based on the variance of the grayscale histogram of the image including both sides of the figure-8 anti-loosening steel wire, the largest variance is selected, and the grayscale value corresponding to the largest variance is used as the threshold of Ostu threshold segmentation to binarize the image including both sides of the figure-8 anti-loosening steel wire, so as to obtain a binarized image including both sides of the figure-8 anti-loosening steel wire.

[0045] Further, step S32 specifically includes:

[0046] S321, dividing the pixels to be processed and numbering them as P1;

[0047] S322, obtaining eight neighboring pixels centered on the pixel to be processed, wherein the eight neighboring pixels of the pixel to be processed are respectively located above, upper right, right, lower right, bottom, lower left, left, and upper left of the pixel to be processed, and are numbered P2, P3, P4, PS, P6, P7, P8, and P9 in sequence;

[0048] S323, determining whether the eight neighboring pixels of the pixel to be processed meet the first deletion condition or the second deletion condition, if so, deleting the pixel to be processed, otherwise, retaining the pixel to be processed;

[0049] S324, repeating steps S321-S323 until there are no pixels to be deleted in the temporary image, and the edge portion removal process is completed, thereby obtaining a plurality of first single pixel points and a plurality of second single pixel points;

[0050] Among them, the first deletion condition is:

[0051]

[0052] Among them, the second deletion condition is:

[0053]

[0054] Wherein, N represents the number of non-zero values ​​in the eight neighboring pixels of the pixel to be processed, and N(1) represents the number of changes from 0 to 1 when the eight neighboring pixels of the pixel to be processed are used as the order;

[0055] S325 , fitting a plurality of first single pixel points to obtain a first single pixel line, and fitting a plurality of second single pixel points to obtain a second single pixel line.

[0056] Furthermore, in step S4, the calculation formula for the angle between the first single pixel line and the second single pixel line is:

[0057]

[0058] Wherein, θ represents the angle between the first single pixel line and the second single pixel line, arctan represents the inverse tangent function, m1 represents the slope of the first single pixel line, m2 represents the slope of the second single pixel line, and x 12 ,y 12 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 2 on the first single pixel line, x 11 ,y 11 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 1 on the first single pixel line, x 22 ,y 22 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 2 on the second single pixel line, x 21 ,y 21They respectively represent the horizontal coordinate and the vertical coordinate of the single pixel point 1 on the second single pixel line.

[0059] Furthermore, step S5 specifically includes:

[0060] S51, based on the first single pixel line, obtaining a plurality of first single pixel points of the first single pixel line;

[0061] S52, saving the first single pixel point at the position every 10 first single pixel points, and calling it an interval pixel point, and obtaining a plurality of interval pixel points and coordinates;

[0062] S53, converting the coordinates of the plurality of spaced pixel points into a rectangular coordinate system to obtain the plurality of spaced pixel points in the rectangular coordinate system;

[0063] S54, fitting a plurality of spaced pixel points in a rectangular coordinate system to obtain a spaced pixel point fitting curve.

[0064] Furthermore, in step S6, the calculation formula for the curvature of each interval pixel point in the first curve segment and the second curve segment is:

[0065]

[0066] Among them, k ′ Indicates the curvature of each pixel interval in the first curve segment or the second curve segment, y ′ Represents the first derivative of the first curve segment or the second curve segment at a certain interval pixel point, y ′″ Indicates the second-order derivative of the first curve segment or the second curve segment at a certain interval pixel point.

[0067] The present invention has the following beneficial effects:

[0068] The present invention proposes a method for detecting loose bolts of a bogie based on series steel wires. The method identifies the area where the series bolts of the figure-8 anti-loosening steel wires are located through an improved YOLOv8 bolt area detection model, thereby improving the recognition accuracy and precision of the area where the figure-8 anti-loosening steel wires are located, significantly improving the reliability of detection, and effectively reducing missed detection and false detection. At the same time, a trained U-net network is used to identify whether the areas on both sides of the figure-8 anti-loosening steel wires are included, and further screening and identification are performed, thereby improving data accuracy and precision, and ensuring accurate positioning of the anti-loosening steel wire area during screening and further identification. Finally, the curvature is calculated through skeleton extraction, angle calculation and curve fitting, thereby judging whether the bogie bolts of the series steel wires are loose, thereby improving the accuracy of bolt identification, and reducing the impact of the environment, so that the bolt detection has strong robustness and stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1A schematic flow chart of a bogie bolt loosening detection method based on series steel wires proposed by the present invention;

[0070] Figure 2 A schematic diagram of the area where the 8-shaped series anti-loosening steel wire series bolts are located;

[0071] Figure 3 This is a schematic diagram of the structure of the improved YOLOv8 bolt area detection model;

[0072] Figure 4 A schematic diagram of an image including both sides of the 8-shaped anti-loosening wire for identification;

[0073] Figure 5 Schematic diagram of the positions of 8 neighboring pixels of the pixel to be processed;

[0074] Figure 6 Extract the structural diagram for the skeleton;

[0075] Figure 7 Schematic diagram of the fitting curve of interval pixels. DETAILED DESCRIPTION

[0076] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0077] like Figure 1 As shown, a bogie bolt loosening detection method based on series steel wires includes the following steps S1-S6:

[0078] S1. Use the improved YOLOv8 bolt area detection model to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located.

[0079] In this embodiment, the purpose of constructing an improved YOLOv8 bolt area detection model is to accurately identify the area where the 8-shaped series anti-loosening steel wire series bolts are located, and the recognition accuracy rate reaches 96.7%, which significantly improves the reliability of model detection and effectively reduces missed detection and false detection. The training and recognition process of the model is as follows:

[0080] Specifically, step S1 includes S11-S13:

[0081] S11. Obtain a data set of images of tandem steel wire subway bogie bolts, and use annotation software to annotate label data of the image data of tandem steel wire subway bogie bolts to obtain a data set of images of tandem steel wire subway bogie bolts with labels.

[0082] Among them, the label data is the area where the 8-shaped series anti-loosening steel wire series bolts are located.

[0083] In this embodiment, a picture data set with an 8-shaped series anti-loosening steel wire series bolt area is provided, and the picture data set is annotated with label data using labeling software, and the label data is the 8-shaped series anti-loosening steel wire series bolt area, so as to obtain a labeled series steel wire subway bogie bolt picture data set for model training.

[0084] S12. Introduce the structure re-parameterized feature reuse module and downsampling convolution layer at the backbone network end to build an improved YOLOv8 bolt area detection model.

[0085] Among them, the structural re-parameterization feature reuse module is used to fuse feature maps of different layers or different scales to achieve feature reuse; the downsampling convolution layer is used to reduce the width and height of the feature map and reduce the image resolution.

[0086] In this embodiment, a structural re-parameterized feature reuse module realizes feature reuse by fusing feature maps from different layers or different scales, thereby improving the efficiency and performance of the improved YOLOv8 bolt area detection model, and helping the improved YOLOv8 bolt area detection model to capture richer contextual information, thereby improving recognition accuracy; a downsampling convolutional layer is used to reduce the width and height of the feature map to reduce its resolution, thereby reducing the amount of calculation and allowing the improved YOLOv8 bolt area detection model to capture features at a deeper level.

[0087] Among them, the structure and connection relationship of the improved YOLOv8 bolt area detection model are as follows: Figure 3 As shown, it includes a backbone network end, a neck network end and a head network end, the backbone network end is used for feature extraction, the neck network end is used for feature fusion, and the head network end is responsible for target detection tasks, namely, including predicting bounding boxes, categories and confidences; wherein, the backbone network end includes a first convolutional layer, a second convolutional layer, a first structure re-parameterized feature reuse module, a first down-sampling convolutional layer, a second structure re-parameterized feature reuse module, a second down-sampling convolutional layer, a third structure re-parameterized feature reuse module, a third down-sampling convolutional layer, a fourth structure re-parameterized feature reuse module and a multi-scale feature aggregation pyramid module; wherein, the neck network end includes a first up-sampling module, a first connection module, a first residual connection module, a second up-sampling module, a second connection module, a second residual connection module, a third convolutional layer, a third connection module, a third residual connection module, a fourth convolutional layer, a fourth connection module, and a fourth residual connection module; wherein, the head network end includes a large detection head, a medium detection head and a small detection head.

[0088] S13. Inputting the labeled tandem steel wire subway bogie bolt image dataset into the improved YOLOv8 bolt area detection model for training, and obtaining a trained improved YOLOv8 bolt area detection model for identifying the area where the 8-shaped tandem anti-loosening steel wire tandem bolts are located.

[0089] Specifically, step S13 specifically includes S131-S133:

[0090] S131. Input the labeled tandem steel wire subway bogie bolt image dataset into the backbone network of the improved YOLOv8 bolt area detection model for feature extraction to obtain feature maps of different scales.

[0091] S132. Input feature maps of different scales into the neck network end of the improved YOLOv8 bolt area detection model for feature fusion to obtain fused features of different scales.

[0092] S133. Input the fusion features of different scales into the head network end of the improved YOLOv8 bolt area detection model to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located, and obtain a trained improved YOLOv8 bolt area detection model, which is used to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located.

[0093] In this embodiment, the setting conditions of the training process of the improved YOLOv8 bolt area detection model are: epoch is set to 300 times, batch-size is set to 4, and learning rate is set to 0.01. After the training is completed, the optimal weight model is automatically saved and used as a model for component detection. The model is used to identify the area with the 8-shaped anti-loosening steel wire and save the recognition result, where the recognition result is as follows: Figure 2 shown.

[0094] S2. Input the area where the 8-shaped anti-loosening steel wire and the 8-shaped anti-loosening steel wire are located into the trained U-net network for identification, and determine whether the output result of the trained U-net network is an image containing both sides of the 8-shaped anti-loosening steel wire. If so, execute step S3, otherwise, the output is abnormal; wherein, the two sides of the 8-shaped anti-loosening steel wire are two lines of different colors, namely, the first color line and the second color line.

[0095] In this embodiment, the U-net network is selected to identify the two sides of the 8-character anti-loosening steel wire in the area where the 8-character series anti-loosening steel wire series bolts are located, and its purpose is to achieve more accurate target segmentation and improve detection accuracy. After training and optimization, the U-net network has a recognition accuracy rate of 94.5%, ensuring the precise positioning of the anti-loosening steel wire area during screening and further identification. As an efficient image segmentation model, U-Net can accurately extract the edges and details of the target area. In this application, U-Net can accurately segment the two sides of the 8-character anti-loosening steel wire, thereby extracting clear contours and providing reliable data support for subsequent bolt detection and analysis. By using U-Net for regional segmentation, it is helpful to reduce background interference and improve the accuracy of data processing. Bolts and anti-loosening steel wires are usually in a complex background, and traditional detection methods are easily affected by environmental noise. U-Net can efficiently isolate the anti-loosening steel wire area, exclude irrelevant background parts, and significantly improve detection accuracy. In addition, the segmented precise area also lays a good foundation for subsequent skeleton extraction, angle calculation and curve fitting, ensuring that further feature analysis is more accurate and helpful to judge the looseness of bolts. Among them, the data set for U-net network training is: bolt data set with steel wire, and the conditions set during training are: epoch is set to 100 times, batch-size is set to 4, learning rate is set to 0.01, num-classes is set to 3, and the network skeleton is selected using the visual geometry group network (VGG network), and the size of the input image is 512*512. Finally, the trained U-net network is used to identify whether the area where the 8-character series anti-loosening steel wire series bolt is located contains two line categories. The recognition results are as follows: Figure 4 As shown, two lines of different colors are identified, namely a first color line and a second color line, wherein the first color line is a red line and the second color line is a green line.

[0096] S3. Binarize the image including both sides of the 8-shaped anti-loosening steel wire to obtain a binarized image including both sides of the 8-shaped anti-loosening steel wire, and perform skeleton extraction to obtain a first single pixel line and a second single pixel line by removing the edge portion of the color line.

[0097] In the present embodiment, the purpose of binarization operation on the image containing both sides of the 8-character anti-loosening steel wire is to enhance the contrast of the target area and highlight the structural characteristics of the anti-loosening steel wire. Through binarization, the anti-loosening steel wire area in the image can be separated from the background, and the anti-loosening steel wire is displayed as a white area, and the background is black, thereby simplifying the feature extraction process of the image, which is convenient for subsequent skeleton extraction and morphological analysis. In addition, the binarization operation helps to reduce noise interference, making the target area clearer and easier to handle. The purpose of skeleton extraction is to extract the center line of the anti-loosening steel wire, thereby obtaining the key information of its geometric form. Skeleton extraction can simplify the outline of the anti-loosening steel wire into a linear representation, retaining its topological structure and shape characteristics, which is important for subsequent angle calculation, curve fitting and bolt loosening detection. By extracting the skeleton, the curvature and direction of the anti-loosening steel wire can be more accurately analyzed, and then it is judged whether it is loose. Skeleton extraction not only reduces the complexity of data processing, but also improves the accuracy and efficiency of analysis.

[0098] Specifically, step S3 specifically includes S31-S32:

[0099] S31, using the Ostu threshold segmentation method to perform a binarization operation on the image containing both sides of the 8-shaped anti-loosening steel wire, to obtain a binarized image containing both sides of the 8-shaped anti-loosening steel wire.

[0100] In this example, the Ostu threshold segmentation method is used for binarization. This method improves the efficiency and accuracy of segmentation by automatically selecting the optimal threshold. This method automatically calculates a global optimal threshold by analyzing the grayscale histogram of the image, reducing the need for manual adjustment and the risk of human intervention. At the same time, the Otsu method can maximize the inter-class variance, thereby effectively improving the segmentation quality of the foreground and background, especially highlighting the target area in complex backgrounds. In addition, this method is highly adaptable and can handle a variety of image features, reduce the impact of noise, and improve the clarity of the segmentation results. The Ostu threshold segmentation method is used to automatically select the optimal threshold for binarization. The specific operation process is as follows:

[0101] Specifically, step S31 includes S311-S315:

[0102] S311, calculate the zero-order matrix of the grayscale histogram of the images on both sides of the 8-shaped anti-loosening wire, that is:

[0103]

[0104] Where k represents the grayscale value range of the pixel points in the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening wire, i represents the grayscale value of the pixel point, zeroCM represents the zero-order matrix, and zeroCM(k) represents the cumulative sum of the zero-order matrix, that is, the cumulative sum of the normalized grayscale histogram from grayscale value 0 to k. I Represents the normalized grayscale histogram of the image on both sides of the 8-shaped anti-loosening wire. I (i) represents the proportion of pixels with gray value i in the normalized gray histogram.

[0105] In this embodiment, zeroCM(k) is mainly used to measure the proportion of the number of pixels in the image whose grayscale values ​​are in the range of 0 to k to the entire image; in addition, histogram I (i) It is mainly used to measure the frequency of each gray value relative to the total number of all pixels in the image.

[0106] S312, calculating the first-order cumulative matrix of the grayscale histogram of the image on both sides of the 8-shaped anti-loosening wire, that is:

[0107]

[0108] Among them, oneCM represents a first-order cumulative matrix, and oneCM(k) represents the cumulative sum of the first-order cumulative matrix.

[0109] In this embodiment, oneCM(k) accumulates the intensity contribution of pixels in the grayscale value range from 0 to k, which is a weighted summation of grayscale levels, and is used to reflect the center of grayscale value distribution or the trend of brightness change.

[0110] S313, calculating the grayscale average value of the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening steel wire, that is:

[0111] mean=oneCM(255)

[0112] Here, mean represents the average value.

[0113] S314, calculating the variance of the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening wire, that is:

[0114]

[0115] Among them, σ 2 Represents variance.

[0116] In this embodiment, k is calculated using the above formula, so as to select the threshold of the Ostu threshold segmentation method.

[0117] S315. Based on the variance of the grayscale histogram of the image including both sides of the figure-8 anti-loosening steel wire, the largest variance is selected, and the grayscale value corresponding to the largest variance is used as the threshold of Ostu threshold segmentation to binarize the image including both sides of the figure-8 anti-loosening steel wire, so as to obtain a binarized image including both sides of the figure-8 anti-loosening steel wire.

[0118] S32, performing skeleton extraction on the binary image including both sides of the 8-shaped anti-loosening steel wire, and obtaining a first single-pixel line and a second single-pixel line by removing the edge portion of the color line.

[0119] In this embodiment, the binarized image containing both sides of the 8-shaped anti-loosening steel wire is used as a temporary image, and the skeleton is extracted using the 8-neighborhood method to remove the edge portions of the first color line and the second color line, and convert the first color line and the second color line into single-pixel lines, so that the angle between the two single-pixel lines can be calculated in the subsequent steps.

[0120] Specifically, step S32 specifically includes S321-S325:

[0121] S321, divide the pixels to be processed and number them as P1.

[0122] S322. Obtain 8 neighboring pixels centered on the pixel to be processed, wherein the 8 neighboring pixels of the pixel to be processed are respectively located at the top, upper right, right, lower right, bottom, lower left, left, and upper left of the pixel to be processed, and are numbered P2, P3, P4, P5, P6, P7, P8, and P9 in sequence.

[0123] In this embodiment, the schematic diagram of the positions of the eight neighboring pixels of the pixel to be processed is as follows: Figure 5 As shown, the eight neighboring pixels of the pixel to be processed are respectively located at the top, upper right, right, lower right, bottom, lower left, left, and upper left of the pixel to be processed.

[0124] S323, determining whether the eight neighboring pixels of the pixel to be processed meet the first deletion condition or the second deletion condition, if so, deleting the pixel to be processed, otherwise, retaining the pixel to be processed.

[0125] S324, repeating steps S321-S323 until there are no pixels to be deleted in the temporary image, and the edge portion removal process is completed, thereby obtaining a plurality of first single pixel points and a plurality of second single pixel points;

[0126] Among them, the first deletion condition is:

[0127]

[0128] Among them, the second deletion condition is:

[0129]

[0130] Wherein, N represents the number of non-zero values ​​in the eight neighboring pixels of the pixel to be processed, and N(1) represents the number of changes from 0 to 1 when the eight neighboring pixels of the pixel to be processed are used as the sequence.

[0131] S325 , fitting a plurality of first single pixel points to obtain a first single pixel line, and fitting a plurality of second single pixel points to obtain a second single pixel line.

[0132] In this embodiment, the schematic diagram of the skeleton extraction is as follows: Figure 6 As shown, Figure 6 A first single pixel line and a second single pixel line are shown.

[0133] S4. Calculate the angle between the first single pixel line and the second single pixel line, and determine whether the angle is less than a set threshold. If so, output an abnormality. Otherwise, execute step S5.

[0134] In this embodiment, the slope of the first single-pixel line can be calculated using a single pixel point on the first single-pixel line. Similarly, the slope of the second single-pixel line can be calculated using a single pixel point on the second single-pixel line. Therefore, according to the slope of the first single-pixel line and the slope of the second single-pixel line, the angle between the first single-pixel line and the second single-pixel line can be calculated. The purpose of calculating the angle between the first single-pixel line and the second single-pixel line is: when the angle between the two lines is less than the threshold, the output is abnormal. The purpose of using the angle for judgment is to prevent the U-net network from identifying the same line as two lines. In addition, according to the series connection method of the steel wire at the end of the shaft, the threshold is set to 18°-23°, which is a reasonable range.

[0135] Specifically, the calculation formula of the angle between the first single pixel line and the second single pixel line in step S4 is:

[0136]

[0137] Wherein, θ represents the angle between the first single pixel line and the second single pixel line, arctan represents the inverse tangent function, m1 represents the slope of the first single pixel line, m2 represents the slope of the second single pixel line, and x 12 ,y 12 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 2 on the first single pixel line, x 11 ,y 11 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 1 on the first single pixel line, x 22 ,y 22 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 2 on the second single pixel line, x 21 ,y 21They respectively represent the horizontal coordinate and the vertical coordinate of the single pixel point 1 on the second single pixel line.

[0138] S5. Extract the spaced pixel points in the first single pixel line and perform rectangular coordinate conversion, and obtain a fitting curve of the spaced pixel points by fitting the spaced pixel points under the rectangular coordinates.

[0139] In this embodiment, the fitting method is the random sampling consensus method (RANSAC). The purpose of selecting the random sampling consensus method is to improve the robustness to outliers in the data set. The random sampling consensus method can automatically identify and remove points that do not conform to the model in the presence of noise and outliers, thereby ensuring that the fitting result is more accurate and stable. The fitting curve of the interval pixel point obtained by fitting is as follows: Figure 7 As shown in the figure, since the actual origin of the image coordinate system is in the upper left corner of the image, it is extremely inconvenient to observe the pixel line in the coordinate system at this time. Therefore, the pixel coordinate axis is inverted in the figure. The solid line in the figure is the standard curvature of this method. Figure 7 The first single pixel line represented by the spaced pixel points shown in the figure has a good fitting effect, the steel wire has no obvious deformation, and the bolt is not loose. In addition, Figure 7 The horizontal and vertical coordinates are the pixel coordinates of the image, that is, the width and height of the image.

[0140] Specifically, step S5 includes S51-S54:

[0141] S51. Based on the first single pixel line, obtain a plurality of first single pixel points of the first single pixel line.

[0142] S52, saving the first single pixel point at the position every 10 first single pixel points, and calling it an interval pixel point, and obtaining a plurality of interval pixel points and coordinates.

[0143] S53, converting the coordinates of the plurality of spaced pixel points into a rectangular coordinate system to obtain the plurality of spaced pixel points in the rectangular coordinate system.

[0144] S54, fitting a plurality of spaced pixel points in a rectangular coordinate system to obtain a spaced pixel point fitting curve.

[0145] S6. Select the curve segments of the interval pixel point fitting curve in the first curve coordinate value interval and the second curve coordinate value interval to obtain the first curve segment and the second curve segment, and calculate the curvature of each interval pixel point in the first curve segment and the second curve segment to obtain the curvature value of each interval pixel point, and determine whether the maximum curvature value is greater than the standard curvature. If so, the bolt is loose, otherwise, the bolt is not loose.

[0146] In this embodiment, according to the fitting curve of the interval pixel points, curve segments with curve coordinate values ​​between 400-900 (first curve coordinate value interval) and 1000-1700 (second curve coordinate value interval) are selected, that is, the first curve segment and the second curve segment are used as curve segments for calculating the curvature. The purpose of this selection is that these two curve segments are the main deformation areas, so by checking these two curve segments, it is possible to determine whether the bolt is loose.

[0147] Specifically, the calculation formula for the curvature of each interval pixel point in the first curve segment and the second curve segment in step S6 is:

[0148]

[0149] Among them, k ′ Indicates the curvature of each pixel interval in the first curve segment or the second curve segment, y ′ Represents the first derivative of the first curve segment or the second curve segment at a certain interval pixel point, y ′″ Indicates the second-order derivative of the first curve segment or the second curve segment at a certain interval pixel point.

[0150] In summary, the bogie bolt loosening detection method based on series steel wire proposed in the present invention, the improved YOLOv8 model and U-net network adopted show excellent accuracy and stability in bolt area detection and anti-loosening steel wire identification respectively; specifically, the improved YOLOv8 bolt area detection model can accurately identify the series bolt area of ​​the 8-shaped series anti-loosening steel wire, and the recognition accuracy rate reaches 96.7%, which significantly improves the reliability of detection and effectively reduces missed detection and false detection; at the same time, the U-net network is used to identify the two side areas of the 8-shaped anti-loosening steel wire. After training and optimization, the recognition accuracy rate reaches 94.5%, ensuring the precise positioning of the anti-loosening steel wire area during screening and further identification, and providing reliable data support for subsequent analysis; secondly, by combining the advantages of YOLOv8 and U-net, and supplemented by skeleton extraction, angle calculation and curve fitting to analyze the loosening of bolts, the recognition accuracy rate of the overall algorithm reaches 95.3%. Tested in a variety of environments, the method demonstrated strong robustness and stability, with low variance in recognition results, and the algorithm was able to maintain a consistent high recognition rate and low error level even in complex backgrounds and with large changes in illumination; therefore, these results indicate that the improved detection method not only improves the efficiency and accuracy of bolt loosening detection, but also provides a reliable intelligent solution for bogie maintenance.

[0151] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0152] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A method for detecting loose bolts of a bogie based on series steel wires, characterized in that: The following steps are involved: S1. Use the improved YOLOv8 bolt area detection model to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located; S2, input the area where the 8-shaped series anti-loosening steel wire series bolt is located into the trained U-net network for identification, and determine whether the output result of the trained U-net network is an image containing both sides of the 8-shaped anti-loosening steel wire. If so, execute step S3, otherwise, the output is abnormal; Among them, the two sides of the 8-shaped anti-loosening steel wire are two lines of different colors, namely the first color line and the second color line; S3, performing a binarization operation on the image including both sides of the 8-shaped anti-loosening steel wire to obtain a binarized image including both sides of the 8-shaped anti-loosening steel wire, and performing skeleton extraction to obtain a first single pixel line and a second single pixel line by removing the edge portion of the color line; S4, calculating the angle between the first single pixel line and the second single pixel line, and determining whether the angle is less than a set threshold, if so, outputting an abnormality, otherwise, executing step S5; S5, extracting the spaced pixel points in the first single pixel line and performing rectangular coordinate conversion, and obtaining a fitting curve of the spaced pixel points by fitting the spaced pixel points under the rectangular coordinates; S6. Select the curve segments of the interval pixel point fitting curve in the first curve coordinate value interval and the second curve coordinate value interval to obtain the first curve segment and the second curve segment, and calculate the curvature of each interval pixel point in the first curve segment and the second curve segment to obtain the curvature value of each interval pixel point, and determine whether the maximum curvature value is greater than the standard curvature. If so, the bolt is loose, otherwise, the bolt is not loose.

2. The method for detecting loose bolts of a bogie based on series steel wires according to claim 1 is characterized in that: Step S1 specifically includes: S11, obtaining a series of steel wire subway bogie bolt image data sets, and using annotation software to annotate the label data of the series of steel wire subway bogie bolt image data sets to obtain a series of steel wire subway bogie bolt image data sets with labels; Among them, the label data is the area where the 8-shaped series anti-loosening steel wire series bolts are located; S12. Introduce the structural re-parameterized feature reuse module and downsampling convolution layer at the backbone network end to build an improved YOLOv8 bolt area detection model; Among them, the structural re-parameterization feature reuse module is used to fuse feature maps of different layers or different scales to achieve feature reuse; Downsampling convolution layer, used to reduce the width and height of the feature map and reduce the image resolution; S13. Inputting the labeled tandem steel wire subway bogie bolt image dataset into the improved YOLOv8 bolt area detection model for training, and obtaining a trained improved YOLOv8 bolt area detection model for identifying the area where the 8-shaped tandem anti-loosening steel wire tandem bolts are located.

3. The method for detecting loose bolts of a bogie based on series steel wires according to claim 2 is characterized in that: The improved YOLOv8 bolt area detection model includes a backbone network end, a neck network end, and a head network end; The backbone network end includes a first convolution layer, a second convolution layer, a first structure re-parameterized feature reuse module, a first down-sampling convolution layer, a second structure re-parameterized feature reuse module, a second down-sampling convolution layer, a third structure re-parameterized feature reuse module, a third down-sampling convolution layer, a fourth structure re-parameterized feature reuse module and a multi-scale feature aggregation pyramid module; The neck network end includes a first upsampling module, a first connection module, a first residual connection module, a second upsampling module, a second connection module, a second residual connection module, a third convolutional layer, a third connection module, a third residual connection module, a fourth convolutional layer, a fourth connection module, and a fourth residual connection module; The head network end includes a large detection head, a medium detection head and a small detection head.

4. The method for detecting loose bolts of a bogie based on series steel wires according to claim 3 is characterized in that: Step S13 specifically includes: S131, inputting the labeled tandem steel wire subway bogie bolt image dataset into the backbone network of the improved YOLOv8 bolt area detection model for feature extraction to obtain feature maps of different scales; S132, inputting feature maps of different scales into the neck network end of the improved YOLOv8 bolt area detection model for feature fusion to obtain fusion features of different scales; S133. Input the fusion features of different scales into the head network end of the improved YOLOv8 bolt area detection model to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located, and obtain a trained improved YOLOv8 bolt area detection model, which is used to identify the area where the 8-shaped series anti-loosening steel wire series bolts are located.

5. The method for detecting loose bolts of a bogie based on series steel wires according to claim 4 is characterized in that: Step S3 specifically includes: S31, using the Ostu threshold segmentation method to perform a binarization operation on the image containing both sides of the 8-shaped anti-loosening steel wire, to obtain a binarized image containing both sides of the 8-shaped anti-loosening steel wire; S32, performing skeleton extraction on the binary image including both sides of the 8-shaped anti-loosening steel wire, and obtaining a first single-pixel line and a second single-pixel line by removing the edge portion of the color line.

6. The method for detecting loose bolts of a bogie based on series steel wires according to claim 5 is characterized in that: Step S31 specifically includes: S311, calculate the zero-order matrix of the grayscale histogram of the images on both sides of the 8-shaped anti-loosening wire, that is: Where k represents the grayscale value range of the pixel points in the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening wire, i represents the grayscale value of the pixel point, zeroCM represents the zero-order matrix, and zeroCM(k) represents the cumulative sum of the zero-order matrix, that is, the cumulative sum of the normalized grayscale histogram from grayscale value 0 to k. I Represents the normalized grayscale histogram of the image on both sides of the 8-shaped anti-loosening wire. I (i) represents the proportion of pixels with gray value i in the normalized gray histogram; S312, calculating the first-order cumulative matrix of the grayscale histogram of the image on both sides of the 8-shaped anti-loosening wire, that is: Among them, oneCM represents the first-order cumulative matrix, oneCM(k) represents the cumulative sum of the first-order cumulative matrix; S313, calculating the grayscale average value of the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening steel wire, that is: mean=oneCM(255) Among them, mean represents the average value; S314, calculating the variance of the grayscale histogram of the image containing both sides of the 8-shaped anti-loosening wire, that is: Among them, σ 2 represents variance; S315. Based on the variance of the grayscale histogram of the image including both sides of the figure-8 anti-loosening steel wire, the largest variance is selected, and the grayscale value corresponding to the largest variance is used as the threshold of Ostu threshold segmentation to binarize the image including both sides of the figure-8 anti-loosening steel wire, so as to obtain a binarized image including both sides of the figure-8 anti-loosening steel wire.

7. The method for detecting bolt loosening of a bogie based on series steel wires according to claim 6, characterized in that: Step S32 specifically includes: S321, dividing the pixels to be processed and numbering them as P1; S322, obtaining eight neighboring pixels centered on the pixel to be processed, wherein the eight neighboring pixels of the pixel to be processed are respectively located above, upper right, right, lower right, bottom, lower left, left, and upper left of the pixel to be processed, and are numbered P2, P3, P4, P5, P6, P7, P8, and P9 in sequence; S323, determining whether the eight neighboring pixels of the pixel to be processed meet the first deletion condition or the second deletion condition, if so, deleting the pixel to be processed, otherwise, retaining the pixel to be processed; S324, repeating steps S321-S323 until there are no pixels to be deleted in the temporary image, and the edge portion removal process is completed, thereby obtaining a plurality of first single pixel points and a plurality of second single pixel points; Among them, the first deletion condition is: Among them, the second deletion condition is: Wherein, N represents the number of non-zero values ​​in the eight neighboring pixels of the pixel to be processed, and N(1) represents the number of changes from 0 to 1 when the eight neighboring pixels of the pixel to be processed are used as the order; S325 , fitting a plurality of first single pixel points to obtain a first single pixel line, and fitting a plurality of second single pixel points to obtain a second single pixel line.

8. The method for detecting loose bolts of a bogie based on series steel wires according to claim 7 is characterized in that: The calculation formula of the angle between the first single pixel line and the second single pixel line in step S4 is: Wherein, θ represents the angle between the first single pixel line and the second single pixel line, arctan represents the inverse tangent function, m1 represents the slope of the first single pixel line, m2 represents the slope of the second single pixel line, and x 12 ,y 12 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 2 on the first single pixel line, x 11 ,y 11 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 1 on the first single pixel line, x 22 ,y 22 Respectively represent the horizontal coordinate and vertical coordinate of the single pixel point 2 on the second single pixel line, x 21 ,y 21 They respectively represent the horizontal coordinate and the vertical coordinate of the single pixel point 1 on the second single pixel line.

9. The method for detecting loose bolts of a bogie based on series steel wires according to claim 8, characterized in that: Step S5 specifically includes: S51, based on the first single pixel line, obtaining a plurality of first single pixel points of the first single pixel line; S52, saving the first single pixel point at the position every 10 first single pixel points, and calling it an interval pixel point, and obtaining a plurality of interval pixel points and coordinates; S53, converting the coordinates of the plurality of spaced pixel points into a rectangular coordinate system to obtain the plurality of spaced pixel points in the rectangular coordinate system; S54, fitting a plurality of spaced pixel points in a rectangular coordinate system to obtain a spaced pixel point fitting curve.

10. The method for detecting bolt loosening of a bogie based on series steel wires according to claim 9, characterized in that: In step S6, the calculation formula for the curvature of each interval pixel point in the first curve segment and the second curve segment is: Among them, k ′ Indicates the curvature of each pixel interval in the first curve segment or the second curve segment, y ′ Represents the first derivative of the first curve segment or the second curve segment at a certain interval pixel point, y ′′ Indicates the second-order derivative of the first curve segment or the second curve segment at a certain interval pixel point.

Citation Information

Patent Citations

  • Series steel wire anti-loosening structure detection method based on machine vision

    CN111145154A

  • Bolt loosening angle recognition method and system

    CN113128400A

  • Method for detecting looseness of steel wire series connection bolt

    CN114494126A

  • Bolt looseness defect detection method, system and device

    CN114820620A

  • Bolt detection method, device, equipment and medium

    CN115511828A

Cited By

  • Method and system for repairing undergalvanized colorless plating area of a substrate

    CN122714479A

  • Method and system for repairing undergalvanized colorless plating area of a substrate

    CN122714479B