A continuous encoder-decoder method for traffic flow prediction tasks

By designing a spatiotemporal continuous encoder-decoder architecture and reconstructing the NCDE kernel using FWPs and GNNs, the problem of existing traffic flow prediction methods being unable to capture long-term spatiotemporal dependencies and follow traffic network patterns is solved, thus achieving efficient traffic flow prediction.

CN115700599BActive Publication Date: 2026-02-13DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211342703.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2026-02-13
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods cannot effectively capture the long-term spatiotemporal dependencies of traffic networks and do not follow the message transmission rules of traffic networks, resulting in insufficient prediction accuracy and high computational costs.

Method used

A spatiotemporal continuous encoder-decoder architecture is designed, which combines FWPs and GNNs to reconstruct the kernel of NCDEs. It uses neighboring historical data and periodic historical data as controlled signals, and captures long-range spatiotemporal correlations through time-processing encoder-decoder and spatial-processing encoder-decoder, following the spatiotemporal evolution law of traffic networks.

Benefits of technology

Without stacking discrete modules, the model improves prediction accuracy, reduces computational cost and memory overhead, effectively captures the spatiotemporal dependencies of traffic networks, and reduces prediction errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700599B_ABST
    Figure CN115700599B_ABST
Patent Text Reader

Abstract

The application provides a continuous encoder-decoder method for a traffic flow prediction task, and belongs to the technical field of spatio-temporal data mining.The application designs a spatio-temporal continuous encoder-decoder overall architecture based on NCDEs, breaks through the shackles of the modeling mode in the existing traffic flow prediction method, and more follows the spatio-temporal evolution law of the traffic network.At the same time, the application reconstructs the kernel of the NCDEs based on FWPs and GNNs, embeds the kernel into the spatio-temporal continuous encoder-decoder architecture, so that the application can overcome the limitation of the traditional NCDEs history forgetting, and effectively capture long-range spatio-temporal correlation.The application can not only greatly improve the accuracy of traffic flow prediction, but also has the advantages of high parameter efficiency and high missing rate tolerance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of spatio-temporal data mining, and particularly relates to a method for spatio-temporal data mining based on deep learning to face traffic flow prediction tasks. BACKGROUND

[0002] Traffic flow prediction, as an important part of the concept of intelligent transportation, can effectively help drivers plan their travel routes reasonably, thereby relieving urban traffic pressure. However, due to the high complexity and nonlinearity of traffic data, how to accurately analyze and mine the spatio-temporal correlation between road nodes from traffic data is the key to realizing accurate traffic flow prediction, and is also the motivation of the present application. The related background technology in this field is introduced in detail as follows.

[0003] (I) Traffic flow prediction

[0004] Define the traffic network graph as G=(V,E), where V∈R N represents the set of road nodes, and N represents the number of road nodes; E∈R M represents the set of edges connecting road nodes in the traffic network, and M represents the number of connecting edges. Let represent the observation value of the i-th node at time t, where F represents the number of features, then represents the observation value of the entire traffic network at time t, {X 1 ,X 2 ,…,X L}∈R L×N×F represents the L adjacent period historical observation value in the traffic network, {X 1 ,X 2 ,…,X P}∈R P×N×F represents the P period historical observation value; represents the prediction value of the future P time periods, {Y 1 ,Y 2 ,…,Y P}∈R P×N×F represents the label value of the future P time periods. The traffic flow prediction based on deep learning aims to find a mapping function f, so that the prediction value of the future time period obtained by taking the adjacent historical observation value and the periodic historical observation value as input is closer to the true traffic value. The traffic flow prediction formula is defined as follows:

[0005]

[0006]

[0007] According to the message passing mechanism between road nodes, existing deep learning-based traffic flow prediction methods can be roughly divided into three categories: CNN-based methods, RNN-based methods, and attention-based methods. However, the existing methods have the following limitations: (1) These methods belong to discrete neural architecture, which needs to stack discrete modules to capture periodicity to further improve prediction accuracy. In 2022, Ming Jin et al. showed that using discrete neural architecture to encode rich spatiotemporal patterns would generate discontinuous hidden state trajectories, resulting in high prediction error. In addition, discrete neural architecture also causes parameter redundancy and model complexity, resulting in high computational cost and memory overhead. (2) The time message passing process and the space message passing process of these methods are independent of each other, while the spatiotemporal message passing process of the traffic network is simultaneous, so the existing methods cannot well follow the message passing rules of the traffic network.

