Traffic flow prediction method and system based on embedded physical information deep neural network

By embedding physical simulated neural networks in traffic flow prediction, combining dynamic mesh division and signal control logic, the problem of insufficient physical consistency and complex scene adaptability in urban complex road networks is solved, and high-precision and reliable traffic flow prediction and multi-objective optimization control are achieved.

CN120452198AActive Publication Date: 2025-08-08CHINA ROAD & BRIDGE +1

Patent Information

Application Number
CN202510743394.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-08-08
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

Traditional traffic prediction methods have problems such as insufficient physical consistency, poor adaptability of complex scenarios and insufficient real-time performance in complex urban road networks, especially in dynamic scenarios such as signal control intersections and tidal lanes.

Method used

The traffic flow prediction method based on embedded physical simulation neural network is adopted. By using the traffic flow physical simulation equation as a constraint embedded neural network training, a hybrid framework of dual-driven models and data is built, and a deep neural network is used to capture nonlinear spatial and temporal correlations, combined with dynamic grid division and signal control logic, dynamic identification and prediction of traffic flow density, flow and congestion propagation are realized.

Benefits of technology

It improves the accuracy and reliability of traffic flow prediction, enhances the dynamic adaptability to complex urban traffic scenarios, supports the generation of multi-objective optimization management and control decisions, and ensures that the prediction results are in line with traffic flow theory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120452198A_ABST
    Figure CN120452198A_ABST
Patent Text Reader

Abstract

The invention provides a traffic flow prediction method and system based on an embedded physical information deep neural network, and belongs to the technical field of intelligent traffic system and deep learning crossing. The method comprises the following steps: firstly, carrying out variable grid division on an urban high-density road network, and establishing a physical model integrated with signal control to generate traffic state prediction; then constructing a physical information neural network, jointly inputting historical detection data and a physical model prediction result, and embedding a traffic flow conservation equation and a vehicle transmission rule as physical constraints through a loss function; weighted loss is utilized to optimize network parameters, and short-time density, flow and congestion propagation prediction conforming to the traffic flow theory is achieved. The problems that a traditional model is low in precision and a pure data driving method is insufficient in physical consistency are solved, and the accuracy and reliability of urban complex road network traffic situation prediction are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intersection of intelligent transportation systems and deep learning technology, and specifically relates to a traffic flow intelligent prediction method and system based on an embedded physical simulation neural network. Background Art

[0002] With the increasing complexity of urban traffic systems, short-term traffic flow prediction has become a key technology for intelligent traffic management. Traditional traffic prediction methods are mainly divided into two categories: model-driven and data-driven, but both have significant limitations:

[0003] Traditional model-driven approaches rely on physical models (such as macroscopic fluid dynamics models) based on macroscopic traffic flow theory (e.g., flow conservation equations and speed-density relationships), resulting in prediction results with clear physical interpretability. However, these approaches often rely on simplifying assumptions (e.g., uniform grid division and constant traffic parameters), making them difficult to adapt to the complex topology of urban road networks (e.g., intersection signal control, dynamic lane function switching, ramp merging, etc.). Furthermore, they are unable to adequately characterize nonlinear traffic dynamics (e.g., congestion propagation and emergencies), leading to the accumulation of long-term prediction errors.

[0004] Data-driven methods, such as deep learning and spatiotemporal graph neural networks, can capture complex traffic patterns by mining spatiotemporal dependencies in historical data, achieving high prediction accuracy when sufficient data is available. However, these methods rely on large amounts of annotated data, leading to a sharp decline in performance when detector coverage is insufficient or data is missing. Furthermore, they lack the constraints of physical laws, potentially generating predictions that violate traffic flow theory (e.g., density exceeding congestion thresholds, sudden changes in traffic flow), reducing their credibility. Furthermore, their models suffer from poor interpretability, making them difficult to provide reliable decision-making for traffic control.

[0005] Some research attempts to combine physical models with machine learning. For example, these approaches use physical models to generate initial predictions and then use neural networks to correct residuals, or directly use model outputs as features to input into neural networks. However, these approaches still have some problems: the physical model and data-driven module are trained in isolation, failing to achieve joint parameter optimization; the differential form of the traffic flow equation is not embedded in the neural network, resulting in loose physical constraints; and the modeling capabilities of dynamic scenarios such as signal control and lane-changing in urban road networks are insufficient. Summary of the Invention

