A traffic trajectory prediction method based on urban topology modeling and social attention mechanism

CN122656091APending Publication Date: 2026-08-28PEKING UNIV SHENZHEN GRADUATE SCHOOL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610680521.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

同时,传感器噪声(如GPS多路径效应)产生的轨迹抖动,往往会随着预测时长的增加而产生累积误差

Benefits of technology

[0035] 1. Urban Topological Mesh Modeling Integrating Physical Road Network Constraints: This invention constructs a discretized topological mesh based on generating-attracting units (PAUs), transforming the originally unconstrained continuous coordinate prediction into the generation of constrained graph node sequences. Compared to traditional prediction methods based on free-space coordinates, this technical solution ensures that the prediction results conform to the physical structure of the road network. By mapping trajectory points to topological vertices with actual traffic semantics, the "illegal path" problem caused by GPS bias is effectively eliminated, enabling the model to perceive high-level constraints such as lane attributes and traffic regulations, significantly improving the compliance and rationality of predicted trajectories in real-world complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122656091A_ABST
    Figure CN122656091A_ABST
Patent Text Reader

Abstract

The application discloses a traffic trajectory prediction method based on city topology modeling and a social attention mechanism, and belongs to the field of intelligent traffic systems and trajectory big data processing. First, the application obtains the space-time trajectory of an intelligent agent through a multi-source sensing method, and carries out denoising and standardization processing by using an improved two-dimensional Gaussian filter. Then, a discretized city topology grid model based on a generation-attracting unit is constructed, which is mapped into a topology node sequence. The motion inertia of an individual is extracted by using an LSTM, and a social attention mechanism with a dynamic mask is introduced. Finally, spatial semantic information is fused, a graph neural network and a conditional variational autoencoder are used to output a multi-modal prediction trajectory conforming to physical constraints, and Kalman filtering is used for online residual error correction. The application effectively solves the rationality and precision of the predicted trajectory in a complex urban environment, and provides reliable support for automatic driving decision-making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation systems and trajectory big data prediction, specifically to a traffic trajectory prediction method based on urban topology modeling and social attention mechanisms. Background Technology

[0002] With the acceleration of global urbanization, urban traffic environments are becoming increasingly complex, and the density and heterogeneity of traffic participants pose significant challenges to traffic safety and efficiency. Intelligent agent trajectory prediction (pedestrian trajectory prediction and vehicle trajectory prediction), as a core pre-processing task for autonomous driving decision-making, is directly related to traffic safety in terms of accuracy. However, existing technologies still have many problems:

[0003] First, existing prediction models often treat the agent's motion as coordinate evolution in a two-dimensional grid space, neglecting the physical and topological constraints of urban road networks. In real urban environments, vehicle motion is strictly constrained by lane lines, traffic flow, and one-way restrictions, while pedestrian motion is limited by building boundaries and sidewalk distribution. Traditional continuous coordinate prediction models often exhibit predicted trajectories that cross buildings or "drift" in non-driving areas, lacking a consistent physical meaning.

[0004] Secondly, the modeling of multi-agent interactions (social interactions) in traffic environments remains inaccurate. Existing social pooling or basic attention mechanisms often only consider Euclidean distance, neglecting the impact of urban physical barriers. For example, pedestrians and vehicles separated by fences on either side of an intersection may be spatially close, but they do not have direct motion interaction. If the model cannot recognize such topological barriers, it will lead to the generation of false interaction features, thereby interfering with the prediction results.

[0005] Furthermore, human movement is highly uncertain and involves multimodal intentions. For example, at an intersection, an agent may either go straight or turn. Existing regression models tend to output an "average path," leading to predictions pointing to illegal areas. Meanwhile, trajectory jitter caused by sensor noise (such as GPS multipath effects) often accumulates errors as the prediction time increases.

[0006] To address the aforementioned challenges, while existing technologies attempt to incorporate map information or simple social models, the challenge of organically combining macroscopic urban network topology discretization modeling with microscopic social attention mechanisms to capture complex dynamic intentions while maintaining physical consistency of trajectories remains a pressing issue in this field. Summary of the Invention

