Train square hole lock loosening detection method and device based on key point recognition, and medium

By directly identifying the position and loosening angle of the train's square hole lock using a deep learning key point detection algorithm, the problem of low detection efficiency and low accuracy in existing technologies is solved, and high-precision loosening detection is achieved.

CN117765518BActive Publication Date: 2026-11-27HEFEI CSG SMART ROBOT TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311867264.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2026-11-27
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

In existing technologies, the detection of loose square hole locks on trains relies on manual inspection of visual anomalies, which is inefficient and inaccurate. Machine vision-based methods suffer from accuracy loss, especially in the process of converting contours into key points.

Method used

A key point detection algorithm based on deep learning is adopted. Through image training and recognition, the position and loosening angle of the square hole lock are directly identified. The YOLOv8-pose model is used to identify the rectangular box and key point coordinate information. The angle deviation between the lock cylinder and the lock ring is calculated by using the cosine law, and a threshold is set to judge loosening.

Benefits of technology

It improves detection accuracy, simplifies the process, avoids the accuracy loss caused by image processing from contour to key points, and achieves efficient end-to-end loosening detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117765518B_ABST
    Figure CN117765518B_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for detecting loose square-hole locks on trains based on key point recognition. It includes image training and image recognition, enabling the detection of the square-hole lock's position and determination of its looseness, as well as the angle of looseness, using a single image. The image acquisition process comprises two stages: In the train inspection robot implementation stage, navigation point information is set for the robot, and the robotic arm is taught, with parameters for the industrial camera mounted on the robotic arm configured; during the train inspection process, the robot moves to the set points and captures images of the train side containing the square-hole lock using the industrial camera; once image acquisition is complete, model training begins, and the trained model is used for recognition. This invention, considering the component characteristics and lock cylinder rotation features of square-hole locks, employs a data augmentation method that simulates lock cylinder rotation to prevent loosening, effectively expanding the dataset and avoiding the workload associated with manually loosening the lock cylinder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of train defect detection technology, specifically to a method, device, and storage medium for detecting loose square hole locks on trains based on key point identification. Background Technology

[0002] Square-hole locks on trains are used to lock equipment boxes, covers, etc., and are an important barrier to protect the safe operation of subway equipment and vehicles. Due to the continuous vibrations of the train during operation, the lock cylinders of these square-hole locks can deflect, seriously affecting the operational safety of the train. Traditional visual anomaly detection relies on manual inspection, using the human eye for inspection. Because there are numerous square-hole locks on the train, an inspection trip takes a long time, and the accuracy is easily affected by factors such as fatigue. Machine vision-based defect detection, however, is fully automated, greatly improving the efficiency of train defect and anomaly detection.

[0003] Existing solutions include those using deep learning, but the recognition methods employ instance segmentation or semantic segmentation. First, the outlines of each sub-component of the square hole lock (such as the lock cylinder triangle) are segmented. Then, image processing methods such as fitting and clustering are used to find key points. Finally, the angles are calculated by connecting the key points. This is a two-stage process, and the post-processing based on the outline is prone to losing accuracy, resulting in low precision and a complex process.

[0004] Meanwhile, existing solutions first need to segment the contours of sub-components based on instance segmentation or semantic segmentation, and then calculate key points (which may be vertices or edge points of the contour) based on the contours through image processing. The accuracy of instance segmentation or semantic segmentation algorithm models is calculated by the overlap ratio between the actual contour and the detected contour. Since the contour is a surface, there are often high overlap ratios, but the key point positions are not accurately identified. Summary of the Invention

[0005] The present invention proposes a method, device and storage medium for detecting loosening of train square hole locks based on key point recognition, which can at least solve one of the technical problems in the background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A method for detecting loose square hole locks on trains based on key point recognition includes two processes: image training and image recognition. It can detect the position of the square hole lock and determine whether the square hole lock is loose and the angle of loosening through a single image.

[0008] The image acquisition process consists of two stages;

[0009] During the implementation phase of the inspection robot, the robot's navigation point information is set, and the robotic arm is taught and the parameters of the industrial camera mounted on the robotic arm are set.

