Deep learning assisted metro car body square hole lock deflection angle calculation method

By combining YOLOv4 and Mask R-CNN algorithms with geometric knowledge, the deflection angle of the square hole lock is automatically calculated, solving the problem of low efficiency in traditional manual inspection and achieving efficient and accurate inspection results.

CN115908264BActive Publication Date: 2026-05-29DALIAN QIHUI COMPUTER NETWORKS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DALIAN QIHUI COMPUTER NETWORKS CO LTD
Filing Date
2022-10-24
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Traditional manual methods for detecting the deflection angle of square hole locks are inefficient, time-consuming, and easily affected by subjective factors, making it difficult to comprehensively detect the safety status of subway vehicles.

Method used

Using the YOLOv4 object detection algorithm and the Mask R-CNN instance segmentation algorithm, combined with geometric knowledge, the deflection angle of the square hole lock is automatically calculated, including image segmentation and key point localization.

Benefits of technology

It achieves efficient and accurate detection of the deflection angle of square hole locks, avoiding the shortcomings of manual detection and providing objective analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115908264B_ABST
    Figure CN115908264B_ABST
Patent Text Reader

Abstract

The deep learning assisted subway car body square hole lock deflection angle calculation method has the characteristics that it includes the following steps: S1: using YOLOV4 algorithm to extract the square hole lock image by using a cascade detection method on the collected high-resolution image; S2: using Mask R-CNN instance segmentation algorithm to segment the square hole lock, and obtaining the mask area and positioning box information of the key parts of the square hole lock; S3: using the key part information of the segmentation result, combining geometric knowledge to obtain the key points of the parts, and then calculating the deflection angle of the square hole lock. The deep learning assisted subway car body square hole lock deflection angle calculation method provided by the application can directly use deep learning and image processing technology to realize car body square hole lock deflection angle calculation, can give objective and accurate detection analysis results, and avoids the defects of traditional manual detection methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of square hole lock deflection angle calculation, and more particularly to a deep learning-assisted method for calculating the deflection angle of a subway car square hole lock. Background Technology

[0002] Square-hole locks are a crucial barrier protecting the safe operation of subway equipment and trains. The constant vibrations from running trains can cause the lock cylinders to deflect, severely impacting operational safety. Traditional visual anomaly detection relies entirely on manual inspection, which, while accurate, has significant drawbacks. High daily train traffic makes comprehensive inspection impossible, and the long inspection time for a single train can lead to eye fatigue, increasing the false positive rate and making it highly susceptible to subjective bias. In contrast, machine-based anomaly detection effectively overcomes the limitations of manual inspection, improving train operation efficiency. Summary of the Invention

[0003] To address the problems existing in the prior art, this invention discloses a deep learning-assisted method for calculating the deflection angle of a square-hole lock on a subway car body, specifically including the following steps:

[0004] S1: The YOLOv4 target detection algorithm is used to extract the square hole lock image from the acquired high-resolution image using a cascaded detection method.

[0005] S2: Use the Mask R-CNN instance segmentation algorithm to segment the square hole lock and obtain the mask region and location box information of the key parts of the square hole lock;

[0006] S3: Utilize the key part information of the square hole lock segmentation result, combine geometric knowledge to obtain the key points of the part, and then calculate the deflection angle of the square hole lock.

[0007] The method of using the YOLOv4 target detection algorithm to extract the square hole lock image from the acquired complete high-resolution image using a cascaded detection approach includes the following steps:

[0008] a. Use the YOLOv4 detection algorithm to detect the bogie in high-resolution images.

[0009] Using the bogie positioning information, the high-resolution image is cropped into 5 parts to reduce the image resolution, and each part is recorded as a medium-resolution image.

[0010] b. Use the YOLOv4 object detection algorithm to perform box detection on the medium resolution image, and extract the box image using the box location information;

[0011] c. Use the YOLOv4 target detection algorithm to detect square-hole locks in the box image, and extract the square-hole lock image using the location information of the square-hole lock;

[0012] The process of segmenting the square hole lock using the Mask R-CNN instance segmentation algorithm to obtain the mask region and bounding box information of key parts of the square hole lock includes the following steps:

[0013] a. Mark the key parts of the square hole lock as label1, label2, and label3;

[0014] b. Use the Mask R-CNN instance segmentation algorithm to segment the aperture lock and obtain the mask regions and bounding box information of label1, label2, and label3;