[0007] The purpose of this invention is to address the shortcomings of existing technologies by proposing a traffic trajectory prediction method based on urban topology modeling and social attention mechanisms.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] S1. First, the spatiotemporal trajectory data of the intelligent agent is obtained through urban roadside sensing units, vehicle-mounted GPS and mobile terminals; the intelligent agent includes pedestrians and vehicles.

[0010] S2. The coordinate values ​​of the spatiotemporal trajectory data are convolved using the improved two-dimensional Gaussian filter of Equation 1 to eliminate random noise generated by the positioning sensor due to the multipath effect. Then, the filtered spatiotemporal trajectory data is Z-score normalized to map it to the same order of magnitude space.

[0011] Formula 1:

[0012] Where x0 and y0 are the original horizontal and vertical coordinates of the spatiotemporal trajectory data, and x and y are pixels that undergo convolution sliding with (x0, y0) as the center. These are the smoothed coordinate values, where π represents pi, e is the natural base, and σ is the standard deviation that controls the degree of smoothing.

[0013] S3. Construct a topological mesh model based on generation-attraction units to transform unconstrained free-space motion into constrained urban road network motion, including the following steps:

[0014] a. Determine the prediction area range based on the maximum and minimum values ​​of x and y in the spatiotemporal trajectory data;

[0015] b. Divide the prediction area into N*M uniform grid cells, and define the road network nodes and road segment centers as vertices V of the topology graph;

[0016] c. Based on road connectivity, establish directed edges E and construct the city network graph G = (V, E);

[0017] d. Following the nearest neighbor principle in Equation 2, the filtered spatiotemporal trajectory data is mapped using a spatial mapping function. Mapped to a sequence of topological nodes :

[0018] Formula 2:

[0019] Where pt represents the filtered continuous coordinate vector at time t, coord(v) represents the center coordinate of the topological node v in the current geographic coordinate system; |·|2 represents the second norm, i.e., the Euclidean distance; argmin represents the vertex index that minimizes the distance.

[0020] S4. For each topological node v in vertex V, extract its multi-source spatial semantic feature vector F; the multi-source spatial semantic features include the POI distribution, land use type and real-time traffic flow density of the region.

[0021] S5. For each agent, using Equation 3 and a bidirectional long short-term memory network, the motion inertia of past moments is extracted forward, the hidden state is corrected backward, and the motion state h at the current moment is obtained. t :

[0022] Formula 3:

[0023] Among them, s t The topology node at time t; h t-1 The h represents the state vector output by the feedforward hidden layer, capturing historical movement trends; t+1 The h represents the state vector output by the backward hidden layer, used to correct the current features during the training phase using future information; t represents the motion state at the current time t; LSTMf and LSTMb represent the sequential / reverse computation of the model along the time axis.

[0024] S6. Calculate the relative spatial position relationship between the target agent i and its neighboring agents j, and construct the social attention weight coefficients. Social interaction feature vectors are obtained through weighted pooling.

[0025] Formula 4:

[0026] Where W is the feature weight transformation matrix; h t h represents the motion state at the current time t. j N represents the motion state of neighboring agent j at the current time t; i Represents the set of all neighboring agents i within a set radius threshold, where k is an element; | represents the vector concatenation operation, a T α represents the attention layer weight vector, and LeakyReLU represents the activation function; ij The social attention weight coefficient of neighboring agent j towards target agent i reflects the influence of social behaviors such as avoidance, following, or grouping on the trajectory.

[0027] Furthermore, when there are urban topological obstacles between two agents, the corresponding obstacles can be linked by retrieving the topological grid connectivity of the urban network graph G. Forced to be set to 0.

[0028] S7. For agent i, the city network graph G, the topological node sequence S, the multi-source spatial semantic feature vector F, and the social interaction feature vector H are used to construct the network graph G, the topological node sequence S, the multi-source spatial semantic feature vector F, and the social interaction feature vector H. i The data is fused and input into the graph neural network. The loss function L is defined by Equation 5 as the weighted sum of the average displacement error and the final displacement error:

[0029] Formula 5:

[0030] in, The coordinate vector predicted by the model at time t; λ1 and λ2 represent the true ground reference coordinates of the trajectory at time t; T' represents the prediction duration; λ1 and λ2 represent the hyperparameters balancing the weights of ADE and FDE; and L represents the total loss value.

[0031] S8. Use a conditional variational autoencoder to output the K possible trajectory sequences of agent i in the future and their probabilities, including the coordinate probability distribution parameters from time T+1 to T+Δt.

[0032] Furthermore, the trajectory sequence is generated by combining a topology graph search algorithm; specifically, based on the initial heat map generated by the conditional variational autoencoder, the top K optimal paths are searched in the urban topology graph G using the A* algorithm, and the continuous output is projected onto the searched topology path to force the predicted trajectory to comply with urban traffic regulations.

[0033] S9. Restore the predicted grid sequence back to continuous geographic space, and correct the prediction residuals using a Kalman filter framework based on the real-time observed location at the next moment.

[0034] The present invention has the following outstanding substantive features and significant progress compared with existing technologies:

[0035] 1. Urban Topological Mesh Modeling Integrating Physical Road Network Constraints: This invention constructs a discretized topological mesh based on generating-attracting units (PAUs), transforming the originally unconstrained continuous coordinate prediction into the generation of constrained graph node sequences. Compared to traditional prediction methods based on free-space coordinates, this technical solution ensures that the prediction results conform to the physical structure of the road network. By mapping trajectory points to topological vertices with actual traffic semantics, the "illegal path" problem caused by GPS bias is effectively eliminated, enabling the model to perceive high-level constraints such as lane attributes and traffic regulations, significantly improving the compliance and rationality of predicted trajectories in real-world complex scenarios.

[0036] 2. Introduction of a Dynamic Topological Masking Mechanism for Social Attention Interaction: Addressing the complex obstacle distribution in urban scenarios, this invention introduces dynamic masking logic based on topological connectivity into the social attention mechanism. Existing technologies often calculate attention solely based on distance, which is prone to misjudgments. This invention automatically masks false interactions isolated by physical obstacles such as buildings and fences by retrieving the connectivity of the topological grid. This design enables the model to more accurately identify sets of agents with genuine interaction intentions, capturing subtle behavioral patterns such as "avoidance" and "following," significantly improving the fidelity of behavioral simulation in crowded, non-convex spatial environments.

[0037] 3. This model combines deep learning generative models with heuristic graph search. Compared to traditional models that only output a single, definitive trajectory, it utilizes CVAE to generate multiple potential probability distributions and employs the A* algorithm to find the optimal path in the topological graph. This ensures that even in highly uncertain intersection scenarios, the model outputs K candidate trajectories that not only cover multiple possible intentions but also strictly adhere to semantic traffic rules such as one-way traffic and no U-turns. Furthermore, the online correction mechanism using Kalman filtering further suppresses long-term prediction drift, achieving a dual improvement in accuracy and stability. Attached Figure Description

[0038] Figure 1 This is the overall flowchart of the present invention;

[0039] Figure 2 This is a flowchart of the urban topology modeling steps of the present invention. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.

[0041] The overall flowchart of the present invention is as follows: Figure 1 Example 1:

[0042] S1. Multi-source trajectory data acquisition: Spatiotemporal trajectory data of pedestrians and vehicles are acquired through key intersections and roadside sensing units deployed on roads; simultaneously, location stream data from vehicle-mounted GPS positioning systems and mobile terminals are integrated. The data includes coordinates (x, y), timestamp t, and agent category labels.

[0043] S2. Noise Reduction and Preprocessing: An improved two-dimensional Gaussian filter is used to convolve the trajectory points to filter out random noise in the positioning signal caused by building reflections.

[0044] Formula 1:

[0045] Where x0 and y0 are the original horizontal and vertical coordinates of the spatiotemporal trajectory data, and x and y are pixels that undergo convolution sliding with (x0, y0) as the center. These are the smoothed coordinate values, where π represents pi, e is the natural base, and σ is the standard deviation that controls the degree of smoothing.

[0046] S3. Urban topology grid construction. The urban topology grid construction steps of this invention are as follows: Figure 2 :