[0010] During the inspection and patrol process, the robot moves to the set point and captures images of the train side including square hole locks through an industrial camera.

[0011] Once image acquisition is complete, model training begins. Once training is complete, the trained model is used for recognition.

[0012] Furthermore, the model training steps are as follows:

[0013] S11. Label the image. First, use rectangles to label the coordinate information of the square hole lock, and use points to label the key point information. The key point information includes: the coordinate information of the three vertices of the lock core triangle P1, P2, and P3, and the coordinate information of the vertices of the lock notch P4.

[0014] S12. Data augmentation; Image processing is used to simulate the loosening of a square hole lock;

[0015] S13. The image and label are fed into the keypoint detection deep learning model network for training.

[0016] Furthermore, the specific steps of S12, data enhancement, are as follows:

[0017] Use the outline annotation tool to mark the location of the lock cylinder;

[0018] Calculate the center position P of the lock cylinder;

[0019] With point P as the center, randomly set an angle θ within the range of 0-360° to rotate the lock cylinder area.

[0020] Furthermore, once the model training is complete, the trained model is used for recognition. The recognition steps are as follows:

[0021] S21. The acquired image is identified by a key point detection model based on deep learning, and the rectangular box and key point coordinate information of the square hole lock are identified.

[0022] S22. Obtain the angular deviation between the lock cylinder and the lock ring by using the coordinate information of key points, and set a threshold to determine whether the square hole lock has become loose and the angle of loosening.

[0023] Furthermore, the key point detection algorithm yolov8-pose based on deep learning is adopted. The acquired image is identified by the yolov8-pose model, and the rectangular frame of the square hole lock and the key point coordinate information of lock core vertices P1, P2, and P3, and lock ring notch vertex P4 are identified.

[0024] Furthermore, it also includes angle calculation; connect P1 and P2 to form line segment L1, draw a perpendicular line from point P3 to line segment L1 to obtain L2, calculate the centroid of triangle P1P2P3 as P5, connect P5 and P4 to obtain line segment L3, the angle between L1 and L3 is the angle of loosening of the square hole lock, set the threshold to γ ​​degrees, when the angle of loosening of the square hole lock is greater than γ degrees, the square hole lock is loose;

[0025] Using the law of cosines, the angle between line segments L2 and L3 is:

[0026]

[0027] The deflection angle θ is:

[0028]

[0029] Let counterclockwise be rad>0, θ∈(0, 180), and clockwise be rad<0, θ∈(-180, 0).

[0030] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.

[0031] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.

[0032] As can be seen from the above technical solutions, in summary, the method for detecting loose square hole locks based on a deep learning keypoint detection algorithm in this embodiment of the invention identifies key points of the square hole lock based on a deep learning keypoint detection model and calculates the loosening angle of the square hole lock accordingly. Simultaneously, considering the component characteristics and lock cylinder rotation characteristics of the square hole lock, a data augmentation method simulating the loosening of the square hole lock by rotating the lock cylinder is adopted, effectively expanding the dataset and avoiding the workload caused by manually loosening the lock cylinder of the square hole lock.

[0033] In summary, the embodiments of the present invention do not require post-processing based on image processing to complete the conversion from contours to key points; instead, they directly utilize an end-to-end deep learning mechanism to perform key point detection. This avoids the accuracy loss caused by image processing in the contour-to-key point conversion process.

[0034] This invention employs keypoint detection based on deep learning, followed by angle calculation through line connection. It features end-to-end learning, fully utilizing the expressive power of deep learning, eliminating the need for subsequent image processing steps, and avoiding accuracy loss due to post-processing. As a one-stage processing method, it is more versatile.

[0035] Meanwhile, this invention directly identifies key points in one step through deep learning and key point detection. The accuracy of the model is the positional deviation between the detected key points and the actual key points. Therefore, it fully utilizes the learning capabilities of deep models to improve recognition accuracy. It also eliminates the post-processing step from contour to key points, simplifying the recognition process. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the method of the present invention;

[0037] Figure 2 This is an example diagram of a square hole lock and key features according to an embodiment of the present invention;