[0006] The technical problem to be solved by the present invention is: in response to the difficult problems of dynamic evolution and nonlinear propagation of traffic flow in complex urban road networks, breaking through the limitations of traditional methods in physical consistency, adaptability to complex scenarios and real-time performance, a traffic flow prediction method that integrates physical information neural networks and traffic flow evolution laws is proposed. By embedding traffic flow physical simulation equations (such as flow conservation and vehicle transfer rules) as constraints into neural network training, a hybrid framework driven by both models and data is constructed to improve prediction accuracy, ensure that the results are consistent with traffic flow theory, and enhance adaptability to dynamic scenarios.

[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0008] The present invention proposes a traffic flow intelligent prediction method based on an embedded physical simulation neural network, which includes the following steps:

[0009] S1. Discretize the target road network based on the traffic flow physical model and generate dynamic mesh division and topological connection relationship;

[0010] S2. Real-time collection of traffic flow data from detectors in the road network, and prediction of short-term traffic conditions using physical evolution equations to obtain grid density and flow at future moments;

[0011] S3. Build a deep neural network model whose input is historical traffic flow data and traffic conditions predicted by the physical model, and output is the traffic flow prediction result at the future time;

[0012] S4. During the neural network training process, the traffic flow conservation equation and vehicle transfer rules are used as physical constraints, and the data fitting error and the physical law residual are jointly optimized through the loss function;

[0013] S5. Based on the trained model, dynamic identification and prediction of traffic flow density, flow rate and congestion propagation status are achieved.

[0014] Furthermore, the discretization modeling in step S1 specifically includes:

[0015] S101. Based on differences in road type and number of lanes, a variable-length gridding strategy is used to perform non-uniform discretization on urban expressways and ground roads. Expressway grids are set with fixed lengths and ramp merging area lengths to enable refined modeling of sudden flow changes. Ground road grid lengths are dynamically adjusted based on intersection spacing. For each grid, static parameters are defined, including the number of lanes, free-flow speed, and congestion density, as well as dynamic parameters, including real-time density and flow.

[0016] S102. Integrate signal control logic into the intersection grid, dynamically adjust vehicle transfer rules between grids through signal phases, establish a flow transfer equation, and introduce signal control constraints into the flow transfer equation:

[0017]

[0018] in represents the grid density, v f represents the free flow speed, q max is the maximum traffic capacity of the road section, Represents the congestion density, δ represents the signal phase, and for each grid i, the density is iteratively updated at the time step Δt according to the following formula:

[0019]

[0020] in represents the grid density at time t+1, Δx i is the length of grid i, represents the flow of the i-1th grid at time t, Represents the flow of the i-th grid at time t, the initial density From the detector data, solve the equation to get the grid-level density and flow prediction sequence at the future time

[0021] Furthermore, in step S2, short-term traffic state prediction is performed through the physical evolution equation, specifically including:

[0022] 1) Calculate the grid density evolution through the traffic flow conservation equation:

[0023]

[0024] in, represents the grid density, Δx i is the length of grid i, t represents time, i=1,2,…,N, is the inter-grid traffic;

[0025] 2) Combined with intersection signal timing, the grid output flow upper limit is corrected, and the constraints are:

[0026]

[0027] in represents the grid density, v f represents the free flow speed, is the maximum traffic capacity of the road section, represents the congestion density, and δ represents the signal phase.

[0028] Furthermore, the deep neural network model in step S3 is a physical information neural network PINNs, whose input features include:

[0029] 1) Historical detector data: including grid density, flow rate, and average speed within the time window;

[0030] 2) Physical model prediction data: including grid density and flow prediction values at future times;

[0031] 3) Road network topology features: Contains the adjacency matrix encoding of the grid connectivity relationship, and additional lane number and signal phase state edge attributes;

[0032] At the network architecture level, the encoder uses a spatiotemporal graph convolution module to extract temporal features through gated convolution, and the graph convolution aggregates spatial associations as follows: (l+1) =ReLU(Θ*(H (l) W t )+b), where W t is the temporal convolution kernel, Θ is the graph convolution parameter matrix; b is the weight coefficient, which is used to adjust the information exchange intensity between nodes;

