A cross-regional trajectory prediction method and system based on class-granular spatiotemporal migration
By using a granular-like spatiotemporal module and distribution transformer method in cross-region topological traffic prediction, the problem of insufficient knowledge transfer in the prior art is solved, and the model's adaptability and prediction accuracy in the target area are improved.
Patent Information
- Application Number
- CN202411805293.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In the cross-regional topological traffic prediction, it is difficult to effectively migrate the spatio-temporal knowledge of the source area to the target area, resulting in insufficient adaptability of the model in the target area.
A cross-regional trajectory prediction method based on particle-like spatiotemporal migration is adopted. By building an initial trajectory prediction model, using source area data and target area data for training, a particle-like spatiotemporal module and distribution transformer are designed to achieve knowledge screening and distribution alignment to improve the model's adaptability.
Through the screening of source area knowledge and the alignment of the data distribution of target area, the accuracy and adaptability of the model's traffic trajectory prediction in the target area are significantly improved.
Smart Images

Figure CN119272095B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of spatiotemporal data mining in intelligent transportation systems, and in particular relates to a cross-regional trajectory prediction method and system based on class-granularity spatiotemporal migration. Background Art
[0002] ITS deploys a large number of sensors in the traffic network to collect traffic signals. Through these topological traffic signals, the traffic model can be effectively trained to predict future topological traffic signals, thereby achieving comprehensive perception and precise control of the traffic network. Among them, topological traffic signals refer to traffic trajectories, vehicle flow, vehicle speed, road occupancy, etc. in the traffic network, which exist in the form of topological structures. The topological traffic prediction model based on deep learning aims to achieve traffic prediction by learning the spatiotemporal dependency of traffic signals and aggregating spatiotemporal features. Its success premise is that the traffic network has sufficient traffic signals for model training. However, in reality, not all areas can provide sufficient data, which greatly limits the performance of the model. Transfer learning aims to use the knowledge learned from the source task to reduce the learning cost (i.e., the amount of training data) of the target task. The topological traffic prediction model based on transfer learning is usually trained in an area with sufficient data (i.e., the source area), and then migrated to an area with limited data (i.e., the target area) for fine-tuning, so as to predict the traffic in the target area, that is, cross-regional topological traffic prediction. The previous method pre-trained the prediction model in the source area and migrated the model parameters (or knowledge) that performed best on the validation set to the target area. However, this method does not screen the knowledge of the source area, because not all source area knowledge is beneficial to the target area. In addition, this method fine-tunes the pre-trained model to adapt to the target area, which makes it difficult to ensure that the model can adapt well to the data distribution of the target area. In summary, how to migrate the spatiotemporal knowledge of topological traffic signals and build a cross-regional traffic prediction method is an urgent problem to be solved. Summary of the invention
[0003] The present invention aims to solve the deficiencies of the prior art and provides the following solutions:
[0004] A cross-region trajectory prediction method based on class-granularity spatiotemporal migration includes the following steps:
[0005] Collecting traffic trajectories of vehicles, and classifying the traffic trajectories according to sampling timestamps to obtain source area data and target area data, wherein the source area data includes source area historical data and source area future data, and the target area signal includes target area historical data and target area future data;
[0006] Constructing an initial trajectory prediction model, and training the initial trajectory prediction model using the source area data and the target area data to obtain a trajectory prediction model, wherein the initial trajectory prediction model includes: an embedding layer, a class granularity spatiotemporal module, a distribution transformer, and a de-embedding layer;
[0007] The real-time traffic trajectory is collected, and the traffic trajectory prediction model is used to predict the traffic trajectory to obtain the traffic trajectory prediction result.
[0008] Preferably, the method for obtaining the source region signal and the target region signal comprises:
[0009] Collecting the traffic trajectory, and preprocessing the traffic trajectory using Z-Score to obtain preprocessed data;
[0010] The preprocessed data is classified according to the sampling timestamp to obtain the source area data and the target area data.
[0011] Preferably, the embedding layer includes a fully connected layer and a linear rectification function:
[0012] ,
[0013] ,
[0014] in, represents a fully connected layer, X1 represents the input of the fully connected layer, W1 represents the weight of the fully connected layer, b1 represents the bias of the fully connected layer, ReLU represents the linear rectification function, X2 represents the input of the linear rectification function, and Max represents the maximum value;
[0015] The embedding layer is used to map the source region historical data and the target region historical data into high-dimensional features:
[0016] ,
[0017] ,
[0018] In the formula, The high-dimensional features of the source region representing the historical data mapping of the source region, represents the source region, Represents the historical data of the source region, Represents the high-dimensional features of the target area mapped with historical data of the target area, Indicates the target area, Indicates the historical data of the target area.
[0019] Preferably, the class-granularity spatiotemporal module includes: a class-granularity space block and a class-granularity time block;
[0020] The class-granularity spatial block is composed of a transferable adaptive graph library, a spatial aggregation layer and a gated linear unit, and the class-granularity temporal block is composed of a learnable graph library, a temporal aggregation layer and a gated linear unit;
[0021] The data processing method of the spatial aggregation layer and the gated linear unit, the temporal aggregation layer and the gated linear unit includes:
[0022] ,
[0023] In the formula, represents the data processing function, A i represents the adjacency matrix of the graph selected from the transferable adaptive graph library / learnable graph library, i represents the graph index, X4 represents the input, and W 4,1 and W 4,2 represents the weight parameter, Represents element-by-element multiplication, and Sigmoid represents the activation function;
[0024] The forward propagation of the class-granularity spatiotemporal module in the source area and the target area includes:
[0025] ,
[0026] ,
[0027] In the formula, m represents the layer index, Represents the source region data output by the forward propagation, Represents the adjacency matrix of the learnable gallery output graph when the input is source region data, represents the adjacency matrix of the output graph of the transferable adaptive graph library when the input is the source region data, Indicates the timestamp of the source region data, Represents the input source area data, represents the source region, S represents the class granularity space block, Represents the target area data output by forward propagation, It represents the adjacency matrix of the output graph of the learnable image library when the input is the target region data. represents the adjacency matrix of the output graph of the transferable adaptive gallery when the input is the target region data, represents the input target area data, p represents the class index, represents the target area, and T represents the class-granularity time block.
[0028] Preferably, the distribution transformer comprises: a covariate distribution transformer and a label distribution transformer, the covariate distribution transformer and the label distribution transformer have the same structure, both consisting of a distribution transformer space block and a distribution transformer time block;
[0029] The distribution transformer spatial block is composed of an adaptive graph library, a spatial aggregation layer and a gated linear unit, and the distribution transformer temporal block is composed of a learnable graph library, a temporal aggregation layer and a gated linear unit;
[0030] The covariate distribution transformer is used to change the covariate distribution of the target region data. The calculation method of the covariate distribution transformer includes:
[0031] ,
[0032] In the formula, Represents a data processing function, represents the output of the covariate distribution transformer, represents the adjacency matrix of the learnable gallery output graph in the covariate distribution transformer, represents the adjacency matrix of the adaptive gallery output graph in the covariate distribution transformer, The high-dimensional features of the target area representing the historical data mapping of the target area are the input of the covariate distribution transformer. represents the timestamp of the target region data, C represents the covariate distribution transformer, S represents the class-granularity spatial block, T represents the class-granularity time block, Indicates the target area;
[0033] The label distribution converter is used to change the label distribution of the target area data. The calculation method of the label distribution converter includes:
[0034] ,
[0035] In the formula, represents the output of the label distribution transformer, represents the adjacency matrix of the output graph of the learnable gallery in the label distribution transformer, represents the adjacency matrix of the adaptive gallery output graph in the label distribution transformer, represents the input of the label distribution transformer, L represents the label distribution transformer, and M represents the number of layers of the class-granularity spatiotemporal module.
[0036] Preferably, the de-embedding layer is used to map high-dimensional data features into the traffic trajectory prediction result.
[0037] Preferably, the method for training the initial trajectory prediction model includes:
[0038] Pre-training the initial trajectory prediction model in the source area using the source area data, so that the initial trajectory prediction model masters the knowledge of the source area;
[0039] Using the source area data and the target area data, the initial trajectory prediction model enters an adaptation phase to align the distribution of the source area with that of the target area;
[0040] The trajectory prediction model is obtained by fine-tuning the initial trajectory prediction model that has completed pre-training and adaptation.
[0041] The present invention also provides a cross-region trajectory prediction system based on class-granularity spatiotemporal migration, wherein the prediction system applies any of the above-mentioned prediction methods and comprises: a data processing module, a model building module and a prediction module;
[0042] The data processing module is used to collect the traffic trajectory of the vehicle, and classify the traffic trajectory according to the sampling timestamp to obtain source area data and target area data, wherein the source area data includes source area historical data and source area future data, and the target area signal includes target area historical data and target area future data;
[0043] The model building module is used to build an initial trajectory prediction model, and train the initial trajectory prediction model using the source area data and the target area data to obtain a trajectory prediction model, wherein the initial trajectory prediction model includes: an embedding layer, a class granularity spatiotemporal module, a distribution transformer, and a de-embedding layer;
[0044] The prediction module is used to collect real-time traffic trajectories and use the trajectory prediction model to perform traffic trajectory prediction to obtain traffic trajectory prediction results.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] The present invention classifies the source area data and the target area data respectively according to the periodic characteristics of traffic data, so as to divide the knowledge of the source area; designs CGSTM, which can learn the spatiotemporal knowledge of each data class in the source area in one module; designs a graph selector, which selects appropriate spatiotemporal knowledge for the target area data class by analyzing the correlation between the source area data class and the target area data class; designs a transferable adaptive graph, which realizes the spatial knowledge transfer of topological traffic signals by migrating the ability to construct spatial graphs rather than the spatial dependence itself; designs DT to change the covariate distribution and label distribution of the target area, and designs label distribution alignment based on the covariate distribution alignment to improve the adaptability of the model in the target area. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of the structure of a picture library according to an embodiment of the present invention;
[0050] Figure 3 It is a schematic diagram of the structure of a class-granularity spatiotemporal module according to an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of the structure of a graph selector according to an embodiment of the present invention;
[0052] Figure 5 is a schematic structural diagram of a distributed converter according to an embodiment of the present invention;
[0053] Figure 6 Schematic diagram of model training according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] Embodiment 1
[0057] In this embodiment, if Figure 1 As shown, a cross-region trajectory prediction method based on class-granular spatiotemporal migration includes the following steps:
[0058] S1. Collect the traffic trajectory of the vehicle, and classify the traffic trajectory according to the sampling timestamp to obtain source area data and target area data, wherein the source area data includes source area historical data and source area future data, and the target area signal includes target area historical data and target area future data.
[0059] The method for obtaining source area data and target area data includes: collecting traffic trajectories, preprocessing the traffic trajectories using Z-Score to obtain preprocessed data; and classifying the preprocessed data according to sampling timestamps to obtain source area data and target area data.
[0060] In this embodiment, the data set of traffic data is divided as follows, where the proportions of training set, validation set and test set are 60%, 20% and 20% respectively. In addition, Z-Score is used to pre-process the data, and the formula is as follows:
[0061] ,
[0062] In the formula, X is the dataset of the original traffic trajectory, Mean( ) represents the mean function, and Std( ) represents the standard deviation function. Considering that the traffic trajectory has significant periodicity, the present invention classifies the source area / target area data according to the sampling timestamp, and the class center is the average value of all traffic signal samples in this class, which is recorded as ,in, represents the class center of the source region data class, represents the class center of the target area data class, k represents the number of sampling timestamps per day, represents the source region, Indicates the target area.
[0063] S2. construct an initial trajectory prediction model, and train the initial trajectory prediction model using source area data and target area data to obtain a trajectory prediction model, wherein the initial trajectory prediction model includes: an embedding layer, a class-granularity spatiotemporal module, a distribution transformer, and a de-embedding layer.
[0064] In this embodiment, when the model is in the source / target area, a set of data is randomly sampled from the processed original data without replacement ( , ) / ( , ), which represent the historical trajectory data and future trajectory data of the source / target area respectively. The purpose of the embedding layer is to map the historical data of the source area / target area into high-dimensional features / The embedding layer includes a fully connected layer and a linear rectification function:
[0065] ,
[0066] ,
[0067] in, represents the fully connected layer, X1 represents the input of the fully connected layer, W1 represents the weight of the fully connected layer, b1 represents the bias of the fully connected layer, ReLU represents the linear rectification function, X2 represents the input of the linear rectification function, and Max represents the maximum value; the embedding layer is used to map the historical data of the source area and the historical data of the target area into high-dimensional features:
[0068] ,
[0069] ,
[0070] In the formula, The high-dimensional features of the source region representing the historical data mapping of the source region, represents the source region, Represents the historical data of the source region, Represents the high-dimensional features of the target area mapped with historical data of the target area, Indicates the target area, Indicates the historical data of the target area.
[0071] In the initial trajectory prediction model of this embodiment, the cluster-granularity spatiotemporal module (CGSTM) and the distribution transformer (DT) both contain a library. Figure 2 As shown, in a graph library, there are T personalized graphs for learning the spatiotemporal dependencies of T data classes and 1 public graph for learning the time / space dependencies of all topological traffic signals. When the graph library inputs a graph index, the graph library selects a graph from the personalized graph according to the graph index and combines it with the public graph to obtain an output graph. In this embodiment, three graph libraries are designed, namely a learnable graph library, an adaptive graph library, and a transferable adaptive graph library. Among them, the adjacency matrix of any graph in the learnable graph library is a weight parameter, which can be directly optimized by back propagation; the adjacency matrix of any graph in the adaptive graph library is calculated as follows:
[0072] ,
[0073] In the formula, It represents the calculation method of the adjacency matrix of the adaptive gallery graph. Dropout means randomly setting the adjacency matrix elements to 0. u1 and u2 represent weight parameters. represents the transpose of the matrix, Softmax represents the activation function, and Softmax is calculated as follows:
[0074] ,
[0075] Among them, X3 represents the input of the Softmax function, and e represents a natural constant. The adjacency matrix of any graph in the transferable adaptive graph library is calculated as follows:
[0076] ,
[0077] In the formula, It represents the calculation method of the adjacency matrix of the graph in the transferable adaptive graph library. v1 and v2 represent weight parameters. Represents the transpose of the matrix, which is obtained by pooling and linear mapping the input of CGSTM.
[0078] In this embodiment, if Figure 3 As shown, the class-granularity spatiotemporal module includes: a class-granularity space block and a class-granularity time block; the class-granularity space block is composed of a transferable adaptive image library, a spatial aggregation layer and a gated linear unit, and the class-granularity time block is composed of a learnable image library, a temporal aggregation layer and a gated linear unit; the data processing method of the spatial aggregation layer and the gated linear unit, and the temporal aggregation layer and the gated linear unit includes:
[0079] ,
[0080] In the formula, represents the data processing function, A i represents the adjacency matrix of the graph selected from the transferable adaptive graph library / learnable graph library, i represents the graph index, X4 represents the input, and W 4,1 and W 4,2 represents the weight parameter, represents element-by-element multiplication, Sigmoid represents the activation function; the forward propagation of the class-granularity spatiotemporal module in the source and target regions includes:
[0081] ,
[0082] ,
[0083] In the formula, m represents the layer index, Represents the source region data output by the forward propagation, Represents the adjacency matrix of the learnable gallery output graph when the input is source region data, represents the adjacency matrix of the output graph of the transferable adaptive graph library when the input is the source region data, Indicates the timestamp of the source region data, Represents the input source area data, represents the source region, S represents the class granularity space block, Represents the target area data output by forward propagation, It represents the adjacency matrix of the output graph of the learnable image library when the input is the target region data. represents the adjacency matrix of the output graph of the transferable adaptive gallery when the input is the target region data, represents the input target area data, p represents the class index, which is generated by the graph selector. represents the target area, and T represents the class-granularity time block.
[0084] In this embodiment, the structure of the graph selector is as follows: Figure 4 As shown, it analyzes the distribution difference between each target region data class and the source region data class, and finds the source region data class with the smallest distribution difference for each target region data class. The spatiotemporal knowledge of the source region class (class index is p) is transferred to the target region class. This embodiment uses the central moment difference to measure the distribution difference. Assume that S1 and S2 are intervals For bounded random samples with probability distributions p1 and p2, respectively, the Q-order central moment difference regularizer is calculated as follows:
[0085] ,
[0086] Where, CMD Q represents the Q-order central moment difference regularizer, a represents the lower bound of the interval, b represents the upper bound of the interval, D represents the spatial dimension of the interval, E represents the expected function, C q represents the q-order central moment function, q represents the order of the central moment function, Figure 4 In , , , and , , , Represents the expected value, standard deviation, skewness, and kurtosis of each data class in the source / target region, which are related to the first-order, second-order, third-order, and fourth-order central moment differences.
[0087] In this embodiment, if Figure 5 As shown, the distribution transformer includes: a covariate distribution transformer and a label distribution transformer. The covariate distribution transformer and the label distribution transformer have the same structure, both of which are composed of a distribution transformer space block and a distribution transformer time block; the distribution transformer space block is composed of an adaptive image library, a spatial aggregation layer and a gated linear unit, and the distribution transformer time block is composed of a learnable image library, a temporal aggregation layer and a gated linear unit; the covariate distribution transformer is used to change the covariate distribution of the target area data, and the calculation method of the covariate distribution transformer includes:
[0088] ,
[0089] In the formula, Represents a data processing function, represents the output of the covariate distribution transformer, represents the adjacency matrix of the learnable gallery output graph in the covariate distribution transformer, represents the adjacency matrix of the adaptive gallery output graph in the covariate distribution transformer, The high-dimensional features of the target area representing the historical data mapping of the target area are the input of the covariate distribution transformer. represents the timestamp of the target region data, C represents the covariate distribution transformer, S represents the class granularity space block, T represents the time block, represents the target area; the label distribution transformer is used to change the label distribution of the target area data, and the calculation method of the label distribution transformer includes:
[0090] ,
[0091] In the formula, represents the output of the label distribution transformer, represents the adjacency matrix of the output graph of the learnable gallery in the label distribution transformer, represents the adjacency matrix of the adaptive gallery output graph in the label distribution transformer, represents the input of the label distribution transformer, L represents the label distribution transformer, and M represents the number of layers of the class-granularity spatiotemporal module.
[0092] The de-embedding layer is used to map high-dimensional data features into traffic signal prediction results. When the source area / target area data is input, the input and output of the de-embedding layer are / and / .
[0093] The method for training the initial trajectory prediction model includes: using source area signals to pre-train the initial trajectory prediction model in the source area so that the model can master the knowledge of the source area; using source area signals and target area signals to make the initial trajectory prediction model enter an adaptation stage to align the distribution of the source area with that of the target area; and fine-tuning the model that has completed pre-training and adaptation to obtain a traffic prediction model.
[0094] In this embodiment, if Figure 6 As shown in Figure 1, the model training process includes pre-training stage, adaptation stage and fine-tuning stage. (a) Pre-training stage: The purpose of this stage is to pre-train the model so that the model can master the knowledge of the source area. The loss value of this stage is calculated as follows:
[0095] ,
[0096] In the formula, Loss1 represents the loss value in the pre-training stage, represents the true value of the future trajectory data of the source area, represents the predicted value of the future trajectory data of the source area, Represents the Huber loss function, which is used to measure the distance between the predicted value and the true value. The calculation formula is as follows:
[0097] ,
[0098] Where Y1 and Y2 represent the input of the Huber loss function, and δ represents the threshold for switching between the two losses. (b) Adaptation phase: The purpose of this phase is to achieve distribution alignment between the source region and the target region so that the model can better adapt to the target region. The loss value of this phase is calculated as follows:
[0099] ,
[0100] In the formula, Loss2 represents the loss value in the adaptation stage, Represents the true value of the future trajectory data of the target area, represents the predicted value of the future trajectory data of the target area, and λ1 and λ2 represent the weights of the loss function; (c) Fine-tuning stage: This stage aims to fine-tune the model to better achieve the traffic trajectory prediction of the target area. The loss value of this stage is calculated as follows:
[0101] ,
[0102] Where Loss3 represents the loss value in the fine-tuning stage.
[0103] In this embodiment, the model parameters are set as follows: (1) The optimizer is adaptive, and the learning rate / training iteration round / training batch size is 1e-2 / 200 / 32; (2) The number of features in the embedding layer / hidden layer / de-embedding layer is 1 / 64 / 1; (3) The length of the historical / future signal time window is 12 / 12; the number of sensor nodes and the number of timestamps depend on the data set; (6) The number of layers of the class-granularity spatiotemporal module M=4; (7) The weight loss λ1=1, λ2=1.
[0104] S3. Collect real-time traffic trajectories, and use the trajectory prediction model to predict traffic trajectories to obtain traffic trajectory prediction results.
[0105] In this embodiment, the prediction effect of the model in this embodiment is evaluated by the mean absolute error (MAE), the root mean square error (RMSE) and the mean absolute percentage error (MAPE):
[0106] ,
[0107] ,
[0108] ,
[0109] Where MAE stands for mean absolute error, RMSE stands for root mean square error, and MAPE stands for mean absolute percentage error. represents the number of samples, ω represents The index of represents the true value of the ωth sample, Represents the predicted value of the ωth sample.
[0110] Embodiment 2
[0111] In this embodiment, a cross-region trajectory prediction system based on class-granularity spatiotemporal migration includes: a data processing module, a model building module and a prediction module.
[0112] The data processing module is used to collect the traffic trajectory of the vehicle, and classify the traffic trajectory according to the sampling timestamp to obtain the source area data and the target area data, wherein the source area data includes the source area historical data and the source area future data, and the target area signal includes the target area historical data and the target area future data; the model construction module is used to construct an initial trajectory prediction model, and train the initial trajectory prediction model using the source area data and the target area data to obtain the trajectory prediction model, wherein the initial trajectory prediction model includes: an embedding layer, a class granularity spatiotemporal module, a distribution transformer and a de-embedding layer; the prediction module is used to collect real-time traffic trajectories, and use the trajectory prediction model to predict the traffic trajectory to obtain the traffic trajectory prediction result.
[0113] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A cross-region trajectory prediction method based on class-granular spatiotemporal migration, characterized in that: The following steps are involved: Collecting comprehensive traffic trajectories of vehicles, and classifying the comprehensive traffic trajectories according to sampling timestamps to obtain source area data and target area data, wherein the source area data includes source area historical data and source area future data, and the target area data includes target area historical data and target area future data; Constructing an initial trajectory prediction model, and training the initial trajectory prediction model using the source area data and the target area data to obtain a trajectory prediction model, wherein the initial trajectory prediction model includes: an embedding layer, a class granularity spatiotemporal module, a distribution transformer, and a de-embedding layer; Collecting real-time traffic trajectories, and using the trajectory prediction model to perform traffic trajectory prediction, to obtain traffic trajectory prediction results; The class-granularity space-time module includes: a class-granularity space block and a class-granularity time block; The class-granularity spatial block is composed of a transferable adaptive graph library, a spatial aggregation layer and a gated linear unit, and the class-granularity temporal block is composed of a learnable graph library, a temporal aggregation layer and a gated linear unit; The data processing method of the spatial aggregation layer and the gated linear unit, the temporal aggregation layer and the gated linear unit includes: , In the formula, represents the data processing function, A i represents the adjacency matrix of the graph selected from the transferable adaptive graph library / learnable graph library, i represents the graph index, X4 represents the input, and W 4,1 and W 4,2 represents the weight parameter, Represents element-by-element multiplication, and Sigmoid represents the activation function; The forward propagation of the class-granularity spatiotemporal module in the source area and the target area includes: , , In the formula, m represents the layer index, Represents the source region data output by the forward propagation, Represents the adjacency matrix of the learnable gallery output graph when the input is source region data, represents the adjacency matrix of the output graph of the transferable adaptive graph library when the input is the source region data, Indicates the timestamp of the source region data, Represents the input source area data, represents the source region, Spa represents the class granularity space block, Represents the target area data output by forward propagation, It represents the adjacency matrix of the output graph of the learnable image library when the input is the target region data. represents the adjacency matrix of the output graph of the transferable adaptive gallery when the input is the target region data, represents the input target area data, p represents the class index, represents the target area, Tem represents the class-granularity time block; The distribution transformer comprises: a covariate distribution transformer and a label distribution transformer, wherein the covariate distribution transformer and the label distribution transformer have the same structure, and are both composed of a distribution transformer space block and a distribution transformer time block; The distribution transformer spatial block is composed of an adaptive graph library, a spatial aggregation layer and a gated linear unit, and the distribution transformer temporal block is composed of a learnable graph library, a temporal aggregation layer and a gated linear unit; The covariate distribution transformer is used to change the covariate distribution of the target region data. The calculation method of the covariate distribution transformer includes: , In the formula, Represents a data processing function, represents the output of the covariate distribution transformer, represents the adjacency matrix of the learnable gallery output graph in the covariate distribution transformer, represents the adjacency matrix of the adaptive gallery output graph in the covariate distribution transformer, The high-dimensional features of the target area representing the historical data mapping of the target area are the input of the covariate distribution transformer. represents the timestamp of the target region data, C represents the covariate distribution transformer, Spa represents the class-granularity spatial block, Tem represents the class-granularity time block, Indicates the target area; The label distribution converter is used to change the label distribution of the target area data. The calculation method of the label distribution converter includes: , In the formula, represents the output of the label distribution transformer, represents the adjacency matrix of the output graph of the learnable gallery in the label distribution transformer, represents the adjacency matrix of the adaptive gallery output graph in the label distribution transformer, represents the input of the label distribution transformer, L represents the label distribution transformer, and M represents the number of layers of the class-granularity spatiotemporal module.
2. According to claim 1, a cross-region trajectory prediction method based on class-granularity spatiotemporal migration is characterized in that: The method for obtaining the source area data and the target area data includes: Collecting the comprehensive traffic trajectory, and preprocessing the traffic trajectory using Z-Score to obtain preprocessed data; The preprocessed data is classified according to the sampling timestamp to obtain the source area data and the target area data.
3. According to claim 1, a cross-region trajectory prediction method based on class-granularity spatiotemporal migration is characterized in that: The embedding layer includes a fully connected layer and a linear rectification function: , , in, represents a fully connected layer, X1 represents the input of the fully connected layer, W1 represents the weight of the fully connected layer, b1 represents the bias of the fully connected layer, ReLU represents the linear rectification function, X2 represents the input of the linear rectification function, and Max represents the maximum value; The embedding layer is used to map the source region historical data and the target region historical data into high-dimensional features: , , In the formula, The high-dimensional features of the source region representing the historical data mapping of the source region, represents the source region, Represents the historical data of the source region, Represents the high-dimensional features of the target area mapped with historical data of the target area, Indicates the target area, Indicates the historical data of the target area.
4. According to claim 1, a cross-region trajectory prediction method based on class-granularity spatiotemporal migration is characterized in that: The de-embedding layer is used to map the high-dimensional data features into the traffic trajectory prediction results.
5. According to claim 1, a cross-region trajectory prediction method based on class-granularity spatiotemporal migration is characterized in that: The method for training the initial trajectory prediction model includes: Pre-training the initial trajectory prediction model in the source area using the source area data, so that the initial trajectory prediction model masters the knowledge of the source area; Using the source area data and the target area data, the initial trajectory prediction model enters an adaptation phase to align the distribution of the source area with that of the target area; The trajectory prediction model is obtained by fine-tuning the initial trajectory prediction model that has completed pre-training and adaptation.
6. A cross-regional trajectory prediction system based on class-granular spatiotemporal migration, the prediction system applying the prediction method according to any one of claims 1 to 5, characterized in that: include: Data processing module, model building module and prediction module; The data processing module is used to collect comprehensive traffic trajectories of vehicles, and classify the comprehensive traffic trajectories according to sampling timestamps to obtain source area data and target area data, wherein the source area data includes source area historical data and source area future data, and the target area data includes target area historical data and target area future data; The model building module is used to build an initial trajectory prediction model, and train the initial trajectory prediction model using the source area data and the target area data to obtain a trajectory prediction model, wherein the initial trajectory prediction model includes: an embedding layer, a class granularity spatiotemporal module, a distribution transformer, and a de-embedding layer; The prediction module is used to collect real-time traffic trajectories and use the trajectory prediction model to perform traffic trajectory prediction to obtain traffic trajectory prediction results.
Citation Information
Patent Citations
Traffic flow prediction method based on space-time diagram transfer learning
CN116959258A
Pedestrian trajectory prediction method based on hierarchical envelope domain adaptation
CN118918140A