[0038] Figure 3 This is an example diagram showing data enhancement, lock cylinder outline, and center point in an embodiment of the present invention;

[0039] Figure 4 This is an example of image enhancement and simulation of a loose square hole lock according to an embodiment of the present invention;

[0040] Figure 5 This is a schematic diagram illustrating angle calculation in an embodiment of the present invention. Detailed Implementation

[0041] 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 some embodiments of the present invention, but not all embodiments.

[0042] like Figure 1 As shown, this invention discloses a method for detecting loose square hole locks based on a deep learning keypoint detection algorithm, comprising two processes: image training and image recognition. It can detect the position of the square hole lock and determine whether the lock is loose, as well as the angle of looseness, using a single image.

[0043] The image acquisition process consists of two stages.

[0044] During the implementation phase of the inspection robot, the robot's navigation point information is set, and the robotic arm is taught, and the parameters of the industrial camera mounted on the robotic arm are set.

[0045] During the train inspection process, the robot moves to the set points and uses an industrial camera to capture images of the train side, including square-hole locks.

[0046] Once image acquisition is complete, model training begins. The training steps are as follows:

[0047] S11. Label the image as shown below. First, label the coordinate information (fks) of the square hole lock using a rectangle, and then label the key point information using points. The key point information includes: the coordinate information of the three points of the lock cylinder triangle (P1, P2, P3), and the coordinate information of the lock notch point (P4), as follows. Figure 2 As shown.

[0048] S12. Data Augmentation. The acquired images generally show that the square-hole lock is not loose. Manually turning the lock cylinder would require a significant amount of manpower; therefore, image processing is used to simulate the lock's loosening.

[0049] 1. Use the outline annotation tool to mark the location of the lock cylinder (e.g., Figure 3 ).

[0050] 2. Calculate the center position P of the lock cylinder (e.g., Figure 3 ).

[0051] 3. Using point P as the center, randomly set an angle θ within the range of 0-360° and rotate the lock cylinder area.

[0052] 4. Set the original lock cylinder area pixels to 0, and then cover the original image with the rotated lock cylinder area.

[0053] An image of a simulated square-hole lock is shown below. Figure 4 As shown.

[0054] S13. The image and labels (coordinate information of the rectangular box of the square hole lock and coordinate information of key points P1P2P3P4) are fed into the key point detection deep learning network for training.

[0055] Once the model is trained, it can be used for recognition. The steps are as follows:

[0056] S21. The acquired image is recognized by a key point detection deep learning model to identify the rectangular frame and key point coordinates of the square hole lock.

[0057] S22. Obtain the angular deviation between the lock cylinder and the lock ring by using the coordinate information of key points, and set a threshold to determine whether the square hole lock has become loose and the angle of loosening.

[0058] The following are detailed explanations:

[0059] Step 1: Using the deep learning-based keypoint detection algorithm YOLOv8-pose, the acquired images are processed by the YOLOv8-pose model to identify the rectangular frame of the square hole lock and the coordinates of key points: lock core vertices P1, P2, and P3, and lock ring notch vertex P4 (e.g., ...). Figure 5 (As shown).

[0060] Step 2: Process the square hole locks within each rectangle sequentially.

[0061] Step 3: Angle Calculation. Connect P1 and P2 to form line segment L1. Draw a perpendicular line from point P3 to line segment L1 to obtain L2. Calculate the centroid of triangle P1P2P3 as P5. Connect P5 and P4 to obtain line segment L3. The angle between L1 and L3 is the angle at which the square hole lock is loose. Set the threshold to 10 degrees. When the angle at which the square hole lock is loose is greater than 10 degrees, the square hole lock is considered loose.

[0062] Using the law of cosines, the angle between line segments L2 and L3 is:

[0063]

[0064] The deflection angle θ is (assuming counterclockwise is rad > 0, θ ∈ (0, 180), clockwise is rad < 0).

[0065] θ∈(-180, 0))

[0066]