[0033] The physical constraint layer outputs the predicted value at the decoder After that, the residual of the traffic flow equation is calculated as:

[0034]

[0035] in is the density prediction value of grid i, is the flow prediction value of grid i;

[0036] The loss function uses the joint optimization of data fitting error and physical law residual, and the data term uses the mean square error between the predicted value and the true value:

[0037]

[0038] The physical terms are weighted sums of the residuals of the equations:

[0039]

[0040] Among them, α and β are empirical weight coefficients, α = 0.7, β = 0.3. Indicates the deviation between the prediction result and the conservation law of the traffic flow model, Represents the difference between the predicted results and the actual traffic flow transmission.

[0041] Furthermore, the loss function in step S4 is defined as:

[0042]

[0043] in, is the mean square error between the predicted value and the true value, is the residual constraint of the physical evolution equation, λ1 and λ2 are dynamic weights, and the degree of non-satisfaction of the equation is calculated by automatic differentiation;

[0044] Residual constraints for physical evolution equations include:

[0045] Residual of the flow conservation equation:

[0046] Vehicle transfer rule residuals:

[0047] Furthermore, step S4 performs training by jointly optimizing the dynamic parameters of the physical information neural network and the physical model. The specific process is as follows:

[0048] First, the detector history data X obs The physical model predicts data X ctm Perform standardization and calculate the standardization parameter μ ρ ,σ ρ and μ q , σ q , generating normalized input

[0049] Subsequently, a spatiotemporal graph convolution encoder is constructed, which uses a gated temporal convolution kernel to extract temporal features and aggregates the spatial associations of adjacent grids through a graph convolution layer to output a hidden state. The decoder concatenates the hidden state with the physical model prediction value and maps it to the density and flow prediction value at the future moment through a fully connected layer. And calculate the physical constraint residual:

[0050]

[0051] Among them, v f represents the free flow speed, q max is the maximum traffic capacity of the road section, represents the congestion density, and δ represents the signal phase.

[0052] Model training adopts a two-stage alternating optimization strategy:

[0053] In the first stage, the physical model parameters are fixed and the Adam optimizer is used to update the neural network parameters to minimize the weighted loss function;

[0054] In the second stage, the neural network parameters are fixed, the physical model parameters are updated using the L-BFGS optimizer, and the free flow speed and congestion density are adjusted by backpropagation of the physical residuals, and the iteration is carried out until the loss function converges.

[0055] Furthermore, the traffic flow prediction result in step S5 includes:

[0056] 1) Grid-level density and flow heatmaps at future times;

[0057] 2) Spatiotemporal evolution trends of congested propagation paths and bottleneck areas;

[0058] Among them, grids with a density growth rate exceeding a threshold are marked as potential congestion sources. The density evolution of upstream and downstream grids is tracked using a spatiotemporal propagation analysis algorithm to generate a diffusion heat map.

[0059] At the same time, the present invention also proposes an electronic system, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method steps described in the present invention.

[0060] Finally, the present invention provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method steps of the present invention.

[0061] Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:

[0062] 1. Achieved deep collaborative optimization of physical laws and data-driven.

[0063] Traditional traffic forecasting methods, such as model-driven techniques (CTM), can ensure consistency with physical laws but are inadequate for capturing the dynamic characteristics of complex road networks. Purely data-driven methods, such as deep learning, perform well with sufficient data but are prone to generating predictions that violate traffic theory due to a lack of physical constraints. This invention ensures that predictions conform to physical theory by strictly embedding the constraints of traffic flow conservation equations. It also leverages neural networks to capture nonlinear spatiotemporal correlations, improving prediction accuracy and reliability.

[0064] 2. Enhanced the dynamic adaptability to complex urban traffic scenarios.

[0065] Existing methods typically require recalibrating model parameters or building independent sub-models when handling dynamic scenarios such as signalized intersections and tidal lanes, resulting in a significant increase in computational complexity and insufficient real-time performance. This proposed method integrates dynamic meshing with signal control logic to support lane function switching and rapid response to emergencies (such as construction closures) without requiring model reconstruction, enabling the model to handle heterogeneous traffic scenarios within a unified framework.

