Subway obstacle detection method based on unsupervised anomaly detection and target tracking
Through the combination of unsupervised anomaly detection and target tracking network, the problem of high false alarm rate and limitation of detection types in subway obstacle detection is solved, more accurate and reliable obstacle identification is achieved, and the safety of subway operation is ensured.
Patent Information
- Application Number
- CN202411112768.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-14
AI Technical Summary
The existing obstacle detection methods in the subway rail transit system have problems such as high false alarm rate, poor real-time performance and limitations in detection types. They cannot accurately identify the types of obstacles, which affects the reliability and subsequent processing of the detection results.
A subway obstacle detection method based on unsupervised anomaly detection and target tracking is adopted. By training the unsupervised anomaly detection network and target tracking network, combined with IOU calculation, real obstacles and false alarm areas are distinguished, and the accuracy and stability of detection are improved.
It significantly improves the accuracy and reliability of obstacle detection, reduces the workload of data annotation, reduces false detections caused by environmental changes, and ensures the safety and stability of subway operations.
Smart Images

Figure CN118629016B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rail transit obstacle detection, and in particular to a subway obstacle detection method based on unsupervised anomaly detection and target tracking. Background Art
[0002] In the subway rail transit system, traditional obstacle detection methods mainly rely on target detection and unsupervised anomaly detection. Both methods have shortcomings and limitations in practical applications. The target detection method mainly marks in advance which categories of objects may invade the rail bed, such as people, suitcases, small animals, etc. In the target detection method, the pre-trained model can identify and detect these known categories of obstacles and issue an alarm. There are problems such as large data labeling workload, poor real-time performance, and dependence on obstacle categories; the unsupervised anomaly detection method learns the normal state of the track without obstacles. When an obstacle appears, the detected image will generate pixel anomaly values different from the normal state, thereby identifying the obstacle. However, due to the different lighting conditions and environmental changes in the rail transit rail bed during actual application, the unsupervised anomaly detection method has a high false alarm rate, which in turn affects the reliability of the detection results. In addition, the unsupervised anomaly detection method can only detect abnormal situations, but cannot specifically identify the type of obstacle, which affects subsequent processing and response measures.
[0003] Therefore, in order to solve the problems of high false alarm rate, poor real-time detection performance and limited detection types in the above-mentioned existing anomaly detection, the present invention proposes a subway obstacle detection method based on unsupervised anomaly detection and target tracking. Summary of the invention
[0004] In order to solve the above-mentioned problems in the prior art, the first purpose of the present invention is to provide a subway obstacle detection method based on unsupervised anomaly detection and target tracking, which is used to ensure the accuracy and certainty of the anomaly detection network while improving the diversity of detection types of the anomaly detection network.
[0005] In order to achieve the above object, the present invention provides a solution: a subway obstacle detection method based on unsupervised anomaly detection and target tracking, comprising:
[0006] S1: Collect video data of subway tracks with no obstacles and tracks with obstacles;
[0007] S2: Create a track bed segmentation network dataset, extract images frame by frame from the collected video, annotate the track bed area in the image, extract the track bed area image through the segmentation network, and annotate the track bed area;
[0008] S3: Create an unsupervised obstacle dataset and a target tracking dataset. Create a corresponding binary image based on the acquired image, perform obstacle detection on the track bed area image. When there is an obstacle in the image, set the pixel value of the obstacle image area to 255 and the pixel value of other areas to 0 to generate an unsupervised obstacle dataset. Record the obstacle image area with a rectangular frame to generate a target tracking dataset.
[0009] S4: Train an unsupervised anomaly detection network to detect whether there are obstacles in the image;
[0010] S5: Train the target tracking network to detect false alarm areas of obstacles;
[0011] S6: Perform subway track bed obstacle detection. When the unsupervised anomaly detection network detects that an obstacle appears inside the track bed area, the target tracking network is used to track the obstacle to detect whether the obstacle detection is a false alarm and complete the obstacle detection.
[0012] As a further improvement of the present invention, the S2 comprises:
[0013] S21: extracting the rail bed image data frame by frame;
[0014] S22: marking the rail bed area in the image;
[0015] S23: extracting the rail bed area image through the segmentation network;
[0016] By extracting rail bed image data frame by frame and marking the rail bed area, the segmentation network is used to accurately extract the rail bed area image, thereby improving the accuracy and efficiency of rail bed area recognition.
[0017] As a further improvement of the present invention, the training data set of the unsupervised anomaly detection network includes images of unobstructed railbeds and images of railbeds with obstacles. By incorporating images of unobstructed railbeds and images of railbeds with obstacles into the training data set, the unsupervised anomaly detection network can learn and identify normal and abnormal conditions of the railbed, thereby improving the accuracy and adaptability of obstacle detection.
[0018] As a further improvement of the present invention, the training data set of the target tracking network includes a position image with an obstacle rectangular frame marked. By marking the position image of the obstacle rectangular frame, the target tracking network can accurately identify and track obstacles on the track bed. This training data set provides rich target position information, enabling the target tracking network to more accurately locate and track obstacles, thereby improving the accuracy and stability of detection.
[0019] As a further improvement of the present invention, the target tracking network adopts a ResNet feature extraction network, combined with feature matching and data association methods, the target tracking network can efficiently extract feature information in the image, enhance the ability to recognize and track obstacles, and achieve accurate tracking of obstacles.
[0020] As a further improvement of the present invention, the unsupervised anomaly detection network and the target tracking network in S6 work together to optimize the accuracy of obstacle detection by calculating the IOU of the detected obstacle area and the real obstacle area; the unsupervised anomaly detection network and the target tracking network work together to effectively distinguish the real obstacles and the false alarm areas by calculating the IOU value of the obstacle area, optimize the detection accuracy, and thus improve the detection performance and reliability of the overall system.
[0021] As a further improvement of the present invention, the S6 comprises:
[0022] S61: Inputting the rectangular frame image P0 where the rail bed area is located into the unsupervised anomaly detection network for anomaly detection. When there is an anomaly in the rail bed area, the position of the rectangular frame where the area is located is set to P(n), and the value of P(n) is 1;
[0023] S62: Start the target tracking network;
[0024] S63: The unsupervised anomaly detection network detects the next frame of the image where P(n) is located, and when Pn does not detect an anomaly, P(n) is a false alarm result; when Pn detects an anomaly, enter S64;
[0025] S64: Track the position of P(n) in the image Pn through the target tracking network, and record the area in the form of a rectangular frame;
[0026] S65: Calculate the IOU value of the rectangular box area in S64 and the rectangular box area in S61. When IOU>0.2, it is considered that there is an obstacle in the area, and P(n)=P(n)+1, and the target tracking network continues to track; when IOU<0.2, the P(n) value remains unchanged;
[0027] S66: Repeat S61 to S65, and confirm whether there is an obstacle in the area through the judgment result. When there is no obstacle, release the tracking of the abnormal area.
[0028] As a further improvement of the present invention, the IOU is set to:
[0029] Wherein, Sp0 is the area of the rectangular box in P0, and Spn is the area of the rectangular box in Pn.
[0030] As a further improvement of the present invention, S61 to S65 are repeated in S66 to continuously detect multiple frames of images. When multiple anomalies are detected in the same area, it is confirmed that there is a real obstacle in the area. By continuously detecting multiple frames of images, the system can accumulate judgment results, reduce false alarms caused by single-frame images, and further improve the accuracy and reliability of obstacle detection.
[0031] The beneficial effects of the present invention are:
[0032] By combining the unsupervised anomaly detection algorithm with the target detection algorithm, the problem of unclassified obstacle detection in the subway was solved, achieving the beneficial effects of reducing data labeling work, improving obstacle detection rate, and eliminating false detections caused by environmental changes. The robustness and reliability of the detection system were significantly improved, thereby ensuring the safety and stability of subway operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a method flow chart of a subway obstacle detection method based on unsupervised anomaly detection and target tracking of the present invention;
[0034] Figure 2 It is a flow chart of an embodiment of a subway obstacle detection method based on unsupervised anomaly detection and target tracking of the present invention;
[0035] Figure 3 It is a target tracking network workflow diagram in the subway obstacle detection method based on unsupervised anomaly detection and target tracking of the present invention;
[0036] Figure 4 is a schematic diagram of the application of the subway obstacle detection method based on unsupervised anomaly detection and target tracking in this embodiment. DETAILED DESCRIPTION
[0037] The specific embodiments of the present invention will be described in detail below. It should be noted that the embodiments described here are only part of the embodiments of the present invention, not all of the embodiments. Based on the following embodiments, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] The first embodiment of the present invention proposes a subway obstacle detection method based on unsupervised anomaly detection and target tracking, comprising:
[0039] S1: Collect video data of subway tracks running without obstacles and tracks running with obstacles; place fixed visible light cameras in the cabs of subway cards 1 and 6 to collect video data of the subway tracks running without obstacles. At the same time, place obstacles of different sizes inside the track bed, and collect video data of the tracks with obstacles when the subway is close to them.
[0040] S2: Create a track bed segmentation network dataset, extract images frame by frame from the collected video, annotate the track bed area in the image, extract the track bed area image through the segmentation network, and annotate the track bed area;
[0041] S3: Create an unsupervised obstacle dataset and a target tracking dataset. Create a corresponding binary image based on the acquired image, perform obstacle detection on the track bed area image. When there is an obstacle in the image, set the pixel value of the obstacle image area to 255 and the pixel value of other areas to 0 to generate an unsupervised obstacle dataset. Record the obstacle image area with a rectangular frame to generate a target tracking dataset.
[0042] The semantic segmentation network deeplab_v3 is used to segment the derailment area, and the minimum rectangular bounding box is calculated based on the rail bed area. The image in the bounding box is captured from the original image captured by the camera, which is the area range where obstacles need to be detected. When there are no obstacles in the image, a binary image of the same size as the image is created, and all pixel values are 0. When there are obstacles in the image, labelme software is used to outline the outline of the obstacle in the image to obtain the polygonal area of the obstacle, and then a binary image of the same size as the image is created, and the pixels of the polygonal area of the obstacle are 255, and other areas are set to 0, which is used as an obstacle dataset for unsupervised detection.
[0043] Create a target tracking dataset, split the video data with obstacles frame by frame, and use the semantic segmentation network deeplab_v3 to segment the derailment area, such as Figure 4 In the figure of the embodiment, the white area is the rail bed area. The minimum rectangular bounding box is calculated based on the white area, and the image in the bounding box is captured from the original image captured by the camera, which is the area range where obstacles need to be detected. If there are obstacles in the image, use labelimg image annotation software to record the obstacle area in the format of a rectangular box and use it as a data set for target detection.
[0044] S4: Train an unsupervised anomaly detection network to detect whether there are obstacles in the image;
[0045] The unsupervised anomaly detection network mainly uses the EfficientAD "teacher-student" model. "Teacher" and "student" represent two asymmetric neural architectures, both of which use the efficient network architecture distilled from the WideResNet101 data set to extract high-dimensional information features of the image. The training data set of the "teacher" model includes all the pictures of the trackbed conditions used to make the unsupervised network data set, including all pictures with and without obstacles, while the training data set of the "student" model only includes pictures without obstacles in the above data set. Therefore, the two models are asymmetric. When a trackbed picture is input into the unsupervised anomaly detection network, the "student" model cannot predict the characteristics of the abnormal area in the trackbed, and will fit the characteristics of no obstacles, assuming that , but the "teacher" model has been trained with obstacles, so it will output abnormal features with obstacles, assuming , through the difference of the results of the two network models, it is the area where obstacles exist. , for each pixel value of the input image, an abnormal heat map is finally inferred, and an abnormal threshold is set. The area greater than the threshold is the area where obstacles exist, and the area less than the threshold is the normal area.
[0046] S5: Train the target tracking network for detecting false alarm areas of obstacles; the target tracking network mainly adopts the feature matching method, and the backbone of the network adopts the RESNET feature extraction network. After the image passes through the unsupervised anomaly detection network, if there is an abnormal area, the image is input to the image feature extraction network ResNet, where the feature information of the abnormal area will be regarded as the network's area of interest. After the next frame of the picture is input, the track bed area is segmented by the semantic segmentation network, and then enters the image feature extraction network. Through the feature matching method, the abnormal features in the previous frame of the image are matched with the features in the image to locate the abnormal area in the image. When the abnormal features are not matched in the next frame of the picture, it is considered that the anomaly may be a false alarm area.
[0047] S6: Perform subway track bed obstacle detection. When the unsupervised anomaly detection network detects that an obstacle appears inside the track bed area, the target tracking network is used to track the obstacle to detect whether the obstacle detection is a false alarm and complete the obstacle detection.
[0048] In this embodiment, refer to Figure 1-4 As shown, the S2 includes:
[0049] S21: extracting the rail bed image data frame by frame;
[0050] S22: marking the rail bed area in the image;
[0051] S23: extracting the rail bed area image through the segmentation network;
[0052] By extracting rail bed image data frame by frame and marking the rail bed area, the segmentation network is used to accurately extract the rail bed area image, thereby improving the accuracy and efficiency of rail bed area recognition.
[0053] In this embodiment, refer to Figure 1-4 As shown, the training data set of the unsupervised anomaly detection network includes images of unobstructed railbeds and images of railbeds with obstacles. By incorporating images of unobstructed railbeds and images of railbeds with obstacles into the training data set, the unsupervised anomaly detection network can learn and identify normal and abnormal conditions of the railbed, thereby improving the accuracy and adaptability of obstacle detection.
[0054] In this embodiment, refer to Figure 1-4 As shown, the training data set of the target tracking network includes the position image with the obstacle rectangle frame marked. By marking the position image of the obstacle rectangle frame, the target tracking network can accurately identify and track the obstacles on the track bed. This training data set provides rich target position information, enabling the target tracking network to locate and track obstacles more accurately, and improve the accuracy and stability of detection.
[0055] In this embodiment, refer to Figure 1-4 As shown, the target tracking network adopts the ResNet feature extraction network, combined with feature matching and data association methods, the target tracking network can efficiently extract feature information in the image, enhance the ability to recognize and track obstacles, and achieve accurate tracking of obstacles.
[0056] In this embodiment, refer to Figure 1-4 As shown, the unsupervised anomaly detection network and the target tracking network in S6 work together to optimize the accuracy of obstacle detection by calculating the IOU of the detected obstacle area and the real obstacle area; the unsupervised anomaly detection network and the target tracking network work together to effectively distinguish the real obstacle and the false alarm area by calculating the IOU value of the obstacle area, optimize the detection accuracy, and thus improve the detection performance and reliability of the overall system.
[0057] In this embodiment, refer to Figure 1-4 As shown, the S6 includes:
[0058] S61: Inputting the rectangular frame image P0 where the rail bed area is located into the unsupervised anomaly detection network for anomaly detection. When there is an anomaly in the rail bed area, the position of the rectangular frame where the area is located is set to P(n), and the value of P(n) is 1;
[0059] S62: Start the target tracking network;
[0060] S63: The unsupervised anomaly detection network detects the next frame of the image where P(n) is located, and when Pn does not detect an anomaly, P(n) is a false alarm result; when Pn detects an anomaly, enter S64;
[0061] S64: Track the position of P(n) in the image Pn through the target tracking network, and record the area in the form of a rectangular frame;
[0062] S65: Calculate the IOU value of the rectangular box area in S64 and the rectangular box area in S61. When IOU>0.2, it is considered that there is an obstacle in the area, and P(n)=P(n)+1, and the target tracking network continues to track; when IOU<0.2, the P(n) value remains unchanged;
[0063] S66: Repeat S61 to S65, and confirm whether there is an obstacle in the area through the judgment result. When there is no obstacle, release the tracking of the abnormal area.
[0064] As a further improvement of the present invention, the IOU is set to:
[0065] Among them, S p0 is the area of the rectangular box in P0, S pn P n The area of the middle rectangular box.
[0066] In this embodiment, refer to Figure 1-4 As shown, in S66, S61 to S65 are repeated to continuously detect multiple frames of images. When multiple abnormalities are detected in the same area, it is confirmed that there is a real obstacle in the area. By continuously detecting multiple frames of images, the system can accumulate judgment results, reduce false alarms caused by single-frame images, and further improve the accuracy and reliability of obstacle detection. For each P (n) area, the judgment is made 5 times in a row, and the steps of S61 to S65 are repeated 4 times. When the value of P (n) appears 3 times or more in the processed 5 frames of images, that is, the value of P (n) is greater than or equal to 3, the area is considered to be a real obstacle. When there are no abnormal alarms of the P area 3 times or more in the processed 5 frames of images, it is considered that there is no obstacle in the area, and after continuously tracking 5 frames of images, the tracking of the abnormal area is released.
[0067] The above shows and describes the basic features, principles and advantages of the present invention. It should be noted that the present invention is not limited to the above embodiments, which are only partial embodiments. Under the premise of not departing from the spirit and scope of the present invention, several improvements and supplements made are considered as the protection scope of the present invention.
Claims
1. A subway obstacle detection method based on unsupervised anomaly detection and target tracking, characterized in that: include: S1: Collect video data of subway tracks with no obstacles and tracks with obstacles; S2: Create a track bed segmentation network dataset, extract images frame by frame from the collected video, annotate the track bed area in the image, extract the track bed area image through the segmentation network, and annotate the track bed area; S3: Create an unsupervised obstacle dataset and a target tracking dataset. Create a corresponding binary image based on the acquired image, perform obstacle detection on the track bed area image. When there is an obstacle in the image, set the pixel value of the obstacle image area to 255 and the pixel value of other areas to 0 to generate an unsupervised obstacle dataset. Record the obstacle image area with a rectangular frame to generate a target tracking dataset. S4: Train an unsupervised anomaly detection network to detect whether there are obstacles in the image; S5: Train the target tracking network to detect false alarm areas of obstacles; S6: Perform subway track bed obstacle detection. When the unsupervised anomaly detection network detects that an obstacle appears inside the track bed area, the target tracking network is used to track the obstacle to detect whether the obstacle detection is a false alarm, and the obstacle detection is completed; The S6 includes: S61: Inputting the rectangular frame image P0 where the rail bed area is located into the unsupervised anomaly detection network for anomaly detection. When there is an anomaly in the rail bed area, the position of the rectangular frame where the area is located is set to P(n), and the value of P(n) is 1; S62: Start the target tracking network; S63: Unsupervised anomaly detection network detects the next frame of the image where P(n) is located and collects the image P n , when P n When no anomaly is detected, P(n) is a false positive result; when P n When an abnormality is detected, enter S64; S64: Track P(n) in image P through the target tracking network n The position in the area is recorded in the form of a rectangular frame; S65: Calculate the IOU value of the rectangular box area in S64 and the rectangular box area in S61. When IOU>0.2, it is considered that there is an obstacle in the area, and P(n)=P(n)+1, and the target tracking network continues to track; when IOU<0.2, the P(n) value remains unchanged; S66: Repeat S61 to S65, confirm whether there is an obstacle in the area through the judgment result, and continuously detect multiple frames of images. When multiple anomalies are detected in the same area, it is confirmed that there is a real obstacle in the area. When there is no obstacle, the tracking of the track bed area is released.
2. The subway obstacle detection method based on unsupervised anomaly detection and target tracking according to claim 1 is characterized in that: The S2 includes: S21: extracting the unobstructed track video data frame by frame; S22: marking the rail bed area in the image; S23: Extract the rail bed area image through the segmentation network.
3. The subway obstacle detection method based on unsupervised anomaly detection and target tracking according to claim 1 is characterized in that: The training data set of the unsupervised anomaly detection network includes images of track beds without obstacles and images of track beds with obstacles.
4. The subway obstacle detection method based on unsupervised anomaly detection and target tracking according to claim 1 is characterized in that: The training data set of the target tracking network includes position images marked with obstacle rectangular frames.
5. The subway obstacle detection method based on unsupervised anomaly detection and target tracking according to claim 1 is characterized in that: The target tracking network adopts the ResNet feature extraction network, combined with feature matching and data association methods, to achieve accurate tracking of obstacles.
6. The subway obstacle detection method based on unsupervised anomaly detection and target tracking according to claim 1, characterized in that: The unsupervised anomaly detection network and the target tracking network in S6 work together to optimize the accuracy of obstacle detection by calculating the IOU between the detected obstacle area and the real obstacle area.
7. According to the subway obstacle detection method based on unsupervised anomaly detection and target tracking according to claim 1, the IOU is set to: in, S p0 is the area of the rectangular box in P0, S pn P n The area of the middle rectangular box.