[0015] The process of using the key part information of the segmentation results, combined with geometric knowledge to obtain the key points of the parts, and then calculating the deflection angle of the square hole lock includes the following steps: a. Obtaining the key point P1 of laleb1;

[0016] b. Obtain the key point P2 of laleb2;

[0017] c. Obtain the key point P3 of laleb3;

[0018] d. Calculate the deflection angle of the square hole lock using the key point information of label1, label2, and label3;

[0019] This invention provides a deep learning-assisted method for calculating the deflection angle of a subway car body square hole lock. This method has the following advantages: This invention directly utilizes deep learning and image processing technology to calculate the deflection angle of the car body square hole lock, which can provide objective and accurate detection and analysis results, avoiding the defects of traditional manual detection methods. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of the method of the present invention;

[0022] Figure 2 The label area and mask area are key components of the square hole lock of this invention;

[0023] Figure 3The flowchart for calculating the deflection angle of the square hole lock of the present invention is shown below; (a) Mask R-CNN segmentation result, (b) binary image of label1, (c) polygon fitting vertex of label1, (d) cluster center, (e) schematic diagram of straight line cutting, (f) straight line filtering result, (g) key point, (h) deflection angle.

[0024] Figure 4 This is a diagram showing the calculation results of the deflection angle of the square hole lock of the present invention;

[0025] Figure 5 This is a flowchart of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] The deep learning-assisted method for calculating the deflection angle of a square-hole lock on a subway car body, as described in this invention, is as follows: Figure 1 As shown, proceed as follows:

[0028] a. Using the YOLOv4 target detection algorithm, a cascaded detection method is employed to extract the square hole lock image from the acquired high-resolution image. The specific steps are as follows:

[0029] a.1. Locate and mark the bogies in the high-resolution image, construct a training sample set for bogie target detection, train the bogies using the YOLOv4 target detection algorithm, use the trained bogie target detection weights to detect the bogies in the high-resolution image, and use the bogie location information to crop the high-resolution image into 5 parts to reduce the image resolution. Each part of the image is denoted as the medium resolution image.

[0030] a.2. Locate and mark the boxes in the medium-resolution image obtained in step a.1, construct a training sample set for box target detection, train the boxes using the YOLOv4 target detection algorithm, use the trained box target detection weights to detect the boxes in the medium-resolution image, and use the box location information to obtain the box image.

[0031] a.3. Locate and mark the square hole locks on the box obtained in step a.2, construct a training sample set for square hole lock target detection, train the square hole locks using the YOLOv4 target detection algorithm, use the trained square hole lock target detection weights to detect the square hole locks on the box, and use the location information of the square hole locks to obtain square hole lock images.

[0032] b. Use the Mask R-CNN instance segmentation algorithm to segment the square hole lock, and obtain the mask region and localization box information of the key parts of the square hole lock, including the following steps:

[0033] b.1. Label the key parts of the square hole lock as label1, label2, and label3, and construct a semantic segmentation training dataset. The labeling results are as follows: Figure 2 As shown, Figure 2 (a) is the location frame information for key parts. Figure 2 (b) is the mask area for critical parts.

[0034] b.2. Using the semantic segmentation model trained in b.1, segment the square hole lock to obtain the mask regions and bounding boxes of label1, label2, and label3. The result is shown in the figure below. Figure 3 (a) c. Using the key part information from the segmentation results in step b.2, and combining geometric knowledge, the key points of the parts are obtained, and then the deflection angle of the square hole lock is calculated, including the following steps:

[0035] c.1. Map the mask region of label1 to the binary image, such as... Figure 3 As shown in (b), the contour coordinates of the mask region are obtained. First, a polygon fitting algorithm is used to fit the contour curve. The corner coordinates after fitting are shown in the figure. Figure 3 As shown in (c), the K-means clustering algorithm is then used to cluster the fitted coordinates to accurately obtain the four corner points of label1. The clustering results are as follows. Figure 3 As shown in (d), the centroids of the four corner points are calculated as the key information P1 of label1. The coordinates of the key points of P1 are as follows: Figure 3 As shown in (d);