[0066] 3. Support the generation of management and control decisions based on multi-objective optimization.

[0067] Traditional traffic control strategies often face a trade-off between safety and efficiency. For example, variable speed limits can reduce the impact of accidents but can also create new bottlenecks. Dynamic lane management can guide traffic around risky areas, but it can also lead to reduced lane resource utilization. This invention uses the high-precision density-flow field output by a physical information neural network to construct a reward function that incorporates multi-dimensional metrics such as speed mean and standard deviation. This provides refined input for reinforcement learning control strategies, establishing a balance between accident prevention, improved traffic efficiency, and resource optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0069] Figure 1 It is a diagram of the overall system architecture of the present invention.

[0070] Figure 2 It is a schematic diagram of dynamic mesh division of the present invention.

[0071] Figure 3 This is a diagram of the physical information neural network structure in the present invention.

[0072] Figure 4 This is a flowchart of the model-data collaborative training in the present invention. DETAILED DESCRIPTION

[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, 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 making any creative efforts shall fall within the scope of protection of the present invention.

[0074] This paper proposes a traffic flow prediction method based on a physical information neural network. By converting the discrete form of the traffic flow equation into a continuous constraint embedded in the neural network loss function, a hybrid framework with deep collaboration between the model and data is constructed, taking into account prediction accuracy, physical consistency, and scenario adaptability. Specifically, the following steps are included:

[0075] 1) Road network discretization and traffic flow physical simulation.

[0076] Grid lengths are dynamically adjusted based on road function and lane count. Expressway grids are fixed at 500 meters, while ramp merging areas are 200 meters long to enable refined modeling of sudden changes in traffic flow. Grid lengths for surface roads are dynamically adjusted based on intersection spacing: if the distance between adjacent signalized intersections is less than 800 meters, grids are divided at half the distance; if it is greater than 800 meters, grids are divided up to an upper limit of 400 meters. Static parameters such as the number of lanes, free-flow speed, and congestion density, as well as dynamic parameters such as real-time density and flow, are then defined for each grid.

[0077] Bind each entrance grid of the intersection to the signal phase, and then define the phase switching function, which takes 1 when the light is green and 0 when the light is red. Then introduce the signal control constraint into the traffic transfer equation:

[0078]

[0079] where q max is the maximum traffic capacity of the road section. For each grid i, the density is iteratively updated with a time step of 10s according to the following formula:

[0080]

[0081] where Δx i is the length of grid i, the initial density From the detector data. Solve the equation to get the grid-level density and flow prediction sequence for the next 15 minutes

[0082] 2) Construction of physical information neural network.

[0083] First, the input features are designed. The historical detection data time window τ = 12 steps, that is, the measured data of the past 2 minutes, is organized into a tensor according to the grid. Contains three channels: density, flow, and velocity; the physical simulation prediction data is set to the physical model prediction results for the next 15 minutes, constructed as Contains two channels: density and flow; topological feature encoding uses the adjacency matrix A(t)∈{0,1} N*N Represents the grid connection relationship and adds edge attributes such as the number of lanes and signal phase status.

[0084] At the network architecture level, the encoder uses a spatiotemporal graph convolution module to extract temporal features through gated convolution, and the graph convolution aggregates spatial associations as follows: (l+1) =ReLU(Θ*(H (l) W t )+b), where W t is the temporal convolution kernel, Θ is the graph convolution parameter matrix, and b is the weight coefficient, which is used to adjust the intensity of information exchange between nodes.

[0085] The physical constraint layer outputs the predicted value at the decoder After that, the residual of the traffic flow equation is calculated as:

[0086]

[0087] in is the density prediction value of grid i, is the traffic prediction value of grid i.

[0088] The loss function uses the joint optimization of data fitting error and physical law residual, and the data term uses the mean square error between the predicted value and the true value:

[0089]

[0090] The physical terms are weighted sums of the residuals of the equations:

[0091]

[0092] Among them, α=0.7 and β=0.3 are the empirical weight coefficients.

[0093] The dynamic weights are set to λ1:λ2=3:1 at the beginning of training to prioritize data fitting, and are gradually adjusted to 1:1 in the later stage to strengthen physical constraints.