[0008] (II) Neural Controlled Differential Equations (NCDEs)

[0009] Deep learning inspired by neural differential equations has been a research hotspot in recent years, which can effectively overcome the limitations of discrete neural architecture. In 2020, Patrick Kidger et al. proposed Neural Controlled Differential Equations (NCDEs), which is a typical representative of this method. Unlike discrete neural architecture, NCDEs no longer parameterize the hidden state, but parameterize the derivative of the hidden state, thereby realizing the continuous of the hidden state. In this way, NCDEs have the advantages of high memory efficiency, high parameter efficiency, adaptive computation, and high missing rate tolerance. At the same time, as a continuous form of RNNs, NCDEs have the mechanism of constantly adjusting the hidden state trajectory according to the controlled signal. The formulaic definition of NCDEs is as follows:

[0010]

[0011] where X represents the continuous path generated by the input data through the interpolation function, z(t) represents the hidden state at time t and is controlled by the controlled signal X'(t), θ f represents the learnable parameters.

[0012] Compared with other neural differential equations (NDEs), NCDEs are more suitable for time series prediction tasks. However, as a continuous form of RNNs, NCDEs also randomly forget historical knowledge when capturing dependencies, which greatly limits its ability to capture long-range dependencies.

[0013] (III) Fast Weight Programmers (FWPs)

[0014] FWPs proposed by Jurgen Schmidhuber et al. in 1992 belong to the key-value associative memory model, where the write is based on summation operation and the retrieval is based on matrix-vector multiplication operation. The FWPs formulaic definition is shown as follows:

[0015] a (t) ,b (t) =W a X(t),W b X(t)

[0016]

[0017] y(t)=W(t)X(t)

[0018] where X(t) represents the input at time t, W(t) represents the trainable fast weight matrix at time t, which is used to provide short-term memory, W a and W b represent the trainable slow weight matrix, which is used to continuously change the fast weight matrix so that it can continuously capture valuable text information.

[0019] In 2021, Imanol Schlag et al. pointed out that Linear Transformers are just FWPs and improved FWPs based on Linear Transformers and delta learning rule to overcome their memory capacity limit. The improved FWPs formulaic definition is shown as follows:

[0020] q (t) ,k (t) ,v (t) =W q X(t),W k X(t),W v X(t)

[0021]

[0022]

[0023]

[0024]

[0025] where β(t) represents the proportion of new values replacing old values, represents the knowledge to be written into W(t), represents the knowledge to be removed from W(t). In this way, the improved FWPs can capture long-range dependencies more effectively.

[0026] In theory, each RNNs has its corresponding continuous form. In 2020, Angelos Katharopoulos et al. showed that Transformers with causal masking are equivalent to RNNs, so FWPs also have their continuous forms. By using FWPs to reconstruct NCDEs, the limitation that they cannot capture long-range dependencies can be overcome. In 2022, Kazuki Irie et al. first reconstructed the core of NCDEs based on FWPs and delta learning rules, and showed superior performance to traditional NCDEs in time series classification tasks. The formulaic definition of reconstructing the kernel of NCDEs based on FWPs and delta learning rules is as follows:

[0027]

[0028]

[0029]

[0030] However, existing research cannot effectively capture the long-term spatio-temporal dependencies of traffic networks, nor can it well follow the message passing rules of traffic networks, so it cannot well solve the traffic flow prediction task. SUMMARY

[0031] In order to break through the modeling mode shackles of existing traffic flow prediction methods by stacking discrete modules to improve the prediction effect of the model, and overcome the limitations of existing traffic flow prediction methods that do not follow the spatio-temporal evolution rules of traffic networks, the present application designs a spatio-temporal continuous encoder-decoder overall architecture based on NCDEs. This architecture can promote real-time spatio-temporal information transmission and capture periodicity without stacking discrete modules. At the same time, the present application reconstructs the kernel of NCDEs based on FWPs and GNNs, and embeds it into the designed architecture so that it can effectively capture long-range spatio-temporal correlations.

[0032] Technical scheme of the present application:

[0033] A continuous encoder-decoder method for traffic flow prediction tasks, the steps are as follows:

[0034] Step 1: Preprocessing of traffic flow data

[0035] (1) Data cleaning: For the original data, the abnormal values and error records need to be cleaned. Since the present application has good tolerance for data missing, it does not need to be handled, avoiding the problem of affecting the prediction effect of the model due to unreasonable missing value filling method.

