Emergency lane dynamic opening decision method and system based on video monitoring
Through the dynamic open decision-making method of emergency lanes based on video surveillance, the real-time analysis of traffic flow data and prediction of traffic congestion status is solved, and the problem of lack of real-time and accuracy of traditional traffic management methods is achieved, efficient dynamic management of emergency lanes and relief of traffic pressure is achieved.
Patent Information
- Application Number
- CN202411710208.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Traditional traffic management methods lack real-time and accuracy, making it difficult to effectively manage and dynamically open emergency lanes, resulting in the inability to take timely response measures during peak traffic or when emergencies occur.
The dynamic open decision-making method of emergency lane based on video surveillance is adopted. The road surveillance video is processed in real time by calling the pre-trained target detection model YOLOv8, and historical traffic flow data is extracted. The traffic congestion prediction model is constructed using the gated circulation unit GRU neural network. The traffic congestion state is predicted by combining the traffic state evaluation algorithm to determine the key factors and decision thresholds for emergency lane startup or closing.
The availability of emergency lanes in emergency situations has been achieved, while making full use of emergency lanes to alleviate traffic pressure, timely adjust traffic management strategies, improve road traffic efficiency, and effectively respond to the increasingly serious traffic congestion problem.
Smart Images

Figure CN119207101B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic management, and in particular to a method and system for making a dynamic opening decision of an emergency lane based on video monitoring. Background Art
[0002] With the acceleration of urbanization, the increase in traffic volume has led to increasingly serious road congestion problems, especially in the use of emergency lanes on highways. How to effectively manage and dynamically open emergency lanes has become a difficult problem that needs to be solved in the field of traffic management. Traditional traffic management methods often rely on manual monitoring and experience judgment, lacking real-time and accuracy, resulting in the inability to take effective response measures in time during traffic peaks or when emergencies occur. Summary of the invention
[0003] In view of this, the present invention provides a method and system for dynamic opening decision of emergency lanes based on video surveillance, which is used to ensure the availability of emergency lanes in emergency situations, fully utilize emergency lanes to alleviate traffic pressure, timely adjust traffic management strategies, improve road traffic efficiency, and effectively deal with the increasingly serious traffic congestion problem.
[0004] In a first aspect, the present invention provides a method for dynamic opening decision of an emergency lane based on video monitoring, the method comprising:
[0005] Step S1: by calling the pre-trained target detection model YOLOv8, the road monitoring video uploaded by the camera is processed in real time to extract historical traffic flow data;
[0006] Step S2: Based on historical traffic flow data, a traffic congestion prediction model is constructed using a gated recurrent unit (GRU) neural network, and the traffic congestion state is predicted in combination with a traffic state evaluation algorithm;
[0007] Step S3: Determine the key factors and decision thresholds for activating or closing the emergency lane by combining the predicted traffic congestion status with traffic regulations and analyzing historical traffic flow data.
[0008] Optionally, the step S1 includes:
[0009] For several live traffic monitoring videos at four monitoring points on a specific road section, the pre-trained target detection model YOLOv8 is called through the API to analyze the video frames in real time to identify traffic flow parameters, including traffic density, traffic volume, and average traffic speed. That is, the traffic density, traffic volume, and average traffic speed in the video are identified and recorded every other frame.
[0010] The traffic density of each frame image is calculated as follows:
[0011] ;
[0012] In the formula, represents the traffic density in the rth frame image under a specific road section P; represents the total number of vehicles in the rth frame image; w represents the video frame width;
[0013] The average speed of traffic in each frame is calculated as follows:
[0014] ;
[0015] In the formula, represents the average speed of traffic in the rth frame image on a specific road section P; F represents the number of frames per second of the video; Indicates the x-axis position of vehicle j in the current frame image; Represents the x-axis position of vehicle j in the first 5 frames of images.
[0016] Optionally, constructing a traffic congestion prediction model in step S2 includes:
[0017] A fixed-size window is used to slide gradually on the historical traffic flow dataset to sample several training samples containing m consecutive frames; the first m-5 frames of traffic flow data in each sample As the input of the GRU model, , the traffic flow parameters of the last 5 frames are used as the prediction target; represents the traffic density in the rth frame image under a specific road section P; represents the traffic volume in the rth frame image under a specific road section P; represents the average speed of the traffic in the rth frame image on a specific road section P;
[0018] The GRU model updates the reset gate, update gate, candidate memory of this layer in frame order, and outputs the memory , whose expression is:
[0019] ;
[0020] ;
[0021] ;
[0022] ;
[0023] In the formula, Represents the reset gate of the rth frame timing at section P; represents the update gate of the rth frame timing at section P; Represents the candidate memory of the r-th frame sequence at road segment P; represents the memory of the rth frame sequence at road section P; Represents the memory of the r-1th frame sequence at section P;
[0024] According to the memory of the GRU model output in the m-5th frame sequence , to predict the total average traffic flow data of the last 5 frames of sample i, that is: , , , its expression is;
[0025] ;
[0026] The error is calculated based on the mean absolute error MAE, which is used to learn the constrained GRU-based traffic congestion prediction model. The calculation formula is:
[0027] ;
[0028] Where n represents the number of predicted frame samples; represents the target value of the traffic flow parameter at the i-th sample; It represents the prediction result of the traffic congestion prediction model for the target value of the i-th sample; It represents the absolute error between the actual value and the predicted value, and is used to reflect the prediction error of the traffic congestion prediction model for the target value of the i-th frame sample.
[0029] Optionally, the traffic status evaluation algorithm in step S2 includes:
[0030] Traffic state evaluation algorithm, its expression is:
[0031] ;
[0032] In the formula, It represents the traffic congestion index at a specific road section P at time t; represents the traffic density at a specific road section P at time t; represents the traffic flow at a specific road section P at time t; It represents the average speed of traffic at a specific road section P at time t.
[0033] Optionally, step S3 includes:
[0034] Estimating the capacity threshold at a specific road segment P using historical traffic flow data , which is used to determine whether the emergency lane at a specific road section P is opened or closed; the expression for the dynamic opening decision of the emergency lane is:
[0035] ;
[0036] After the traffic flow parameters at a specific road section P are extracted in real time, the traffic flow parameters after a period of time in the future are predicted through the traffic congestion prediction model to estimate the traffic capacity at the road section P at time t. , whose expression is:
[0037] ;
[0038] In the formula, It represents the traffic capacity of a specific road section P at the future time t; Represents the traffic density of a specific road section P at the future time t; It represents the average speed of traffic on a specific road section P at the future time t;
[0039] For a specific road section P, the traffic capacity at the next time t Exceed When the average speed of traffic on a specific road section P at time t in the future is less than 60px / s, the emergency lane on the specific road section P should be opened, that is: ; Otherwise, the emergency lane is closed to ensure its availability in emergency situations; The capacity threshold at a specific road section P , and its calculation formula is:
[0040] ;
[0041] In the formula, represents the historical maximum traffic density at a specific road section P, It indicates the total average traffic speed of a specific road section P when the traffic congestion index is 1 to 4.
[0042] In a second aspect, the present invention provides a dynamic opening decision system for an emergency lane based on video surveillance, the system is implemented based on the dynamic opening decision method for an emergency lane based on video surveillance described in the first aspect, and the system comprises:
[0043] The traffic flow data extraction module is used to extract historical traffic flow data by calling the pre-trained target detection model YOLOv8 and processing the road monitoring video uploaded by the camera in real time;
[0044] Traffic congestion prediction module, which is used to build a traffic congestion prediction model based on historical traffic flow data using the gated recurrent unit (GRU) neural network, and predict traffic congestion status in combination with the traffic status evaluation algorithm;
[0045] The emergency lane opening decision module is used to determine the key factors and decision thresholds for starting or closing the emergency lane by combining the predicted traffic congestion status with traffic regulations and analyzing historical traffic flow data.
[0046] In the technical solution provided by the present invention, the method includes calling a pre-trained target detection model YOLOv8 to process the road monitoring video uploaded by the camera in real time to extract historical traffic flow data; according to the historical traffic flow data, a traffic congestion prediction model is constructed using a gated recurrent unit GRU neural network, and the traffic congestion state is predicted in combination with a traffic state evaluation algorithm; through the predicted traffic congestion state, combined with traffic regulations and by analyzing historical traffic flow data, the key factors and decision thresholds for starting or closing the emergency lane are determined. The method ensures the availability of the emergency lane in an emergency situation through real-time data extraction, traffic congestion prediction and decision analysis, while making full use of the emergency lane to alleviate traffic pressure, timely adjusts the traffic management strategy, improves road traffic efficiency, effectively responds to the increasingly serious traffic congestion problem, and provides a new solution for traffic management. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A flowchart of a method for dynamically opening an emergency lane based on video surveillance provided by an embodiment of the present invention;
[0049] Figure 2 A flow chart of a traffic flow data extraction process provided by an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of traffic flow data extraction based on video images provided by an embodiment of the present invention;
[0051] Figure 4 A visualization chart of historical traffic flow data provided by an embodiment of the present invention;
[0052] Figure 5 A diagram of the traffic congestion prediction model architecture provided by an embodiment of the present invention;
[0053] Figure 6 A dynamic opening decision flow chart of an emergency lane provided in an embodiment of the present invention;
[0054] Figure 7 A schematic diagram of a dynamic emergency lane opening decision system based on video monitoring provided by an embodiment of the present invention;
[0055] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] It should be clear that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings.
[0059] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0060] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0061] In recent years, with the rapid development of video surveillance technology and artificial intelligence, the extraction and analysis of traffic flow data based on video surveillance has gradually become an important means to solve the problem of traffic congestion. The application of target detection models (such as the YOLO series) in real-time video analysis makes the extraction of traffic flow parameters (such as traffic density, flow rate, and average speed) more efficient and accurate. These parameters provide basic data support for subsequent traffic status evaluation and congestion prediction. In terms of traffic congestion prediction, the use of historical traffic flow data combined with machine learning algorithms (such as gated recurrent unit GRU neural network) for modeling can effectively predict the traffic flow state in the future. This method not only improves the accuracy of the prediction, but also provides a scientific basis for traffic managers to adjust traffic management strategies in a timely manner. The dynamic opening decision of the emergency lane is based on the analysis and prediction of real-time traffic flow data, combined with traffic regulations and historical traffic flow data of specific sections to determine when to open or close the emergency lane. By establishing a dynamic opening decision model for the emergency lane, the emergency lane can be fully utilized to relieve traffic pressure and improve road traffic efficiency while ensuring the availability of the emergency lane in an emergency.
[0062] Figure 1 A flowchart of a method for dynamic opening decision of an emergency lane based on video monitoring provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0063] Step S1: By calling the pre-trained target detection model YOLOv8, the road monitoring video uploaded by the camera is processed in real time to extract historical traffic flow data.
[0064] In the embodiment of the present invention, the target detection model can accurately and quickly extract key traffic flow parameters from the video, including vehicle density, vehicle volume, and average vehicle speed, thereby providing basic data for subsequent processing.
[0065] In the embodiment of the present invention, once every 25 minutes, a monitoring device at a specific road P is used to record and upload a 10-minute road monitoring video in real time to the emergency lane dynamic opening decision system.
[0066] In the embodiment of the present invention, Figure 2 As shown, step S1 includes:
[0067] For several live traffic monitoring videos at four monitoring points on a specific road section, the pre-trained target detection model YOLOv8 is called through the API to analyze the video frames in real time to identify traffic flow parameters, including traffic density, traffic volume, and average traffic speed. That is, the traffic density, traffic volume, and average traffic speed in the video are identified and recorded every other frame.
[0068] The traffic density of each frame image is calculated as follows:
[0069] ;
[0070] In the formula, represents the traffic density in the rth frame image under a specific road section P; represents the total number of vehicles in the rth frame image; w represents the video frame width;
[0071] First, input a video file and use OpenCV methods to capture the video frame width (width=1280px), frame height (height=720px) and frames per second (FPS=25Hz); secondly, according to the ultralytics.YOLO('yolov8n.pt') method, directly call the official pre-trained target detection model YOLOv8 through the API to dynamically capture the identification ID, center point coordinates (x, y) and width and height of the rectangular box of each vehicle in different frame images, and count the total number of vehicles in each frame image. ;like Figure 3 As shown, the latest position trajectory of each vehicle is continuously tracked until it passes through the artificially calibrated red dividing line; then, the average speed of the vehicles passing through the red dividing line in the current frame image is calculated based on the Euclidean distance difference between the vehicle at the red dividing line and the position in the previous five frames.
[0072] The average speed of traffic in each frame is calculated as follows:
[0073] ;
[0074] In the formula, represents the average speed of traffic in the rth frame image on a specific road section P; F represents the number of frames per second of the video; Indicates the x-axis position of vehicle j in the current frame image; Represents the x-axis position of vehicle j in the first 5 frames of images.
[0075] In the embodiment of the present invention, considering the computational efficiency and stability, five vehicles may be randomly selected in the frame image, and then their average speed may be used to represent the average speed of the traffic in the current frame image. At the same time, since only the average speed of the traffic in the frame image needs to be obtained, it is not necessary to carefully consider the additional impact of the vehicle size on the speed measurement effect in the process of calculating the specific vehicle speed. In addition, since it is necessary to continuously track the position changes of the specific vehicle in the process of calculating the specific vehicle speed, the speed measurement results of the first five frames in each video lack usability and need to be deleted.
[0076] Step S2: Based on historical traffic flow data, a traffic congestion prediction model is constructed using a gated recurrent unit (GRU) neural network, and the traffic congestion status is predicted in combination with a traffic status evaluation algorithm.
[0077] In the embodiment of the present invention, the traffic congestion prediction model can process the traffic flow data extracted in real time to predict the traffic flow state of a specific road section in the next period of time to warn of possible congestion events.
[0078] In this embodiment, Figure 4 As shown in FIG. 1 , the visualization result of the historical traffic flow data at a specific road section P includes the following steps:
[0079] a) Based on the traffic flow data extraction results, considering the smoothing effect of the graph curve, every 500 frame samples can be averaged into a visualization data point. Among them, every 25 frame samples express the road traffic conditions of one second in the traffic monitoring video.
[0080] b) Due to the differences in the scale of traffic density, flow and speed, the change trend of traffic flow parameters with a smaller value range may no longer be obvious in the visualization chart. Therefore, the traffic density Density and traffic flow Flow can be multiplied in different degrees to enhance the presentation effect of small-scale parameter trend changes. The traffic flow data after the normalization process is shown in Table 1. Among them, the traffic density index Density index, the flow index Flowindex and the speed Speed (px / s).
[0081] Table 1
[0082] ;
[0083] c) A brief statistical analysis of the merged traffic flow data is performed, as shown in Table 2, which shows the maximum, mean and standard deviation of all visualized data points in terms of traffic volume, density and speed parameters.
[0084] Table 2
[0085] .
[0086] In the embodiment of the present invention, Figure 5 As shown, in step S2, a traffic congestion prediction model is constructed, including:
[0087] A fixed-size window is used to slide gradually on the historical traffic flow dataset to sample several training samples containing m consecutive frames; the first m-5 frames of traffic flow data in each sample As the input of the GRU model, , the traffic flow parameters of the last 5 frames are used as the prediction target; represents the traffic density in the rth frame image under a specific road section P; represents the traffic volume in the rth frame image under a specific road section P; represents the average speed of the traffic in the rth frame image on a specific road section P;
[0088] The GRU model updates the reset gate, update gate, candidate memory of this layer in frame order, and outputs the memory , whose expression is:
[0089] ;
[0090] ;
[0091] ;
[0092] ;
[0093] In the formula, Represents the reset gate of the rth frame timing at section P; represents the update gate of the rth frame timing at section P; Represents the candidate memory of the r-th frame sequence at road segment P; represents the memory of the rth frame sequence at road section P; Represents the memory of the r-1th frame sequence at section P;
[0094] According to the memory of the GRU model output in the m-5th frame sequence , to predict the total average traffic flow data of the last 5 frames of sample i, that is: , , , its expression is;
[0095] ;
[0096] The error is calculated based on the mean absolute error MAE, which is used to learn the constrained GRU-based traffic congestion prediction model. The calculation formula is:
[0097] ;
[0098] Where n represents the number of predicted frame samples; represents the target value of the traffic flow parameter at the i-th sample; It represents the prediction result of the traffic congestion prediction model for the target value of the i-th sample; It represents the absolute error between the actual value and the predicted value, and is used to reflect the prediction error of the traffic congestion prediction model for the target value of the i-th frame sample.
[0099] In the embodiment of the present invention, the traffic state evaluation algorithm in step S2 includes:
[0100] Traffic state evaluation algorithm, its expression is:
[0101] ;
[0102] In the formula, It represents the traffic congestion index at a specific road section P at time t; represents the traffic density at a specific road section P at time t; represents the traffic flow at a specific road section P at time t; It represents the average speed of traffic at a specific road section P at time t.
[0103] In the embodiment of the present invention, according to the constructed traffic congestion prediction model, the specific traffic flow parameters of a specific road P after a period of time can be predicted, namely: traffic flow density , Traffic flow and the average speed of traffic Therefore, combined with the traffic status evaluation algorithm defined here, the traffic congestion index can be further calculated to measure the future traffic conditions of a specific road section. For example, when the traffic congestion index When the traffic congestion index is 1 to 4, it is determined that the specific road section is currently unobstructed; when the traffic congestion index is When the traffic congestion index is 5-8, it is determined that the current traffic on a specific road section is restricted; when the traffic congestion index is When it is 8-10, it is determined that the specific road section is currently difficult to pass.
[0104] Step S3: Determine the key factors and decision thresholds for activating or closing the emergency lane by combining the predicted traffic congestion status with traffic regulations and analyzing historical traffic flow data.
[0105] In the embodiment of the present invention, Figure 6 As shown, step S3 includes:
[0106] Estimating the capacity threshold at a specific road segment P using historical traffic flow data , which is used to determine whether the emergency lane at a specific road section P is opened or closed; the expression for the dynamic opening decision of the emergency lane is:
[0107] ;
[0108] After the traffic flow parameters at a specific road section P are extracted in real time, the traffic flow parameters after a period of time in the future are predicted through the traffic congestion prediction model to estimate the traffic capacity at the road section P at time t. , whose expression is:
[0109] ;
[0110] In the formula, It represents the traffic capacity of a specific road section P at the future time t; Represents the traffic density of a specific road section P at the future time t; It represents the average speed of traffic on a specific road section P at the future time t;
[0111] For a specific road section P, the traffic capacity at the next time t Exceed When the average speed of traffic on a specific road section P at time t in the future is less than 60px / s, the emergency lane on the specific road section P should be opened, that is: ; Otherwise, the emergency lane is closed to ensure its availability in emergency situations; The capacity threshold at a specific road section P , and its calculation formula is:
[0112] ;
[0113] In the formula, represents the historical maximum traffic density at a specific road section P, It indicates the total average traffic speed of a specific road section P when the traffic congestion index is 1 to 4.
[0114] In the embodiment of the present invention, It can be adjusted flexibly according to actual conditions, and the generally recommended setting is 0.85.
[0115] In the embodiment of the present invention, analyzing historical traffic flow data includes:
[0116] First, there is a significant positive correlation between the changing trends of traffic density and traffic volume over time on the same road section. This is because in the process of calculating traffic density and traffic volume values, the number of vehicles in the current frame image is proportional to the calculation result, so this naturally leads to the convergence of the changing trends of the average traffic density and traffic volume. This coincides with actual experience, which to some extent shows the effectiveness of the traffic flow data extraction process.
[0117] Then, if we compare the changing trends of traffic speed and traffic volume, we can find the phenomenon of "hysteresis response". That is, the traffic density or traffic volume change at the current time step will continue to affect the average traffic speed of several future time steps. In fact, the sensitivity of this hysteresis response is related to the capacity of the current road section to some extent. In other words, the road section is actually a "water pipe", and the size of the water pipe indicates the maximum threshold of the capacity. The continuous change of inflow within the safety limit will not significantly interfere with the subsequent flow rate. However, when the inflow per unit time exceeds the traffic threshold, it will quickly affect the flow rate.
[0118] Finally, the changing trend of traffic density or traffic volume over time is significantly negatively correlated with the average traffic speed.
[0119] Figure 7 A schematic diagram of a dynamic emergency lane opening decision system based on video monitoring provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the system is implemented based on the above-mentioned emergency lane dynamic opening decision method based on video monitoring, and the system includes:
[0120] Traffic flow data extraction module 1, traffic congestion prediction module 2 and emergency lane opening decision module 3; traffic flow data extraction module 1 and traffic congestion prediction module 2 are connected, and traffic congestion prediction module 2 and emergency lane opening decision module 3 are connected.
[0121] The traffic flow data extraction module 1 is used to extract historical traffic flow data by calling the pre-trained target detection model YOLOv8 and processing the road monitoring video uploaded by the camera in real time; the traffic congestion prediction module 2 is used to construct a traffic congestion prediction model based on the historical traffic flow data using the gated recurrent unit GRU neural network, and predict the traffic congestion status in combination with the traffic status evaluation algorithm; the emergency lane opening decision module 3 is used to determine the key factors and decision thresholds for starting or closing the emergency lane through the predicted traffic congestion status, combined with traffic regulations and by analyzing historical traffic flow data.
[0122] The present invention can identify traffic flow patterns and potential congestion through traffic congestion prediction, and the emergency lane opening decision dynamically adjusts the use strategy of the emergency lane according to the prediction results, which is used to optimize lane resource utilization and alleviate traffic congestion. The characteristics of the present invention are that through real-time video monitoring, advanced data analysis and deep learning technology, the advanced target detection model YOLOv8 and the GRU-based traffic congestion prediction model can accurately predict the traffic status of a specific road section, improve the flexibility and efficiency of traffic management, and also can quickly respond according to the actual traffic conditions, effectively improve the road capacity and safety, improve the use efficiency of the emergency lane, reduce the occurrence of traffic congestion, ensure the availability of the emergency lane in an emergency, and then improve the overall traffic management intelligence level and road capacity, so as to scientifically determine the opening or closing of the emergency lane.
[0123] Each step of the embodiment of the present invention may be performed by an electronic device, which includes but is not limited to a mobile phone, a tablet computer, a portable PC, a desktop computer, etc.
[0124] In the technical solution provided by the present invention, the method includes calling a pre-trained target detection model YOLOv8 to process the road monitoring video uploaded by the camera in real time to extract historical traffic flow data; according to the historical traffic flow data, a traffic congestion prediction model is constructed using a gated recurrent unit GRU neural network, and the traffic congestion state is predicted in combination with a traffic state evaluation algorithm; through the predicted traffic congestion state, combined with traffic regulations and by analyzing historical traffic flow data, the key factors and decision thresholds for starting or closing the emergency lane are determined. The method ensures the availability of the emergency lane in an emergency situation through real-time data extraction, traffic congestion prediction and decision analysis, while making full use of the emergency lane to alleviate traffic pressure, timely adjusts the traffic management strategy, improves road traffic efficiency, effectively responds to the increasingly serious traffic congestion problem, and provides a new solution for traffic management.
[0125] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the electronic device where the computer-readable storage medium is located is controlled to execute the above-mentioned embodiment of the dynamic opening decision method of the emergency lane based on video surveillance.
[0126] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present invention, such as Figure 8 As shown, the electronic device 21 includes: a processor 211, a memory 212, and a computer program 213 stored in the memory 212 and executable on the processor 211. When the computer program 213 is executed by the processor 211, the dynamic opening decision method for the emergency lane based on video surveillance in the embodiment is implemented. To avoid repetition, they are not described one by one here.
[0127] The electronic device 21 includes, but is not limited to, a processor 211 and a memory 212. Those skilled in the art will appreciate that Figure 8 It is only an example of the electronic device 21 and does not constitute a limitation of the electronic device 21. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0128] The processor 211 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0129] The memory 212 may be an internal storage unit of the electronic device 21, such as a hard disk or memory of the electronic device 21. The memory 212 may also be an external storage device of the electronic device 21, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the electronic device 21. Further, the memory 212 may also include both an internal storage unit of the electronic device 21 and an external storage device. The memory 212 is used to store computer programs and other programs and data required by network devices. The memory 212 may also be used to temporarily store data that has been output or is to be output.
[0130] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for dynamic opening decision of emergency lane based on video surveillance, characterized in that: The method comprises: Step S1, by calling the pre-trained target detection model YOLOv8, the road monitoring video uploaded by the camera is processed in real time to extract historical traffic flow data; Step S2: Based on historical traffic flow data, a traffic congestion prediction model is constructed using a gated recurrent unit (GRU) neural network, and the traffic congestion state is predicted in combination with a traffic state evaluation algorithm; Step S3, determining the key factors and decision thresholds for activating or closing the emergency lane by combining the predicted traffic congestion status with traffic regulations and analyzing historical traffic flow data; The traffic congestion prediction model is constructed in step S2, including: A fixed-size window is used to slide gradually on the historical traffic flow dataset to sample several training samples containing m consecutive frames; the first m-5 frames of traffic flow data in each sample As the input of the GRU model, , the traffic flow parameters of the last 5 frames are used as the prediction target; represents the traffic density in the rth frame image under a specific road section P; represents the traffic volume in the rth frame image under a specific road section P; represents the average speed of the traffic in the rth frame image on a specific road section P; The GRU model updates the reset gate, update gate, candidate memory of this layer in frame order, and outputs the memory , whose expression is: ; ; ; ; In the formula, Represents the reset gate of the rth frame timing at section P; represents the update gate of the rth frame timing at section P; Represents the candidate memory of the r-th frame sequence at road segment P; represents the memory of the rth frame sequence at road section P; Represents the memory of the r-1th frame sequence at section P; According to the memory of the GRU model output in the m-5th frame sequence , to predict the total average traffic flow data of the last 5 frames of sample i, that is: , , , its expression is; ; The error is calculated based on the mean absolute error MAE, which is used to learn the constrained GRU-based traffic congestion prediction model. The calculation formula is: ; Where n represents the number of predicted frame samples; represents the target value of the traffic flow parameter at the i-th sample; It represents the prediction result of the traffic congestion prediction model for the target value of the i-th sample; Represents the absolute error between the actual value and the predicted value, which is used to reflect the prediction error of the traffic congestion prediction model for the target value of the i-th frame sample; The step S3 comprises: Estimating the capacity threshold at a specific road segment P using historical traffic flow data , which is used to determine whether the emergency lane at a specific road section P is opened or closed; the expression for the dynamic opening decision of the emergency lane is: ; After the traffic flow parameters at a specific road section P are extracted in real time, the traffic flow parameters after a period of time in the future are predicted through the traffic congestion prediction model to estimate the traffic capacity at the road section P at time t. , whose expression is: ; In the formula, It represents the traffic capacity of a specific road section P at the future time t; Represents the traffic density of a specific road section P at the future time t; It represents the average speed of traffic on a specific road section P at the future time t; For a specific road section P, the traffic capacity at the next time t Exceed When the average speed of traffic on a specific road section P at time t in the future is less than 60px / s, the emergency lane on the specific road section P should be opened, that is: ; Otherwise, the emergency lane is closed to ensure its availability in emergency situations; The capacity threshold at a specific road section P , and its calculation formula is: ; In the formula, represents the historical maximum traffic density at a specific road section P, It indicates the total average traffic speed of a specific road section P when the traffic congestion index is 1 to 4.
2. The method according to claim 1, characterized in that The step S1 comprises: For several live traffic monitoring videos at four monitoring points on a specific road section, the pre-trained target detection model YOLOv8 is called through the API to analyze the video frames in real time to identify traffic flow parameters, including traffic density, traffic volume, and average traffic speed. That is, the traffic density, traffic volume, and average traffic speed in the video are identified and recorded every other frame. The traffic density of each frame image is calculated as follows: ; In the formula, represents the traffic density in the rth frame image under a specific road section P; represents the total number of vehicles in the rth frame image; w represents the video frame width; The average speed of traffic in each frame is calculated as follows: ; In the formula, represents the average speed of traffic in the rth frame image on a specific road section P; F represents the number of frames per second of the video; Indicates the x-axis position of vehicle j in the current frame image; Represents the x-axis position of vehicle j in the first 5 frames of images.
3. The method according to claim 1, characterized in that The traffic status evaluation algorithm in step S2 includes: Traffic state evaluation algorithm, its expression is: ; In the formula, It represents the traffic congestion index at a specific road section P at time t; represents the traffic density at a specific road section P at time t; represents the traffic flow at a specific road section P at time t; It represents the average speed of traffic at a specific road section P at time t.
4. A dynamic emergency lane opening decision system based on video surveillance, characterized in that: The system is implemented based on the emergency lane dynamic opening decision method based on video monitoring according to claim 1, and the system includes: The traffic flow data extraction module is used to extract historical traffic flow data by calling the pre-trained target detection model YOLOv8 and processing the road monitoring video uploaded by the camera in real time; Traffic congestion prediction module, which is used to build a traffic congestion prediction model based on historical traffic flow data using the gated recurrent unit (GRU) neural network, and predict traffic congestion status in combination with the traffic status evaluation algorithm; The emergency lane opening decision module is used to determine the key factors and decision thresholds for starting or closing the emergency lane by combining the predicted traffic congestion status with traffic regulations and analyzing historical traffic flow data.
Citation Information
Patent Citations
Emergency lane online opening decision-making method, system and device and storage medium
CN116994440A