[0094] 3) Model training and prediction.

[0095] This is achieved by jointly optimizing the dynamic parameters of physical information neural networks (PINNs) and physical models.

[0096] First, the detector history data X obs The physical model predicts data X ctm Perform standardization and calculate the standardization parameter μ ρ ,σ ρ and μ q , σ q , generating normalized input

[0097] Then, a spatiotemporal graph convolution encoder is constructed using the gated temporal convolution kernel. Extract temporal features and pass them through the graph convolution layer Aggregate the spatial associations of adjacent grids and output the hidden state The decoder combines the hidden state H with the physical model prediction value X ctm Splicing, mapped to density and flow prediction values at future moments through the fully connected layer And calculate the physical constraint residual:

[0098]

[0099] The training process adopts a two-stage alternating optimization strategy: in the first stage, the physical model parameters θ are fixed CTM ={υ f , ρ jam}Use Adam optimizer with initial learning rate η=10 -3 Update the neural network parameters θ NN , minimize the weighted loss function The data items The physical item is Dynamically adjust the weight coefficient from λ1:λ2=3:1 to λ1:λ2=1:1; in the second stage, fix θ NN , update θ using the L-BFGS optimizer CTM , the free flow speed and congestion density are adjusted by back-propagation of the physical residual, and iterated until the loss function converges.

[0100] After training, the model will output the grid-level density, flow and propagation path for the next 15 minutes. It is marked as a potential congestion source, and the density evolution of its upstream and downstream grids is tracked through the spatiotemporal propagation analysis algorithm to generate a congestion diffusion heat map.

[0101] The final prediction results are mapped to the road network, with color gradients representing density levels and arrows superimposed to mark traffic directions, forming a visual decision support interface.

[0102] Example 1: The following is a specific example to further illustrate the method processing flow of the present invention. Figure 1 The overall system architecture diagram of the present invention includes the following steps:

[0103] Step 1: Discretize the road network and conduct physical simulation modeling of traffic flows. Dynamic gridding is implemented, dividing the expressway mainline into a 500-meter grid. Ramp merge areas are compressed to 200 meters to precisely capture sudden changes in traffic flow. Grid length for surface roads is dynamically adjusted (300-600 meters) based on intersection spacing. A dynamic adjacency matrix is set for tidal lanes, with weight coefficients automatically switching based on peak hours (0.8 for inbound traffic during the morning rush hour and 0.7 for outbound traffic during the evening rush hour). Figure 2A grid-based intersection division method is presented for refined management and analysis of traffic flow. The intersection is divided into multiple directions and lanes, with each direction further divided into different lane types, such as through, left, and right turns. Specifically, the four main directions of the intersection are labeled W (west), E (east), S (south), and N (north), and each direction is further divided into multiple sub-areas based on vehicle driving intentions. For example, in the west direction (W), there are two main roads, W1 and W2, each of which is further divided into through (WIL, WIR), left-turn (WIA, WIB), and right-turn (WIMR, WIM) lanes. Similarly, the east direction (E) has two main roads, E1 and E2, each containing corresponding through, left, and right-turn lanes. The north-south directions (S and N) also follow this division principle, ensuring a clear path for each driving direction and intention.

[0104] Model parameter initialization, grid transmission model parameters: free flow velocity v f =60km / h, congestion density ρ jam = 140 veh / km, with real-time density and flow initialized using detector data. The signal control grid is loaded with phase timing constraints (green light start delay ≤ 3 seconds, yellow light time is fixed at 3 seconds) and the grid density is dynamically updated according to the traffic flow conservation equation:

[0105]

[0106] Where T step =10s, l i is the grid length. Under the signal phase constraint, the upper limit of the grid output flow is: α(t)∈{0,1} is the signal phase state function (green light is 1, red light is 0). The grid-level density and flow prediction sequence for the next 15 minutes is generated through iterative calculation