[0036] (2) Time granularity division: according to the specific prediction task requirements, the traffic flow is combined and processed according to the appropriate window size.

[0037] (3) Data normalization: the cleaned data is normalized to eliminate the adverse effects of abnormal data and improve the speed of gradient descent to solve the optimal solution.

[0038] Second step: making model training set, validation set and test set

[0039] (1) Generate a set of triples S1 using a sliding window: according to the prediction task requirements, determine the adjacent historical period window size L and the future prediction period window size P, and the periodic historical period window size is equal to the future prediction period window size. Process the normalized traffic flow data to generate a set S1 composed of adjacent historical data, periodic historical data and prediction period label triples: {X near ,X period ,Y label}, where the adjacent historical data X near ={X 1 ,X 2 ,…,X t ,…,X L}∈R L×N×F , the periodic historical data X period ={X 1 ,X 2 ,…,X P}∈R P×N×F , and the prediction period label Y label ={Y 1 ,Y 2 ,…,Y t ,…,Y P}∈R P×N×F ; N is the number of sensors, F is the number of input features, L is the number of adjacent historical periods, P is the number of future prediction periods, X t represents the observed value of the traffic network at time t, and Y t represents the label value of the traffic network at time t.

[0040] (2) Cubic spline interpolation: splice the adjacent historical data and the periodic historical data to generate {X 1 ,…,X L-1 ,X L ,X L+1 ,…,X L+P}∈R (L+P)×N×F ; then use the cubic spline interpolation method to generate a continuous and derivable path X, where X(t)∈R N×F and X'(t)∈R N×Frespectively, and t is any real number in the interval [0, P+L]; finally, the path X is combined with the prediction horizon label into a new set S2: {X, Y label}.

[0041] (3) Dataset division: the set S2 is divided into training set, validation set and test set in proportion, which are used for model training, validation and testing respectively.

[0042] Third step: build a spatio-temporal continuous encoder-decoder model, which is composed of three parts: time processing encoder-decoder, space processing encoder-decoder and generator.

[0043] (1) Time processing encoder-decoder

[0044] Inspired by Kazuki Irie et al., the present application uses FWPs and delta learning rules to reconstruct the time processing encoder-decoder kernel. The query q (t) ∈R N×H×D and the key k (t) ∈R N×H×D are generated by X'(t), and the value v (t) ∈R N×H×D is generated by X(t):

[0045] q (t) ,k (t) ,v (t) ∈W q X'(t),W k X'(t),W v X(t)

[0046] where H is the number of self-attention heads, and D is the feature dimension of the self-attention head; W q is the slow weight matrix used to generate the query q (t) , W k is the slow weight matrix used to generate the key k (t) , and W v is the slow weight matrix used to generate the value v (t) .

[0047] Since traffic flow has a relatively stable periodicity, i.e. the traffic flow of each period has a similar order of magnitude and trend, which means that the same period of adjacent two weeks has similar X(t) and X'(t). Therefore, the adjacent historical data and periodic historical data can be used as the controlled signal of the time processing encoder-decoder. The time processing encoder-decoder is formulated as shown below:

[0048]

[0049]

[0050] where X'(t) and X(t) are used as controlled signals of the time processing encoder-decoder to continuously adjust its hidden state trajectory; W(t) e R N×H×D×D denotes the hidden state of the time processing encoder-decoder at time t, and the initial value W(0) of the hidden state is generated by the MLP; f(W(t), X(t), X'(t); θ f ) e R N×H×D×D denotes the time processing CDE function; θ f denotes the learnable parameters.

[0051] In addition, in order to follow the time message passing rules of the traffic network and improve the parameter efficiency of the model, the time processing encoder and the decoder share network parameters. In this way, the model can capture the periodicity of the data without avoiding the stacking of discrete modules and introducing additional network parameters. Therefore, the time processing encoder-decoder can be represented as:

[0052]

[0053] (2) Spatial processing encoder-decoder

[0054] In order to make the model have good generalization ability and be able to capture rich spatial dependencies, the inventors reconstruct the kernel of the spatial processing encoder-decoder based on the DAGG proposed by Lei Bai et al. to capture rich spatial dependencies. The formulaic definition of the CDE function based on the DAGG is as follows:

[0055]