[0047] a. The extreme values ​​of latitude and longitude within the statistical region determine the predicted spatial boundary;

[0048] b. Divide the region into an N*M grid, and define road intersections and road segment centers as graph vertices V;

[0049] c. Based on the physical connectivity of roads, connect vertices to establish directed edges E, and generate the city topology graph G=(V, E);

[0050] d. Use spatial mapping functions to map continuous points into a topological sequence, following the nearest neighbor principle:

[0051] Formula 2:

[0052] Where pt represents the filtered continuous coordinate vector at time t, coord(v) represents the center coordinate of the topological node v in the current geographic coordinate system; |·|2 represents the second norm, i.e., the Euclidean distance; argmin represents the vertex index that minimizes the distance.

[0053] S4. Spatial Semantic Feature Encoding: Retrieve the POI density, land function attributes (e.g., commercial area, residential area), and real-time traffic flow around each topological node v$. Transform these discrete features into a multi-source spatial semantic feature vector F through an embedding layer, representing the potential attractiveness of the region to the agent.

[0054] S5. Individual temporal feature extraction: Model individual movement trends using a bidirectional long short-term memory network (Bi-LSTM).

[0055] Formula 3:

[0056] Among them, s t The topology node at time t; h t-1 The h represents the state vector output by the feedforward hidden layer, capturing historical movement trends; t+1 The h represents the state vector output by the backward hidden layer, used to correct the current features during the training phase using future information; trepresents the motion state at the current time t; LSTMf and LSTMb represent the sequential / reverse computation of the model along the time axis.

[0057] S6. Social Attention Interaction Modeling: Calculate the relative positions of the target agent and its neighboring agents to construct social attention coefficients. Introduce dynamic masking: If there are topological inaccessibility barriers between two agents, adjust the attention weights accordingly. Social interaction feature vectors are obtained through weighted pooling. :

[0058] Formula 4:

[0059] Where W is the feature weight transformation matrix; h t h represents the motion state at the current time t. j N represents the motion state of neighboring agent j at the current time t; i Represents the set of all neighboring agents i within a set radius threshold, where k is an element; | represents the vector concatenation operation, a T α represents the attention layer weight vector, and LeakyReLU represents the activation function; ij The social attention weight coefficient of neighboring agent j towards target agent i reflects the influence of social behaviors such as avoidance, following, or grouping on the trajectory.

[0060] S7. Full Feature Fusion and Graph Convolutional Prediction: F, ht, and H are fused and input into a graph neural network. The loss function is defined as equation 5 to optimize the training model.

[0061] Formula 5:

[0062] in, The coordinate vector predicted by the model at time t; λ1 and λ2 represent the true ground reference coordinates of the trajectory at time t; T' represents the prediction duration; λ1 and λ2 represent the hyperparameters balancing the weights of ADE and FDE; and L represents the total loss value.

[0063] S8. Multimodal decoding generation: Conditional variational autoencoder (CVAE) is used for decoding, sampling from the latent distribution to generate K candidate prediction trajectories, and outputting the corresponding probability distribution parameters.

[0064] S9. Online Correction and Restoration: The predicted topological nodes are restored to latitude and longitude coordinates. Using a Kalman filter framework, the predicted location is used as a state prior. The gain is dynamically updated in combination with real-time observations to correct the residuals online, and the final smooth prediction result is output.

[0065] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the scope of protection of the appended claims.

Claims