[0107] Step 2: Multivariate traffic data fusion and preprocessing. Historical data is collected based on 5-minute granularity traffic data from Weibo detectors and signal phase logs accurate to 0.1 seconds. Real-time data is generated by roadside units, which push grid status every 30 seconds. The velocity field is inverted using floating vehicle FPS trajectories. By mapping floating vehicle trajectories onto the grid network, cubic spline interpolation is used to fill time gaps and achieve spatiotemporal alignment of the data. Anomalous data with negative flow or excessive congestion density values are corrected based on the traffic flow continuity equation. Finally, density and flow are normalized.

[0108] Step 3: Design of physical information neural network architecture. Figure 3 As shown, Figure 3This paper presents the architecture of physical information neural networks (PINNs), a deep learning model designed to improve traffic flow prediction accuracy and physical consistency. The network consists of an input layer, hidden layers, and an output layer. The input layer receives a variety of raw data, including spatial coordinates, timestamps, and historical traffic status data, as input nodes, such as I1, I2, ..., Im. These nodes collectively constitute the network's information source. Next, data is processed by hidden layers consisting of multiple layers of fully connected neurons. The figure shows two hidden layers. Each layer's neurons are connected to all nodes in the previous layer and transformed using activation functions to extract complex patterns and features from the input data, enabling the network to learn nonlinear relationships between the data. Finally, the information processed by the last hidden layer is passed to the output layer. The output nodes O1, O2, ..., On are responsible for generating predictions of traffic density and flow at future moments.

[0109] In the physical information neural network, in addition to the traditional data fitting error, physical state loss is also specially introduced to ensure that the model prediction results conform to the known physical laws. This not only allows the model to make accurate predictions based on historical data, but also can use physical knowledge to infer when data is insufficient, thereby improving the robustness and generalization ability of the model, making it an effective tool for solving the problem of traffic situation prediction in complex urban road networks.

[0110] The input layer is configured with a primary input channel and an auxiliary input channel. The primary input channel uses density and flow sequences from the past 12 time steps, while the auxiliary input channel uses density and flow values predicted by the physical model for the next 15 minutes, concatenated into an additional feature vector. The graph attention layer uses a dynamic weight matrix between grids for calculation; the spatiotemporal convolution layer employs a three-level dilated temporal convolution with the number of channels set to [64, 128, 256]. After the decoder outputs the predicted value, the physical constraint module calculates the residual term of the traffic flow equation, with a residual loss weight set to 0.5. The output layer consists of three parts: a sigmoid activation outputs the density prediction result, a Tanh activation map outputs the flow prediction, and a softmax generates grid-level classification probabilities and outputs the congestion probability prediction.

[0111] Step 4: Coordinated training and optimization. Model training uses a two-stage alternating training strategy. In stage 1, the physical model parameters are fixed and the network weights are updated using the Adam optimizer, with the learning rate decayed by 50% every 10 epochs. In stage 2, the network parameters are frozen and the physical model parameters are optimized using L-BFGS, iterating until the residual converges. Termination criteria are that the data reconstruction loss is less than 0.02 and the physical residual loss is less than 0.01. The maximum number of training epochs is set to 300, with an early stopping threshold of 20 epochs.

[0112] Figure 4This paper details the collaborative training process of physical information neural networks (PINNs) for traffic flow prediction. It begins with road network discretization and physical model initialization, proceeds through data collection and preprocessing, and constructs the physical information neural network, before entering a two-stage collaborative optimization phase. In the first stage, the physical model parameters are fixed, and the network weights are updated using the Adam optimizer to minimize the weighted loss function. In the second stage, the neural network parameters are fixed, and the physical parameters are adjusted using the L-BFGS optimizer to minimize the physical residual loss. The two stages alternate until the loss converges. The system then enters a closed-loop control and feedback phase, outputting prediction results and generating a control strategy. Control is then monitored and executed in real time. If the deviation exceeds 15%, incremental learning is initiated. Otherwise, continuous prediction and feedback are initiated, and model parameters are fine-tuned to ensure prediction accuracy and physical consistency, ultimately achieving accurate prediction and effective management of traffic conditions in complex urban road networks.

[0113] Step 5: Generate and execute the closed-loop control strategy. Using a multi-objective optimization modeling approach, with signal period (discrete values of 40 / 60 / 80 / 100 / 120 seconds), tidal lane sign (0 / 1), and speed limit gear (40 / 60 / 80 km / h) as decision variables, the objective function is constructed to minimize the comprehensive control cost function:

[0114] min(5·∑T delay +3 maxQ queue +1·|Δν limit |);

[0115] At the same time, constraints are imposed to ensure that the density prediction value does not exceed 0.9ρ_jam and the phase difference error is ≤5 seconds. The real-time control interface includes a dual-mode execution mechanism. In normal mode, a control command set is issued to the infrastructure through V2I communication every 5 minutes. In emergency mode, when the grid density exceeds the threshold (>126veh / km) for 3 consecutive minutes, a second-level response command (forced ramp closure and downstream speed limit reduction by 40%) is immediately triggered. The system integrates an online self-learning mechanism. By monitoring the difference between the actual queue length and the predicted value in real time (triggering an update when the deviation is >15%), an incremental learning strategy is adopted to freeze the GRU layer parameters and fine-tune the CNN convolution kernel (learning rate 10^-5) based on the latest 30 minutes of data until the loss function converges to below the threshold of 0.005, thereby achieving dynamic optimization of the control model.

[0116] Example 2: This embodiment proposes an electronic system, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method steps described in the present invention.

[0117] Embodiment 3: This embodiment provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method steps described in the present invention.

[0118] It should be noted that the processing flow of Examples 2 to 3 corresponds to the specific steps of the method provided in the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present invention.

[0119] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0120] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0121] The above embodiments are only for illustrating the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.

Claims

1. A traffic flow prediction method and system based on a deep neural network embedded with physical information, characterized in that: The following steps are involved: S1. Discretize the target road network based on the traffic flow physical model and generate dynamic mesh division and topological connection relationship; S2. Real-time collection of traffic flow data from detectors in the road network, and prediction of short-term traffic conditions using physical evolution equations to obtain grid density and flow at future moments; S3. Build a deep neural network model whose input is historical traffic flow data and traffic conditions predicted by the physical model, and output is the traffic flow prediction result at the future time; S4. During the neural network model training process, the traffic flow conservation equation and vehicle transfer rules are used as physical constraints, and the data fitting error and the physical law residual are jointly optimized through the loss function; S5. Based on the trained model, dynamic identification and prediction of traffic flow density, flow rate and congestion propagation status are achieved.

2. The method according to claim 1, characterized in that The discretization modeling in step S1 specifically includes: S101. Based on differences in road type and number of lanes, a variable-length gridding strategy is used to perform non-uniform discretization on urban expressways and ground roads. Expressway grids are set with fixed lengths and ramp merging area lengths to enable refined modeling of sudden flow changes. Ground road grid lengths are dynamically adjusted based on intersection spacing. For each grid, static parameters are defined, including the number of lanes, free-flow speed, and congestion density, as well as dynamic parameters, including real-time density and flow. S102. Integrate signal control logic into the intersection grid, dynamically adjust vehicle transfer rules between grids through signal phases, establish a flow transfer equation, and introduce signal control constraints into the flow transfer equation: in represents the grid density, v f represents the free-flow velocity, q max is the maximum traffic capacity of the road section, Represents the congestion density, δ represents the signal phase, and for each grid i, the density is iteratively updated at the time step Δt according to the following formula: in represents the grid density at time t+1, Δx i is the length of grid i, represents the flow of the i-1th grid at time t, Represents the flow of the i-th grid at time t, the initial density From the detector data, solve the equation to obtain the grid-level density and flow prediction sequence at the future time 3. The method according to claim 1, characterized in that In step S2, short-term traffic state prediction is performed using the physical evolution equation, specifically including: 1) Calculate the grid density evolution through the traffic flow conservation equation: in, represents the grid density, Δx i is the length of grid i, t represents time, is the inter-grid traffic; 2) Combined with intersection signal timing, the grid output flow upper limit is corrected, and the constraints are: Among them, v f represents the free flow speed, is the maximum traffic capacity of the road section, represents the congestion density, and δ represents the signal phase.

