An abnormal parking and road congestion recognition method with adaptive weight decay
By using the YOLOv11 model for frame extraction inference in the road surveillance video, and combining the tracking method of adaptive weight attenuation, the problem of high computing power cost in the existing technology is solved, efficient abnormal parking and road congestion detection is achieved, and the detection concurrency is increased.
Patent Information
- Application Number
- CN202411718617.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-08
AI Technical Summary
When detecting abnormal parking and road congestion, the prior art relies on target detection and tracking, resulting in high computing power costs, which is difficult to popularize on a large scale, and cannot effectively reduce computing power costs.
The YOLOv11 target detection model is used to perform frame extraction inference on road monitoring videos, and combined with the tracking method of adaptive weight attenuation, the determination of abnormal parking and road congestion is achieved, and the computing cost is reduced.
While ensuring the accuracy of traffic event detection, the cost of computing power is reduced, the detection concurrency volume is increased, and the concurrency volume can be increased by 10 to 50 times under the original computing power.
Smart Images

Figure CN119785576A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to an abnormal parking and road congestion recognition method with adaptive weight decay. Background Art
[0002] With the continuous increase in traffic volume in my country, traffic management is facing greater and greater challenges. Especially on highways, abnormal parking and road congestion are important factors affecting traffic efficiency and safety. In recent years, abnormal parking and road congestion detection methods mostly rely on target detection and tracking. Compared with traditional background subtraction and edge detection methods, they have greatly improved in accuracy. However, due to the huge computing power required, the cost is extremely high and is not conducive to large-scale popularization. It cannot cover a large area of road monitoring. Based on this, how to reduce the computing power cost while ensuring the accuracy of traffic event detection has become an urgent problem to be solved. Summary of the invention
[0003] In view of the shortcomings of the prior art, the present invention provides an abnormal parking and road congestion identification method with adaptive weight attenuation, which adopts the YOLOv11 target detection model to perform frame extraction inference on road monitoring video, and realizes abnormal parking and road congestion judgment through the tracking method with adaptive weight attenuation, effectively reducing the computing power cost.
[0004] The present invention is achieved through the following technical solutions:
[0005] A method for identifying abnormal parking and road congestion with adaptive weight decay is provided, comprising the following steps:
[0006] S1. Collect and annotate a target detection dataset in YOLO format using real-life monitoring on the road. Use the YOLOv11 algorithm model to train the dataset and select the optimal model to convert it into ONNX format. Based on the large model knowledge distillation strategy, use the YOLO11x.pt model with the largest number of parameters to pre-annotate the dataset, manually supplement the missing parts, and generate five categories: passenger car, bus, truck, motorcycle, and bicycle. Use a smaller YOLO model as the pre-training weight for training.
[0007] S2. For each detected target, an adaptive tracker is created, and the state weight in the tracker is used to determine whether the vehicle has stopped. The state weight represents the life cycle of the tracker. If the IOU match with the last detection result is successful, the state weight will increase automatically. If the match fails, the state weight will decay. If the state weight is equal to 0, the state weight will be destroyed. If the state weight is greater than the threshold, it is determined to be stopped.
[0008] Among them: The IOU matching formula is as follows:
[0009]
[0010] Set hyperparameters A, B, C and D respectively.
[0011] Among them: the hyperparameter A is the inter-frame detection frequency, and its value range is between 10 and 50;
[0012] Hyperparameter B is the initial value of the adaptive tracker state weight. The initial value of each vehicle after detection is taken from hyperparameter B;
[0013] Hyperparameter C is the threshold of the state weight. When the state weight is greater than hyperparameter C, it is determined to be stopped. The setting of hyperparameter C is based on the stopping judgment condition.
[0014] Hyperparameter D is the upper limit of the state weight. The state weight increment shall not be greater than hyperparameter D. If it exceeds this value, it is assigned to hyperparameter D. The value range of hyperparameter D is 2 to 5 times that of hyperparameter C.
[0015] S3. Set a hyperparameter E in the range of 5 to 10. Put all trackers with state weights greater than 0 into an array, and regularly count the number of short stops. If the number is greater than the hyperparameter E, it is determined that the current road section is congested.
[0016] Preferably, in step S1, in order to avoid the problem of overfitting in a single scene, negative samples can be generated with the assistance of a high-precision large model. In the field of target detection, adding them to the data set as a background image can greatly reduce the probability of overfitting. The specific steps are as follows: create an empty image through the Opencv tool, import a video, use the YOLOv11x.pt model to remove the detected target and then superimpose it on the empty image, repeat the operation until the background picture appears completely, select videos of different scenes to repeat the above process, and enhance the background image of the data set.
[0017] Negative samples can be generated with the assistance of a high-precision large model. In the field of target detection, adding them to the dataset as background images can greatly reduce the probability of overfitting, avoid the problem of overfitting in a single scene, and enhance the background image of the dataset to improve the robustness of the model.
[0018] Furthermore, in step S1, the model is optimized, the best model is selected according to the Precision and Recall indicators and exported to ONNX format, and the model is quantized using TensorRT.
[0019] Further, in step S1, the YOLO model selects one of YOLOv11s.pt, YOLOv11m.pt or YOLOv11l.pt according to the computing power of the inference card.
[0020] Furthermore, in step S2, the parking determination condition refers to the length of parking time.
[0021] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0022] 1. Save computing resources. There is no need for real-time precise tracking. While ensuring accuracy, the detection frequency, i.e., resource usage, is less than ten times that of the existing algorithm. Therefore, under the original computing power, this method can increase the concurrency by 10 to 50 times.
[0023] Second, the hyperparameter configuration is simple. The frame rate of mainstream camera video streams is between 25 and 30fps. The entire set of hyperparameters only needs to be simply modified to complete abnormal parking and road congestion identification in most surveillance camera devices.
[0024] 3. No need to manually specify the area. In the past, congestion detection algorithms needed to combine speed or area ratio to determine congestion. The present invention samples multiple vehicles to obtain the stop-and-go status to derive the road congestion status. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a workflow diagram of traffic anomaly detection according to the present invention.
[0026] Figure 2 This is a schematic diagram of the working state of the adaptive tracker of the present invention.
[0027] Figure 3 Schematic diagram of the state weight of the adaptive tracker of the present invention. DETAILED DESCRIPTION
[0028] In order to clearly illustrate the technical features of this solution, this solution is described below through a specific implementation method.
[0029] An abnormal parking and road congestion recognition method with adaptive weight decay comprises the following steps:
[0030] S1. Use the real-life monitoring scenes on the road to collect and annotate the target detection dataset in YOLO format, use the YOLOv11 algorithm model to train the dataset and select the optimal model to convert it to ONNX format; select the best model according to the Precision and Recall indicators and export it to ONNX format, and use TensorRT to quantify the model.
[0031] Based on the large model knowledge distillation strategy, the YOLO11x.pt model with the largest number of parameters is used to pre-label the dataset, and the missing parts are manually supplemented to generate five categories: cars, buses, trucks, motorcycles, and bicycles. Smaller YOLO models such as YOLOv11s.pt, YOLOv11m.pt, or YOLOv11l.pt are used as pre-training weights for training; the selected YOLO model is selected according to the computing power of the inference card.
[0032] S2. For each detected target, an adaptive tracker is created, and the state weight in the tracker is used to determine whether the vehicle has stopped. The state weight represents the life cycle of the tracker. If the IOU match with the last detection result is successful, the state weight will increase automatically. If the match fails, the state weight will decay. If the state weight is equal to 0, the state weight will be destroyed. If the state weight is greater than the threshold, it is determined to be stopped.
[0033] Among them: The IOU matching formula is as follows:
[0034]
[0035] Set hyperparameters A, B, C and D respectively.
[0036] Among them: the hyperparameter A is the inter-frame detection frequency, and its value range is between 10 and 50.
[0037] Hyperparameter B is the initial value of the adaptive tracker state weight. The value initialized after each vehicle is detected is taken from hyperparameter B.
[0038] The hyperparameter C is the threshold of the state weight. When the state weight is greater than the hyperparameter C, it is judged to be parked. The setting of the hyperparameter C is based on the parking judgment condition; the parking judgment condition refers to the length of parking time, such as parking for 1 second is considered as parking, or parking for more than 10 seconds is considered as parking.
[0039] Hyperparameter D is the upper limit of the state weight. The state weight increment shall not be greater than hyperparameter D. If it exceeds this value, it is assigned to hyperparameter D. The value range of hyperparameter D is 2 to 5 times that of hyperparameter C.
[0040] S3. Set a hyperparameter E in the range of 5 to 10. Put all trackers with state weights greater than 0 into an array, and regularly count the number of short stops. If the number is greater than the hyperparameter E, it is determined that the current road section is congested.
[0041] In specific applications, the present invention first collects road surveillance videos on a large scale and splits them into pictures as data set materials. Since frame-by-frame splitting generates 25 to 30 frames of pictures per second, which is a huge amount of data and has a lot of repeated content, in this embodiment, 10 intervals are set to generate one picture; based on the strategy of large model knowledge distillation, using a model with higher precision for pre-labeling can reduce the workload of manual labeling and improve efficiency. The YOLO11x.pt model with the largest number of parameters is used to pre-label the data set, but it is not limited to other models in the YOLO series or other models of Vision Transform for pre-labeling. When labeling, other categories are filtered out, and only five categories of small passenger cars (car), large buses (bus), trucks (truck), motorcycles (motorcycles), and bicycles (bicycles) are retained. Manual participation is used to supplement the missing small targets, and the targets with incorrect labeling are deleted, so as to finally generate a large number of positive sample data sets.
[0042] To avoid the problem of overfitting in a single scene, negative samples can be generated with the assistance of a high-precision large model. In the field of target detection, adding them to the dataset as a background image can greatly reduce the probability of overfitting. The specific steps are as follows: Create an empty image through the Opencv tool, import a video, use the YOLOv11x.pt model to remove the detected target and then superimpose it on the empty image, repeat the operation until the background picture appears completely, select videos of different scenes and repeat the above process to enhance the background image of the dataset and improve the robustness of the model.
[0043] In this embodiment, the inference card is NVIDIA Tesla T4, and YOLOv11m.pt is used as the pre-training weight for training. The best model is selected according to the indicators such as Precision and Recall and exported to ONNX format. The model is quantized using TensorRT. The whole process tests the real-time video including streaming, decoding, inference and other steps, and the speed is stable at more than 20fps. The inference speed is acceptable, and the hyperparameter A is set to 10 in this embodiment.
[0044] like Figure 1 As shown in the figure, multi-threading is used to simultaneously obtain multiple video streams and deploy model multi-batch inference. The hyperparameter B is set to 5, the hyperparameter C is set to 20, and the hyperparameter A interval is 10 frames and the video stream is 25 frames per second. It is calculated that the vehicle parking time is 6 seconds. If you want to judge the parking time in about 1 second, you can set the hyperparameter C to 7-9; the hyperparameter D is set to twice the hyperparameter C, which is set to 40 in this case; the hyperparameter E is set to 7, which can be appropriately increased if the road is wide and there are many lanes.
[0045] Based on the above hyperparameters, it can be seen that the present invention is characterized in that there is no need for frame-by-frame detection. The tracker only tracks stopped or slow-moving vehicles. It can still effectively detect parking and congestion situations when the frame extraction interval is large. In this way, more computing power resources can be allocated to analyze more video streams in parallel.
[0046] like Figure 2 As shown, the interval frequency is set to hyperparameter A. For each target detected in each detection cycle, an IOU match is performed with the currently active tracker in the array. The matched tracker has its state weight automatically increased and the hyperparameter D is not determined. For the unmatched tracker, a new adaptive tracker is created and the initial value of the state weight is set to hyperparameter B. The state weight of the tracker that is not matched in the original array is decayed. When it decays to 0, it is removed from the array and the resources of the adaptive tracker are released, as shown in Figure 3 As shown, the state weight in the tracker is compared with the hyperparameter C to determine whether the vehicle has stopped, and the number of parking lots in the cumulative array is compared with the hyperparameter E to determine whether the current road section is congested.
[0047] Of course, the above description is not limited to the above examples. Technical features not described in the present invention can be achieved by or by using existing technologies, which will not be repeated here. The above embodiments and drawings are only used to illustrate the technical scheme of the present invention and are not limitations of the present invention. The present invention is described in detail with reference to the preferred implementation methods. Ordinary technicians in this field should understand that changes, modifications, additions or substitutions made by ordinary technicians in this technical field within the essential scope of the present invention do not depart from the purpose of the present invention, and should also fall within the scope of protection of the claims of the present invention.
Claims
1. An abnormal parking and road congestion recognition method with adaptive weight decay, characterized by: The following steps are involved: S1. Collect and annotate a target detection dataset in YOLO format using real-life monitoring on the road. Use the YOLOv11 algorithm model to train the dataset and select the optimal model to convert it into ONNX format. Based on the large model knowledge distillation strategy, use the YOLO11x.pt model with the largest number of parameters to pre-annotate the dataset, manually supplement the missing parts, and generate five categories: passenger car, bus, truck, motorcycle, and bicycle. Use a smaller YOLO model as the pre-training weight for training. S2. For each detected target, an adaptive tracker is created, and the state weight in the tracker is used to determine whether the vehicle has stopped. The state weight represents the life cycle of the tracker. If the IOU match with the last detection result is successful, the state weight will increase automatically. If the match fails, the state weight will decay. If the state weight is equal to 0, the state weight will be destroyed. If the state weight is greater than the threshold, it is determined to be stopped. Among them: The IOU matching formula is as follows: Set hyperparameters A, B, C and D respectively. Among them: the hyperparameter A is the inter-frame detection frequency, and its value range is between 10 and 50; Hyperparameter B is the initial value of the adaptive tracker state weight. The initial value of each vehicle after detection is taken from hyperparameter B; Hyperparameter C is the threshold of the state weight. When the state weight is greater than hyperparameter C, it is determined to be stopped. The setting of hyperparameter C is based on the stopping judgment condition. Hyperparameter D is the upper limit of the state weight. The state weight increment shall not be greater than hyperparameter D. If it exceeds this value, it is assigned to hyperparameter D. The value range of hyperparameter D is 2 to 5 times that of hyperparameter C. S3. Set a hyperparameter E in the range of 5 to 10. Put all trackers with state weights greater than 0 into an array, and regularly count the number of short stops. If the number is greater than the hyperparameter E, it is determined that the current road section is congested.
2. The abnormal parking and road congestion identification method with adaptive weight decay according to claim 1 is characterized by: In step S1, in order to avoid the problem of overfitting in a single scene, negative samples can be generated with the assistance of a high-precision large model. In the field of target detection, adding them to the data set as background images can greatly reduce the probability of overfitting. The specific steps are as follows: Create an empty image through the Opencv tool, import a video, use the YOLOv11x.pt model to remove the detected target and then superimpose it on the empty image, repeat the operation until the background picture appears completely, select different scene videos to repeat the above process, and enhance the background image of the data set.
3. The abnormal parking and road congestion identification method with adaptive weight decay according to claim 1 is characterized by: In step S1, the model is optimized, the best model is selected according to the Precision and Recall indicators and exported to ONNX format, and the model is quantized using TensorRT.
4. The method for identifying abnormal parking and road congestion with adaptive weight decay according to claim 1, characterized in that: In step S1, the YOLO model selects one of YOLOv11s.pt, YOLOv11m.pt or YOLOv11l.pt according to the computing power of the inference card.
5. The abnormal parking and road congestion identification method with adaptive weight decay according to claim 1 is characterized by: In step S2, the parking determination condition refers to the length of parking time.