1. A traffic trajectory prediction method based on urban topology modeling and social attention mechanisms, characterized in that, Includes the following steps: S1. First, the spatiotemporal trajectory data of the intelligent agent is acquired through urban roadside sensing units, vehicle-mounted GPS, and mobile terminals; the intelligent agent includes pedestrians and vehicles. S2. The coordinate values ​​of the spatiotemporal trajectory data are convolved using the improved two-dimensional Gaussian filter from Equation 1 to eliminate random noise generated by the positioning sensor due to multipath effects. Then, the filtered spatiotemporal trajectory data is Z-score normalized to map it to the same order of magnitude space. Formula 1: Where x0 and y0 are the original horizontal and vertical coordinates of the spatiotemporal trajectory data, and x and y are the pixels that undergo convolution sliding with (x0, y0) as the center. The coordinates are smoothed, where π represents pi, e is the natural base, and σ is the standard deviation that controls the degree of smoothing. S3. Construct a topological mesh model based on generation-attraction units to transform unconstrained free-space motion into constrained urban road network motion, including the following steps: a. Determine the prediction area range based on the maximum and minimum values ​​of x and y in the spatiotemporal trajectory data; b. Divide the prediction area into N*M uniform grid cells, and define the road network nodes and road segment centers as vertices V of the topology graph; c. Based on road connectivity, establish directed edges E and construct the city network graph G = (V, E); d. Following the nearest neighbor principle in Equation 2, the filtered spatiotemporal trajectory data is mapped using a spatial mapping function. Mapped to a sequence of topological nodes : Formula 2: Where pt represents the filtered continuous coordinate vector at time t, coord(v) represents the center coordinates of the topological node v in the current geographic coordinate system; |·|2 represents the second norm, i.e., the Euclidean distance; argmin represents the vertex index that minimizes the distance. S4. For each topological node v in vertex V, extract its multi-source spatial semantic feature vector F; the multi-source spatial semantic features include the POI distribution, land use type and real-time traffic flow density of the region. S5. For each agent, using Equation 3 and a bidirectional long short-term memory network, the motion inertia of past moments is extracted forward, the hidden state is corrected backward, and the motion state h at the current moment is obtained. t : Formula 3: Among them, s t The topology node at time t; h t-1 The h represents the state vector output by the feedforward hidden layer, capturing historical movement trends; t+1 The h represents the state vector output by the backward hidden layer, used to correct the current features using future information during the training phase; t The motion state at the current time t; LSTMf and LSTMb represent the model being computed sequentially or in reverse order along the time axis. S6. Calculate the relative spatial position relationship between the target agent i and its neighboring agents j, and construct the social attention weight coefficients. Social interaction feature vectors are obtained through weighted pooling. Formula 4: Where W is the feature weight transformation matrix; h t h represents the motion state at the current time t. j N represents the motion state of neighboring agent j at the current time t; i represents the set of all neighboring agents i within a set radius threshold, where k is an element; | represents the vector concatenation operation, a T α represents the attention layer weight vector, and LeakyReLU represents the activation function; ij The social attention weight coefficient of neighboring agent j to target agent i reflects the influence of social behaviors such as avoidance, following, or grouping on the trajectory. S7. For agent i, the city network graph G, the topological node sequence S, the multi-source spatial semantic feature vector F, and the social interaction feature vector H are used to construct the network graph G, the topological node sequence S, the multi-source spatial semantic feature vector F, and the social interaction feature vector H. i The data is fused and input into the graph neural network. The loss function L is defined by Equation 5 as the weighted sum of the average displacement error and the final displacement error: Formula 5: in, The coordinate vector predicted by the model at time t; The ground reference coordinates represent the trajectory at time t; T' represents the prediction duration; λ1 and λ2 represent the hyperparameters balancing the weights of ADE and FDE; L represents the total loss value; S8. Use a conditional variational autoencoder to output the K possible trajectory sequences of agent i in the future and their probabilities, including the coordinate probability distribution parameters from time T+1 to T+Δt. S9. Restore the predicted grid sequence back to continuous geographic space, and correct the prediction residuals using a Kalman filter framework based on the real-time observed location at the next moment.

2. The traffic trajectory prediction method based on urban topology modeling and social attention mechanism according to claim 1, characterized in that: In step S6, when there are urban topological obstacles between two agents, the corresponding α is determined by retrieving the topological grid connectivity of the urban network graph G. ij Forced to be set to 0.

3. The traffic trajectory prediction method based on urban topology modeling and social attention mechanism according to claim 1, characterized in that: In step S8, the trajectory sequence is generated by combining a topology search algorithm; specifically, based on the initial heat map generated by the conditional variational autoencoder, the top K optimal paths are searched in the urban topology map G using the A* algorithm, and the continuous output is projected onto the searched topology path to force the predicted trajectory to comply with urban traffic regulations.