[0056] where I N e R N×N denotes the identity matrix; E A e R N×C denotes the trainable node embedding matrix, and C denotes the node embedding dimension; corresponding to the B e R N×N denotes the degree matrix; sigma denotes the ReLU activation function; Theta denotes the trainable weight transformation matrix; b e R H×D×D denotes the bias; Z(t) e R N×H×D×D denotes the hidden state of the spatial processing encoder-decoder at time t.

[0057] The inventors use the derivative W'(t) of the time processing encoder-decoder hidden state W(t) as the controlled signal of the spatial processing encoder-decoder. Similar to the time processing encoder-decoder, the formulaic definition of the spatial processing encoder-decoder is as follows:

[0058]

[0059] The time processing encoder-decoder and the space processing encoder-decoder are combined to obtain a spatio-temporal processing encoder-decoder; the spatio-temporal processing encoder-decoder is defined as follows:

[0060]

[0061] wherein f(W(t), X(t), X'(t); θ f ) can effectively capture long-range spatio-temporal correlations based on the FWP and the delta reconstruction kernel, and g(Z(t); t) takes the DAGG as the kernel and takes W'(t) as the controlled signal, thereby being able to capture rich spatial dependencies. Therefore, Z(t) can also be referred to as the hidden state of the spatio-temporal processing encoder-decoder. In this way, the hidden state Z(t) of the spatio-temporal processing encoder-decoder contains rich spatio-temporal features in the interval [0, t].

[0062] (3) Generator

[0063] Since the features stored in the hidden state Z(t) of the spatio-temporal processing encoder-decoder are not necessarily all beneficial to the prediction of the result at time t, it is necessary to further filter the features. In order to solve the above problem, q (t) can be used to obtain the features in the hidden state Z(t) of the spatio-temporal processing encoder-decoder that are useful for time t. The process is defined as follows:

[0064]

[0065] wherein t ∈ R and 0 < t ≤ P, F(t) ∈ R N×H×D represents the features useful for predicting time t extracted by q (t) .

[0066] In order to obtain the prediction results of the future P time steps , the generator needs to obtain the feature set F = {F(1), F(2), …, F(P)} ∈ R P×N×H×D as input. In the present application, an MLP with residual connection is used as the generator, which is defined as follows:

[0067]

[0068] H2 = σ(FC H×D→H×D (H1) + F)

[0069]

[0070] wherein denotes a layer normalization operation, and denotes a ReLU activation function.

[0071] Jeongwhan Choi et al. use MLPs to generate prediction results with the final state of the encoder Z(L), but this method causes continuous spatiotemporal message passing to occur only in the historical period. In contrast, continuous spatiotemporal message passing in the present application can occur in the historical period and the future period, so the present application can better follow the spatiotemporal message passing rules in the traffic network.

[0072] Fourth step: model training and performance evaluation

[0073] (1) Model training: after inputting the batch continuous path X as input data into the spatiotemporal continuous encoder-decoder model, obtaining the model prediction result, selecting a suitable loss function and calculating the loss value according to the model prediction result and the label value, selecting a suitable optimization algorithm to calculate the optimal solution of the model parameter. During the model training, the model hyperparameters can be adjusted according to the fitting situation of the validation set.

[0074] (2) Performance evaluation: determine the evaluation index, which is used to measure the fitting situation of the model prediction result and the label value in the test set, and then evaluate the overall prediction effect of the model.

[0075] Advantages of the present application:

[0076] (1) Since the present application is a traffic flow prediction model designed based on NCDEs, it completely inherits all the advantages of NCDEs, such as: high memory efficiency, high parameter efficiency, self-adaptive calculation, and high tolerance to irregular data, etc. However, existing traffic flow prediction methods often do not have these advantages.

[0077] (2) The present application breaks through the shackles of the modeling method of the existing traffic flow prediction method, which improves the model prediction effect by stacking discrete modules, and uses adjacent historical data and periodic historical data as controlled signals to continuously adjust the change trajectory of the hidden state, so as to not only capture the periodicity of the data without stacking discrete modules, but also more follow the spatiotemporal evolution rules of the traffic network, thereby effectively reducing the numerical error of the model prediction.

[0078] (3) The present application reconstructs the time processing encoder-decoder and space processing encoder-decoder kernels based on FWPs and GNNs, respectively, overcoming the limitations of traditional NCDEs in forgetting historical knowledge, so as to effectively capture long-range spatiotemporal correlations. BRIEF DESCRIPTION OF DRAWINGS

[0079] Figure 1The spatiotemporal continuous encoder-decoder framework is mainly composed of three components, i.e., a temporal processing encoder-decoder, a spatial processing encoder-decoder, and a generator.

[0080] Figure 2 The kernel structure diagram of the NCDEs reconstruction based on the FWPs and the GNNs.

[0081] Figure 3 The comparison diagram of the prediction performance of the spatiotemporal continuous encoder-decoder model and a baseline model.

[0082] Figure 4 The comparison diagram of the prediction result of the spatiotemporal continuous encoder-decoder in one day and the true value thereof. DETAILED DESCRIPTION

[0083] The specific embodiments of the present application will be described in detail below with reference to the technical solutions, the accompanying drawings, and specific examples.

[0084] A spatiotemporal continuous encoder-decoder method for traffic flow prediction, the steps are as follows:

[0085] Step 1: Preprocessing of traffic flow data

[0086] (1) Dataset: The PEMS04 dataset provided by the PeMS (PeMS) is used to further illustrate the present application, which is widely used in existing traffic flow prediction research. The PEMS04 dataset is a dataset obtained by collecting data from 307 sensors on the California highway every 30 seconds in real time. Since the dataset is a standard dataset and the data has been aggregated into a window size of 5 minutes, there is no need to perform data cleaning and time granularity division on the dataset.

[0087] (2) Data normalization: In order to eliminate the adverse effects of abnormal data and improve the speed of gradient descent to solve the optimal solution, the Z-score standardization method is used to normalize the data, and the formula is as follows:

[0088]

[0089] Wherein, x represents the original value of the sample, mean represents the mean value of the sample, std represents the standard deviation of the sample, x * represents the sample value after Z-score standardization and is located in the interval [-1, 1].

[0090] Step 2: Making model training set, validation set and test set

[0091] (1) In this example, short-term traffic flow prediction will be performed using the present application, i.e. one-hour future traffic flow will be predicted using one-hour adjacent period flow data and one-hour periodic period flow data. For example, assuming that traffic flow on October 14, 15:00-16:00 is to be predicted, the adjacent period flow data is taken from the traffic flow on October 14, 14:00-15:00, and the periodic period flow is taken from the traffic flow on October 7, 15:00-16:00.

[0092] (2) Generate a set of triplets S1 using a sliding window: According to the task requirements determined in (1), the adjacent historical period window size L = 12 and the future prediction period window size P = 12 are determined, so the periodic historical period window size is also 12. Process the normalized traffic flow data to generate a set S1 consisting of adjacent historical data, periodic historical data and prediction period label triplets: {X near ,X period ,Y label}, where the adjacent historical data X near = {X 1 ,X 2 ,…,X L} ∈ R L×N×F , the periodic historical data X period = {X 1 ,X 2 ,…,X P} ∈ R P×N×F , the prediction period label Y label = {Y 1 ,Y 2 ,…,Y P} ∈ R P×N×F , N = 307 is the number of sensors, and F = 1 is the number of input features.

[0093] (3) Cubic spline interpolation: splice the adjacent historical data and the periodic historical data to generate {X 1 ,…,X L-1 ,X L ,X L+1 ,…,X L+P} ∈ R (L+P)×N×F ; then use cubic spline interpolation to generate a continuous and derivable path X, where X(t) ∈ R N×F and X'(t) ∈ R N×F represent the value and derivative of the path X at time t, respectively, and t is any real number in the interval [0, P+L]; finally, combine the path with the prediction period label to form a set S2: {X, Y label}.

[0094] (4) Dataset division: The data is divided into training set, validation set and test set in the ratio of 8:1:1.

[0095] Third step: Spatiotemporal continuous encoder-decoder model running process

[0096] By Figure 1 It can be seen that the spatiotemporal continuous encoder-decoder model is composed of three components: the temporal processing encoder-decoder, the spatial processing encoder-decoder and the generator.

[0097] (1) Temporal processing encoder-decoder

[0098] The temporal processing encoder-decoder uses the continuous path X generated by cubic spline interpolation and its derivative X' as the controlled signal. The query q (t) ∈R N×H×D and the key k (t) ∈R N×H×D are generated using X'(t), and the value v (t) ∈R N×H×D is generated using X(t).

[0099] q (t) ,k (t) ,v (t) ∈W q X'(t),W k X'(t),W v X(t)

[0100] Where H=4 is the number of self-attention heads, and D=8 is the feature dimension of the self-attention head.

[0101] The temporal processing encoder-decoder reconstructs its NCDEs kernel using FWPs and delta learning rules, and the temporal processing encoder-decoder hidden state W(t) is generated by the following neural controlled differential equation:

[0102]

[0103] (2) Spatial processing encoder-decoder

[0104] The spatial processing encoder-decoder reconstructs its NCDEs kernel using DAGG:

[0105]

[0106] Where the hyperparameter node embedding dimension is set to C=10.

[0107] The spatial processing encoder-decoder uses the derivative W'(t) of the temporal processing encoder-decoder hidden state W(t) as the controlled signal, and the spatial processing encoder-decoder hidden state Z(t) is generated by the following neural controlled differential equation:

[0108]

[0109] (3) Generator

[0110] With query q (t) to filter the spatio-temporal features in the space processing encoder-decoder hidden state Z(t):

[0111]

[0112] To obtain the prediction results of the future P time steps, the MLP generator with residual connection needs to obtain the feature set F = {F(1), F(2), …, F(P)} ∈ R P×N×H×D As input to obtain the prediction value

[0113]

[0114] H2= σ(FC H×D→H×D (H1)+F)

[0115]

[0116] Fourth step: model training and performance evaluation

[0117] (1) Model training: input the batch continuous path X as input data into the model to obtain the model prediction result, select MAE as the loss function and calculate the loss value according to the model prediction result and the label value, select Adam optimization algorithm to calculate the optimal solution of the model parameter. During the model training, the model hyperparameters are adjusted according to the fitting condition of the validation set.

[0118] (2) Performance evaluation: the evaluation index of traffic flow prediction is determined as the mean absolute error (MAE) and the root mean square error (RMSE).

[0119] The MAE calculation formula is as follows:

[0120]

[0121] The RMSE calculation formula is as follows:

[0122]

Claims

1. A traffic flow prediction task oriented continuous encoder-decoder method, characterized in that, The method comprises the following steps: First step: preprocessing traffic flow data; Second step: making model training set, validation set and test set (1) Generating a set of triples S1 using a sliding window: according to the prediction task requirements, determine the adjacent historical period window size L and the future prediction period window size P, and the periodic historical period window size is equal to the future prediction period window size; process the normalized traffic flow data to generate a set S1 composed of adjacent historical data, periodic historical data and prediction period label triples: {X near , X period , Y label}, wherein the adjacent historical data X near ={X 1 , X 2 ,…,X t ,…,X L}∈R L×N×F , the periodic historical data X period ={X 1 , X 2 ,…,X P}∈R P×N×F , and the prediction period label Y label ={Y 1 , Y 2 ,…,Y t ,…,Y P}∈R P×N×F ; wherein N is the number of sensors, F is the number of input features, L is the number of adjacent historical periods, P is the number of future prediction periods, X t represents the observed value of the traffic network at historical time t, and Y t represents the label value of the traffic network at future time t; (2) Cubic spline interpolation: splice the adjacent historical data and periodic historical data to generate {X 1 ,…,X L-1 ,…,X L ,…,X L +1 ,…,X L+P}∈R (L+P)×N×F ; Then use the cubic spline interpolation method to generate a continuous and derivable path X, wherein X(t)∈R N×F and X'(t)∈R N×F represent the value and derivative of the path X at time t, and t is any real number in the interval [0, P+L]; Finally, the path X is combined with the prediction period label to form a new set S2: {X, Y label}. (3) Dataset division: divide the set S2 into training set, validation set and test set according to the proportion, which are respectively used for model training, validation and testing; Third step: constructing a spatiotemporal continuous encoder-decoder model The spatiotemporal continuous encoder-decoder model is composed of a time processing encoder-decoder, a space processing encoder-decoder and a generator; (1) Time processing encoder-decoder Generate a query q from X'(t) (t) ∈ R N×H×D and key k (t) ∈ R N×H×D and value v from X(t) (t) ∈ R N×H×D : q (t) ,k (t) ,v (t) ∈W q X′(t),W k X′(t),W v X(t) Where H is the number of self-attention heads, and D is the feature dimension of the self-attention head; W q Indicates the information used to generate query q. (t) The slow weight matrix, W k Indicates the key k used to generate the key. (t) The slow weight matrix, W v Indicates the value v used to generate (t) The slow weight matrix; The time processing encoder-decoder kernel is reconstructed by using FWPs and delta learning rules; the time processing encoder-decoder hidden state W(t) is generated by the following neural controlled differential equation: where X'(t) and X(t) are both used as controlled signals of the time processing encoder-decoder to continuously adjust its hidden state trajectory; W(t) e R N×H×D×D denotes the time processing encoder-decoder hidden state at time t, and the hidden state initial value W(0) is generated by MLPs; f(W(t), X(t), X'(t); θ f ) e R N×H×D×D denotes the time processing CDE function; θ f denotes the learnable parameters; (2) Space processing encoder-decoder The space processing encoder-decoder uses DAGG to reconstruct its NCDEs kernel: where I N ∈ R N×N denotes the identity matrix; E A ∈ R N×C denotes the trainable node embedding matrix, and C denotes the node embedding dimension; corresponding to the B∈ R N×N denotes the degree matrix; σ denotes the ReLU activation function; Θ denotes the trainable weight transformation matrix; b∈ R H×D×D denotes the bias; Z(t)∈ R N×H×D×D denotes the hidden state of the spatial processing encoder-decoder at time t; The derivative W'(t) of the time processing encoder-decoder hidden state W(t) is used as the controlled signal of the space processing encoder-decoder; the formulaic definition of the space processing encoder-decoder is as follows: The time processing encoder-decoder and the space processing encoder-decoder are combined to obtain a spatiotemporal processing encoder-decoder; the formulaic definition of the spatiotemporal processing encoder-decoder is as follows: where f(W(t), X(t), X'(t); 0 f ) can effectively capture long-range spatio-temporal correlations based on FWPs and delta reconstruction kernels, g(Z(t); t) takes DAGG as the kernel and W'(t) as the controlled signal, thus being able to capture rich spatial dependencies; therefore, Z(t) is also called the hidden state of the spatio-temporal processing encoder-decoder; in this way, the spatio-temporal processing encoder-decoder hidden state Z(t) contains rich spatio-temporal features in the interval [0, t]; (3) Generator Using the query q (t) to obtain features useful for time t in the spatiotemporal processing encoder-decoder hidden state Z(t), which is defined as shown below: where t e R and 0 < t < P, F(t) e R N×H×D representing the features extracted that are useful for predicting the time t; (t) representing the features extracted that are useful for predicting the time t; The MLP generator with residual connections obtains the feature set F = {F(1), F(2), …, F(P)} e R according to the above formula P ×N×H×D The prediction values for the future P time steps are obtained as input H2 = σ (FC H×D→H×D (H1) + F) wherein, denotes a layer normalization operation, and σ denotes a ReLU activation function. Fourth step: model training and performance evaluation (1) Model training: input the batch continuous path X as input data into the spatiotemporal continuous encoder-decoder model to obtain the model prediction result, select the loss function and calculate the loss value according to the model prediction result and the label value, select the optimization algorithm to calculate the optimal solution of the model parameters; during the model training, the model hyperparameters are adjusted according to the fitting condition of the validation set; (2) Performance evaluation: determine the evaluation index, which is used to measure the fitting condition of the model prediction result and the label value in the test set, and then evaluate the overall prediction effect of the model.