[0036] c.2. Map the mask region of label2 to a binary image. Use an ellipse fitting algorithm to calculate the coordinates of the center point P2 of the ellipse in the mask region. This center point is the temporary keypoint coordinates of label2. Then, connect the lines P1 and P2. We can see that lines P1 and P2 intersect lines AB and CD at points E and F, respectively. This indicates that the opening direction of the square hole lock is either line AB or line CD, because the opening direction of the square hole lock is on the same side as points P2 and P1. Vectors can be used to... with vector sum vector The opening direction of the square hole lock is determined by the cosine of the angle between the two points. That is, the direction where the cosine of the angle is 1 is the opening direction. As shown in the figure, the opening direction of the square hole lock is the straight line CD. The intersection point P' of the perpendicular lines drawn from point P1 to the straight line CD is the coordinate point P2 after label2 is adjusted. Figure 3 Point P2 in (g) is shown;

[0037] c.3. Use the center point of the regression box of label3 as the key point of label3, such as... Figure 3 As shown in point P3 of (g);

[0038] c.4. Calculate using the key point information of P1, P2, and P3 and the inverse cosine function. Determine the relative position of P2 with respect to P3 to calculate the deflection angle of the square hole lock. The result is shown in the figure below. Figure 3 As shown in (h);

[0039] Figure 4 The diagram shows a comparison of the rotation angles of a square hole lock in different directions. The experimental results indicate that the present invention can be subjectively seen to be correct in calculating the deflection direction of the square hole lock, which also shows that the present invention can accurately calculate the deflection angle of the square hole lock.

[0040] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for calculating the deflection angle of a square-hole lock on a subway car body based on deep learning assistance, characterized in that, Includes the following steps: S1: Use the YOLOv4 algorithm to extract the square hole lock image from the acquired high-resolution image using a cascaded detection method; S2: Use the Mask R-CNN instance segmentation algorithm to segment the square hole lock and obtain the mask region and location box information of the key parts of the square hole lock; S3: Utilizing the key part information from the segmentation results, combined with geometric knowledge, key points of the parts are obtained, and then the deflection angle of the square hole lock is calculated, including the following steps: Mark the key parts of the square hole lock as label1, label2, and label3; Map the mask region of label1 to a binary image to obtain the contour coordinates of the mask region. First, use a polygon fitting algorithm to fit the contour curve, and then use a K-means clustering algorithm to cluster the fitted coordinates to accurately obtain the information of the four corner points ABCD of label1. Obtain the clustering results and calculate the centroid of the four corner points as the key information P1 of label1. Mapping the mask region of label2 to a binary image, and using an ellipse fitting algorithm to calculate the center point coordinates P2 of the ellipse in the mask region, which are the temporary keypoint coordinates of label2, we can then connect lines P1P2 and find that lines P1P2 intersect lines AB and CD at points E and F, respectively. This allows us to determine whether the opening direction of the square hole lock is line AB or line CD. Using vectors... with vector sum vector The cosine of the included angle is used to determine the opening direction of the square hole lock. That is, the direction in which the cosine of the included angle is 1 is the opening direction. The opening direction of the square hole lock is the straight line CD. The intersection point P' of the perpendicular lines drawn from point P1 to the straight line CD is the coordinate point P2 after label2 is adjusted. Use the center point of the regression box of label3 as the key point of label3; Using the key information of P1, P2, and P3 and the inverse cosine function, calculate Determine the relative position of P2 with respect to P3 to calculate the deflection angle of the square hole lock. ; The YOLOv4 target detection algorithm is used to extract the square hole lock image from the acquired complete image using a cascaded detection method. The process includes the following steps: using the YOLOv4 detection algorithm to detect the bogie in the high-resolution image; using the bogie positioning information, the high-resolution image is cropped into 5 parts to reduce the image resolution, and each part is recorded as a medium-resolution image; using the YOLOv4 object detection algorithm to detect the box body in the medium-resolution image; using the box body positioning information, the box body image is extracted; using the YOLOv4 object detection algorithm to detect the square hole lock in the box body image; using the square hole lock positioning information, the square hole lock image is extracted. The Mask R-CNN instance segmentation algorithm was used to segment the square hole lock, and the mask region and location box information of the key parts of the square hole lock were obtained.

2. The method for calculating the deflection angle of a subway car body square hole lock based on deep learning assistance as described in claim 1, characterized in that: Includes the following steps: Keypoint P1 of laleb1 is obtained; keypoint P2 of laleb2 is obtained; The key point P3 of label1, label2, and label3 is obtained; the deflection angle of the square hole lock is calculated using the key point information of label1, label2, and label3.