Traffic flow prediction method based on spatiotemporal meta-graph learning
The traffic flow prediction method based on spatiotemporal metagraph learning solves the problems of real-time change capture, multi-factor consideration and high computational cost in traffic flow prediction in the existing technology, and achieves more accurate and efficient traffic mode learning, adaptability and Improvement of generalization ability.
Patent Information
- Application Number
- CN202410814408.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing traffic flow prediction methods are difficult to capture changes in real-time traffic conditions, ignore other influencing factors, have high computational costs, and have limitations in processing spatiotemporal data. They have insufficient adaptability and generalization capabilities, especially when the traffic network structure changes. Challenging.
A traffic flow prediction method based on spatiotemporal metagraph learning is adopted. By building an initial traffic prediction model, including a metagraph learner, encoder and decoder, the spatiotemporal graph network is used to extract features, and a super network and a fully connected layer are combined to generate node embeddings to adapt to Traffic patterns in different road sections and time periods simplify the model structure and reduce computational complexity.
It achieves more accurate traffic pattern learning, improves prediction accuracy and efficiency, is more adaptable, can automatically learn node-level prototypes, adapts to changes in the traffic network, and reduces computational complexity.
Smart Images

Figure CN118379882B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a traffic flow prediction method based on spatiotemporal meta-graph learning. Background Art
[0002] In recent years, countries around the world have been vigorously developing intelligent transportation systems (ITS). Intelligent transportation systems play an indispensable role in the field of traffic management and control. They have significantly improved traffic safety, effectively alleviated traffic congestion, and significantly improved traffic operation efficiency. Traffic flow prediction is a key part of the intelligent transportation system. Accurate prediction of road network traffic flow provides key information for the intelligent transportation system, especially in busy urban highways. Accurate prediction can help traffic management departments reasonably guide and control traffic flow distribution. On the other hand, it also helps drivers plan routes to avoid congestion and improve the efficiency of urban transportation systems.
[0003] Traffic flow refers to the number of vehicles passing through a certain traffic section in a unit of time. It is an important indicator to measure traffic conditions and is of great significance to urban traffic management and planning. The composition of traffic flow includes the types and numbers of vehicles, and different types of vehicles contribute differently to traffic flow. Traffic flow can be measured by traffic counters, geomagnetic vehicle detectors, cameras and other equipment, which can monitor the passage of vehicles in real time and record information such as the number and speed of vehicles. Traffic flow shows obvious periodic changes within a day, with larger traffic flow during peak hours (such as commuting time) and smaller traffic flow during non-peak hours. In addition, holidays and special events (such as large-scale events, traffic accidents, etc.) will also have an impact on traffic flow.
[0004] Rich historical traffic data is the premise for traffic forecasting, and the development of sensor technology has facilitated the collection of this data. Traffic flow forecasting is a method of predicting future traffic conditions by analyzing data such as traffic flow and speed collected by sensors. Due to the digitization of the transportation system, we can use data-driven methods based on artificial intelligence and machine learning to achieve more accurate predictions.
[0005] In order to improve the ability to accurately predict traffic flow distribution, the academic community has proposed many prediction strategies. Currently, these strategies are mainly divided into two categories: one is the prediction model based on statistical theory, and the other is the prediction model based on machine learning algorithms.
[0006] Forecasting methods based on statistics: Statistical methods mainly include the autoregressive integrated moving average model ARIMA, the historical average model HA, the exponential smoothing model ES and the Kalman filter model KF. These models play an important role in analyzing time series data and predicting future traffic flow. However, the assumptions of these models are relatively strict, and once they are subject to random interference, the prediction accuracy of the models may decrease. In addition, these models cannot fully reflect the nonlinear characteristics of traffic conditions, so they have certain limitations when used.
[0007] Prediction methods based on machine learning: In traffic flow prediction, machine learning methods are widely used. These methods can be divided into two categories: traditional machine learning methods and deep learning methods.
[0008] Traditional machine learning methods:
[0009] Traditional machine learning methods include support vector regression model SVR, K-nearest neighbor model KNN, Bayesian model, fuzzy logic model, etc. The SVR model uses the supervised machine learning method of regression online support vector machine, which can predict short-term traffic flow in typical and atypical situations. The KNN model uses the value of the nearest neighbor as the input parameter, combines the prediction range of multiple intervals to optimize the parameters, and then predicts the traffic flow. The Bayesian model improves the prediction accuracy by searching the manifold neighborhood, and proposes a traffic state prediction method based on the adaptive neighborhood selection expansion strategy. The fuzzy logic model uses fuzzy methods to cluster the input data to determine the input-output relationship. These traditional machine learning methods have strong nonlinear mapping capabilities and are not as strict as statistical methods in terms of data requirements. Therefore, they can better adapt to the uncertainty of traffic flow and improve the prediction effect. However, since the spatial structure of the observation points is unstructured, these methods only analyze from the time dimension, so the effect of improving the prediction accuracy is limited.
[0010] Deep Learning Methods:
[0011] In recent years, with the rapid development of deep neural network models, their application potential in traffic flow prediction has been fully explored. Compared with traditional machine learning methods, deep learning models have shown stronger data processing capabilities, especially in extracting complex spatiotemporal features of traffic data. In current research, deep learning algorithms have become the mainstream technology for traffic flow prediction and have achieved remarkable results.
[0012] Since the data information of traffic roads is dynamically related in time and space, in order to make accurate predictions, researchers modeled the sensor data in the road network as a multivariate time series MTS to capture the spatial correlation and temporal autocorrelation of task data. These two correlations can naturally be represented by graphs and sequences. Therefore, the mainstream model uses the architecture based on graph convolutional networks GCN and recurrent neural networks RNN to process these data.
[0013] With the rapid development of graph convolutional networks (GCNs), traffic flow prediction has become a hot topic of research and has attracted more and more attention. GW-Net generates adaptive graphs by training the adjacency matrix as a free variable, bringing a new perspective to this field. Models such as MTGNN, AGCRN, and GTS apply graph structure learning methods to the field of traffic flow prediction.
[0014] In summary, the existing traffic flow prediction methods still have some problems and limitations. First, traditional traffic flow prediction methods are mainly based on historical data, which makes it difficult to capture changes in real-time traffic conditions. These methods often require a large amount of data and complex models, and have high computational costs. Second, most of the existing traffic flow prediction methods focus on a single traffic parameter (such as the number of vehicles or speed), while ignoring other factors that may affect traffic flow (such as weather, road conditions, etc.). This leads to a certain degree of impact on the accuracy and reliability of the prediction results. In addition, traditional traffic flow prediction methods have certain limitations in processing spatiotemporal data. Since the traffic conditions of roads are different in space (local roads, highways, interchanges) and in time (off-peak and peak times), traffic data (traffic speed and flow) have potential spatiotemporal heterogeneity, which limits the adaptability and generalization ability of the prediction model. Finally, existing traffic flow prediction methods often require prior knowledge of the structural information of the traffic network. In practical applications, the structure of the traffic network may change (such as road construction, traffic control, etc.), resulting in non-stationarity in traffic data, which makes traffic flow prediction more challenging. Summary of the invention
[0015] The purpose of the present invention is to design a traffic flow prediction method based on spatiotemporal meta-graph learning in order to solve the above problems.
[0016] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0017] Traffic flow prediction method based on spatiotemporal meta-graph learning, including:
[0018] S1. Build an initial traffic prediction model. The initial traffic prediction model includes a meta-graph learner, an encoder, and a decoder. The meta-graph learner includes a super network and a meta-node library. , fully connected layer and enhanced representation layer, the encoder includes α first spatiotemporal graph networks STG from input to output, α time series are input into α first spatiotemporal graph networks STG in chronological order, and the decoder includes α second spatiotemporal graph networks STG from input to output; the encoder is used to extract spatiotemporal features, the super network is used to generate node embeddings and adjust based on meta-nodes, the meta-node library stores time series in the form of multiple nodes, the fully connected layer is used to project spatiotemporal features to a local query vector, the enhanced representation layer is used to enhance the representation of spatiotemporal features according to the local query vector, the decoder is used to splice the spatiotemporal features of the input time series and the enhanced features of the spatiotemporal features, and decode them to predict the traffic flow in the future time step; the output of the super network is used as the input of the encoder, the output of the encoder is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the enhanced representation layer, the output of the enhanced representation layer and the output of the encoder are both used as the input of the decoder, where, and d represent the meta node library The number and dimension of memory items, ℝ represents the set of all real numbers;
[0019] S2, obtain the training set and divide it into training data, verification data and test data;
[0020] S3, the training data, the verification data and the test data are respectively imported into the model trainer, the model verifier and the model tester to train and optimize the initial traffic prediction model to obtain the optimized traffic prediction model;
[0021] S4, obtaining given multi-step observation data;
[0022] S5. Use the optimized traffic prediction model to predict the next multi-step prediction results of the multi-step observation data.
[0023] The beneficial effects of the present invention are: modular design: modular design is adopted to combine the meta-graph learner with the space-time graph network, which simplifies the model structure, reduces the computational complexity, and is more efficient than the existing technology; space-time graph network: the space-time graph network enables the model to capture the spatial and temporal correlations in the traffic network, thereby achieving accurate traffic pattern learning, which is more accurate than the existing technology; meta-graph learning mechanism: the meta-graph learning mechanism of this method can automatically learn node-level prototypes to adapt to traffic patterns in different sections and time periods, which is more effective than the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is the architecture diagram of the traffic prediction model;
[0025] Figure 2 for Figure 1 Enlarged view of (a);
[0026] Figure 3 for Figure 1 The enlarged image of (ii);
[0027] Figure 4 This is the training and testing flow chart;
[0028] Figure 5 This is the ablation experiment on the METR-LA dataset;
[0029] Figure 6 This is the ablation experiment on the PEMS-BAY dataset;
[0030] Figure 7 Ablation experiments on the EXPY-TKY dataset. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0032] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.
[0033] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0034] In the description of the present invention, it should be understood that the terms "upper", "lower", "inside", "outside", "left", "right", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use, or are directions or positional relationships commonly understood by those skilled in the art. These directions or positional relationships are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0035] Furthermore, the terms “first”, “second”, etc. are merely used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0036] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms such as "setting" and "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0037] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.
[0038] The multi-step traffic prediction problem is defined as follows:
[0039]
[0040] in, , N represents the number of spatial unit entities (nodes, grids, regions, road connections), and C represents the information dimension of the entity. Since this method only predicts traffic speed, C is equal to 1. For a given Step Observation , the goal of this method is to train Traffic prediction model , to infer the next Step Observation , Traffic prediction model It is used to predict the given α-step observation data to obtain the next β observation results.
[0041] Traffic flow prediction methods based on spatiotemporal meta-graph learning include:
[0042] S1. Build an initial traffic prediction model. The initial traffic prediction model includes a meta-graph learner, an encoder, and a decoder, such as Figure 1 , Figure 2 , Figure 3 shown.
[0043] Meta-graph learner includes super network, meta-node library , fully connected layer and enhanced representation layer, the super network is used to generate node embedding and adjust it based on the meta-node. The meta-node library stores time series in the form of multiple nodes. The fully connected layer is used to project the spatiotemporal features to a local query vector. The enhanced representation layer is used to enhance the representation of spatiotemporal features according to the local query vector. The output of the encoder is used as the input of the fully connected layer, and the output of the fully connected layer is used as the input of the enhanced representation layer. and d represent the meta node library The number and dimension of memory items, ℝ represents the set of all real numbers;
[0044] Integrate memory and discrimination capabilities into spatiotemporal graph learning, and use the idea of memory network to build a meta-node library. The definition of the meta-node library is expressed as: , ; where the superscript i represents the row index, Represents the spatiotemporal characteristics H t The hidden state of the i-th node in , Indicates that a fully connected layer is used to hide the state A local query vector projected to, the fully connected layer parameters are ;Will With each memory vector Perform matching to calculate scalar Memory read operations, scalar Representation vector and memory vector Similarity between; meta-node vector Can be restored as a combination of memory items, express The transpose of , exp() is the abbreviation of the exponential function with the natural number e as the base, is the bias term of the fully connected layer. The super network generates node embeddings for graph structure learning based on the meta-node library. The node embedding generation process is expressed as: , where NN H represents a super network, implemented with a fully connected layer, Figure 1 and Figure 3 The super network parameters in are , E' represents the generated node, Represents the learned spatiotemporal meta-graph.
[0045] The encoder includes α first space-time graph networks STG from input to output, α time series are input into α first space-time graph networks STG in chronological order, the encoder is used to extract space-time features, and the output of the super network is used as the input of the encoder; the extracted features of the first space-time graph network STG are expressed as: ; ;in and Represent graph convolution operations respectively The input and output of and is the kernel parameter approximated to order K by Chebyshev polynomials, k∈K, is an activation function, , r, and C represent the update gate, reset gate, and candidate hidden state in the first spatiotemporal graph network STG, respectively; 、r t , C tRepresent the update gate, reset gate and candidate hidden state of the tth step respectively; represents the calculated bias of the network parameters, Represents the approximation to k order using Chebyshev polynomials , H t , H t-1 are the hidden states of the t-th and t-1-th steps respectively, Expressed as the corresponding network parameters, Auxiliary input representing the topological structure of the adaptive graph G, matrix It is constructed based on metrics and empirical laws, where N represents the number of spatial unit entities. In the field of spatiotemporal modeling, the matrix They are usually constructed based on various metrics, such as cosine similarity, and empirical laws. The choice of these metrics has great flexibility, which motivates us to explore combining graph structure learning with spatiotemporal modeling and achieve joint optimization.
[0046] The decoder includes α second spatiotemporal graph networks STG from input to output; the decoder is used to concatenate and reconstruct the spatiotemporal features of the input time series and the enhanced features of the spatiotemporal features, which is expressed as To enhance H t The expression, Represent the splicing operation and decode it to predict the traffic flow in the future time step; the output of the enhanced representation layer and the output of the encoder are both used as the input of the decoder.
[0047] S2, obtain the training set and divide it into training data, verification data and test data;
[0048] S3, the training data, the verification data and the test data are respectively imported into the model trainer, the model verifier and the model tester, and the initial traffic prediction model is trained and optimized to obtain the optimized traffic prediction model; Figure 4 As shown in Figure 2, the specific training optimization process includes:
[0049] ①. Set the number of times N that the model trainer trains the traffic prediction model and start training;
[0050] ② The adaptive graph G is embedded through the super network transformation of the meta-graph learner to generate a spatiotemporal meta-graph with node embedding ;
[0051] ③ At the beginning of the time step, the space-time meta-graph and time series The encoder performs convolution operation on the input graph data from the perspective of time to extract the spatiotemporal features. In each subsequent time step, the remaining α-1 time series inputs are sequentially input into the encoder to obtain the encoding result spatiotemporal features H t; The auxiliary input of the adaptive graph G topology is , Represents the approximation to k order using Chebyshev polynomials , Represents the learned spatiotemporal meta-graph.
[0052] ④、The fully connected layer and enhanced representation layer of the meta-graph learner transform the spatiotemporal features H t Converted into enhanced representation M t ;
[0053] ⑤. In the first time step of the decoder, the spatiotemporal features H of the input time series are t and the enhanced spatiotemporal features M t concatenated and input into the subsequent second spatiotemporal graph network STG for decoding to predict the traffic flow in the future time step;
[0054] ⑥ Calculate the contrast loss L1 and consistency loss L2. The contrast loss L1 and consistency loss L2 are intended to improve the network's ability to distinguish different scenes. The contrast loss L1 is expressed as: ; The consistency loss L2 is expressed as: ; Where T represents the total number of samples in the training set, p and n represent the given local query vector In the case of Take the first two elements of the sorted memory vector; The most similar As a positive sample, the second similar Considered as negative samples, represents the difference between positive and negative samples to keep the memory vector as compact and diverse as possible. These two constraints guide the memory Different spatiotemporal patterns are distinguished at the node level.
[0055] ⑦. Add the contrast loss L1 and consistency loss L2 to the mean absolute error to get the loss value L of the current training round. task , the loss value L task The input is sent to the Adam optimizer to obtain the gradient of the model parameters, and then the back propagation algorithm is used to update the parameters of the entire current traffic prediction model; the loss value L task It is expressed as: ; Where k1 and k2 are balancing factors;
[0056] ⑧. Use the data generated by the model validator to measure the performance of the current turn flow prediction model and print the results;
[0057] ⑨. Determine whether the current number of training times is equal to N. If so, return to ② and proceed to the next round of training; otherwise, end the training, save the model parameters, and enter ⑩;
[0058] ⑩. Input the test data into the trained traffic prediction model, use the model tester to test the model performance, and then evaluate the model performance.
[0059] Model performance indicators
[0060] The performance metrics include mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE), which are described as follows:
[0061] MAE (Mean Absolute Error) is an indicator for evaluating the accuracy of a prediction model. It is calculated by taking the average of the absolute values of all deviations between the true value and the predicted value. The formula is:
[0062] ;
[0063] Among them, n is the total number of training results after training is completed, y i is the true value, is the predicted value.
[0064] RMSE (Root Mean Squared Error) is obtained by averaging the sum of the squares of all deviations between the true value and the predicted value and then taking the root. The formula is:
[0065] ;
[0066] The root mean square error measures the distribution of these errors and reflects how concentrated the data are around the best fit line.
[0067] MAPE (Mean Absolute Percentage Error) is a relative error measure that uses absolute values to avoid positive and negative errors from canceling each other out. Its formula is:
[0068] ;
[0069] The mean absolute percentage error measures the relative error of the predicted value to the true value;
[0070] S4, obtaining given multi-step observation data;
[0071] S5. Use the optimized traffic prediction model to predict the next multi-step prediction results of the multi-step observation data.
[0072] Three different datasets were used to evaluate the effectiveness of this model, namely: METR-LA dataset, PEMS-BAY dataset, and EXPY-TKY dataset. As shown in Table 1, Table 1 lists the time, place, and method of data collection for the three datasets;
[0073] Table 1
[0074]
[0075] Among them, the METR-LA dataset collects traffic data from 207 sensors in Los Angeles; the PEMS-BAY dataset collects traffic speed data from 325 sensors in the San Francisco Bay Area. The METR-LA and PEMS-BAY datasets are divided in chronological order, with 70% of the data used for training, 10% for validation, and the remaining 20% for testing, that is, the datasets are divided in a 7:1:2 manner. The EXPY-TKY dataset is a new non-stationary dataset that collects traffic speed and corresponding traffic event information from 1,843 highway sections in Tokyo in three months through large-scale vehicle GPS records, with a collection interval of 10 minutes. The dataset uses the data from the first two months for training and validation, and the data from the last month for testing.
[0076] For the EXPY-TKY dataset, the encoder and decoder structures of the proposed model are both composed of 1 RNN layer, where the number of hidden units is set to 32. 10 meta-nodes are retained in the memory unit, each of which is a 32-dimensional learnable vector.
[0077] On the METR-LA dataset and PEMS-BAY dataset, the observation step length and forecast range are all set to 12, and on the EXPY-TKY dataset, and Both are set to 6.
[0078] Adam is used as the optimizer for training the network, where the learning rate is set to 0.01 and the batch size is set to 64. The optimizer will stop early if the validation loss converges within 20 epochs, otherwise the training will stop after 200 epochs.
[0079] The effectiveness of the traffic prediction model STMeG proposed by this method is evaluated by comparing it with four existing models. The four existing models are:
[0080] (1) STGCN: STGCN is a general framework for processing structured time series. It can not only solve traffic network modeling and prediction problems, but also be applied to more general spatiotemporal sequence learning tasks. The spatiotemporal block of STGCN combines graph convolution and gated spatiotemporal convolution to extract the most useful spatial features and coherently capture the most essential spatiotemporal features.
[0081] (2) GMAN: GMAN proposes a spatiotemporal attention mechanism that can better model dynamic spatial correlation and nonlinear temporal correlation. The model adopts an Encoder-Decoder structure and adds an attention layer to transform the encoded historical features to generate future feature representations.
[0082] (3) MTGNN: MTGNN proposes a graph learning layer that can adaptively extract sparse graph adjacency matrices from data. In addition, based on the learned graph adjacency matrix, the authors use a graph convolution module to learn spatial dependencies between variables. In terms of temporal convolution, the authors propose an expanded inception layer to process longer sequence temporal data.
[0083] (4) PM-MemNet: PM-MemNet utilizes a memory network to match input data with representative patterns with a key-value memory structure. The model first extracts and clusters representative traffic patterns as keys in the memory structure. Then, by matching the extracted keywords with the input, PM-MemNet obtains the necessary information about the existing traffic patterns from the memory structure and uses it to make predictions.
[0084] Comparative analysis of experimental results
[0085] In order to verify the effectiveness of the model proposed in this invention, a large number of performance comparison experiments were conducted with existing methods. The proposed model framework and experimental results are shown in Table 2, Table 3, Figure 5 , Figure 6 and Figure 7 As shown:
[0086] Table 2
[0087]
[0088] Table 2 shows the performance of various traffic prediction models on different data sets. It can be seen from Table 2 that the traffic prediction model STMeG proposed in the present invention shows excellent prediction performance on all three data sets. This result fully verifies the effectiveness and robustness of the traffic prediction model STMeG in processing dynamic traffic flow prediction tasks. At the same time, the PM-MemNet and MTGNN models also show good prediction performance, thanks to their use of the powerful backbone network WaveNet, which can capture more complex local and global dependencies when processing time series. CCRNN shows better performance on the EXPY-TKY dataset than on the METR-LA and PEMS-BAY datasets. This is mainly because CCRNN uses the 0-1 adjacency matrix of the road network to provide a good initialization for the learnable graph structure, while such information is not provided in the METR-LA and PEMS-BAY datasets, resulting in disadvantages in structure and information initialization. However, STGCN, and GMAN do not perform as well as other models on the EXPY-TKY dataset, especially when the number of nodes increases. The self-attention mechanism they adopt is unable to effectively handle such a large-scale network structure.
[0089] Figure 5 , Figure 6 and Figure 7 Ablation experiments on the datasets METR-LA, PEMS-BAY, and EXPY-TKY are shown respectively. To facilitate the description of the ablation model, the traffic prediction model STMeG is divided into the following modules: ① encoder-decoder module; ② meta-node library module; ③ super network module. Modules ② and ③ are collectively called meta-graph learner modules.
[0090] In order to better evaluate the actual performance of each component of the model proposed in this invention, a series of variants of the traffic prediction model STMeG are defined: 1) STMeG w / ①, which means that the ablation model only retains the ① encoder-decoder module of STMeG and lets the encoder and decoder share the same adaptive graph. 2) STMeG w / ①③, which means that the ablation model contains the ③ super network module of STMeG and uses a memory network as a meta-node library to enhance the hidden state from the encoder to obtain M t Similarly, the encoder and decoder share the same adaptation graph. 3) STMeG w / ①②③, which means that the ablation model contains the super network and meta node library of STMeG, and uses the super network to transform the encoder’s hidden state H t Convert it into an instantaneous image and provide it to the decoder. 3) Figure 6, we can see that compared with STMeG w / ①②, STMeG w / ①②③ achieves higher performance improvement on the basis of STMeG w / ①. This is because STMeG w / ①② needs to learn an independent graph for each sample in each batch, which increases the complexity of the model.
[0091] Table 3
[0092]
[0093] Table 3 shows the parameters and MAE performance comparison of each traffic flow prediction model. This experiment takes the EXPY-TKY dataset as an example. Compared with METR-LA and PEMS-BAY, EXPY-TKY is larger in scale. Figure 5 It can be seen that the model proposed in this invention has the smallest average MAE despite the second smallest number of training parameters. MTGNN, which has a similar MAE performance to the model of this invention, has approximately 8 times the number of parameters of our model, because MTGNN involves dot product operations on large data tensors, which is very memory / time consuming. In general, our model takes up less memory at runtime and achieves lower computational complexity while maintaining relatively high efficiency.
[0094] The technical solution of the present invention is not limited to the above-mentioned specific embodiments. All technical variations made according to the technical solution of the present invention fall within the protection scope of the present invention.
Claims
1. Traffic flow prediction method based on spatiotemporal meta-graph learning, characterized in that: include: S1. Build an initial traffic prediction model. The initial traffic prediction model includes a meta-graph learner, an encoder, and a decoder. The meta-graph learner includes a super network and a meta-node library. , a fully connected layer and an enhanced representation layer, the encoder includes α first space-time graph networks STG from input to output, α time series are input into α first space-time graph networks STG in chronological order, and the decoder includes α second space-time graph networks STG from input to output; The encoder is used to extract spatiotemporal features, the super network is used to generate node embeddings and adjust them based on meta nodes. The meta node library stores time series in the form of multiple nodes. The fully connected layer is used to project the spatiotemporal features to a local query vector. The enhanced representation layer is used to enhance the representation of spatiotemporal features based on the local query vector. The decoder is used to concatenate the spatiotemporal features of the input time series and the enhanced features of the spatiotemporal features, and decode them to predict the traffic flow in the future time step. The output of the super network is used as the input of the encoder, the output of the encoder is used as the input of the fully connected layer, the output of the fully connected layer is used as the input of the enhanced representation layer, and the output of the enhanced representation layer and the output of the encoder are both used as the input of the decoder. and d represent the meta node library The number and dimension of memory items, ℝ represents the set of all real numbers; The definition of the meta node library is expressed as: , ; where the superscript i represents the row index, Represents the spatiotemporal characteristics H t The hidden state of the i-th node in , Indicates that a fully connected layer is used to hide the state A local query vector projected to, the fully connected layer parameters are ;Will With each memory vector Perform matching to calculate scalar Memory read operations, scalar Representation vector and memory vector Similarity between; meta-node vector Can be restored as a combination of memory items, express The transpose of , exp() is the abbreviation of the exponential function with the natural number e as the base, is the bias term of the fully connected layer; The super network generates node embeddings for graph structure learning based on the meta-node library. The node embedding generation process is expressed as: , where NN H represents a super network, implemented with a fully connected layer, E' represents the generated nodes, represents the learned spatiotemporal meta-graph; The first spatiotemporal graph network STG extracts features expressed as: ; ;in and Represent graph convolution operations respectively The input and output of and is the kernel parameter approximated to order K by Chebyshev polynomials, k∈K, is an activation function, , r, and C represent the update gate, reset gate, and candidate hidden state in the first spatiotemporal graph network STG, respectively; 、r t , C t Represent the update gate, reset gate and candidate hidden state of the tth step respectively; represents the calculated bias of the network parameters, Represents the approximation to kth order using Chebyshev polynomials , H t , H t-1 are the hidden states of the t-th and t-1-th steps respectively, Expressed as the corresponding network parameters, Auxiliary input representing the topological structure of the adaptive graph G, matrix It is constructed based on metrics and empirical laws, where N represents the number of spatial unit entities; S2, obtain the training set and divide it into training data, verification data and test data; S3, the training data, the verification data and the test data are respectively imported into the model trainer, the model verifier and the model tester, the initial traffic prediction model is trained and optimized, and the optimized traffic prediction model is obtained; S4, obtaining given multi-step observation data; S5. Use the optimized traffic prediction model to predict the next multi-step prediction results of the multi-step observation data.
2. The traffic flow prediction method based on spatiotemporal meta-graph learning according to claim 1 is characterized in that: The specific training optimization process includes: ①. Set the number of times N that the model trainer trains the traffic prediction model and start training; ② The adaptive graph G is embedded through the super network transformation of the meta-graph learner to generate a spatiotemporal meta-graph with node embedding ; ③ At the beginning of the time step, the space-time meta-graph and time series The encoder performs convolution operation on the input graph data from the perspective of time to extract the spatiotemporal features. In each subsequent time step, the remaining α-1 time series inputs are sequentially input into the encoder to obtain the encoding result spatiotemporal features H t ; ④、The fully connected layer and enhanced representation layer of the meta-graph learner transform the spatiotemporal features H t Converted into enhanced representation M t ; ⑤. In the first time step of the decoder, the spatiotemporal features H of the input time series are t and the enhanced spatiotemporal features M t concatenated and input into the subsequent second spatiotemporal graph network STG for decoding to predict the traffic flow in the future time step; ⑥. Calculate the contrast loss L1 and consistency loss L2; ⑦. Add the contrast loss L1 and consistency loss L2 to the mean absolute error to get the loss value L of the current training round. task , the loss value L task The data is input into the Adam optimizer to obtain the gradient of the model parameters, and then the parameters of the entire current traffic prediction model are updated through the back propagation algorithm. ⑧. Use the data generated by the model validator to measure the performance of the current turn flow prediction model and print the results; ⑨. Determine whether the current number of training times is equal to N. If so, return to ② and proceed to the next round of training; otherwise, end the training, save the model parameters, and enter ⑩; ⑩. Input the test data into the trained traffic prediction model, use the model tester to test the model performance, and then evaluate the model performance.
3. The traffic flow prediction method based on spatiotemporal meta-graph learning according to claim 2 is characterized in that: The contrast loss L1 is expressed as: ; The consistency loss L2 is expressed as: ; Loss value L task It is expressed as: ; Where T represents the total number of samples in the training set, p and n represent the given local query vector In the case of Take the first two elements of the sorted memory vector; The most similar As a positive sample, the second similar Considered as negative samples, represents the difference between positive samples and negative samples, and k1 and k2 are balancing factors.