4. The method according to claim 1, wherein The deep neural network model in step S3 is a physical information neural network PINNs, whose input features include: 1) Historical detector data: including grid density, flow rate, and average speed within the time window; 2) Physical model prediction data: including grid density and flow prediction values at future times; 3) Road network topology features: Contains the adjacency matrix encoding of the grid connectivity relationship, and additional lane number and signal phase state edge attributes; At the network architecture level, the encoder uses a spatiotemporal graph convolution module to extract temporal features through gated convolution, and the graph convolution aggregates spatial associations as follows: (l+1) =ReLU(Θ*(H (l) W t )+b), where W t is the temporal convolution kernel, Θ is the graph convolution parameter matrix, and b is the weight coefficient, which is used to adjust the intensity of information exchange between nodes; The physical constraint layer outputs the predicted value at the decoder After that, the residual of the traffic flow equation is calculated as: in is the density prediction value of grid i, is the flow prediction value of grid i; The loss function uses the joint optimization of data fitting error and physical law residual, and the data term uses the mean square error between the predicted value and the true value: The physical terms are weighted sums of the residuals of the equations: Among them, α and β are empirical weight coefficients, α = 0.7, β = 0.3, Indicates the deviation between the prediction result and the conservation law of the traffic flow model, Represents the difference between the predicted results and the actual traffic flow transmission.

5. The method according to claim 1, wherein The loss function in step S4 is defined as: in, is the mean square error between the predicted value and the true value, is the residual constraint of the physical evolution equation, λ1 and λ2 are dynamic weights, and the degree of non-satisfaction of the equation is calculated by automatic differentiation.

6. The method according to claim 5, characterized in that Residual constraints for physical evolution equations include: Residual of the flow conservation equation: Vehicle transfer rule residuals: in represents the grid density, t represents the time, is the inter-grid traffic, v f represents the free flow velocity, q max is the maximum traffic capacity of the road section, Represents congestion density.

7. The method according to claim 1, characterized in that Step S4 performs training by jointly optimizing the dynamic parameters of the physical information neural network and the physical model. The specific process is as follows: First, the detector history data X obs The physical model predicts data X ctm Perform standardization and calculate the standardization parameter μ ρ ,σ ρ and μ q ,σ q , generating normalized input Subsequently, a spatiotemporal graph convolution encoder is constructed, which uses a gated temporal convolution kernel to extract temporal features and aggregates the spatial associations of adjacent grids through a graph convolution layer to output a hidden state. The decoder concatenates the hidden state with the physical model prediction value and maps it to the density and flow prediction value at the future moment through a fully connected layer. And calculate the physical constraint residual: Among them, v f represents the free flow speed, q max is the maximum traffic capacity of the road section, represents the congestion density, and δ represents the signal phase; Model training adopts a two-stage alternating optimization strategy: In the first stage, the physical model parameters are fixed and the Adam optimizer is used to update the neural network parameters to minimize the weighted loss function; In the second stage, the neural network parameters are fixed, the physical model parameters are updated using the L-BFGS optimizer, and the free flow speed and congestion density are adjusted by backpropagation of the physical residuals, and the iteration is carried out until the loss function converges.

8. The method according to claim 1, characterized in that The traffic flow prediction results in step S5 include: 1) Grid-level density and flow heatmaps at future times; 2) Spatiotemporal evolution trends of congested propagation paths and bottleneck areas; Among them, the grids whose marked density growth rate exceeds the threshold are potential congestion sources. The density evolution of their upstream and downstream grids is tracked through the spatiotemporal propagation analysis algorithm to generate a diffusion heat map.

9. A computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 8.

10. An electronic system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Dynamic path planning method based on traffic prediction

    CN110009906A

  • Traffic flow model and data fusion driven traffic state estimation method and device

    CN116153069A

  • Traffic jam prediction method and device

    CN118486161A

  • Path optimization method for realizing dynamic user balance under strong heterogeneous cost field

    CN118607740A

  • Method, device and system for predicting traffic parameters of a road network

    WO2024030077A1

Cited By

  • Security time keeping method and system based on physical information neural network, medium and product

    CN121167149A

  • Vehicle congestion prediction method and device, equipment and storage medium

    CN121438569A

  • Urban road traffic state intelligent estimation method based on microphysical representation

    CN121583101A

  • A Smart Estimation Method for Urban Road Traffic State Based on Differentiable Physical Representation

    CN121583101B

  • Wheat flour quality detection system and method based on computer vision

    CN121686451A