Traffic flow data interpolation and prediction method based on multi-task pre-training fine-tuning normal form
Through the method based on the multi-task pre-training fine-tuning paradigm, the shortcomings of traditional traffic flow prediction methods in terms of data loss are solved, and higher robustness and prediction accuracy are achieved, helping to alleviate traffic congestion problems.
Patent Information
- Application Number
- CN202411962630.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
Traditional traffic flow prediction methods are difficult to effectively deal with the problem of missing data, which limits their application in actual scenarios.
The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm is adopted. By acquiring traffic flow data, analyzing its temporal and spatial characteristics, classifying data missing patterns, and using the classification results to generate perturbation data with missing values, and training a mixed model for data interpolation and prediction.
It improves the robustness of the model to data loss, improves the accuracy of traffic flow prediction, and can better help traffic managers plan the operation of traffic flow and reduce traffic congestion.
Smart Images

Figure CN119903953A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow data interpolation and prediction, and in particular to a traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm. Background Art
[0002] Accurately predicting future traffic flow trends and rationally planning traffic flow operations have become one of the important ways to alleviate traffic congestion.
[0003] However, traditional traffic flow prediction methods often cannot effectively deal with data missing situations, which limits their application in practical scenarios. Data missing may occur due to various reasons, such as sensor failure, network communication problems, or incomplete data collection. Summary of the invention
[0004] In order to solve the problems existing in the above-mentioned prior art, the purpose of the present invention is to provide a traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm, aiming to improve the robustness of the model to data missing and improve the accuracy of traffic flow prediction, so as to better help traffic managers plan the operation of traffic flow and reduce traffic congestion.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm, comprising:
[0007] Obtain traffic flow data; analyze and extract the temporal and spatial characteristics of traffic flow data;
[0008] Data missing pattern classification: classifying the traffic flow data according to the data missing pattern; the data missing pattern includes: completely random missing pattern, point missing pattern and time stamp missing pattern;
[0009] The traffic flow data is masked accordingly through the classification results to generate disturbance data with missing values, and the mixed model is trained using the disturbance data; the mixed model includes: an interpolation sub-model and a traffic flow prediction sub-model;
[0010] In the process of training the hybrid model, comparative learning and adaptive learning are performed in sequence, and the model parameters are further fine-tuned to obtain an optimal hybrid model, and the optimal hybrid model is used to predict traffic flow data to obtain traffic flow prediction results.
[0011] Optionally, presetting the completely random missing mode includes:
[0012]
[0013] Among them, xij represents the value at the i-th node and the j-th time step, represents the traffic flow value after random masking, u ij represents a random number that follows a uniform distribution in the range from 0 to 1, r rm It represents the hyperparameter that determines the proportion of values to be deleted, and RM represents the random missing function.
[0014] Optionally, presetting the point missing mode includes:
[0015]
[0016] Among them, x i: ∈R N represents the complete traffic flow data at the i-th node, represents the data after the node missing pattern interference, r nm represents the hyperparameter that determines the node missing ratio, and NM represents the point missing function.
[0017] Optionally, presetting the timestamp missing mode includes:
[0018]
[0019] Among them, x i:j,u:v ∈R N×T represents the continuous complete traffic flow matrix from the i-th node to the j-th node and from the u-th timestamp to the v-th timestamp, represents the matrix after block deletion, r bm It represents the hyperparameter that determines the timestamp missing ratio, and BM represents the block missing function.
[0020] Optionally, training the hybrid model using the perturbation data includes:
[0021] Inputting the perturbation data into an encoder of the training hybrid model to extract the spatiotemporal correlation in the perturbation data; the encoder comprises: a dilated causal convolution module and a graph convolution module;
[0022] Inputting disturbance data with spatiotemporal correlation into the interpolation sub-model, reconstructing the disturbance data, and outputting interpolation results; the interpolation sub-model includes: a multi-layer perceptron;
[0023] The interpolation results are input into the decoder of the hybrid model, namely the traffic flow prediction sub-model, and traffic flow prediction is performed on the interpolation results.
[0024] Optionally, performing traffic flow prediction on the interpolation result includes:
[0025]
[0026] in, There are missing data, f θ is the encoder, is the hidden representation, GRU P (*) is the decoder for prediction task, is the predicted value, which should be as close as possible to the actual future traffic flow value Y.
[0027] Optionally, training the hybrid model using the contrastive learning includes:
[0028] The hybrid model is trained by contrastive learning using an inference model parameterized by two layers of multilayer perceptrons:
[0029] Using the online network and the target network to superimpose the target periodic data in the target feature dimension, using multiple masks generated by missing data patterns and a projected gradient descent algorithm based on the superimposed target periodic data to generate enhanced noise, and obtaining the periodic input data of the model based on the noise;
[0030] The hybrid model is trained through the periodic input data to learn the similarities of the same input under different missing modes.
[0031] Optionally, training the hybrid model using the adaptive learning includes:
[0032] An adaptive graph is established based on a distance adjacency matrix, a semantic adjacency matrix and two node embedding matrices; the adaptive graph represents the spatial correlation of the traffic network; the adaptive graph includes: a distance graph, a semantic graph and a parameterized graph;
[0033] The hybrid model is trained based on the spatial correlation of the represented transportation network.
[0034] Optionally, fine-tuning the model parameters includes:
[0035] Fine-tuning the interpolation sub-model includes:
[0036]
[0037] Among them, λ1 represents the step size of gradient update, θ' P Represents θ and θ P A combination of Represents θ' P The descent gradient, f θ () represents the encoder of the model, GRU P represents the decoder used for prediction, Represents the generated mask data, Y i represents the target value, Represents the reconstruction loss of the model;
[0038] Fine-tuning the traffic flow prediction sub-model includes:
[0039]
[0040] Among them, θ' R Denote θ and θ R , λ2 represents the step size of gradient update, Represents θ' R The descent gradient of Represents the reconstruction loss of the model, GRU R represents the decoder used for reconstruction, f θ () represents the encoder of the model, Represents the generated mask data, Y i Indicates the target value.
[0041] The beneficial effects of the present invention are:
[0042] The present invention adopts a multi-task pre-training fine-tuning paradigm to solve the limitations of traditional methods in terms of data missing. In the pre-training stage, the model simulates data interference under different missing modes and learns multiple tasks at the same time to obtain generalized feature representations. Subsequently, in the fine-tuning stage, the features learned in the pre-training stage are transferred to specific data missing modes to complete data interpolation or prediction tasks. The present invention has high training efficiency and good model generalization performance, and can achieve accurate traffic flow interpolation and prediction under different data missing modes.
[0043] The present invention ensures that the model is sufficiently robust to data missing, helps the model learn robust hidden layer representations, and after only a short period of fine-tuning, the model can be migrated to specific missing patterns and tasks with good model performance. This helps to expand the application of traffic flow interpolation and prediction tasks in real scenarios.
[0044] The present invention adopts a multi-task pre-training fine-tuning paradigm to cope with different data missing patterns. In the pre-training stage, the model simulates data interference under different missing patterns and learns multiple tasks at the same time to obtain generalized feature representations. In the fine-tuning stage, the feature representations learned in the pre-training stage are migrated to specific data missing patterns to complete data interpolation or prediction tasks. Compared with traditional methods, the present invention can not only achieve accurate traffic flow prediction under different data missing patterns, but also has higher training efficiency and good model generalization performance. Therefore, the present invention has important application prospects and social significance in solving traffic congestion problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. 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.
[0046] Figure 1 A schematic diagram of a traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm according to an embodiment of the present invention;
[0047] Figure 2 Schematic diagram of the hybrid model training process according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] 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.
[0049] 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.
[0050] like Figure 1 As shown, this embodiment discloses a traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm, including: obtaining traffic flow data; the traffic flow data includes: time features and spatial features; presetting a data missing mode, and classifying the traffic flow data according to the data missing mode; the data missing mode includes: a completely random missing mode, a point missing mode and a timestamp missing mode; masking the traffic flow data accordingly through the classification results to generate perturbation data with missing values, and training a hybrid model using the perturbation data; the hybrid model includes: an interpolation sub-model and a traffic flow prediction sub-model; in the process of training the hybrid model, performing contrast learning and adaptive learning in turn, and further fine-tuning the model parameters to obtain the optimal hybrid model, using the optimal hybrid model to predict traffic flow data, and obtaining traffic flow prediction results.
[0051] Specifically:
[0052] Step 1: Data is collected by sensors at intervals of 30 seconds and aggregated into 5-minute traffic flow data as input. In the spatiotemporal encoder-decoder structure, there is input data X, whose dimension is X∈R N×T×F, where N represents the number of nodes, T represents the length of the time series data, and F represents the input feature dimension of each time step. The data X is divided into N slices, each slice represents a node, and these slices are X1, X2, …, X N ∈R T×F , whose dimension is X i ∈R T×F . Used to extract temporal and spatial features;
[0053] Step 2: Based on the classification of missing data patterns in multivariate time series data, missing data patterns in multivariate time series data are mainly divided into the following three types: 1) Missing completely at random (MCAR), the presence or absence of values is not related to location and time, and is independent of each other. The formula for the random missing pattern is as follows:
[0054]
[0055] where x ij represents the value at the i-th node and the j-th time step, where i∈N and j∈T I , N represents the number of nodes, T I Indicates the input time length, represents the traffic flow value after random masking, u ij is a random number that follows a uniform distribution in the range from 0 to 1, that is, u ij ~U(0,1), r rm is a hyperparameter that determines the proportion of values to be deleted. 2) Missing at random (MAR): The missing data depends on certain conditions, but is independent within the conditions. Random missing data can be divided into point missing and timestamp missing. Point missing refers to the situation where some detection points have long-term communication interruptions. The formula for point missing mode is as follows:
[0056]
[0057] Among them, x i: ∈R N represents the complete traffic flow data at the i-th node, represents the data after the node missing mode interference, u i ~U(0,1), and r nm is a hyperparameter that determines the proportion of node missing. Timestamp missing refers to the situation where communication is interrupted at all points in some timestamps. The formula for timestamp missing mode is as follows:
[0058]
[0059] Among them, x:j ∈R N represents the complete traffic flow data at the jth time step, represents the data after the interference of timestamp missing, u j ~U(0,1), and r tm is a hyperparameter used to determine the proportion of timestamp missing. 3) Missing not at random (MNAR) is a missing pattern that is neither MCAR nor MAR. Block missing is a missing pattern that combines point missing and timestamp missing. Some nodes experience signal interruption in the same period, which is reflected in the traffic data as rectangular or square block missing. The formula for the block missing pattern is as follows:
[0060]
[0061] Among them, x i:j,u:v ∈R N×T represents the continuous complete traffic flow matrix from the i-th node to the j-th node and from the u-th timestamp to the v-th timestamp, represents the matrix after block deletion, U i:j,u:v ~U(0,1), and r bm is a hyperparameter used to determine the proportion of block missing. Matching actual data to the appropriate missing pattern lays the foundation for subsequent model creation and experimental verification;
[0062] Step 3: According to the selected missing pattern and missing rate, randomly apply the corresponding mask to the input data to generate perturbed data with missing values and perform four tasks: traffic flow prediction, data interpolation, contrastive learning, and adaptive graph learning. The details of the four tasks are as follows:
[0063] (1) Traffic flow prediction:
[0064] Traffic flow prediction is the main goal. The predicted traffic flow should be as close as possible to the real future traffic flow.
[0065] (2) Data interpolation:
[0066] Traffic flow data interpolation is intrinsically related to traffic flow prediction. Most studies use interpolated data for prediction, resulting in error accumulation and low training efficiency. In this work, we treat data interpolation and traffic flow prediction as parallel tasks connected by a multi-layer perceptron (MLP) during pre-training. We fine-tune the model in both prediction and interpolation tasks to prevent error accumulation and reduce training time. Data interpolation is performed using a masked autoencoder, which is a denoising autoencoder.
[0067] (3) Re-parameterized adversarial graph contrast learning:
[0068] The graph contrastive learning framework in this paper is a paradigm evolved from two classic contrastive learning methods, BYOL and SimSiam. It uses a predictor similar to that in the variational autoencoder (VAE), that is, an inference model parameterized by two layers of multi-layer perceptrons.
[0069] (4) Adaptive Graph Learning:
[0070] This paper builds an adaptive graph based on a distance-based adjacency matrix, a semantic adjacency matrix and two node embedding matrices to describe the dynamic associations between nodes.
[0071] Step 4: Transfer generalization to specific missing patterns and tasks.
[0072] Furthermore, the spatiotemporal encoder-decoder structure in step 1 can be modeled as:
[0073] Extracting time features:
[0074] H=LeakyReLu(BN(Concat(H1, H2,...,H N )));
[0075] H i represents the time representation of the i-th node, concat represents the concatenation of the elements, BN represents the normalization operation, and Leaky ReLU represents the activation function
[0076] Extract spatial features:
[0077]
[0078] H (l+1) represents the feature weight of the l+1th layer, represents the average normalization of the adjacency matrix A, represents the transpose of the second set of weight matrices of the lth layer, and LeakyReLU represents the activation function.
[0079] Furthermore, in step 2, the classification of data missing patterns in multivariate time series data can be summarized as random data missing, timestamp data missing, point data missing, block data missing, etc. These missing models will be used as a way of data enhancement to simulate different missing patterns of traffic data, laying a good foundation for model creation and experimental verification.
[0080] Furthermore, step three will model multiple tasks simultaneously, including traffic flow prediction, data interpolation, contrastive learning, and adaptive graph learning, among which traffic flow prediction is the main task among the four tasks and also the core task of the present invention, and its formula is as follows:
[0081]
[0082] in, There are missing data, f θ is the encoder, is the hidden representation, GRU P (*) is the decoder for prediction task, is the predicted value, which should be as close as possible to the actual future traffic flow value Y
[0083] That is, the predicted traffic flow should be close to the actual value. The loss function can be calculated by the following formula and the model parameters can be updated by gradient descent:
[0084]
[0085] Further, training the hybrid model using the perturbed data includes:
[0086] The perturbation data is input into the encoder of the training hybrid model to extract the spatiotemporal correlation in the perturbation data; the encoder includes: a dilated causal convolution module and a graph convolution module;
[0087] The disturbance data with temporal and spatial correlation is input into the interpolation sub-model, the disturbance data is reconstructed, and the interpolation result is output; the interpolation sub-model includes: a multi-layer perceptron;
[0088] The interpolation results are input into the decoder of the hybrid model, i.e., the traffic flow prediction sub-model, and traffic flow prediction is performed on the interpolation results.
[0089] Furthermore, training the hybrid model using contrastive learning includes:
[0090] The hybrid model is trained by contrastive learning using an inference model parameterized by two layers of multilayer perceptrons:
[0091] Using the online network and the target network to superimpose the target periodic data in the target feature dimension, using multiple masks generated by missing data patterns and a projected gradient descent algorithm based on the superimposed target periodic data to generate enhanced noise, and obtaining the periodic input data of the model based on the noise;
[0092] The hybrid model is trained through the periodic input data to learn the similarities of the same input under different missing modes.
[0093] Specifically:
[0094] The goal of graph contrastive learning (GCL) in MTPF is to ensure that the encoder can learn the similarities of different missing rates and missing patterns, so as to learn robust representations and improve the accuracy of traffic flow prediction. This embodiment uses two neural networks: an online network (OnlineNetwork) and a target network (TargetNetwork). The online network is defined by the parameter θ and has three components: (1) an encoder f for extracting representations θ , a projector g for projected representation θ , and a predictor q for the output θ The target network has the same architecture as the online network, but with different parameters, denoted by ξ. ξ can be determined by calculating an exponential moving average or the same parameters as θ. Given periodic data X r , X d and X w , superimpose them in the feature dimension to obtain X = concat (X r ,X d ,X w ). The MTPF method uses two masks generated by missing data patterns and a projected gradient descent (PGD) algorithm based on X to generate enhanced noise δ to obtain periodic inputs to the model. It is assumed that if GCL can overcome input randomness and uncertainty and learn the similarities of the same input under different missing patterns, the model can learn a more robust representation. and pass -norm for normalization.
[0095] Further, using adaptive learning to train the hybrid model includes:
[0096] An adaptive graph is built based on the distance adjacency matrix, semantic adjacency matrix and two node embedding matrices; the adaptive graph represents the spatial correlation of the transportation network;
[0097] The mixture model is trained based on the spatial correlation of the represented transportation network.
[0098] Specifically:
[0099] The spatial association is represented by multiple graphs (distance graph, semantic graph and parameterized graph).
[0100] (1) Distance map
[0101] Two adjacent nodes may have a high correlation. Therefore, distance can be used to describe spatial dependence. The weighted adjacency matrix A SP ∈R N×N The definition is as follows:
[0102]
[0103] Among them, w(i,j) is the weight of the edge, σ 2 is the variance of the distance, ∈ is the control matrix A SP The sparsity threshold in the present invention is set to 0.5.
[0104] (2) Semantic Graph
[0105] Semantic adjacency matrix A SE ∈R N×N Calculated by the Dynamic Time Warping (DTW) algorithm to express the association between nodes with similar traffic patterns:
[0106]
[0107] in, There are two sub-time series and The shortest distance between It is a distance metric.
[0108] (3) Parameterized graph
[0109] Parameterized adjacency matrix A PA ∈R N×N Used to extract implicit spatial dependencies from data:
[0110]
[0111] Among them, M1 and It is the decomposed node parameter matrix with rank R1 (R1<<N), which represents the connection relationship between nodes. Diag(Λ) is a diagonal matrix.
[0112] (4) Fusion graph
[0113] The three different graphs mentioned above are used to generate the final fusion graph, so that the graph neural network can model multiple heterogeneous correlations in the spatial dimension:
[0114] A1=g(α1A SP +α2A SE ),
[0115] A2=g(β1A1+β2A PA ),
[0116] Among them, α1, α2, β1 and β2 are hyperparameters learned from the data and used to give different weights to different graphs, and g(*) is the Sigmoid activation function.
[0117]
[0118] in, is the renormalized fusion map, Where I represents the identity matrix, and yes The degree matrix of .
[0119] Further, fine-tuning model parameters includes:
[0120] The fine-tuning imputation sub-model includes:
[0121]
[0122] Among them, θ' P Denote θ and θ P The combination of λ1 represents the step size of gradient update, θ' P express, express, Indicates that Y i express, express;
[0123] Fine-tuning the traffic flow prediction sub-model includes:
[0124]
[0125] Among them, θ' R Denote θ and θ R , λ2 represents the step size of gradient update, express, It means that GRU R express, Indicates that Y i express.
[0126] like Figure 2 As shown, this embodiment discloses a traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm, including:
[0127] The expressions of the data restoration task update parameters and the traffic flow prediction update parameters are as follows:
[0128]
[0129] In the formula, Indicates the update parameters of the data restoration task. represents the update parameters of the traffic flow prediction task, θ represents the initial model parameters, β1 and β2 represent the finer step sizes for the inner loop data restoration task and the traffic flow prediction task, respectively. and They represent the loss functions of the data restoration task and the traffic flow prediction task, S' i Represents the enhanced data samples.
[0130] Furthermore, the expression of the hybrid model is:
[0131]
[0132] In the formula, represents the mixture model parameters and γ represents the step size used for the outer loop gradient update.
[0133] Furthermore, the update parameters of the data restoration task in the adaptation phase and the update parameters of the traffic flow prediction task in the adaptation phase are expressed as:
[0134]
[0135] Where λ1 and λ2 represent the learning rates of the data restoration task and the traffic flow prediction task, respectively. Represents the restored data of the adaptation phase.
[0136] The updated model parameters for the data interpolation task and the traffic flow prediction task are calculated by multi-step gradient descent, that is, To calculate the result of data interpolation; through and Calculate the results of traffic flow prediction, where the Dropout(*) method based on model gradient is also optional in this paper.
[0137] In the problem set, through as well as and Evaluate the effect; update the momentum Finally, update the final model parameters
[0138] in, Fill in model parameters for data, is the traffic flow prediction model parameter, and Combined to get θ' i When all tasks are used as input for model training, the θ' of the last task is K The value is transformed into θ in the meta-update * .f θ is the model with initialization parameters, β1 and β2 represent the finer step size of the gradient for the inner loop data restoration task and the traffic flow prediction task, respectively. and They represent the loss functions of the data restoration task and the traffic flow prediction task respectively, is the gradient of the loss function with respect to the model parameter θ, indicating the rate of change of the loss function relative to the model parameter, S' i Represents the enhanced support set data sample, S'i Represents the support set data samples used for prediction. represents the hybrid model parameters, γ represents the step size for the outer loop gradient update, K is the number of inner loops, and θ' K After completing K tasks in the inner loop, the model parameters are updated. is the model used for data restoration tasks, is the model used for data prediction tasks, Q' i Input sample for the problem set of the restoration task in the i-th cycle, is the input sample of the problem set of the traffic flow prediction task in the i-th cycle. λ1 and λ2 represent the learning rates of the data restoration task and the traffic flow prediction task respectively, and X' i Actual restoration data for the adaptation phase Represents the actual forecast data during the adaptation phase.
[0139] Specifically:
[0140] 1. The dilated causal convolutional model and graph convolutional neural network are used as the basic modules of the encoder to extract the spatiotemporal correlation in traffic data, while the recurrent neural network (GRU) will be used as the decoder. The data interpolation module outputs the interpolation results in chronological order, and the traffic flow prediction module gradually outputs the prediction results.
[0141] 2. The typical missing patterns in this article will be used as a data augmentation method. In the pre-training stage, data augmentation is performed on the input samples to ensure that the model can learn better generalization characteristics under different missing patterns, so as to have excellent prediction effects under real data missing or a specific data missing pattern.
[0142] 3. The traffic flow prediction task adopts a conventional encoder-decoder structure. The data interpolation task uses a masked autoencoder connected by a multi-layer perceptron (MLP) for data reconstruction. If the encoder representation generated from the input with missing values can be accurately converted back to the complete input by the masked autoencoder, it shows that the learned representation is robust enough. The goal of contrastive learning is to ensure that the encoder can learn different missing rates and similarities of missing patterns, so as to learn robust representations and improve the accuracy of traffic flow prediction. Adaptive graph learning represents the spatial correlation of the traffic network by fusing multiple graph structures.
[0143] 4. There is a dataset G, a missing data scenario MS, a loss function, a step size λ1 / λ2 for gradient update, and pre-trained model parameters θ, θ P and θ R , and the adjacency matrix A. For every pair of input X i and target value Y i, the input data is perturbed by MS to generate a view that is different from the original input And generate data mask This view is fed into the parameter-shared encoder f θ and decoder GRU P To predict future traffic values and calculate predicted losses The result is input to f θ and GRU R Reconstruct the data and get the reconstruction loss Then, the model parameters for traffic flow prediction and data reconstruction are updated respectively. The method of parameter fine-tuning is shown in Table 1.
[0144] Table 1
[0145]
[0146] The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm of this embodiment can simultaneously learn multiple characters in different missing modes based on the multi-task pre-training fine-tuning paradigm to help the model learn a good representation. Through parameter fine-tuning, it can be quickly generalized to specific missing modes and specific tasks, with good prediction effects, which can help traffic management personnel reasonably plan the operation of traffic flow and alleviate traffic congestion problems.
[0147] 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 traffic flow data interpolation and prediction method based on a multi-task pre-training fine-tuning paradigm, characterized in that: include: Obtain traffic flow data; Analyze and extract the temporal and spatial characteristics of traffic flow data; Data missing pattern classification: classifying the traffic flow data according to the data missing pattern; The data missing modes include: completely random missing mode, point missing mode and timestamp missing mode; The traffic flow data is masked accordingly through the classification results to generate disturbance data with missing values, and the mixed model is trained using the disturbance data; the mixed model includes: an interpolation sub-model and a traffic flow prediction sub-model; In the process of training the hybrid model, comparative learning and adaptive learning are performed in sequence, and the model parameters are further fine-tuned to obtain an optimal hybrid model, and the optimal hybrid model is used to predict traffic flow data to obtain traffic flow prediction results.
2. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: The preset completely random missing mode includes: Among them, x ij represents the value at the i-th node and the j-th time step, represents the traffic flow value after random masking, u ij represents a random number that follows a uniform distribution in the range from 0 to 1, r rm It represents the hyperparameter that determines the proportion of values to be deleted, and RM represents the random missing function.
3. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: The preset point missing mode includes: Among them, x i: ∈R N represents the complete traffic flow data at the i-th node, represents the data after the node missing pattern interference, r nm represents the hyperparameter that determines the node missing ratio, and NM represents the point missing function.
4. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: The preset timestamp missing mode includes: Among them, x i:j,u:v ∈R N×T represents the continuous complete traffic flow matrix from the i-th node to the j-th node and from the u-th timestamp to the v-th timestamp, represents the matrix after block deletion, r bm It represents the hyperparameter that determines the timestamp missing ratio, and BM represents the block missing function.
5. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: Training the hybrid model using the perturbation data includes: Inputting the perturbation data into an encoder of the training hybrid model to extract the spatiotemporal correlation in the perturbation data; the encoder comprises: a dilated causal convolution module and a graph convolution module; Inputting disturbance data with spatiotemporal correlation into the interpolation sub-model, reconstructing the disturbance data, and outputting interpolation results; the interpolation sub-model includes: a multi-layer perceptron; The interpolation results are input into the decoder of the hybrid model, namely the traffic flow prediction sub-model, and traffic flow prediction is performed on the interpolation results.
6. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 5 is characterized in that: Performing traffic flow prediction on the interpolation result includes: in, There are missing data, f θ is the encoder, is the hidden representation, GRU P (*) is the decoder for prediction task, is the predicted value, which should be as close as possible to the actual future traffic flow value Y.
7. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: Training the hybrid model using the contrastive learning includes: The hybrid model is trained by contrastive learning using an inference model parameterized by two layers of multilayer perceptrons: Using the online network and the target network to superimpose the target periodic data in the target feature dimension, using multiple masks generated by missing data patterns and a projected gradient descent algorithm based on the superimposed target periodic data to generate enhanced noise, and obtaining the periodic input data of the model based on the noise; The hybrid model is trained through the periodic input data to learn the similarities of the same input under different missing modes.
8. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: Training the hybrid model using the adaptive learning includes: An adaptive graph is established based on a distance adjacency matrix, a semantic adjacency matrix and two node embedding matrices; the adaptive graph represents the spatial correlation of the traffic network; the adaptive graph includes: a distance graph, a semantic graph and a parameterized graph; The hybrid model is trained based on the spatial correlation of the represented transportation network.
9. The traffic flow data interpolation and prediction method based on the multi-task pre-training fine-tuning paradigm according to claim 1 is characterized in that: Fine-tuning the model parameters includes: Fine-tuning the interpolation sub-model includes: Among them, λ1 represents the step size of gradient update, θ' P Represents θ and θ P A combination of Represents θ' P The descent gradient, f θ () represents the encoder of the model, GRU P represents the decoder used for prediction, Represents the generated mask data, Y i represents the target value, Represents the reconstruction loss of the model; Fine-tuning the traffic flow prediction sub-model includes: Among them, θ' R Denote θ and θ R , λ2 represents the step size of gradient update, Represents θ' R The descent gradient of Represents the reconstruction loss of the model, GRU R represents the decoder used for reconstruction, f θ () represents the encoder of the model, Represents the generated mask data, Y i Indicates the target value.
Citation Information
Cited By
Traffic flow prediction method under high data missing rate condition and related equipment
CN121963490A