A multimodal traffic flow prediction method and system based on deep learning
Through a multimodal traffic flow prediction method based on deep learning, a Markov decision model is constructed using the traffic flow prediction model and a reinforcement learning model with a dual-Q network structure. This solves the problems of time-consuming computation and low efficiency in handling emergencies in existing technologies, and achieves efficient determination of traffic signal control strategies and improvement of intersection traffic efficiency.
Patent Information
- Application Number
- CN202510428544.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-04-08
AI Technical Summary
Existing traffic flow prediction methods require frequent refitting of parameters, and the calculation time increases with the amount of data, and cannot efficiently handle traffic mutations caused by sudden events.
A multimodal traffic flow prediction method based on deep learning is adopted. The traffic flow prediction model and the reinforcement learning model of the double-Q network structure are used to construct a Markov decision model. The spatial flow network layer, motion flow network layer, time series prediction layer, multimodal fusion layer, and fully connected layer are integrated and implemented through PyTorch and TensorFlow.
The traffic light control strategy is determined without recalculating model parameters, which reduces calculation time, can efficiently handle emergencies, and improve intersection traffic efficiency.
Smart Images

Figure CN120299266B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a multimodal traffic flow prediction method and system based on deep learning. Background Art
[0002] Traffic flow forecasting is the process of estimating the volume of vehicles or pedestrians on a road within a specific future timeframe by analyzing historical and real-time data, combining mathematical models and artificial intelligence techniques. Its core approach is to improve forecast accuracy by integrating multimodal vehicle data and optimizing algorithms, thereby providing a scientific basis for traffic management and route planning.
[0003] The existing technology mainly uses traditional time series analysis methods to achieve traffic flow forecasting. However, this method relies on sliding window calculations of historical data and requires frequent refitting of parameters. Therefore, the model parameters need to be recalculated for each prediction, and the calculation time increases with the amount of data. It cannot efficiently handle traffic flow mutations caused by sudden events (such as traffic accidents). Summary of the Invention
[0004] In order to overcome the above-mentioned drawbacks of traffic flow prediction, such as the need to frequently refit parameters, recalculate model parameters for each prediction, and the computational time increasing with the amount of data; and the inability to efficiently handle sudden changes in traffic volume caused by unexpected events, the present invention provides a multimodal traffic flow prediction method based on deep learning, comprising:
[0005] Obtain multimodal vehicle driving data collected at a specific intersection;
[0006] Based on the multimodal vehicle driving data, a traffic flow prediction model is used to predict the traffic flow prediction data of the specific intersection;
[0007] Inputting the traffic flow prediction data into a reinforcement learning model of a double-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency;
[0008] Solving the Markov decision model to obtain a traffic light control strategy for the specific intersection;
[0009] Among them, the traffic flow prediction model integrates the spatial flow network layer, the motion flow network layer, the time series prediction layer, the multimodal fusion layer, and the fully connected layer; the reinforcement learning model of the dual-Q network structure is implemented through PyTorch and TensorFlow.
[0010] Furthermore, the traffic flow prediction data for the specific intersection is obtained by using a traffic flow prediction model based on the multimodal vehicle driving data:
[0011] Based on the video frame data in the multimodal vehicle driving collection data, the spatial stream network layer is used to perform data processing to obtain vehicle distribution characteristics;
[0012] Based on the vehicle trajectory data in the multimodal vehicle driving collection data, the motion flow network layer is used to analyze the optical flow field to perform vehicle motion trend analysis to obtain trajectory pattern features;
[0013] Based on the time series data of the sensors in the multimodal vehicle driving data, the time series prediction layer is used to weight key time nodes through an attention mechanism to obtain sensor time series features;
[0014] Based on the vehicle distribution characteristics, the trajectory pattern characteristics and the sensor timing characteristics, tensor splicing is performed using the multimodal fusion layer to obtain a spliced target feature;
[0015] Based on the target features, the fully connected layer is used to perform feature interaction to obtain traffic flow prediction data.
[0016] Furthermore, the training process of the traffic flow prediction model includes:
[0017] Obtaining multimodal vehicle driving sample data and real traffic flow data at the specific intersection;
[0018] Based on the multimodal vehicle driving sample data, a traffic flow prediction model is used to perform prediction to obtain traffic flow sample prediction data;
[0019] Based on the real traffic flow data and the traffic flow sample prediction data, a weighted summation is performed using a mean square error (MSE) loss combined with a KL divergence loss to obtain a loss value;
[0020] Based on the loss value, an Adaptive Moment Estimation (Adam) optimizer is used to update the parameters of the traffic flow prediction model to obtain a trained traffic flow prediction model.
[0021] Furthermore, the training process of the reinforcement learning model of the dual-Q network structure includes:
[0022] Obtaining real traffic flow data at the specific intersection;
[0023] Inputting the real traffic flow data into a reinforcement learning model with a double-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; solving the Markov decision model to obtain a traffic light sample control strategy;
[0024] Based on the traffic light sample control strategy, a road simulation is performed using a road simulation technology to obtain vehicle traffic data;
[0025] Calculating a reward value for the vehicle traffic data using a reward function;
[0026] The reinforcement learning model is iteratively trained based on the reward value to obtain a reinforcement learning model with a trained dual-Q network structure.
[0027] Furthermore, the reward function satisfies the following formula:
[0028]
[0029] Among them, r t is the reward value of the vehicle traffic data, w1, w2, w3 are weights, v i is the speed of the i-th vehicle passing the stop line in the vehicle traffic data, N is the total number of vehicles passing the stop line in the vehicle traffic data, q j is the queue length of the jth lane in the vehicle traffic data, Traffic light phase switching conflict information.
[0030] Furthermore, after solving the Markov decision model to obtain the traffic light control strategy for the specific intersection, the method further includes:
[0031] Based on the traffic flow prediction data, the preset traffic flow mutation threshold and the traffic light adjustment range, the signal period in the traffic light control strategy is adjusted using an optimization algorithm to obtain an updated traffic light adjustment strategy.
[0032] Furthermore, after solving the Markov decision model to obtain the traffic light control strategy for the specific intersection, the method further includes:
[0033] Using the traffic light control strategy to adjust the specific intersection to obtain traffic flow adjustment data;
[0034] Based on the traffic flow adjustment data, congestion detection is performed using a congestion detection algorithm to obtain a congestion detection result;
[0035] If the congestion detection result indicates that there is a congestion trend, the traffic light control strategy is optimized using fuzzy control rules based on the traffic flow adjustment to obtain an optimized traffic light control strategy.
[0036] On the other hand, the present invention also provides a multimodal traffic flow prediction system based on deep learning, comprising:
[0037] Data collection module, used to obtain multi-modal vehicle driving data at a specific intersection;
[0038] A traffic flow prediction model module is used to predict traffic flow at the specific intersection based on the multimodal vehicle driving data and the traffic flow prediction model;
[0039] A dynamic signal optimization module is used to input the traffic flow prediction data into a reinforcement learning model with a dual-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; the Markov decision model is solved to obtain a traffic light control strategy for the specific intersection; wherein, the traffic flow prediction model integrates a spatial flow network layer, a motion flow network layer, a time series prediction layer, a multimodal fusion layer, and a fully connected layer; the traffic flow prediction model and the reinforcement learning model of the dual-Q network structure are implemented using PyTorch / TensorFlow.
[0040] Furthermore, the traffic flow prediction model module is specifically used to obtain vehicle distribution characteristics by processing the video frame data in the multimodal vehicle driving collection data using the spatial stream network layer;
[0041] Based on the vehicle trajectory data in the multimodal vehicle driving collection data, the motion flow network layer is used to analyze the optical flow field to perform vehicle motion trend analysis to obtain trajectory pattern features;
[0042] Based on the time series data of the sensors in the multimodal vehicle driving data, the time series prediction layer is used to weight key time nodes through an attention mechanism to obtain sensor time series features;
[0043] Based on the vehicle distribution characteristics, the trajectory pattern characteristics and the sensor timing characteristics, tensor splicing is performed using the multimodal fusion layer to obtain a spliced target feature;
[0044] Based on the target features, the fully connected layer is used to perform feature interaction to obtain traffic flow prediction data.
[0045] Furthermore, the traffic flow prediction model module is further used to train the traffic flow prediction model in the following manner:
[0046] Obtaining multimodal vehicle driving sample data and real traffic flow data at the specific intersection;
[0047] Based on the multimodal vehicle driving sample data, a traffic flow prediction model is used to perform prediction to obtain traffic flow sample prediction data;
[0048] Based on the real traffic flow data and the traffic flow sample prediction data, a weighted summation is performed using the mean square error (MSE) loss combined with the KL divergence loss to obtain a loss value;
[0049] Based on the loss value, the parameters of the traffic flow prediction model are updated using an adaptive moment estimation Adam optimizer to obtain a trained traffic flow prediction model.
[0050] Furthermore, the dynamic signal optimization module is further configured to train the reinforcement learning model of the dual-Q network structure in the following manner:
[0051] Obtaining real traffic flow data at the specific intersection;
[0052] Inputting the real traffic flow data into a reinforcement learning model with a double-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; solving the Markov decision model to obtain a traffic light sample control strategy;
[0053] Furthermore, the dynamic signal optimization module is further configured to perform road simulation based on the traffic signal light sample control strategy using road simulation technology to obtain vehicle traffic data;
[0054] Calculating a reward value for the vehicle traffic data using a reward function;
[0055] The reinforcement learning model is iteratively trained based on the reward value to obtain a reinforcement learning model with a trained dual-Q network structure.
[0056] Based on the traffic flow prediction data, the preset traffic flow mutation threshold and the traffic light adjustment range, the signal period in the traffic light control strategy is adjusted using an optimization algorithm to obtain an updated traffic light adjustment strategy.
[0057] Furthermore, the dynamic signal optimization module is further configured to adjust the specific intersection using the traffic light control strategy to obtain traffic flow adjustment data;
[0058] Based on the traffic flow adjustment data, congestion detection is performed using a congestion detection algorithm to obtain a congestion detection result;
[0059] If the congestion detection result indicates that there is a congestion trend, the traffic light control strategy is optimized using fuzzy control rules based on the traffic flow adjustment to obtain an optimized traffic light control strategy.
[0060] On the other hand, the present invention further provides a computer device, characterized by comprising: one or more processors;
[0061] The processor is configured to store one or more programs;
[0062] When the one or more programs are executed by the one or more processors, any one of the above-mentioned multimodal traffic flow prediction methods based on deep learning is implemented.
[0063] On the other hand, the present invention also provides a computer-readable storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed, it implements any one of the multimodal traffic flow prediction methods based on deep learning described above.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] The present invention provides a multimodal traffic flow prediction method and system based on deep learning, the method comprising:
[0066] An electronic device acquires multimodal vehicle driving data collected at a specific intersection; a traffic flow prediction model is used to perform predictions to obtain traffic flow prediction data for the specific intersection; and the traffic flow prediction data is input into a reinforcement learning model with a dual-Q network structure to obtain a traffic light control strategy for the specific intersection. In an embodiment of the present invention, a traffic flow prediction model is used to obtain traffic flow prediction data, and a reinforcement learning model with a dual-Q network structure is used to construct a Markov decision model with the goal of maximizing intersection traffic efficiency. The Markov decision model is then solved to obtain a traffic light control strategy for the specific intersection. This approach not only determines the traffic light control strategy, but also eliminates the need to recalculate model parameters, reducing computational time and enabling the handling of unexpected events. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 Schematic diagram of the process of the multimodal traffic flow prediction method based on deep learning of the present invention;
[0068] Figure 2 Schematic diagram of the structure of the multimodal traffic flow prediction system based on deep learning of the present invention;
[0069] Figure 3 Schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0070] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0071] Example 1:
[0072] The present invention provides a multimodal traffic flow prediction method based on deep learning, the flow chart is as follows Figure 1 Shown, including:
[0073] Step 101: Acquire multimodal vehicle driving data collected at a specific intersection;
[0074] Step 102: Based on the multimodal vehicle driving data, a traffic flow prediction model is used to perform predictions to obtain traffic flow prediction data for a specific intersection;
[0075] Step 103: Input the traffic flow prediction data into the reinforcement learning model of the double-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency;
[0076] Step 104: Solve the Markov decision model to obtain the traffic light control strategy for a specific intersection. The traffic flow prediction model integrates a spatial flow network layer, a motion flow network layer, a time series prediction layer, a multimodal fusion layer, and a fully connected layer. The reinforcement learning model of the dual-Q network structure is implemented using PyTorch and TensorFlow.
[0077] An embodiment of the present invention provides a multimodal traffic flow prediction method based on deep learning, which is applied to an electronic device, which may be a personal computer (PC), a server, or other intelligent device.
[0078] In order to accurately and effectively perform multimodal traffic flow prediction based on deep learning, the embodiment of the present invention uses a traffic flow prediction model to obtain traffic flow prediction data, and also uses a reinforcement learning model with a dual-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency. The Markov decision model is solved to obtain the traffic light control strategy for a specific intersection. This method not only realizes the determination of the traffic light control strategy, but also eliminates the need to recalculate model parameters, reduces calculation time, and can realize the handling of sudden events.
[0079] In order to determine the traffic light control strategy for a specific intersection, in an embodiment of the present invention, an electronic device can obtain multimodal vehicle driving data collected at a specific intersection. Specifically, video frame data can be collected by a camera array deployed at a specific intersection, and transmitted to the electronic device using H.265 encoding compression; an Internet of Things device composed of a geomagnetic sensor and a radar sensor is used to collect vehicle flow, vehicle speed, and vehicle model data in real time, with a sampling frequency set to 1Hz, wherein the vehicle flow, vehicle speed, and vehicle model data can be referred to as sensor time series data; the Global Positioning System (GPS) trajectory data of the networked vehicle, i.e., the vehicle trajectory data, is obtained through the vehicle to X (V2X) communication protocol, and the longitude and latitude coordinates, driving direction, and instantaneous speed are extracted. The video frame data, vehicle flow, vehicle speed, vehicle model data, longitude and latitude coordinates, driving direction, and instantaneous speed are the multimodal driving data collected in the embodiment of the present invention.
[0080] After acquiring the multimodal driving data, the electronic device can use a timestamp synchronization mechanism to unify the multimodal driving data collected from the camera array, sensors, and V2X communication to the same time base to ensure the temporal consistency of the data. Through coordinate conversion technology, the vehicle's GPS trajectory data is mapped to the grid coordinate system of the electronic map to achieve precise alignment of the vehicle position with the spatial structure of the intersection. The electronic device also establishes a data cleaning pipeline to compensate for missing values in the multimodal driving data using linear interpolation to ensure data continuity. Based on statistical methods, the 3σ criterion (three times the standard deviation criterion) is used to identify and eliminate outliers to avoid interference of noise data in subsequent analysis.
[0081] In order to achieve multimodal traffic flow prediction, in an embodiment of the present invention, the electronic device locally stores a traffic flow prediction model. The electronic device can input multimodal vehicle driving data into the traffic flow prediction model to obtain the traffic flow prediction data for the specific intersection output by the traffic flow prediction model. The traffic flow prediction model integrates a spatial flow network layer, a motion flow network layer, a time series prediction layer, a multimodal fusion layer, and a fully connected layer. In one example, the spatial flow network layer can extract the spatial features of the intersection and capture the static spatial distribution of the traffic flow. The motion flow network layer can capture the motion characteristics of the vehicle and analyze the dynamic changes of the traffic flow. The time series prediction layer can analyze the time series characteristics of the traffic flow and predict future traffic changes. The multimodal fusion layer can deeply fuse the features of the spatial flow, motion flow, and time series prediction. The fully connected layer can integrate all features and output the final traffic flow prediction data.
[0082] The electronic device also locally stores a reinforcement learning model of a dual-Q network structure. After obtaining the traffic flow prediction data, the traffic flow prediction data is input into the reinforcement learning model of the dual-Q network structure. The reinforcement learning model of the dual-Q network structure constructs a Markov decision model with the goal of maximizing intersection traffic efficiency.
[0083] In one example, the state space of the Markov decision model can include current traffic flow, signal light status, intersection topology, etc. The action space can be a signal light switching strategy, such as the duration of red, green, and yellow lights. The reward function can be aimed at maximizing the efficiency of intersection traffic, and the reward function can include vehicle waiting time, traffic volume, queue length, etc. The dual Q network structure can use two independent Q networks (Q1 and Q2) to estimate the action value function to reduce the over-estimation problem. Regularly update the target network parameters to stabilize the training process. Store historical state-action-reward-next state tuples, randomly sample for training, break data correlation, effectively avoid training oscillation problems, and improve training stability.
[0084] In an embodiment of the present invention, PyTorch and TensorFlow can be used to implement a reinforcement learning model of a dual-Q network structure.
[0085] The electronic device can solve the Markov decision model to derive a traffic light control strategy for a specific intersection. In one example, the electronic device can gradually optimize the strategy by alternating between strategy evaluation and strategy improvement. This directly optimizes the value function until convergence.
[0086] In order to obtain traffic flow prediction data, based on the above embodiment, in an embodiment of the present invention, based on multimodal vehicle driving data, a traffic flow prediction model is used to perform predictions, and traffic flow prediction data for a specific intersection is obtained, including:
[0087] Based on the video frame data in the multimodal vehicle driving data collection, the spatial stream network layer is used to process the data to obtain the vehicle distribution characteristics;
[0088] Based on the vehicle trajectory data in the multimodal vehicle driving data, the motion flow network layer is used to analyze the optical flow field to analyze the vehicle motion trend and obtain the trajectory pattern characteristics;
[0089] Based on the time series data of sensors in multimodal vehicle driving data, the time series prediction layer uses the attention mechanism to weight key time nodes to obtain sensor time series features;
[0090] Based on the vehicle distribution characteristics, trajectory pattern characteristics and sensor timing characteristics, a multimodal fusion layer is used to perform tensor splicing to obtain the spliced target features;
[0091] Based on the target features, the fully connected layer is used for feature interaction to obtain traffic flow prediction data.
[0092] Based on the video frames from multimodal vehicle driving data, electronic devices can use a spatial stream network layer to extract static spatial features of the intersection and generate vehicle distribution features that reflect vehicle density and location distribution. This spatial stream network layer can capture key information such as lane distribution and vehicle location at the intersection, providing basic spatial data support for traffic flow prediction.
[0093] Based on vehicle trajectory data, the motion flow network layer analyzes vehicle trajectories and speed changes using optical flow or a long short-term memory network (LSTM), generating trajectory pattern features that reflect the vehicle's direction and motion pattern. This motion flow network layer can identify vehicle motion trends, acceleration changes, and lane changes, providing important insights for dynamic traffic flow analysis.
[0094] Based on time series data collected by sensors (such as traffic volume, speed, and vehicle type), the time series prediction layer uses an attention mechanism to weight key time nodes, extracting cyclical changes in traffic flow and sudden event characteristics, and generating high-precision sensor time series features. This time series prediction layer can capture cyclical patterns such as morning and evening rush hours and effectively predict abnormal situations such as sudden congestion.
[0095] The multimodal fusion layer deeply fuses vehicle distribution features, trajectory pattern features, and sensor timing features. Through tensor concatenation and an attention mechanism, it dynamically adjusts the weights of each modality to generate unified high-dimensional target features. This multimodal fusion layer fully leverages the complementarity of multimodal data, improving the richness and robustness of feature representation.
[0096] Based on the fused target features, the fully connected layer performs feature interaction and nonlinear mapping through a multi-layer neural network, outputting traffic flow prediction data. This fully connected layer maps high-dimensional features into specific traffic flow values, providing scientific and reliable data support for the formulation of traffic light control strategies. Through the collaborative work of various layers, the traffic flow prediction model achieves high-precision, real-time traffic flow forecasts, providing intelligent solutions for urban traffic management.
[0097] In order to obtain traffic flow prediction data, based on the above embodiments, in an embodiment of the present invention, the training process of the traffic flow prediction model includes:
[0098] Obtain multimodal vehicle driving sample data and real traffic flow data at specific intersections;
[0099] Based on the multimodal vehicle driving sample data, the traffic flow prediction model is used to make predictions and obtain traffic flow sample prediction data;
[0100] Based on the real traffic flow data and traffic flow sample prediction data, the MSE loss is combined with the KL divergence loss for weighted summation to obtain the loss value;
[0101] Based on the loss value, the Adam optimizer is used to update the parameters of the traffic flow prediction model to obtain the trained traffic flow prediction model.
[0102] To train the traffic flow prediction model, electronic devices can obtain multimodal vehicle driving sample data at a specific intersection and the corresponding real traffic flow data. The multimodal vehicle driving sample data includes video frame data, vehicle trajectories, and sensor time series data. The real traffic flow data is obtained through intersection monitoring equipment or manual annotation and is used for model training and verification.
[0103] Based on multimodal vehicle driving sample data, a traffic flow prediction model is used to generate traffic flow sample prediction data. The model extracts multimodal features and outputs traffic flow sample prediction data through the collaborative work of the spatial flow network layer, motion flow network layer, time series prediction layer, multimodal fusion layer, and fully connected layer.
[0104] To evaluate the accuracy of the prediction results, we used a weighted sum of the MSE loss and KL divergence loss based on real traffic flow data and sample traffic flow predictions to calculate the model's loss. MSE loss measures the difference between the predicted and true values, while KL divergence loss evaluates the similarity between the predicted and true distributions. Combining these two methods effectively improves the model's prediction accuracy and robustness.
[0105] In one example, the electronic device can calculate the loss value using the following multi-task loss function formula:
[0106]
[0107] Among them, L total is the loss value, α and β are weight coefficients respectively, the sum of these two weight coefficients is 1, y i is the actual traffic flow in the i-th time period in the real traffic flow data, is the predicted traffic flow of the i-th time period in the traffic flow sample prediction data, N is the number of time periods, C is the number of traffic state categories, and the traffic state categories include smooth, congested and slow, P c is the predicted probability of the cth traffic state category in the traffic flow sample prediction data, Q c is the true probability of the cth traffic category in the real traffic flow data.
[0108] Among them, this loss function can jointly optimize the numerical accuracy and distribution consistency of traffic flow, and improve the traffic flow prediction model's ability to characterize complex traffic patterns. In an example, the initial weights α and β can be set to 0.7 and 0.3 during training, and a dynamic adjustment strategy can be used to balance the two loss magnitudes.
[0109] Based on the calculated loss value, the Adam optimizer is used to update the parameters of the traffic flow prediction model. Combining the advantages of the momentum method and adaptive learning rate, the Adam optimizer enables rapid convergence and avoids local optima during training. Through multiple iterations of training, a fully trained traffic flow prediction model is ultimately obtained. This model can accurately predict future traffic flows and provide reliable data support for optimizing traffic light control strategies.
[0110] In order to train the reinforcement learning model of the dual-Q network structure and improve the reinforcement results of the reinforcement learning model, based on the above embodiments, in an embodiment of the present invention, the training process of the reinforcement learning model of the dual-Q network structure includes:
[0111] Get real traffic flow data at a specific intersection;
[0112] Real traffic flow data is fed into a reinforcement learning model with a dual-Q network structure to construct a Markov decision model with the goal of maximizing intersection efficiency. The Markov decision model is then solved to obtain a sample traffic light control strategy.
[0113] Based on the traffic light sample control strategy, road simulation technology is used to simulate the road and obtain vehicle traffic data;
[0114] Calculate the reward value of vehicle traffic data using the reward function;
[0115] The reinforcement learning model is iteratively trained based on the reward value to obtain a reinforcement learning model with a trained dual-Q network structure.
[0116] In an embodiment of the present invention, the electronic device can obtain real traffic flow data at a specific intersection. This data may include key indicators such as vehicle flow, vehicle speed, and queue length, and is usually collected through intersection monitoring equipment or historical traffic databases.
[0117] Real-world traffic flow data is fed into a reinforcement learning model with a dual-Q network architecture, which constructs a Markov decision model aimed at maximizing intersection efficiency. By defining a state space, action space, and reward function, the Markov decision model formalizes the traffic light control problem as a sequential decision problem. The dual-Q network architecture employs two independent Q networks to mitigate overestimation and improve model stability and convergence speed.
[0118] Solve the Markov decision model to generate sample traffic light control strategies. This process uses policy iteration or value iteration, combined with deep reinforcement learning algorithms, to gradually optimize the traffic light control strategy to maximize intersection efficiency.
[0119] Based on the generated traffic light sample control strategy, high-fidelity road simulation is performed using road simulation technology. This technology constructs a virtual traffic environment, simulates vehicle behavior under the traffic light control strategy, and generates vehicle traffic data, including intersection crossing time, queue length, and delay time.
[0120] The reward function is used to evaluate the simulated vehicle traffic data and calculate the reward value. The reward function usually takes intersection traffic efficiency as the core goal and combines multiple indicators (such as vehicle waiting time, traffic volume, and queue length) for weighted calculation to fully reflect the effectiveness of the traffic light control strategy.
[0121] Based on the calculated reward values, the reinforcement learning model with a dual-Q network structure is iteratively trained. By continuously adjusting the model parameters and optimizing the traffic light control strategy, a trained reinforcement learning model with a dual-Q network structure is ultimately obtained. This reinforcement learning model with a dual-Q network structure can achieve efficient and adaptive determination of traffic light control strategies in real-world traffic environments, significantly improving intersection efficiency and traffic management.
[0122] In order to train the reinforcement learning model of the dual-Q network structure, based on the above embodiments, in this embodiment of the present invention, the reward function satisfies the following formula:
[0123]
[0124] Among them, r t is the reward value of vehicle traffic data, w1, w2, w3 are weights, v i is the speed of the i-th vehicle passing the stop line in the vehicle traffic data, N is the total number of vehicles passing the stop line in the vehicle traffic data, q j is the queue length of the jth lane in the vehicle traffic data, Traffic light phase switching conflict information.
[0125] In one example, w1, w2, and w3 may be 0.5, 0.3, and 0.2, respectively.
[0126] In the embodiment of the present invention, the five-tuple of the Markov decision model can be expressed as<S,A,P,R,γ> , the state space S is s t =[f t ,d t ,q t ,τt ],s t is the state vector of the tth time period in the future, f t is the predicted traffic volume in the tth time period in the future, d t is the duration of the current signal phase in the future t-th time period, q t is the queue length of each lane in the future t-th time period, τ t is the time period feature of the future t-th time period, specifically the classification code of the morning and evening peak / off-peak period. The action space A is a t ∈{maintain the current phase, switch to the next phase in advance, and extend the green light duration by △ seconds}, where a t is the action taken in the tth time period in the future, △ is an adjustable parameter and can be 5-15s.
[0127] In order to accurately and effectively adjust traffic lights and thus improve traffic efficiency at intersections, based on the above embodiments, in an embodiment of the present invention, after solving the Markov decision model to obtain a traffic light control strategy for a specific intersection, the following steps are further included:
[0128] Based on traffic flow prediction data, preset traffic flow mutation threshold and traffic light adjustment range, the signal cycle in the traffic light control strategy is adjusted using an optimization algorithm to obtain an updated traffic light adjustment strategy.
[0129] When optimizing traffic signal control strategies, a Markov decision model can be used to solve the traffic signal at a specific intersection to obtain a preliminary traffic signal control strategy. Subsequently, an optimization algorithm is used to dynamically adjust the signal cycle based on traffic flow forecast data, a preset traffic flow mutation threshold, and the traffic signal adjustment range.
[0130] Specifically, the signal period adjustment formula may be as follows:
[0131]
[0132] Among them, C new is the adjusted signal period, C base is the basic signal period preset according to historical data, and clip is the calculated result, i.e. C new Limited to C min and C max The mathematical function between is the traffic flow prediction data, f max is the maximum value of traffic flow data. In one example, it can be the predicted traffic flow in the next 5 minutes, f threshold is the preset traffic mutation threshold (for example, year-on-year change rate ≥ 15%), C minThe minimum signal period of the traffic light adjustment range, in one example it can be 60s, C max In one example, the maximum signal period of the traffic light adjustment range may be 180 seconds.
[0133] Through this adjustment method, the signal cycle can be dynamically adjusted according to real-time traffic flow forecasts and sudden changes, thereby optimizing the traffic light control strategy and improving the traffic efficiency of the intersection.
[0134] In order to accurately and effectively adjust traffic lights and thus improve traffic efficiency at intersections, based on the above embodiments, in an embodiment of the present invention, after solving the Markov decision model to obtain a traffic light control strategy for a specific intersection, the following steps are further included:
[0135] Use traffic light control strategies to adjust specific intersections and obtain traffic flow adjustment data;
[0136] Based on the traffic flow adjustment data, congestion detection is performed using a congestion detection algorithm to obtain a congestion detection result;
[0137] If the congestion detection result shows that there is a congestion trend, the traffic light control strategy is optimized based on traffic flow adjustment using fuzzy control rules to obtain an optimized traffic light control strategy.
[0138] During the traffic light control strategy optimization process, the electronic device can use a Markov decision model to solve the traffic light at a specific intersection and obtain a preliminary traffic light control strategy. This traffic light control strategy can be used to adjust the traffic flow at the specific intersection. Based on the traffic flow adjustment data obtained after adjustment, congestion detection is performed using a congestion detection algorithm to obtain a congestion detection result.
[0139] If the congestion detection result shows that there is a congestion trend, the electronic device can further optimize the traffic light control strategy using preset fuzzy control rules. For example, when the queue length at the east (the east, south, west, and north described here are the east, south, west, and north in the actual application scenario, and the same will be repeated later) entrance is long and the traffic flow at the west entrance is low, the electronic device can extend the east-west green light time by 10%. If the waiting time difference between each phase is large, the electronic device will switch to the maximum pressure phase. These rules are processed by Mamdani fuzzy reasoning and defuzzified using the center of gravity method.
[0140] The specific formula for the electronic device to determine that the congestion detection result indicates the presence of a congestion trend is:
[0141]
[0142] Where K is the number of time periods, which can be 6, y k is the actual flow rate in the kth time period, is the predicted flow rate for the kth time period, and ∈ is the preset flow rate deviation threshold. When the mode switching condition expressed by this formula is met, the traffic light control strategy can be optimized using the above fuzzy control rules.
[0143] Through these mechanisms, electronic devices can dynamically adjust traffic light control strategies based on real-time traffic conditions, thereby effectively alleviating traffic congestion and improving traffic efficiency at intersections.
[0144] In an embodiment of the present invention, a three-dimensional traffic situation display interface of a Web Graphics Library (WebGL) can also be developed, integrating electronic maps, video surveillance images, and predicted traffic heat maps for overlay display; constructing a visual decision panel: displaying historical / predicted traffic comparison through a line graph, and using a Sankey diagram to display vehicle turning distribution; realizing a signal timing scheme simulation function: supporting the deduction of traffic flow changes after parameter adjustment, and providing a comparison view of multiple optimization schemes; deploying an abnormal warning subsystem: when it is detected that the regional congestion index exceeds the threshold, a detour suggestion is automatically generated and pushed to the navigation platform.
[0145] Example 2:
[0146] Based on the same inventive concept, the present invention also provides a multimodal traffic flow prediction system based on deep learning, the structural diagram of which is shown in FIG. Figure 2 Shown, including:
[0147] The data collection module 201 is used to obtain multi-modal vehicle driving data at a specific intersection;
[0148] Traffic flow prediction model module 202 is used to predict traffic flow at a specific intersection using a traffic flow prediction model based on multimodal vehicle travel data;
[0149] The dynamic signal optimization module 203 is used to input traffic flow prediction data into the reinforcement learning model of the dual-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; the Markov decision model is solved to obtain the traffic light control strategy for a specific intersection; the traffic flow prediction model integrates a spatial flow network layer, a motion flow network layer, a time series prediction layer, a multimodal fusion layer, and a fully connected layer; the traffic flow prediction model and the reinforcement learning model of the dual-Q network structure are implemented using PyTorch / TensorFlow.
[0150] In a specific implementation, the traffic flow prediction model module 202 is specifically configured to:
[0151] Based on the video frame data in the multimodal vehicle driving data collection, the spatial stream network layer is used to process the data to obtain the vehicle distribution characteristics;
[0152] Based on the vehicle trajectory data in the multimodal vehicle driving data, the motion flow network layer is used to analyze the optical flow field to analyze the vehicle motion trend and obtain the trajectory pattern characteristics;
[0153] Based on the time series data of sensors in multimodal vehicle driving data, the time series prediction layer uses the attention mechanism to weight key time nodes to obtain sensor time series features;
[0154] Based on the vehicle distribution characteristics, trajectory pattern characteristics and sensor timing characteristics, a multimodal fusion layer is used to perform tensor splicing to obtain the spliced target features;
[0155] Based on the target features, the fully connected layer is used for feature interaction to obtain traffic flow prediction data.
[0156] In a specific implementation, the traffic flow prediction model module 202 is further configured to:
[0157] The traffic flow prediction model is trained in the following way:
[0158] Obtain multimodal vehicle driving sample data and real traffic flow data at specific intersections;
[0159] Based on the multimodal vehicle driving sample data, the traffic flow prediction model is used to make predictions and obtain traffic flow sample prediction data;
[0160] Based on the real traffic flow data and traffic flow sample prediction data, the mean square error (MSE) loss is combined with the KL divergence loss for weighted summation to obtain the loss value;
[0161] Based on the loss value, the parameters of the traffic flow prediction model are updated using the adaptive moment estimation Adam optimizer to obtain the trained traffic flow prediction model.
[0162] In a specific implementation, the dynamic signal optimization module 203 is further configured to:
[0163] The reinforcement learning model of the double-Q network structure is trained in the following way:
[0164] Get real traffic flow data at a specific intersection;
[0165] Real traffic flow data is fed into a reinforcement learning model with a dual-Q network structure to construct a Markov decision model with the goal of maximizing intersection efficiency. The Markov decision model is then solved to obtain a sample traffic light control strategy.
[0166] In a specific implementation, the dynamic signal optimization module 203 is further configured to:
[0167] Based on the traffic light sample control strategy, road simulation technology is used to simulate the road and obtain vehicle traffic data;
[0168] Calculate the reward value of vehicle traffic data using the reward function;
[0169] The reinforcement learning model is iteratively trained based on the reward value to obtain a reinforcement learning model with a trained dual-Q network structure.
[0170] Based on traffic flow prediction data, preset traffic flow mutation threshold and traffic light adjustment range, the signal cycle in the traffic light control strategy is adjusted using an optimization algorithm to obtain an updated traffic light adjustment strategy.
[0171] In a specific implementation, the dynamic signal optimization module 203 is further configured to:
[0172] Use traffic light control strategies to adjust specific intersections and obtain traffic flow adjustment data;
[0173] Based on the traffic flow adjustment data, congestion detection is performed using a congestion detection algorithm to obtain a congestion detection result;
[0174] If the congestion detection result shows that there is a congestion trend, the traffic light control strategy is optimized based on traffic flow adjustment using fuzzy control rules to obtain an optimized traffic light control strategy.
[0175] Example 3:
[0176] like Figure 3 As shown, the present invention also provides an electronic device, which may be a computer, a single-chip microcomputer, a smart mobile device, or the like. The electronic device in this embodiment may include a processor, a memory, a transceiver component, and the like. The memory, processor, and transceiver component are connected via a bus; the memory may be used to store an execution program, which may include instructions; and the processor may be used to execute the instructions stored in the memory. The memory may also be used to store data, which may be accessed and / or modified during the execution of the instructions.
[0177] The processor 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. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a multimodal traffic flow prediction method based on deep learning in the above embodiment.
[0178] Example 4:
[0179] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It can be understood that the storage medium here can include both built-in storage media in the electronic device and, of course, extended storage media supported by the electronic device. The storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space. These instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor loads and executes one or more instructions stored in the storage medium, which can implement the steps of a multimodal traffic flow prediction method based on deep learning in the above embodiment.
[0180] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0181] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0182] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit its scope of protection. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art may still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the scope of protection of the pending claims.
Claims
1. A multimodal traffic flow prediction method based on deep learning, characterized in that: The method comprises: Obtain multimodal vehicle driving data collected at a specific intersection; Based on the multimodal vehicle driving data, a traffic flow prediction model is used to predict the traffic flow prediction data of the specific intersection; Inputting the traffic flow prediction data into a reinforcement learning model of a double-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; Solving the Markov decision model to obtain a traffic light control strategy for the specific intersection; The traffic flow prediction model integrates a spatial flow network layer, a motion flow network layer, a time series prediction layer, a multimodal fusion layer, and a fully connected layer; the reinforcement learning model of the dual-Q network structure is implemented using PyTorch and TensorFlow. The traffic flow prediction data of the specific intersection is obtained by using a traffic flow prediction model to predict based on the multimodal vehicle driving data: Based on the video frame data in the multimodal vehicle driving collection data, the spatial stream network layer is used to perform data processing to obtain vehicle distribution characteristics; Based on the vehicle trajectory data in the multimodal vehicle driving collection data, the motion flow network layer is used to analyze the optical flow field to perform vehicle motion trend analysis to obtain trajectory pattern features; Based on the time series data of the sensors in the multimodal vehicle driving data, the time series prediction layer is used to weight key time nodes through an attention mechanism to obtain sensor time series features; Based on the vehicle distribution characteristics, the trajectory pattern characteristics and the sensor timing characteristics, tensor splicing is performed using the multimodal fusion layer to obtain a spliced target feature; Based on the target features, the fully connected layer is used to perform feature interaction to obtain traffic flow prediction data.
2. The method according to claim 1, wherein The training process of the traffic flow prediction model includes: Obtaining multimodal vehicle driving sample data and real traffic flow data at the specific intersection; Based on the multimodal vehicle driving sample data, a traffic flow prediction model is used to perform prediction to obtain traffic flow sample prediction data; Based on the real traffic flow data and the traffic flow sample prediction data, a weighted summation is performed using the mean square error (MSE) loss combined with the KL divergence loss to obtain a loss value; Based on the loss value, the parameters of the traffic flow prediction model are updated using an adaptive moment estimation Adam optimizer to obtain a trained traffic flow prediction model.
3. The method according to claim 1, characterized in that The training process of the reinforcement learning model of the dual-Q network structure includes: Obtaining real traffic flow data at the specific intersection; Inputting the real traffic flow data into a reinforcement learning model with a double-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; solving the Markov decision model to obtain a traffic light sample control strategy; Based on the traffic light sample control strategy, a road simulation is performed using a road simulation technology to obtain vehicle traffic data; Calculating a reward value for the vehicle traffic data using a reward function; The reinforcement learning model is iteratively trained based on the reward value to obtain a reinforcement learning model with a trained dual-Q network structure.
4. The method according to claim 1, wherein After solving the Markov decision model to obtain the traffic light control strategy for the specific intersection, the method further includes: Based on the traffic flow prediction data, the preset traffic flow mutation threshold and the traffic light adjustment range, the signal period in the traffic light control strategy is adjusted using an optimization algorithm to obtain an updated traffic light adjustment strategy.
5. The method according to claim 1, wherein After solving the Markov decision model to obtain the traffic light control strategy for the specific intersection, the method further includes: Using the traffic light control strategy to adjust the specific intersection to obtain traffic flow adjustment data; Based on the traffic flow adjustment data, congestion detection is performed using a congestion detection algorithm to obtain a congestion detection result; If the congestion detection result indicates that there is a congestion trend, the traffic light control strategy is optimized using fuzzy control rules based on the traffic flow adjustment to obtain an optimized traffic light control strategy.
6. A multimodal traffic flow prediction system based on deep learning, characterized in that: include: Data collection module, used to obtain multi-modal vehicle driving data at a specific intersection; A traffic flow prediction model module is used to predict traffic flow at the specific intersection based on the multimodal vehicle driving data and the traffic flow prediction model; A dynamic signal optimization module is configured to input the traffic flow prediction data into a reinforcement learning model with a dual-Q network structure to construct a Markov decision model with the goal of maximizing intersection traffic efficiency; the Markov decision model is solved to obtain a traffic light control strategy for the specific intersection; the traffic flow prediction model integrates a spatial flow network layer, a motion flow network layer, a time series prediction layer, a multimodal fusion layer, and a fully connected layer; the traffic flow prediction model and the reinforcement learning model with the dual-Q network structure are implemented using PyTorch and TensorFlow; Traffic flow prediction model module, specifically used for: Based on the video frame data in the multimodal vehicle driving collection data, the spatial stream network layer is used to perform data processing to obtain vehicle distribution characteristics; Based on the vehicle trajectory data in the multimodal vehicle driving collection data, the motion flow network layer is used to analyze the optical flow field to perform vehicle motion trend analysis to obtain trajectory pattern features; Based on the time series data of the sensors in the multimodal vehicle driving data, the time series prediction layer is used to weight key time nodes through an attention mechanism to obtain sensor time series features; Based on the vehicle distribution characteristics, the trajectory pattern characteristics and the sensor timing characteristics, tensor splicing is performed using the multimodal fusion layer to obtain a spliced target feature; Based on the target features, the fully connected layer is used to perform feature interaction to obtain traffic flow prediction data.
7. An electronic device, characterized in that: include: at least one processor and memory; The memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the multimodal traffic flow prediction method based on deep learning as described in any one of claims 1 to 5 is implemented.
8. A readable storage medium, characterized in that: An execution program is stored thereon, and when the execution program is executed, the multimodal traffic flow prediction method based on deep learning as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Traffic signal lamp strategy evaluation evolution method and system
CN118015860A
Adaptive traffic signal control method based on reinforcement learning and self-attention mechanism
CN118942261A