Urban traffic in-transit volume prediction system and method based on trajectory probability network
Through a trajectory probability network-based method, combined with current observations, historical trajectories and road network information, the amount of urban traffic on the way is predicted, which solves the problem of prediction inaccurate caused by incomplete data in the existing methods, and achieves a more comprehensive and efficient prediction effect.
Patent Information
- Application Number
- CN202411830603.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
AI Technical Summary
Existing traffic flow prediction methods have challenges in obtaining complete, city-wide traffic data, and rely on sensor deployment and GPS services, the data is incomplete, resulting in inaccurate predictions.
Using a trajectory probability network method, a trajectory probability network model is constructed, combined with current observations, historical trajectory and road network information, node trajectory probability estimates and road trajectory probability estimates are carried out to predict the on-road volume.
A more comprehensive on-road volume prediction effect is achieved, a variety of information sources are integrated, which significantly reduces calculation time while maintaining high prediction accuracy, which is better than the most advanced methods.
Smart Images

Figure CN119760642A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a system and method for predicting urban traffic in-transit volume based on a trajectory probability network. Background Art
[0002] Traffic flow prediction is a critical task in urban management, providing insights into traffic congestion, road safety, and infrastructure planning. Researchers have developed various methods to predict traffic flow, including traditional time series models, deep learning models, and graph neural networks. However, obtaining complete, city-wide traffic data is challenging. Some methods rely on historical in-transit data captured by sensors deployed in road networks or GPS services. These methods are effective in real-world applications, but the devices for traffic flow counting (such as cameras on the road) are very limited and not uniformly distributed, which means that the vehicle trajectories we observe are incomplete, so obtaining complete, city-wide data is challenging and they are impractical in real-world applications.
[0003] To overcome this challenge, some studies have focused on inspection data based on key intersection detection, providing a more feasible alternative. Some work relies on prior probabilities to estimate missing trajectories, assuming that vehicles follow specific patterns, such as choosing the shortest route. Some deep learning-based methods reconstruct missing trajectories using current observations. However, these methods usually ignore historical data or road network information, resulting in inaccurate predictions. In addition, these methods usually rely on time series models, which suffer from inefficiency and cumulative errors.
[0004] Patent document CN113593242A (application number: 202111140098.7) discloses a method for estimating the in-transit volume based on a vehicle detector group at an intersection, comprising the following steps: S1: Obtain the road network topology structure and the location distribution of vehicle detectors in the entire road network, and form a vehicle detector group with four vehicle detectors at the upstream and downstream intersections of each sampling section; S2: Collect vehicle passing information of each sampling section through the vehicle detector group during the statistical period; S3: Count the traffic volume of each sampling section during the statistical period, and calculate the average driving speed and average traffic density; S4: Calculate the average traffic density of all sampling sections in the entire road network, and calculate the average in-transit volume of the entire road network during the statistical period. Summary of the invention
[0005] In view of the defects in the prior art, the purpose of the present invention is to provide a method and system for predicting urban traffic in-transit volume based on trajectory probability network.
[0006] According to the present invention, a method for predicting urban traffic in-transit volume based on trajectory probability network includes:
[0007] Step S1: construct a trajectory probability network model, and train the trajectory probability network model to obtain a trained trajectory probability network model;
[0008] Step S2: Based on the currently observed information, historical trajectory information and road network information, the trained trajectory probability network model is used to estimate the node trajectory probability;
[0009] Step S3: obtaining a road trajectory probability estimate based on the node trajectory probability estimate, and predicting the amount of traffic on the road based on the road trajectory probability estimate;
[0010] The trajectory probability network model predicts the trajectory probability of the vehicle by aggregating real-time observation information, historical observation information and road network information, thereby achieving a comprehensive prediction of the on-road volume.
[0011] Preferably, the trajectory probability network model includes: an embedding layer module, a multi-view attention module and a linear projection module;
[0012] The embedding layer module is used to realize the projection of all real-world information into the aligned label space; wherein all real-world information includes: real-time observation data, historical observation data and road network data;
[0013] The multi-view attention module is used to fuse real-time observation data, historical observation data and road network data;
[0014] The linear projection module is used to map the hidden mark to the trajectory probability through linear projection and softmax activation function.
[0015] Preferably, the embedded layer module comprises:
[0016] Convert real-time observation data into real-time observation data embedding features;
[0017]
[0018] Among them, z obs represents the real-time observation data embedding feature; SiLU represents the activation function; LN represents the layer normalization operation; Linear represents the linear mapping layer; E traj (·) indicates discrete encoder; Represents the position encoding in the time dimension; X∈{0,1,…,V} B,T ; V represents the total number of intersections, T represents the longest observation time, and B represents the number of batches;
[0019] Convert historical observation data into historical observation data embedding features;
[0020]
[0021] Among them, z his represents the embedding features of historical observation data; N represents the number of recorded historical data; X his Represents historical observation data;
[0022] Convert road network data into road network data embedding features;
[0023]
[0024] Among them, z adj is the embedding feature of road network data, AvgPooling represents the average pooling operation; the road network data is recorded as A = [A0, A1, ..., A N ], where M is the number of adjacency lists, A0 is a discrete adjacency list that records the connectivity of the road network, A1,…,A M It is a discrete or continuous adjacency table that records various weights of the road network, including road level and road length; A0 and real-time observation data share a discrete encoder, A1,…,A M Use your own discrete encoder or continuous encoder, denoted by E adj (·); Encode the location in node latitude and connectivity latitude.
[0025] Preferably, the multi-view attention module comprises:
[0026] z′ adj =MultiQueryAttention(z obs ,z adj ,z adj )
[0027] z′ his =MultiHeadAttention(z obs ,z his ,z his )
[0028] z′ obs =z obs +z′ adj +z′ his
[0029] z′ obs =MultiHeadAttention(z′ obs ,z′ obs ,z′ obs )+z′ obs
[0030] z″ obs=FeedForward(z′ obs )+z′ obs
[0031] Among them, MultiQueryAttention is a multi-query attention mechanism; MultiHeadAttention is a multi-head attention mechanism; FeedForward is a feedforward layer.
[0032] Preferably, the linear projection module comprises: a hidden marker z″ obs It is mapped to trajectory probability through linear projection and softmax activation function;
[0033] q θ (YX,X hist ,A)=softmax(Linear(z″ obs ))
[0034] Where Y∈[0,1] B,T,V is the estimated path probability; softmax represents the activation function; X hist Represents historical observation data.
[0035] Preferably, the training of the trajectory probability network model includes:
[0036] Based on the true trajectory probability p(Y), the trajectory probability network model is trained by optimizing the KL divergence between the true trajectory and the estimated trajectory. The loss function includes:
[0037]
[0038] Among them, p(Y[b,t,v]) and q θ (Y[b,t,v]|X[b],X hist [b], A[b]) obeys Bernoulli distribution; during training, a part of the complete real-time observation data is randomly masked to form missing observation data; training with complete observation values, if v = X[b,t], p(Y[b,t,v]) = 1; otherwise, p(Y[b,t,v]) = 0; the loss function is simplified to:
[0039]
[0040] in, is the one-hot encoding of the true trajectory.
[0041] Preferably, step S3 comprises:
[0042]
[0043] in, The bth car is at e at time t i probability;
[0044] After calculating the trajectory probabilities of all vehicles observed in real time, the on-road quantity is obtained by expected summation:
[0045]
[0046] According to the present invention, a system for predicting urban traffic in-transit volume based on trajectory probability network is provided, comprising:
[0047] Module M1: construct a trajectory probability network model and train the trajectory probability network model to obtain a trained trajectory probability network model;
[0048] Module M2: Based on the currently observed information, historical trajectory information and road network information, the trained trajectory probability network model is used to estimate the node trajectory probability;
[0049] Module M3: Obtain road trajectory probability estimation based on node trajectory probability estimation, and predict on-road traffic based on road trajectory probability estimation;
[0050] The trajectory probability network model predicts the trajectory probability of the vehicle by aggregating real-time observation information, historical observation information and road network information, thereby achieving a comprehensive prediction of the on-road volume.
[0051] Preferably, the trajectory probability network model includes: an embedding layer module, a multi-view attention module and a linear projection module;
[0052] The embedding layer module is used to realize the projection of all real-world information into the aligned label space; wherein all real-world information includes: real-time observation data, historical observation data and road network data;
[0053] The multi-view attention module is used to fuse real-time observation data, historical observation data and road network data;
[0054] The linear projection module is used to map the hidden marks to the trajectory probability through linear projection and softmax activation function;
[0055] The embedded layer module includes:
[0056] Convert real-time observation data into real-time observation data embedding features;
[0057]
[0058] Among them, z obsrepresents the real-time observation data embedding feature; SiLU represents the activation function; LN represents the layer normalization operation; Linear represents the linear mapping layer; E traj (·) indicates discrete encoder; Represents the position encoding in the time dimension; X∈{0,1,…,V} B,T ; V represents the total number of intersections, T represents the longest observation time, and B represents the number of batches;
[0059] Convert historical observation data into historical observation data embedding features;
[0060]
[0061] Among them, z his represents the embedding features of historical observation data; N represents the number of recorded historical data; X his Represents historical observation data;
[0062] Convert road network data into road network data embedding features;
[0063]
[0064] Among them, z adj is the embedding feature of road network data, AvgPooling represents the average pooling operation; the road network data is recorded as A = [A0, A1, ..., A M ], where M is the number of adjacency lists, A0 is a discrete adjacency list that records the connectivity of the road network, A1,…,A M It is a discrete or continuous adjacency table that records various weights of the road network, including road level and road length; A0 and real-time observation data share a discrete encoder, A1,…,A M Use your own discrete encoder or continuous encoder, denoted by E adj (·); Encode the position in node latitude and connectivity latitude;
[0065] The multi-view attention module includes:
[0066] z′ adj =MultiQueryAttention(z obs ,z adj ,z adj )
[0067] z′ his =MultiHeadAttention(z obs ,z his ,z his )
[0068] z′obs =z obs +z′ adj +z′ his
[0069] z′ obs =MultiHeadAttention(z′ obs ,z′ obs ,z′ obs )+z′ obs
[0070] z″ obs =FeedForward(z′ obs )+z′ obs
[0071] Among them, MultiQueryAttention is a multi-query attention mechanism; MultiHeadAttention is a multi-head attention mechanism; FeedForward is a feedforward layer;
[0072] The linear projection module includes: a hidden marker z″ obs It is mapped to trajectory probability through linear projection and softmax activation function;
[0073] q θ (YX,X hist ,A)=softmax(Linear(z″ obs ))
[0074] Where Y∈[0,1] B,T,V is the estimated path probability; softmax represents the activation function; X hist Represents historical observation data.
[0075] Preferably, the training of the trajectory probability network model includes:
[0076] Based on the true trajectory probability p(Y), the trajectory probability network model is trained by optimizing the KL divergence between the true trajectory and the estimated trajectory. The loss function includes:
[0077]
[0078] Among them, p(Y[b,t,v]) and q θ (Y[b,t,v]|X[b],X hist[b], A[b]) obeys Bernoulli distribution; during training, a part of the complete real-time observation data is randomly masked to form missing observation data; training with complete observation values, if v = X[b,t], p(Y[b,t,v]) = 1; otherwise, p(Y[b,t,v]) = 0; the loss function is simplified to:
[0079]
[0080] in, is the one-hot encoding of the true trajectory;
[0081] The module M3 comprises:
[0082]
[0083] in, The bth car is at e at time t i probability;
[0084] After calculating the trajectory probabilities of all vehicles observed in real time, the on-road quantity is obtained by expected summation:
[0085]
[0086] Compared with the prior art, the present invention has the following beneficial effects:
[0087] 1. The proposed trajectory probability network model achieves a more comprehensive on-road traffic prediction effect by combining current observations, historical trajectories and road network information. All heterogeneous data are embedded in the same latent space, and trajectory probabilities are estimated through a multi-view attention mechanism. Experiments on real-world road networks show that the trajectory probability network model outperforms the state-of-the-art methods in terms of accuracy and efficiency.
[0088] 2. The present invention proposes a new neural network-based probability model, namely the trajectory probability network model, which constructs a more detailed and comprehensive in-transit prediction method by aggregating the probability distribution of all possible trajectories;
[0089] 3. The trajectory probability network model integrates multiple information sources. By extracting and fusing the features of current observations, historical trajectories, and road network information, it realizes the collaborative reasoning of different information sources and provides more comprehensive information for in-transit traffic prediction.
[0090] 4. The trajectory probability network model significantly reduces the computing time while maintaining high prediction accuracy through an end-to-end reasoning process. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0092] Figure 1 Schematic diagram of the trajectory probability network model structure.
[0093] Figure 2 Schematic diagram of the embedded layer module structure.
[0094] Figure 3 Schematic diagram of the multi-view attention module structure.
[0095] Figures 4a to 4c This is a comparison experiment of the in-transit quantity prediction error of different models under different observation rates.
[0096] Figure 5a to Figure 5d Visualize the prediction effect of on-road traffic on different roads using different models.
[0097] Figures 6a to 6c Visualize the prediction effect of in-transit volume at different times for different models.
[0098] Figure 7 For ablation experiments. DETAILED DESCRIPTION
[0099] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0100] Example 1
[0101] According to the present invention, a method and system for predicting urban traffic in-transit volume based on trajectory probability network is provided. The trajectory probability network model predicts the joint distribution of all possible situations; the trajectory probability network model integrates current observations, historical trajectories and road network information to comprehensively infer trajectory probabilities. Unlike the one-by-one autoregressive prediction method, the trajectory probability network model provides a complete estimate in a single step, significantly reducing the calculation time while maintaining the prediction performance. Experiments conducted on real-world road networks show that the trajectory probability network model outperforms the most advanced methods in terms of accuracy and efficiency.
[0102] Rather than predicting a single trajectory, the present invention estimates the joint distribution of all potential trajectories. Trajectory probabilities can be used to calculate expected traffic, most likely traffic, or traffic distribution, providing more comprehensive information for traffic management. In a case where a vehicle may choose route A with a probability of 0.6 and route B with a probability of 0.4, trajectory probabilities can estimate potential traffic on both routes, whereas a single trajectory prediction can only provide traffic on route A. In addition, the present invention performs a complete prediction in a single step, significantly reducing computation time while maintaining prediction performance.
[0103] In this embodiment, it is assumed that the road network is represented by a graph G = (V, E), where V is a node set and E is an edge set. V = {1, 2, ..., n}, n is the number of intersections (nodes). E = {e1, e2, ..., e E}. e i =(o i ,d i ,l i )It represents the starting point of the i-th road (edge)* i , end point d i and weight l i The weights could be length, average speed, traffic level, or other information about the road.
[0104] Trajectories can be represented using edges or nodes. Considering that the number of nodes is much smaller than the number of edges, nodes are used in the following sections. Trajectories can be represented as a series of nodes, [v1,v2,…,v T ], where v i ∈V is a rearrangement of , T is the maximum time step, and a special node 0 is used to indicate that the car disappears. To show the time spent on each road, we repeat v in the trajectory i , for example, [1,2,2,2,2,3,4,0] means that the car spends 1 time step on edge (1,2), 4 time steps on (2,3), 1 time step on (3,4), and finally disappears at node 4. We denote all trajectories as X∈{0,1,…,V} B,T , where B is the number of observed trajectories and T is the maximum time step.
[0105] In real-world scenarios, the number of devices used to count traffic flow (such as cameras on the road) is very limited and the distribution is not uniform, which means that the vehicle trajectories we observe are incomplete. For example, assuming that only nodes 1 and 3 are observed, for the trajectory [1,2,2,2,2,3,4,0] described above, the observed trajectory should be [1,0,0,0,0,3,0,0]. Given all observed trajectories within T time steps, the purpose of road-level traffic prediction is to estimate the traffic flow of each road at each time, that is, the total number of vehicles passing through the road. The traffic flow is expressed as Vol∈R E,T Represented by, where Vol[it] is the flow rate of road i at time t.
[0106] The trajectory probability is the distribution of X. Assuming that each trajectory is independently distributed, the probability of the trajectory is defined as Y∈[0,1] B,T,V , where Y[b,t,v] is a probability value, indicating the probability that the bth trajectory at time t is v.
[0107] Once the trajectory probability distribution is obtained, the flow rate can be calculated by the expected value or maximum a posteriori estimation (MAP) of the trajectory probability.
[0108] In this embodiment, by q θ (Y|X,X his ,A) to approximate p(Y), where θ is the parameter of our model, X his is the historical trajectory information, and A represents the road network information.
[0109] The urban traffic in-transit volume prediction method based on trajectory probability network includes:
[0110] Step S1: construct a trajectory probability network model, and train the trajectory probability network model to obtain a trained trajectory probability network model;
[0111] Step S2: Based on the currently observed information, historical trajectory information and road network information, the trained trajectory probability network model is used to estimate the node trajectory probability;
[0112] Step S3: obtaining a road trajectory probability estimate based on the node trajectory probability estimate, and predicting the amount of traffic on the road based on the road trajectory probability estimate;
[0113] The trajectory probability network model predicts the trajectory probability of the vehicle by aggregating real-time observation information, historical observation information and road network information, thereby achieving a comprehensive prediction of the on-road volume.
[0114] like Figure 1As shown, the trajectory probability network model includes: an embedding layer, a multi-view attention block and a linear projection. The embedding layer is used to embed the observed trajectory, road network and historical trajectory into the token; in the multi-view attention block, the historical information and road network information are fused into the observed information. The additional conditions can make the prediction of unobserved hidden tokens more reliable. Finally, the hidden tokens are input into the linear projection to form the estimated trajectory probability.
[0115] The embedding layer includes: The embedding layer projects all real-world information into the aligned label space. The embedding layer consists of three parts: real-time observation data embedding, historical observation data embedding and road network data embedding, such as Figure 2 shown.
[0116] Real-time observation data is recorded as X∈{0,1,…,V} B,T ; Where B is the batch size, which is passed through the discrete encoder E traj (·), linear mapping, layer normalization and SiLU activation are converted into features, specifically:
[0117]
[0118] in, is the position encoding in the time dimension, Linear is the linear mapping layer, LN is the layer normalization operation, SiLU is the activation function, z obs It is an embedded representation of real-time observation data.
[0119] The historical observation data is recorded as X his ∈{0,1,…,V} V,N,T , where N is the number of recorded historical data. Historical observation data and real-time observation data are embedded in the same way, sharing the same discrete encoder and linear layer:
[0120]
[0121] Among them, z his is the embedding representation of historical observation data.
[0122] The road network data is recorded as A = [A0, A1, ..., A M ], where M is the number of adjacency lists, A0 is a discrete adjacency list that records the connectivity of the road network, A1,…,A M It is a discrete or continuous adjacency table that records various weights of the road network, such as road level and road length. A0 and real-time observation data share a discrete encoder, A1,…,A M Use your own discrete encoder or continuous encoder, denoted by E adj(·). After encoding, all features are average-pooled to form an embedded representation, specifically:
[0123]
[0124] in, is the position encoding of node latitude and connectivity latitude, AvgPooling is the average pooling operation, z adj Embedded representation for road network data.
[0125] The multi-view attention module includes:
[0126] The multi-view attention module is the core component of the trajectory probability network model, which integrates real-time observation information, historical observation data information and road network data information. Figure 3 As shown, the multi-view attention block consists of two cross-attention blocks and one self-attention block, all of which are included in the residual connection and LayerNorm layers. Multi-head attention and multi-query attention mechanisms are used to capture the complex relationship between different views. The neighboring tags represent the information of each node, which is comprehensive but inefficient. Therefore, the present invention adopts a multi-query attention mechanism to reduce the amount of computation. The neighboring tags are linearly projected to the key and value tags, and the observation tags are linearly projected to the query tags. It is shown in the ablation study that the multi-query attention mechanism can reduce the amount of computation without affecting the performance. Specifically:
[0127] Among them, MultiQueryAttention is a multi-query attention mechanism, whose input is projected to query, key and value respectively, z′ adj is an intermediate variable. MultiHeadAttention is a multi-head attention mechanism, whose input is projected to query, key and value respectively, z′ his ,z′ obs is the intermediate variable. The hidden variable of the final attention block is mapped to the output through the feedforward layer, which consists of a linear layer, a SiLU activation function, and a linear layer. FeedForward is the feedforward layer, z″ obs is the output of the multi-view attention module.
[0128] z′ adj =MultiQueryAttention(z obs ,z adj ,z adj )
[0129] z′ his =MultiHeadAttention(z obs ,z his ,z his )
[0130] z′ obs =z obs +z′ adj +z′ his
[0131] z′ obs =MultiHeadAttention(z′ obs ,z′ obs ,z′ obs )+z′ obs
[0132] z″ obs =FeedForward(z′ obs )+z′ obs
[0133] The linear projection module comprises:
[0134] After the multi-view attention block, the hidden token z″ obs It is mapped to the trajectory probability through linear projection and softmax activation function. The output is calculated as follows:
[0135] q θ (YX,X hist ,A)=softmax(Linear(z″ obs ))
[0136] Among them, θ is the model parameter, Y∈[0,1] B,T,V is the estimated path probability.
[0137] Given the true trajectory probability p(Y), optimize the KL-divergence between the true trajectory and the estimated trajectory to train the trajectory probability network model;
[0138] The loss function is recorded as
[0139]
[0140] where p(Y[b,t,v]) and q θ (Y[b,t,v]|X[b],X hist [b], A[b]) obeys Bernoulli distribution. During training, we randomly mask a part of the complete real-time observation data to form the missing observation data. Furthermore, since we use complete observation values for training, if v = X[b,t], p(Y[b,t,v]) = 1; otherwise, p(Y[b,t,v]) = 0. Therefore, the loss function is simplified to:
[0141]
[0142] in, is the one-hot encoding of the true trajectory.
[0143] After training, I converted the trajectory probabilities represented by nodes into the trajectory probabilities represented by roads using the following formula:
[0144]
[0145] in The bth car is at e at time t i After calculating the trajectory probabilities of all vehicles observed in real time, the on-road quantity is obtained by summing their expectations:
[0146]
[0147] The present invention also provides a system for predicting the amount of urban traffic in transit based on a trajectory probability network. The XX system can be implemented by executing the process steps of the method for predicting the amount of urban traffic in transit based on a trajectory probability network. That is, those skilled in the art can understand the method for predicting the amount of urban traffic in transit based on a trajectory probability network as a preferred implementation of the system for predicting the amount of urban traffic in transit based on a trajectory probability network.
[0148] Example 2
[0149] Embodiment 2 is a preferred embodiment of Embodiment 1
[0150] Based on the urban traffic in-transit volume prediction method and system based on trajectory probability network provided by the present invention, experiments were carried out on two real road networks in Boston and Jinan. The Boston road network consists of 241 nodes and 369 edges, including 600,000 trajectories. Jinan consists of 8,908 nodes and 23,312 edges, including 963,125 independent vehicle trajectories. The trajectory is decomposed into several data of 60 time steps, and one trajectory of a vehicle is randomly taken as real-time observation data, and the other four trajectories are historical observation data. The network is trained with SDG optimizer and Cosine Annealing scheduler, and the initial mask rate is 0.5. It is compared with Cam-Traj-Rec and Traj2Traj algorithms.
[0151] like Figures 4a to 4cAs shown, the overall MAE (mean absolute error) is a comparative experiment of the in-transit prediction error of different models at different observation rates, showing the MAE of different methods at different checkpoint ratios. The trajectory probability network model always has a lower MAE than the other two methods under various conditions. When the checkpoint ratio is 0.1, the MAE of the trajectory probability network model is about 20% lower than the other methods. At an observation ratio of 10%, the trajectory probability network model can achieve similar performance to Cam-Traj-Rec at a 50% observation ratio. At a 20% observation ratio, the trajectory probability network model has surpassed the performance of other methods at a 50% observation ratio. In addition, the trajectory probability network model is significantly faster than the other two methods, and can achieve almost real-time performance on the Boston dataset.
[0152] Cam-Traj-Rec is a prior-based algorithm that assigns a prior distribution to missing trajectories based on road weights. The prior distribution is calculated based on the lengths of different paths between the start and end points. As an interpolation method, Cam-Traj-Rec has difficulty handling missing trajectory segments at the beginning and end, making its MAE highly sensitive to the checkpoint ratio, which affects the length of the missing part.
[0153] Traj2Traj is a trajectory reconstruction method based on LSTM that can handle missing segments at the beginning and end of the trajectory. However, as an autoregressive method, Traj2Traj suffers from error accumulation as the time step increases. In addition, since this method only relies on current observations and the road network, the reliability of its predictions decreases when the observation data is highly incomplete.
[0154] like Figure 5a to Figure 5d As shown in Figure 5(c), a visualization of the prediction effect of in-transit traffic on different roads using different models. In the core part of the downtown area, a major problem with Cam-Traj-Rec is that its predicted traffic is affected by the deviation of the prior distribution. This leads to errors in the judgment of which roads are the busiest. In contrast, the prediction provided by the deep learning-based method Traj2Traj is closer to the true value, but still lacks precision. As shown in the upper left part of Figure 5(c), although Traj2Traj can correctly capture the relationship between roads, its absolute traffic prediction is not accurate.
[0155] like Figures 6a to 6c As shown in the figure, it is a visualization of the prediction effect of the in-transit volume at different times for different models, and the flow at each time step is visualized in the figure. Figure 6a As shown in , Cam-Traj-Rec performs poorly at the beginning. This is a common limitation of interpolation-based methods, which have difficulty dealing with missing data at the beginning and end of trajectories. In contrast, Figure 6bIt is shown that Traj2Traj outperforms Cam-Traj-Rec, but its performance becomes unstable as the number of time steps increases. A possible explanation is that LSTM-based methods are sensitive to long-term dependencies. In addition, autoregressive methods face challenges in determining when a trajectory ends, especially when the input data is highly incomplete. Figure 6c , the performance of the trajectory probability network model is both stable and accurate. Its predictions are very close to the true values, and errors in the early stages do not adversely affect subsequent predictions. However, there are some slight inaccuracies in the beginning, which may be because the softmax function makes it difficult for the model to confidently predict a value of 1.
[0156] like Figure 7 As shown, ablation studies are performed to evaluate the impact of various computationally efficient mechanisms. These experiments are limited to the Boston dataset because the “BVLC” label shape is too large for the Jinan dataset. The results are summarized in the table. It can be seen from rows (2) and (3) that the introduction of historical data and road network information significantly reduces the MAE, among which the road network information plays a more critical role. Rows (4) and (5) show that the discretization mechanism effectively reduces the computation without significantly affecting the performance. In addition, rows (6) and (7) show that the label shape of the adjacency list has little effect on the performance, but has a significant impact on the time complexity. Finally, row (8) shows that the multi-query attention mechanism reduces the computation while maintaining stable performance.
[0157] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0158] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A method for predicting urban traffic volume based on trajectory probability network, characterized in that: include: Step S1: construct a trajectory probability network model, and train the trajectory probability network model to obtain a trained trajectory probability network model; Step S2: Based on the currently observed information, historical trajectory information and road network information, the trained trajectory probability network model is used to estimate the node trajectory probability; Step S3: obtaining a road trajectory probability estimate based on the node trajectory probability estimate, and predicting the amount of traffic on the road based on the road trajectory probability estimate; The trajectory probability network model predicts the trajectory probability of the vehicle by aggregating real-time observation information, historical observation information and road network information, thereby achieving a comprehensive prediction of the on-road volume.
2. The urban traffic in-transit volume prediction method based on trajectory probability network according to claim 1 is characterized in that: The trajectory probability network model includes: an embedding layer module, a multi-view attention module and a linear projection module; The embedding layer module is used to realize the projection of all real-world information into the aligned label space; wherein all real-world information includes: real-time observation data, historical observation data and road network data; The multi-view attention module is used to fuse real-time observation data, historical observation data and road network data; The linear projection module is used to map the hidden mark to the trajectory probability through linear projection and softmax activation function.
3. The method for predicting urban traffic in-transit volume based on trajectory probability network according to claim 2 is characterized in that: The embedded layer module includes: Convert real-time observation data into real-time observation data embedding features; Among them, z obs represents the real-time observation data embedding feature; SiLU represents the activation function; LN represents the layer normalization operation; Linear represents the linear mapping layer; E traj (·) indicates discrete encoder; Represents the position code in the time dimension; X∈{0,1,…,V} B,T ; V represents the total number of intersections, T represents the longest observation time, and B represents the number of batches; Convert historical observation data into historical observation data embedding features; Among them, z his represents the embedding features of historical observation data; N represents the number of recorded historical data; X his Represents historical observation data; Convert road network data into road network data embedding features; Among them, z adj is the embedding feature of road network data, AvgPooling represents the average pooling operation; the road network data is recorded as A = [A0, A1, ..., A N ], where M is the number of adjacency lists, A0 is a discrete adjacency list that records the connectivity of the road network, A1,…,A M It is a discrete or continuous adjacency table that records various weights of the road network, including road level and road length; A0 and real-time observation data share a discrete encoder, A1,…,A M Use your own discrete encoder or continuous encoder, denoted by E adj (·); Encode the location in node latitude and connectivity latitude.
4. The method for predicting urban traffic in-transit volume based on trajectory probability network according to claim 2 is characterized in that: The multi-view attention module includes: With' adj =MultiQueryAttention(from obs ,With adj ,With adj ) With' his =MultiHeadAttention(from obs ,With his ,With his ) With' obs =from obs +z′ adj +z′ his With' obs =MultiHeadAttention(z′ obs ,With' obs ,With' obs )+z′ obs from o ′ bs =FeedForward(z′ obs )+z′ obs Among them, MultiQueryAttention is a multi-query attention mechanism; MultiHeadAttention is a multi-head attention mechanism; FeedForward is a feedforward layer.
5. The method for predicting urban traffic in-transit volume based on trajectory probability network according to claim 2 is characterized in that: The linear projection module includes: a hidden marker z′ o ' bs It is mapped to trajectory probability through linear projection and softmax activation function; q θ (YX,X hist ,A)=softmax(Linear(z′ o ′ bs )) Where Y∈[0,1] B,T,V is the estimated path probability; softmax represents the activation function; X hist Represents historical observation data.
6. The urban traffic in-transit volume prediction method based on trajectory probability network according to claim 1 is characterized in that: The training of the trajectory probability network model includes: Based on the true trajectory probability p(Y), the trajectory probability network model is trained by optimizing the KL divergence between the true trajectory and the estimated trajectory. The loss function includes: Among them, p(Y[b,t,v]) and q θ (Y[b,t,v]|X[b],X hist [b], A[b]) obeys Bernoulli distribution; during training, a part of the complete real-time observation data is randomly masked to form missing observation data; training with complete observation values, if v = X[b,t], p(Y[b,t,v]) = 1; otherwise, p(Y[b,t,v]) = 0; the loss function is simplified to: in, is the one-hot encoding of the true trajectory.
7. The method for predicting urban traffic in-transit volume based on trajectory probability network according to claim 1 is characterized in that: The step S3 comprises: in, The bth car is at e at time t i The probability of After calculating the trajectory probabilities of all vehicles observed in real time, the on-road quantity is obtained by expected summation:
8. An urban traffic in-transit volume prediction system based on trajectory probability network, characterized in that: include: Module M1: construct a trajectory probability network model and train the trajectory probability network model to obtain a trained trajectory probability network model; Module M2: Based on the currently observed information, historical trajectory information and road network information, the trained trajectory probability network model is used to estimate the node trajectory probability; Module M3: Obtain road trajectory probability estimation based on node trajectory probability estimation, and predict on-road traffic based on road trajectory probability estimation; The trajectory probability network model predicts the trajectory probability of the vehicle by aggregating real-time observation information, historical observation information and road network information, thereby achieving a comprehensive prediction of the on-road volume.
9. The urban traffic in-transit volume prediction system based on trajectory probability network according to claim 8 is characterized in that: The trajectory probability network model includes: an embedding layer module, a multi-view attention module and a linear projection module; The embedding layer module is used to realize the projection of all real-world information into the aligned label space; wherein all real-world information includes: real-time observation data, historical observation data and road network data; The multi-view attention module is used to fuse real-time observation data, historical observation data and road network data; The linear projection module is used to map the hidden marks to the trajectory probability through linear projection and softmax activation function; The embedded layer module includes: Convert real-time observation data into real-time observation data embedding features; Among them, z obs represents the real-time observation data embedding feature; SiLU represents the activation function; LN represents the layer normalization operation; Linear represents the linear mapping layer; E traj (·) indicates discrete encoder; Represents the position code in the time dimension; X∈{0,1,…,V} B,T ; V represents the total number of intersections, T represents the longest observation time, and B represents the number of batches; Convert historical observation data into historical observation data embedding features; Among them, z his represents the embedding features of historical observation data; N represents the number of recorded historical data; X his Represents historical observation data; Convert road network data into road network data embedding features; Among them, z adj is the embedding feature of road network data, AvgPooling represents the average pooling operation; the road network data is recorded as A = [A0, A1, ..., A M ], where M is the number of adjacency lists, A0 is a discrete adjacency list that records the connectivity of the road network, A1,…,A M It is a discrete or continuous adjacency table that records various weights of the road network, including road level and road length; A0 and real-time observation data share a discrete encoder, A1,…,A M Use your own discrete encoder or continuous encoder, denoted by E adj (·); Encode the position in node latitude and connectivity latitude; The multi-view attention module includes: With' adj =MultiQueryAttention(from obs ,With adj ,With adj ) With' his =MultiHeadAttention(from obs ,With his ,With his ) With' obs =from obs +z′ adj +z′ his With' obs =MultiHeadAttention(z′ obs ,With' obs ,With' obs )+z′ obs from o ′ bs =FeedForward(z′ obs )+z′ obs Among them, MultiQueryAttention is a multi-query attention mechanism; MultiHeadAttention is a multi-head attention mechanism; FeedForward is a feedforward layer; The linear projection module includes: a hidden marker z′ o ' bs It is mapped to trajectory probability through linear projection and softmax activation function; q θ (YX,X hist ,A)=softmax(Linear(z′ o ′ bs )) Where Y∈[0,1] B,T,V is the estimated path probability; softmax represents the activation function; X hist Represents historical observation data.
10. The urban traffic in-transit volume prediction system based on trajectory probability network according to claim 8, characterized in that: The training of the trajectory probability network model includes: Based on the true trajectory probability p(Y), the trajectory probability network model is trained by optimizing the KL divergence between the true trajectory and the estimated trajectory. The loss function includes: Among them, p(Y[b,t,v]) and q θ (Y[b,t,v]|X[b],X hist [b], A[b]) obeys Bernoulli distribution; during training, a part of the complete real-time observation data is randomly masked to form missing observation data; using complete observation values for training, if v = X[b,t], p(Y[v,t,v]) = 1; otherwise, p(Y[v,t,v]) = 0; the loss function is simplified to: in, is the one-hot encoding of the true trajectory; The module M3 comprises: in, The bth car is at e at time t i The probability of After calculating the trajectory probabilities of all vehicles observed in real time, the on-road quantity is obtained by expected summation:
Citation Information
Patent Citations
In-transit quantity estimation method based on intersection vehicle detector group
CN113593242A