2. The method of claim 1, wherein, The first step comprises: (1) Data cleaning: for the original data, the abnormal values and error records need to be cleaned; (2) Time granularity division: according to the specific prediction task requirements, the traffic flow is combined and processed according to the appropriate window size; (3) Data normalization: the cleaned data is normalized.

3. The method according to claim 1 or 2, characterized in that, In the model training process of the fourth step, MAE is selected as the loss function and the loss value is calculated according to the model prediction result and the label value, and Adam optimization algorithm is selected to calculate the optimal solution of the model parameters.

4. The method according to claim 1 or 2, characterized in that, In the performance evaluation process of the fourth step, the evaluation indexes of traffic flow prediction are determined as mean absolute error MAE and root mean square error RMSE; wherein, The MAE calculation formula is as follows: The RMSE calculation formula is as follows:

5. The method of claim 3, wherein, In the performance evaluation process of the fourth step, the evaluation indexes of traffic flow prediction are determined as mean absolute error MAE and root mean square error RMSE; wherein, The MAE calculation formula is as follows: The RMSE calculation formula is as follows:

Citation Information

Patent Citations

  • A Spark-Based Deep Learning Method for Data-Driven Traffic Flow Forecasting

    AU2020102350A4

  • Traffic prediction method based on multi-step coupled graph convolutional network

    CN114692984A