A traffic flow prediction method based on a space-time graph wavelet convolutional neural network
By constructing a traffic flow prediction model based on spatiotemporal graph wavelet convolutional neural network, the problem of existing methods failing to effectively capture spatiotemporal dependencies is solved, achieving efficient traffic flow prediction, especially accurate prediction in the short, medium and long term.
Patent Information
- Application Number
- CN202210260593.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-03-16
AI Technical Summary
Existing traffic flow prediction methods fail to effectively capture the spatiotemporal dependencies between nodes during modeling, resulting in inadequate performance in short-term, medium-term, and long-term predictions.
A traffic flow prediction model based on the spatiotemporal graph wavelet convolutional neural network (STGWCNN) is constructed by combining a spatiotemporal feature extraction layer and a prediction output layer with graph wavelet convolutional neural network and time-gated convolutional layer to fully capture the spatiotemporal dependencies of traffic flow data.
It improves the accuracy and flexibility of traffic flow prediction, effectively predicting traffic flow in the short, medium and long term, and has a fast calculation speed, capable of capturing the spatial topological relationships between adjacent nodes.
Smart Images

Figure CN114626607B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic flow prediction, specifically relating to a traffic flow prediction method based on a spatiotemporal graph wavelet convolutional neural network. Background Technology
[0002] With the continuous improvement of people's living standards, the number of private cars is increasing rapidly every year, and private travel has become the preferred mode of transportation for modern people. Consequently, traffic problems are also on the rise. How to better achieve traffic control to effectively improve traffic guidance rates, thereby increasing travel efficiency and alleviating traffic pressure, has become one of the focuses of modern transportation research. This has led to more researchers exploring Intelligent Transportation Systems (ITS). In ITS, traffic data collection and short-term traffic flow prediction are among its key technologies and important bases for the control and scheduling of intelligent traffic management systems. High-precision prediction can provide travelers with accurate and reliable dynamic route guidance schemes, improving the execution efficiency of intelligent traffic management systems.
[0003] However, in the modeling process of traffic flow prediction tasks, how to simultaneously capture the spatiotemporal dependencies of traffic flow data remains a core issue in modeling research. Previous spatiotemporal graph network modeling has either focused on the relational modeling of the graph structure or on the temporal modeling of nodes, largely neglecting the spatial and temporal relationships between nodes. In reality, in the real world, sensors acquiring traffic flow data act as network nodes, and each node is influenced not only by its current state but also by its neighboring nodes. Furthermore, the state of each node is also affected by the accumulation of historical states. Therefore, modeling methods for spatiotemporal graph networks that lack consideration of the spatiotemporal dependencies between nodes are somewhat inadequate in capturing long-term spatiotemporal trends between nodes. Summary of the Invention
[0004] The purpose of this invention is to provide a traffic flow prediction method based on spatiotemporal graph wavelet convolutional neural network, taking into account the complex temporal and spatial dependencies of traffic flow data in traffic flow prediction tasks, and combining graph neural networks in deep learning.
[0005] To achieve the above objectives, the technical solution of the present invention is: a traffic flow prediction method based on a spatiotemporal graph wavelet convolutional neural network, comprising:
[0006] S1. Traffic flow data preprocessing;
[0007] S2. Establishment of traffic flow prediction model;
[0008] S3. Traffic flow prediction model training and parameter tuning;
[0009] S4. Traffic flow prediction is performed based on the traffic flow prediction model optimized in step S3.
[0010] In one embodiment of the present invention, step S1 is implemented as follows: select the public transportation dataset PEMS-BAY, divide the dataset into three parts—training set, validation set, and test set—in a 7:1.5:1.5 ratio according to time order, perform a shuffle operation, and use the Z-Score method to uniformly standardize the traffic flow dataset.
[0011] In one embodiment of the present invention, the traffic flow prediction model, namely the STGWCNN model, includes a spatiotemporal feature extraction layer and a prediction output layer; the spatiotemporal feature extraction layer includes two spatiotemporal convolutional blocks, which are used to extract the spatiotemporal features of traffic flow data, wherein each spatiotemporal convolutional block contains two time-gated convolutional layers and a graph wavelet convolutional neural network layer; the prediction output layer includes a time convolutional layer, a fully connected layer, a sigmoid layer, and a fully connected layer connected in sequence.
[0012] In one embodiment of the present invention, the STGWCNN model adopts a "sandwich" structure with large ends and a small middle to fully utilize the bottleneck strategy. It uses graph wavelet neural network layers to scale down and up the channels to achieve scale compression and feature compression. Functionally, the graph wavelet convolutional neural network layers capture the spatial topology of spatiotemporal sequence data, which can effectively learn localized and sparse feature representations, while improving the network's expression effect and flexibility. The temporally gated convolutional layers stack causal convolutions through gated linear units, which can better achieve the purpose of extracting the temporal dependence of spatiotemporal sequences.
[0013] In one embodiment of the present invention, for the input spatiotemporal graph sequence data G t ={G t-1 …G t-m …G t-H+1 After step S1, the data first passes through two spatiotemporal convolutional blocks, then is input into a time convolutional layer with a gated structure, followed by a fully connected layer, then through a sigmoid function before being input into the next fully connected layer, and finally the predicted output G is output. t+P Throughout the training process of the traffic flow prediction model, the loss function, optimizer function, and learnable hyperparameters are adjusted to find the hyperparameter combination that best performs the traffic flow prediction model on the test set, thus establishing the final traffic flow prediction model.
[0014] Compared with the prior art, the present invention has the following advantages: the spatiotemporal convolutional block constructed by the method of the present invention can fully extract the spatiotemporal dependencies of traffic flow data, and the constructed traffic flow prediction model has good performance in short-term (prediction duration of 15 minutes), medium-term (prediction duration of 30 minutes), and long-term (prediction duration of 60 minutes) traffic flow prediction tasks. The model can flexibly adjust the neighborhood range of nodes, and the more sparsity graph wavelet transform not only speeds up the calculation speed, but also can capture the adjacent spatial topological relationships centered on each node very well. Attached Figure Description
[0015] Figure 1 This is a diagram illustrating the architecture of the traffic flow prediction method based on spatiotemporal graph wavelet convolutional neural network of this invention. Detailed Implementation
[0016] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0017] This invention provides a traffic flow prediction method based on a spatiotemporal graph wavelet convolutional neural network, comprising:
[0018] S1. Traffic flow data preprocessing;
[0019] S2. Establishment of traffic flow prediction model;
[0020] S3. Traffic flow prediction model training and parameter tuning;
[0021] S4. Traffic flow prediction is performed based on the traffic flow prediction model optimized in step S3.
[0022] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0023] 1. Problem Definition and Analysis
[0024] A fundamental assumption behind traffic flow prediction modeling is that a node's future information depends on its historical information and that of its neighbors. Spatiotemporal graph modeling, as a crucial method in traffic flow data research, primarily studies how to capture the spatiotemporal dependencies of spatiotemporal data through spatiotemporal graph network models. Given a spatiotemporal sequence graph G with H historical state features... t = {G t-1 …G t-m …G t-H+1}, establish a spatiotemporal graph network model, that is, construct a function mapping relationship, namely Gt +P = F(G t-1 …G t-m …G t- H+1) is used to predict the results over P future time steps. The traffic flow prediction model is defined as shown in formula (1):
[0025] G t+1 G t+2 , ..., G t+P =arg max logF(G t+1 G t+2 , ..., G t+P |G t-H+1 , ..., G t (1)
[0026] 2. This invention relates to a traffic flow prediction method based on a spatiotemporal graph wavelet convolutional neural network.
[0027] The STGWCNN model proposed in this invention mainly consists of two parts: a spatiotemporal feature extraction layer and a prediction output layer. The spatiotemporal feature extraction layer comprises two spatiotemporal convolutional blocks, each containing two temporal convolutional layers and one spatial convolutional layer. The prediction output layer includes a temporal convolutional layer, a fully connected layer, and a sigmoid layer. The specific operation is as follows:
[0028] Spatial Convolutional Layers: Wavelet transform defines a method for transforming signals from the nodal domain to the spectral domain. In graph wavelet transform, the graph signal is projected from the nodal domain to the spectral domain using a set of wavelet ψ... s =(ψ s1 , ψ s2 ,…,ψ sn ) serves as the basis. Each wavelet ψ si Corresponding to a signal that diffuses from node i onto the graph, s is a hyperparameter that acts as a scaling factor, used to adjust the neighborhood range of a node. Mathematically, ψ si It can be written as formula (2):
[0029] ψ s =UG s U T (2)
[0030] G s =dig((g(sλ1),(g(sλ2),…,(g(sλ n ))) is a sparse diagonal matrix, and Where U represents the feature vector. Introducing the graph convolution operator, using "*"... G “ represents the graph convolution operation, and Θ represents the convolution kernel. Then, for an input signal x, the graph wavelet convolution with wavelet as the basis is defined as follows:
[0031] x* G Θ=ψ s (ψ s -1 x)⊙(ψ s -1 Θ) (3)
[0032] Where ⊙ represents the Hadamard product, represented by a diagonal matrix g. θ Instead of ψ s -1 Θ, so the signal x∈R n After filtering, convolution kernel g θ The spectral convolution can then be equivalently expressed as formula (4):
[0033] x* G Θ=ψ s g θ ψ s -1 x (4)
[0034] Where ψ s =UG s U T =(ψ s1 , ψ s2 ,…,ψ sn ), ψ s -1 =(ψ s1 * , ψ s2 * ,…,ψ sn * ) is ψ s The inverse transform. Taking full advantage of the graph wavelet transform, formula (4) defines the graph convolution of two-dimensional variables as "x* G Θ". For a spatiotemporal graph prediction task, the input consists of H frames of time-series data with a graph structure. Each frame's... (here C) i In this invention, C represents the dimension of the input data. i =1), which can be viewed as a matrix. Its i-th column is graph G. t V at the i-th node t C i For each step size t of H, parallel graph wavelet convolution is performed using the same convolution kernel. Therefore, graph convolution can be further extended to three-dimensional variables, i.e., using... Indicates "x*" G Θ.
[0035] Temporal Convolutional Layers: Extracting temporal dependencies is another important task in spatiotemporal graph modeling. Although RNN-based models are widely used in time series analysis, recurrent networks used for traffic flow prediction still suffer from problems such as time-consuming iterations, complex gating mechanisms, and slow response to dynamic changes. In contrast, using convolutional neural networks (CNNs) for time series prediction tasks has the advantages of fast training speed, simple structure, and independence from previous steps. Therefore, this invention employs the entire convolutional structure along the time axis to capture the temporal dynamics of traffic flow. This special design allows for parallel and controllable training processes through hierarchical representations formed by multiple layers of convolutional structures. The gating mechanism has been proven in modeling sequential data problems. By embedding causal convolutions into the structure of gated linear units (GLUs), in the temporally gated convolutional layer, the input sequence of each node... The result will be divided into two parts. After passing through the causal convolution formula (9), one part will be processed by σ (representing the Sigmoid function) and output as P; the other part will be processed by a residual connection to prevent feature loss and output as Q. Finally, the output of the temporally gated convolution is P, and Q is calculated using the Hadamard method. In this invention, for the input is (here C) i In this invention, C represents the dimension of the input data. i =1), the kernel of causal convolution is K. t Then the length of the sequence reduced by K times for each causal convolution. t -1 means Let the kernel of the time-gated convolution be... Then the time-gated convolution can be expressed as formula (5):
[0036]
[0037] in* c denoted by time-gated convolution operation, σ(·) represents the Sigmoid function, and ⊙ represents the Hadamard product.
[0038] Spatiotemporal convolutional layers: To fuse features from both the spatial and temporal domains, spatiotemporal convolutional blocks are constructed to jointly process graph-structured time-series gated linear units. These blocks can be stacked or expanded according to the scale and complexity of specific situations, such as... Figure 1 As shown. For the input The output after two spatiotemporal convolutional blocks is The formula is shown as (6):
[0039]
[0040] in Θ represents the sizes of the first and second temporally gated convolutional kernels in the l-th convolutional block, respectively. l This represents the kernel size of the graph wavelet convolutional layer; ReLU(·) represents the activation function.
[0041] Prediction Output Layer: The input spatiotemporal graph sequence data is passed through two stacked temporal convolutional layers and then fed into an additional temporal convolutional layer to map it as a single-step prediction. Finally, a linear transformation of channel c is applied to the model's output Z to obtain the final prediction result. where w∈R c Let b be the weight vector and b be the bias. This invention uses L2 loss to measure the performance of our model. Therefore, the loss function of the STGWCNN model for the prediction task is Equation (7):
[0042]
[0043] Among them W θ V represents the learnable parameters of the model. t+1 Represents the actual value; This indicates the model's prediction results.
[0044] The overall implementation algorithm of the method of this invention is as follows:
[0045]
[0046] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A traffic flow prediction method based on a spatiotemporal graph wavelet convolutional neural network, characterized in that, include: S1. Traffic flow data preprocessing; S2. Establishment of traffic flow prediction model; S3. Traffic flow prediction model training and parameter tuning; S4. Traffic flow prediction is performed based on the traffic flow prediction model optimized in step S3. The traffic flow prediction model includes a spatiotemporal feature extraction layer and a prediction output layer. The spatiotemporal feature extraction layer includes two spatiotemporal convolutional blocks, each containing two temporal convolutional layers and one spatial convolutional layer. The prediction output layer includes a temporal convolutional layer, a fully connected layer, a sigmoid layer, and a fully connected layer connected in sequence. Spatial convolutional layer: with "* G " represents the graph convolution operation, Θ represents the convolution kernel, and for an input signal x, the wavelet ψ is applied..." s =(ψ s1 ,ψs2,…,ψ sn The graph wavelet convolution with the basis is defined as follows: x* G Θ=ψ s (ψ s -1 x)⊙(ψ s -1 I) ⊙ represents the Hadamard product, represented by a diagonal matrix g. θ Instead of ψ s -1 Θ, signal x∈R n After g θ The spectral convolution is then equivalently represented as: x* G Θ=ψ s g θ ψ s -1 x ψ s -1 For ψ s inverse transform; For input time-series data with a graph structure consisting of H frames, each frame C i To represent the dimension of the input data, parallel graph wavelet convolution operations are performed for each stride t of H using the same convolution kernel. Graph convolution is further extended to three-dimensional variables, i.e., using... Represents x* G Θ; Temporal convolutional layer: for input as The kernel of causal convolution is K. t Each time a causal convolution is performed, the length of the time series is reduced by K. t -1 means Let the convolution kernel of the temporal convolutional layer be The temporal convolutional layer is then represented as: * c Indicates a temporal convolution operation; Spatiotemporal convolutional blocks: To fuse features from both the spatial and temporal domains, spatiotemporal convolutional blocks are constructed to jointly process graph-structured time-series gated linear units. The blocks themselves can be stacked or expanded according to the size and complexity of specific situations. For the input... The output after two spatiotemporal convolutional blocks is Represented as: in Θ represents the kernel size of the first and second temporal convolutional layers in the l-th temporal convolutional block, respectively. l It represents the kernel size of the spatial convolutional layer; ReLU(·) represents the activation function; Prediction output layer: The input spatiotemporal graph sequence data is fed into an additional temporal convolutional layer after passing through two stacked temporal convolutional layers, which maps it to a single-step prediction; Finally, a linear transformation of channel c is performed on the model's output Z to obtain the final prediction result. where w∈R c Let b be the weight vector and b be the deviation.
2. The traffic flow prediction method based on spatiotemporal graph wavelet convolutional neural network according to claim 1, characterized in that, The implementation method of step S1 is as follows: Select the public transportation dataset PEMS-BAY, divide the dataset into three parts, namely training set, validation set and test set, in chronological order at a ratio of 7:1.5:1.5, and perform a shuffle operation. Then, use the Z-Score method to standardize the traffic flow dataset.
3. The traffic flow prediction method based on spatiotemporal graph wavelet convolutional neural network according to claim 1, characterized in that, The traffic flow prediction model adopts a "sandwich" structure with large ends and a small middle to fully utilize the bottleneck strategy. The graph wavelet convolutional neural network layer performs down-scaling and up-scaling on the channels to achieve scale compression and feature compression.
4. The traffic flow prediction method based on spatiotemporal graph wavelet convolutional neural network according to claim 1, characterized in that, For the input spatiotemporal graph sequence data G t ={G t-1 …G t-m …G t-H+1 After step S1, the data first passes through two spatiotemporal convolutional blocks, then is input into a time convolutional layer with a gated structure, followed by a fully connected layer, then through a sigmoid function before being input into the next fully connected layer, and finally the predicted output G is output. t+P Throughout the training process of the traffic flow prediction model, the loss function, optimizer function, and learnable hyperparameters are adjusted to find the hyperparameter combination that best performs the traffic flow prediction model on the test set, thus establishing the final traffic flow prediction model.
Citation Information
Patent Citations
Traffic flow prediction method and system for urban road network
CN112183862A