[0067] In summary, the method for detecting loose square hole locks based on a deep learning keypoint detection algorithm in this embodiment of the invention identifies key points of the square hole lock using a deep learning keypoint detection model and calculates the loosening angle based on these points. Furthermore, considering the component characteristics and lock cylinder rotation features of the square hole lock, a data augmentation method simulating lock cylinder rotation to loosen the lock is adopted, effectively expanding the dataset and avoiding the workload of manually loosening the lock cylinder.

[0068] In summary, the embodiments of the present invention do not require post-processing based on image processing to complete the conversion from contours to key points; instead, they directly perform key point detection through an end-to-end deep learning mechanism. This avoids the accuracy loss caused by image processing in the contour-to-key point conversion process.

[0069] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.

[0070] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.

[0071] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the train square hole lock loosening detection methods based on key point recognition in the above embodiments.

[0072] It is understood that the system provided in the embodiments of the present invention corresponds to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.

[0073] This application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, communication interface, and memory communicate with each other via the communication bus.

[0074] Memory, used to store computer programs;

[0075] When the processor executes the program stored in the memory, it implements the above-mentioned method for detecting loosening of train square hole locks based on key point recognition.

[0076] The communication bus mentioned in the aforementioned electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.

[0077] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0078] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0079] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0080] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0081] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0082] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0083] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting loosening of train square hole locks based on key point recognition, characterized in that, It includes two processes: image training and image recognition. It can detect the position of a square hole lock and determine whether the square hole lock is loose and the angle of looseness through a single image. The image acquisition process consists of two stages; During the implementation phase of the inspection robot, the robot's navigation point information is set, and the robotic arm is taught and the parameters of the industrial camera mounted on the robotic arm are set. During the inspection and patrol process, the robot moves to the set point and captures images of the train side including square hole locks through an industrial camera. Once image acquisition is complete, model training begins. After training is complete, the trained model is used for recognition. The model training steps are as follows: S11. Label the image. First, label the coordinate information of the square hole lock with a rectangle, and label the lock cylinder information with key points. The key point information includes: the coordinate information of the three vertices of the lock cylinder triangle P1, P2, and P3, and the coordinate information of the vertices of the lock notch P4. S12. Data augmentation; Image processing is used to simulate the loosening of a square hole lock; S13. The image and labels are fed into the keypoint detection deep learning model network for training; Once the model is trained, it is used for recognition. The recognition steps are as follows: S21. The acquired image is identified by a key point detection deep learning model to identify the rectangular frame and key point coordinate information of the square hole lock; S22. Obtain the angular deviation between the lock cylinder and the lock ring by using the coordinate information of key points, and set a threshold to determine whether the square hole lock has become loose and the angle of loosening; The YOLOv8-pose keypoint detection algorithm based on deep learning was used to identify the rectangular frame and keypoint coordinates of the square hole lock by using the YOLOv8-pose model. The lock core vertices P1, P2, and P3, and the lock ring notch vertex P4 were identified. This also includes angle calculation; connecting P1 and P2 forms line segment L1, drawing a perpendicular line from point P3 to line segment L1 to obtain L2, calculating the centroid of triangle P1P2P3 as P5, connecting P5 and P4 to obtain line segment L3, the angle between L1 and L3 is the angle at which the square hole lock is loose, and setting a threshold. Degree, when the angle of loosening of the square hole lock is greater than The degree indicates that the square hole lock is loose; Using the law of cosines, the angle between line segments L2 and L3, in radians, is: Then the deflection angle for: Let counterclockwise be rad > 0. Clockwise rad < 0, .

2. The method for detecting loosening of train square hole locks based on key point recognition according to claim 1, characterized in that: The data augmentation in S12 involves the following specific steps. Use the outline annotation tool to mark the location of the lock cylinder; Calculate the center position P of the lock cylinder; With point P as the center, randomly set the angle within the range of 0-360°. Rotate the lock cylinder area.

3. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as described in claim 1 or 2.

4. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as claimed in claim 1 or 2.

Citation Information

Patent Citations

  • Anti-vibration damper defect visual detection method and system based on key point detection and medium

    CN110458798A

  • Deep learning-based composite insulator grading ring inclination fault detection method

    CN112884715A