A trajectory restoration system based on urban traffic road network
By combining the Transformer model and the GRU graph neural network, and utilizing the topology and spatiotemporal characteristics of urban traffic networks, the problem of accuracy and consistency in the reconstruction of low-sampling-rate trajectory data was solved, achieving higher-precision trajectory reconstruction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUDAN UNIVERSITY
- Filing Date
- 2023-04-01
- Publication Date
- 2026-06-05
Smart Images

Figure CN116612631B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent transportation technology, specifically a trajectory reconstruction system based on urban traffic network. Background Technology
[0002] With the widespread use of GPS modules in various mobile devices, GPS trajectories have appeared in many applications, such as travel time estimation, traffic prediction, and trajectory similarity measurement. However, the performance of these models largely depends on the trajectory sampling rate. That is, high-sample-rate trajectories provide more detailed information about vehicle motion patterns, thus enabling these models to perform well. However, in reality, a large number of trajectories have low sampling rates, making it difficult for most existing models to effectively utilize these trajectories. Meanwhile, although most existing map matching algorithms based on Hidden Markov Models (HMMs) and their variants have high accuracy for high-sample trajectories, their performance drops significantly as the sampling rate increases, mainly due to the high uncertainty of low-sample-rate trajectory data. While much existing work aims to improve the accuracy of map matching, including HMM-based methods and learning-based methods, the problem of low-sample trajectories has never been completely resolved.
[0003] Another branch of research on low-sample trajectories includes trajectory reconstruction, which aims to recover missing points from a given trajectory set. Some existing work ignores the topology of the road network, using only grid information or raw GPS points as input. Therefore, the encoder model fails to capture the rich spatial information of GPS points. These issues lead to low prediction accuracy and a lack of spatial consistency in trajectory reconstruction models. Summary of the Invention
[0004] In view of the above problems, the purpose of this invention is to provide a trajectory reconstruction system based on urban traffic network to solve the problems of low prediction accuracy and lack of spatial consistency in current trajectory reconstruction.
[0005] The present invention provides a trajectory reconstruction system based on urban traffic network, the system comprising:
[0006] The traffic trajectory data acquisition module uses an onboard GPS device to collect latitude and longitude data (specifically, low-sampling-rate trajectory points) of vehicles traveling on real urban roads at a set collection period and interval (e.g., typically uploading GPS positioning every 2-6 minutes); and performs data preprocessing and cleaning to ensure the accuracy and validity of the data.
[0007] The GPS trajectory feature extraction module uses a temporal and spatial combined Transformer model (as a deep learning neural network) (Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[J]. Advances in neural information processing systems, 2017, 30.) to extract rich spatiotemporal features from the collected trajectory points with low sampling rates.
[0008] The GPS trajectory reconstruction learning module employs a GRU (Gated Recurrent Unit) (Cho K, Van B,Gulcehre C, et al. Learning phrase representations using RNNencoder-decoder for statistical machine translation[J].arXiv preprint arXiv:1406.1078,2014.) The graph neural network model is used to reconstruct the trajectory and is trained using multi-task learning; based on the output of the previous module, the latitude and longitude information of the missing sampling points in the input low-sampling-rate trajectory is predicted.
[0009] Specifically, in the GPS trajectory reconstruction learning module, the GRU acts as a decoder, receiving the output of the encoder from the GPS trajectory feature extraction module as input. It then predicts the latitude and longitude information of missing sampling points in the low-sampling-rate trajectory based on previous predictions and contextual information. In other words, the input sequence of this module is the output of the encoder from the GPS trajectory feature extraction module, while the output sequence is the latitude and longitude information of the missing sampling points in the low-sampling-rate trajectory. The internal state of the GRU consists of previous predictions and historical information from the input sequence, enabling the model to make predictions even with missing data.
[0010] Furthermore:
[0011] The traffic trajectory data acquisition module is one of the key modules in this invention. It is the first step in the entire trajectory reconstruction process. In this invention, the acquired trajectory data mainly comes from vehicle-mounted GPS devices. The latitude and longitude data collected by these GPS devices can be uploaded to the backend server for processing via network transmission or other methods. During data acquisition, a certain acquisition period and interval can be set to ensure that the acquired data has a certain timeliness and usability. After the trajectory data is acquired, it can be preprocessed and cleaned. The preprocessing process includes operations such as noise removal and missing data filling to reduce data errors and improve data usability. The cleaning process includes operations such as removing abnormal data and filtering invalid data to ensure the accuracy and validity of the data.
[0012] The GPS trajectory feature extraction module employs a deep learning neural network to extract features from trajectory points with low sampling rates. It is specifically divided into three sub-modules: road network feature representation, trajectory feature representation, and representation learning.
[0013] The road network feature representation submodule specifically includes:
[0014] (1) Process the urban roads and construct the topological relationship between the roads G=(V,E), where |V|=N represents the number of road segments in the road network. This represents the connection relationship between road segments, i.e., element e in E. ij =1 if and only if the i-th road segment and the j-th road segment are connected;
[0015] (2) Divide the road network into m×n grid cells; then, for each road segment, extract the grid numbers it passes through; thus, each road segment can be represented as a grid sequence; input these grid sequences into the GRU to obtain the gridded representation x of each road segment. grid ;
[0016] (3) Create a vocabulary list for each road segment. Where N×d represents the number of road segments in the road network, that is, the number of nodes in the road network diagram established in the above road network topology;
[0017] (4) Take the x obtained in step (3) id and x obtained in step (2) grid The data is then concatenated to obtain the input to the graph neural network.
[0018] (5) Use a graph neural network to model the road network topology using a graph attention model; specifically, input the results obtained in step (4) into an M-layer graph attention network (GAT). In P, Cucurull G, Casanova A, et al. Graph attention networks[J]. arXiv preprint arXiv:1710.10903,2017.), graph attention networks aggregate information about nodes in the graph and their neighbors to obtain the final road network representation x. road .
[0019] The trajectory feature representation submodule specifically includes:
[0020] (1) Using the R-Tree data structure, extract the location information around each GPS sampling point;
[0021] (2) Convert the road network information stored in the R-Tree data structure into a weighted directed graph, where nodes represent locations in the road network, edges represent paths between locations, and the weight of an edge represents the degree of association between paths. In the process of constructing the subgraph corresponding to each GPS point, the exponential decay function is used to calculate the weight between nodes. By calculating the distance between each node and the GPS point, the similarity or weight between nodes is calculated.
[0022] The exponential decay function is in the following form: Where d represents the distance between GPS and the road segment, and β is a hyperparameter used to control the rate of similarity decay. The smaller d is, the greater the similarity or weight between them; the greater the distance between them, the smaller the similarity or weight between them, which satisfies the weight decay law.
[0023] (3) Represent the road network obtained in the previous part as x road As a feature of each subgraph in the trajectory.
[0024] The representation learning submodule specifically includes:
[0025] (1) Use the Transformer model to extract features of the time dependence of the trajectory. By learning the time relationship between trajectory points with low sampling rate, the time series features between trajectory points are captured to improve the accuracy and precision of trajectory reconstruction.
[0026] (2) Using the Gated Fusion mechanism (Zheng C, Fan X, Wang C, et al. Gman: A graph multi-attention network for traffic prediction[C] / / Proceedings of the AAAIconference on artificial intelligence.2020,34(01):1234-1241.), spatial features and temporal features are spliced and fused to obtain a spatiotemporal feature matrix;
[0027] (3) Input the fused spatiotemporal features into the graph neural network model, and use the graph neural network model to extract features from the spatiotemporal graph;
[0028] (4) By using a short-circuit module to connect the multi-head attention mechanism module and the forward propagation module, the advantages of the two modules can be fully utilized;
[0029] (2)-(4) Construct a Transformer model based on graph neural network (GNN) for spatiotemporal graph feature extraction.
[0030] The GPS trajectory reconstruction learning module uses a GRU model for trajectory reconstruction and is trained using multi-task learning. Specifically, it includes:
[0031] (1) The GPS trajectory sequence is modeled and reconstructed using a GRU model. Specifically, the final output obtained from the trajectory feature representation submodule is input into a single-layer GRU model to obtain the features of the reconstructed trajectory at each time step, i.e. This represents the output of the GRU model at time point j.
[0032] (2) Use cross-entropy as the loss function for road segment prediction. Assume the output of GRU at time point j is... So, what are the predicted losses for this road segment? Defined as:
[0033]
[0034] In the formula, V represents the set of all road segments, l represents the length of the trajectory, and e j This represents the road segment corresponding to the j-th sampling point in the actual trajectory. c represents the learnable parameters. j This represents a predefined mask.
[0035] (3) Use the regression loss as the loss function to predict the acute migration ratio. Assume the output of the GRU at time point j is... So, the moving ratio predicts the loss. Defined as:
[0036]
[0037] In the formula, r j This indicates that the j-th sampling point in the actual trajectory is located on the corresponding road segment e. j The moving ratio on, w rate σ represents the learnable parameters, and σ is the Sigmoid activation function.
[0038] (4) The optimization objective of the entire model is defined as:
[0039]
[0040] In the formula, λ is a hyperparameter used to weigh the importance of the two loss functions.
[0041] (5) Repeat (2)-(4) until the model reaches the expected result.
[0042] Advantages of the present invention
[0043] This invention fully utilizes road network information for trajectory reconstruction. During trajectory reconstruction, considering the potentially large distances between adjacent sampling points (for example, assuming a car travels at 100 km / h on an elevated road, if the time interval between two sampling points is 100 seconds, the distance between them could reach nearly 3 km), adjacent sampling points may traverse many road segments. Taking into account the complex topology of the road network, this invention uses a graph neural network and extracts a novel spatiotemporal Transformer model to extract spatial information from GPS trajectories. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the trajectory reconstruction model based on urban traffic network proposed in this invention.
[0045] Figure 2 This diagram illustrates the deployment of the trajectory reconstruction model based on the urban traffic network proposed in this invention in Shanghai. Detailed Implementation
[0046] The invention will be further illustrated below with reference to specific examples and accompanying drawings.
[0047] Figure 1This is a schematic diagram of the trajectory reconstruction model based on urban traffic network proposed in this invention. The method includes a traffic trajectory data acquisition module for collecting latitude and longitude data of vehicles traveling on real urban roads; a GPS trajectory feature extraction module for extracting rich spatiotemporal features from the low-sampling-rate trajectory points collected and inputting them into a neural network; and a GPS trajectory reconstruction learning module for inputting the output of the previous stage into a new neural network model to predict the latitude and longitude information of the missing sampling points in the low-sampling-rate trajectory.
[0048] Figure 2 This diagram illustrates the deployment of the trajectory reconstruction model based on the urban traffic network proposed in this invention in Shanghai. This model effectively utilizes information from the urban traffic network to reconstruct and correct GPS trajectories, thereby improving the accuracy of trajectory reconstruction. In the diagram, circles represent GPS data obtained from GPS devices. After processing by the model, this data is converted into high-sampling-rate trajectories, represented by triangles, resulting in more realistic and accurate vehicle driving trajectories. In practical applications, this model can be applied to taxis, express delivery, logistics, and other fields, providing strong support for urban traffic management, intelligent transportation construction, and transportation safety.
[0049] This specific implementation was tested using trajectory data from Shanghai, Chengdu, China, and Porto, Portugal. Table 1 shows a comparison of the test results with current mainstream trajectory reconstruction models and algorithms, where the data represents the average time for all vehicles to pass through intersections when the method was tested on the specified dataset. The fixed-interval reconstruction method is a traditional non-deep learning method that uses linear interpolation to reconstruct high-sampling-rate trajectories and combines it with an Hidden Markov Model (HMM) algorithm to project GPS onto the road network. The GPS reconstruction method utilizes a state-of-the-art deep learning model, obtaining a high-sampling-rate GPS sequence from the input GPS sequence and combining it with an HMM algorithm to project GPS onto the road network. The end-to-end method is the best trajectory reconstruction method, using an end-to-end algorithm to directly reconstruct the actual GPS trajectory. For each city, this invention uses Recall, Precision, Accuracy, and F1 Score to evaluate the accuracy of road segment reconstruction, and MAE and RMSE to evaluate the accuracy of GPS reconstruction. Wherein, Recall represents the ratio of the number of samples correctly predicted as positive to the actual number of positive samples; Precision represents the ratio of the number of samples correctly predicted as positive to the total number of samples predicted as positive; Accuracy represents the ratio of the number of samples correctly predicted to the total number of samples; F1 Score considers both precision and recall; MAE is the average of the absolute values of the differences between predicted and true values; and RMSE is the square root of the average of the squares of the differences between predicted and true values.
[0050] Table 1
[0051]
[0052]
Claims
1. A trajectory reconstruction system based on urban traffic network, characterized in that, include: The traffic trajectory data acquisition module uses an onboard GPS device to collect latitude and longitude data of vehicles traveling on real urban roads at a set collection period and interval. Specifically, it collects trajectory points with a low sampling rate. The module also performs data preprocessing and cleaning to ensure the accuracy and validity of the data. The GPS trajectory feature extraction module employs a temporal and spatial combined Transformer model as a deep learning neural network to extract spatiotemporal features from low-sampling-rate trajectory points. Specifically, it consists of three sub-modules: road network feature representation, trajectory feature representation, and representation learning. The road network feature representation submodule specifically includes: (1) Process the urban roads and construct the topological relationships between them. ,in Indicates the number of road segments in the road network. This indicates the connection relationship between road segments, i.e. Middle elements If and only if the first The road section and the first The road sections are connected; (2) Divide the road network into The grid cells are then extracted; then, for each road segment, the grid numbers of the traversed grids are extracted; thus, each road segment is represented as a grid sequence; these grid sequences are then input into the GRU to obtain the gridded representation of each road segment. ; (3) Create a vocabulary list for each road segment. ,in This indicates the number of road segments in the road network, that is, the number of nodes in the road network diagram established in the above road network topology; (4) The result obtained in (3) The results obtained in (2) The data is then concatenated to obtain the input to the graph neural network. (5) The graph attention model is used to model the road network topology using a graph neural network. Specifically, the result obtained in (4) is input into an M-layer graph attention network (GAT). The graph attention network aggregates the information of the nodes in the graph and the information of their neighbors to obtain the final road network representation. ; The trajectory feature representation submodule specifically includes: (1) Using the R-Tree data structure, extract the location information around each GPS sampling point; (2) Convert the road network information stored in the R-Tree data structure into a weighted directed graph, where nodes represent locations in the road network, edges represent paths between locations, and the weight of the edges represents the degree of association between paths; in the process of constructing the subgraph corresponding to each GPS point, the exponential decay function is used to calculate the weight between nodes, and the similarity or weight between nodes is calculated by calculating the distance between each node and the GPS point. The exponential decay function is in the following form: ,in Indicates the distance between GPS and the road segment. It is a hyperparameter used to control the rate at which similarity decays; when The smaller the distance between them, the greater their similarity or weight; the greater the distance between them, the smaller their similarity or weight, which follows the weight decay law. (3) Represent the road network obtained in the previous part As a feature of each subgraph in the trajectory; The representation learning submodule specifically includes: (1) Use the Transformer model to extract features of the time dependence of the trajectory. By learning the time relationship between trajectory points with low sampling rate, the time series features between trajectory points are captured to improve the accuracy and precision of trajectory reconstruction. (2) Using the Gated Fusion mechanism, spatial features and temporal features are spliced and fused to obtain a spatiotemporal feature matrix; (3) Input the fused spatiotemporal features into the graph neural network model to extract features from the spatiotemporal graph; (4) By using a short-circuit module to connect the multi-head attention mechanism module and the forward propagation module, the advantages of both modules can be fully utilized; (2)-(4) Complete the spatiotemporal graph feature extraction using the Transformer model based on graph neural networks; The GPS trajectory reconstruction learning module uses a GRU graph neural network model for trajectory reconstruction and is trained using multi-task learning. Based on the output of the GPS trajectory feature extraction module, it predicts the latitude and longitude information of missing sampling points in the input low-sampling-rate trajectory. Specifically, the GRU acts as a decoder, receiving the output of the encoder from the GPS trajectory feature extraction module as input, and predicts the latitude and longitude information of missing sampling points in the low-sampling-rate trajectory based on previous prediction results and context information. The GPS trajectory reconstruction learning module uses a GRU model for trajectory reconstruction and is trained using multi-task learning, specifically including: (1) The GPS trajectory sequence is modeled and reconstructed using a GRU model; specifically, the final output obtained from the trajectory feature representation submodule is input into a single-layer GRU model to obtain the features of the reconstructed trajectory at each time step, i.e. Indicates the GRU model at the 1st Output at each time point; (2) Use cross-entropy as the loss function for road segment prediction; assume that GRU is in the first... The output at each time point is Then the predicted loss of the road segment Defined as: , (1) In the formula, Represents the set of all road segments. Indicates the length of the trajectory. Represents the first in the true trajectory The road segment corresponding to each sampling point Represents the learnable parameters. This represents a predefined mask; (3) Use regression loss as the loss function to predict the proportion of acute migration; assume that GRU in the first stage... The output at each time point is Then the moving ratio predicts the loss. Defined as: , (2) In the formula, Represents the first in the true trajectory Each sampling point is located on the corresponding road section. The moving ratio on, Represents the learnable parameters. Use the Sigmoid activation function; (4) The optimization objective of the entire model is defined as: , (3) In the formula, This is a hyperparameter used to weigh the importance of the two parts of the loss function; (5) Repeat (2)-(4) until the model reaches the expected result.
2. The trajectory reconstruction system based on urban traffic network according to claim 1, characterized in that, The latitude and longitude data collected by the traffic trajectory data acquisition module are uploaded to the backend server for processing via network transmission, including data preprocessing and cleaning. Preprocessing includes noise removal and missing data filling, while cleaning includes removing outlier data and filtering invalid data.