A traffic flow prediction method based on a multi-mode dynamic memory graph convolution network
The multi-mode dynamic memory graph convolutional network (MM-DMGCN) solves the problem of insufficient capture of dynamic changes in spatiotemporal relationships in existing traffic flow prediction methods, achieves higher prediction accuracy and robustness, can cope with emergencies and abnormal situations, and enhances the interpretability of the model.
Patent Information
- Application Number
- CN202411122085.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Existing traffic flow prediction methods fail to effectively capture the dynamic changes of spatiotemporal relationships in traffic data, especially the spatiotemporal dependencies between different time steps and nodes, resulting in insufficient prediction accuracy.
A multi-mode dynamic memory graph convolutional network (MM-DMGCN) is adopted to dynamically adjust the adjacency matrix through a temporal feature extraction module, a bidirectional memory recurrent network, a memory dynamic graph convolutional network and a dynamic adjacency matrix update method to capture the spatiotemporal dependency changes in the transportation network.
The accuracy and robustness of traffic flow predictions are improved, enabling better response to emergencies and abnormal situations, and enhancing the interpretability of the model.
Smart Images

Figure CN119107798B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation technology and relates to a traffic flow prediction method based on a multi-mode dynamic memory graph convolutional network. Background Art
[0002] With the rapid development of Intelligent Transportation Systems (ITS) and the increasing volume of urban traffic data, accurate traffic flow forecasting is becoming increasingly important in real-world transportation networks. Traffic flow forecasting not only helps alleviate traffic congestion and improve road efficiency, but also provides a scientific basis for urban planning and traffic management. In the context of smart city development, an increasing number of sensors are being installed and deployed on urban roads to collect real-time traffic data. However, the complexity and nonlinear nature of traffic data make accurate traffic forecasting a significant challenge.
[0003] Early traffic flow prediction models primarily relied on statistical methods and machine learning algorithms, but these models were unable to capture the highly complex, nonlinear characteristics of traffic data. In recent years, deep neural networks have demonstrated outstanding performance in processing time series, and many deep learning-based methods have been widely applied to traffic prediction tasks. Some researchers have attempted to use graph neural networks (GNNs) to extract spatiotemporal dependencies from non-Euclidean multi-sensor data. Currently, these approaches typically construct spatial graphs with predefined or data-adaptive adjacency matrices, capture the correlations between spatial nodes at each time step through GNNs, and use recurrent neural networks (RNNs) or transformers to connect each node to itself between adjacent time steps to capture information from temporally adjacent nodes. However, these methods are often limited by static spatial modeling and fail to accurately capture the dynamic and complex relationships between time and space. Specifically, they fail to fully extract the spatiotemporal relationships between different time steps and nodes, including the dynamic changes in these relationships, thus compromising prediction accuracy.
[0004] Therefore, more effective methods are needed to extract the spatiotemporal relationships between different time steps and nodes, including the dynamic changes in spatiotemporal relationships, and consider assigning different spatiotemporal fusion graphs to different traffic modes. By dynamically adjusting the adjacency matrix and introducing more complex spatiotemporal fusion mechanisms, the changes in spatiotemporal dependencies in the traffic network can be more accurately captured, thereby achieving more precise traffic flow prediction. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a traffic flow prediction method based on a Multi-Mode Dynamic Memory Graph Convolutional Network (MM-DMGCN). This method aims to address the problems existing in current methods, such as insufficient extraction of spatiotemporal correlations, insufficient consideration of periodic features, and failure to fully capture the overall spatiotemporal characteristics and dynamic evolution correlations in the traffic network in the model. In addition, these studies often ignore the potential of adjacency matrices learned from real-time traffic data and the memory of valuable traffic patterns at each traffic node.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] In the first aspect, the present invention provides a traffic flow prediction method based on MM-DMGCN, which takes into account the extraction of periodic features and typical historical traffic patterns (HTTP) and a dynamic adjacency matrix that evolves over time.
[0008] The multi-scale dynamic fusion graph convolutional network includes the following steps:
[0009] S1: Temporal feature extraction model based on aggregated convolutional network;
[0010] S2: Bi-MRNM-based periodic feature capture model;
[0011] S3: Dynamic graph convolutional model based on HTTP;
[0012] S4: Dynamic adjacency matrix update method based on GRU recurrent network;
[0013] S5: Traffic flow prediction method based on MM-DMGCN.
[0014] Secondly, in step S1 of this embodiment of the present invention, the Temporal Feature Extraction Module (TFEM) is designed to capture complex temporal correlations in high-dimensional spatiotemporal representations through a convolutional sliding window and aggregate and reduce the dimensionality of temporal features. This module efficiently captures temporal correlations and integrates temporal information into the feature dimension, reducing computational complexity while preserving important temporal features.
[0015] Thirdly, in step S2 of this embodiment of the present invention, a bidirectional memory recurrent network module (Bi-MRNM) is used to extract the periodic characteristics of traffic flow through a long short-term memory network (LSTM) and a gated recurrent unit (GRU) module. The Bi-MRNM can capture temporal dependencies from both the forward and backward directions, while the GRU module, through its built-in gating mechanism, effectively memorizes and forgets information, extracting periodic variation characteristics.
[0016] Specifically, Bi-MRNM utilizes LSTM to handle long-term periodic dependencies while leveraging GRU to improve computational efficiency and convergence speed. Bi-MRNM aims to enhance adaptive perception of the periodicity and trends in traffic data through adaptive learnable embeddings. After capturing the temporal and periodic characteristics of traffic data, the two feature representations are fused to form a comprehensive feature representation. This method considers the temporal dimension of each node in the traffic network as its potential spatial representation and integrates temporal information into the feature dimension. This approach not only reduces the number of model parameters but also effectively preserves the model's temporal information.
[0017] In a fourth aspect, in step S3, the embodiments of the present application propose a dynamic graph convolutional framework with memory mode (Memory Dynamic Graph Convolutional, MDGCN) to dynamically capture the spatial correlation between nodes. The module mainly consists of a diffusion graph convolutional layer (Diffusion Graph Convolutional Layer, DGCL), a fully connected layer, an attention layer, a typical traffic pattern interaction layer, a graph generator, and a residual connection layer. Specifically, first, the input node feature matrix and the dynamic adjacency matrix are processed by the diffusion graph convolutional layer to generate new node representations. Then, these features are passed to the fully connected layer for high-order feature extraction and transformation. Next, the attention layer dynamically adjusts the weights of the node features by calculating the attention weight matrix between the node features, highlighting the relationships between important nodes. In this process, the typical traffic pattern interaction layer interacts and fuses the typical traffic patterns and hidden features of different time periods to form comprehensive features, enhancing the model's ability to capture hidden dynamic spatial correlations between nodes. Then, the generated hidden feature representation is sent to the graph generator, which mainly includes a series of neural network layers to generate a new dynamic adjacency matrix. By learning the similarity between nodes and generating a dynamic adjacency matrix, the dynamic spatial relationships between nodes in the traffic network can be better captured. Subsequently, the initial adjacency matrix and the dynamic adjacency matrix are fused, allowing the model to consider both static and dynamic features. Finally, the residual connection layer fuses the input features with the features processed by each layer to maintain the transmission of original information and enhance the stability of the model. Through this design, the model can dynamically capture the spatial correlation between nodes, improving the accuracy and robustness of traffic flow prediction.
[0018] In a fifth aspect, in step S4, the embodiments of the present application design a new dynamic adjacency matrix A I to replace the original static adjacency matrix, which enhances the model's ability to capture complex data. At the same time, the present application designs a new adjacency matrix definition method based on spatial structure, which extracts distance spatial information by calculating the correlation of node hierarchy in the distance graph, more comprehensively describing the spatial correlation between nodes.
[0019] In this model, the initial adjacency matrix A I is defined based on the physical connection relationship of the traffic network and historical data. To better capture the dynamic change characteristics of traffic flow, a GRU gating mechanism is introduced to update the adjacency matrix. Specifically, the input traffic flow data sequence X t is processed by the GRU unit to generate a hidden state H. The GRU gating mechanism combines the input data and the hidden state to output a dynamic adjacency matrix A IThis dynamic adjacency matrix can reflect the changing node connection relationship over time, capture more accurate spatio-temporal features, and improve the accuracy and robustness of traffic flow prediction. By dynamically updating the adjacency matrix, the model has the ability to adapt to traffic flow changes and can better handle emergencies and abnormal situations.
[0020] In the sixth aspect, the embodiments of the present application aim to integrate the features extracted and processed by the aforementioned modules to generate the final prediction result of traffic flow. This module mainly consists of linear layers and fully connected layers to ensure the accuracy of the output and the efficiency of the model.
[0021] The beneficial effects of the present application are:
[0022] (1) More comprehensive spatio-temporal feature extraction
[0023] Temporal Feature Extraction Module (TFEM): Through time embedding encoding and temporal aggregation convolution, it effectively captures the temporal correlation in high-dimensional spatio-temporal data and integrates it into the feature dimension, preserving important temporal features while reducing computational complexity.
[0024] Bidirectional Memory Recurrent Network Module (Bi-MRNM): Combining LSTM and improved GRU, it captures temporal dependencies from both forward and backward directions and extracts periodic variation features, more accurately identifying the periodic patterns of traffic flow.
[0025] Memory Dynamic Graph Convolutional Network (MDGCN): Through diffusion graph convolutional layers, attention mechanisms, and typical traffic pattern interactions, it dynamically captures the spatial correlation between nodes and generates a new dynamic adjacency matrix, more accurately reflecting the changing node connection relationship over time and capturing more comprehensive spatio-temporal features.
[0026] (2) Higher prediction accuracy and robustness
[0027] Dynamic Adjacency Matrix: Replaces static adjacency matrix, better simulates the correlation between detectors in the road network as traffic flow changes dynamically, enhances the model's ability to capture complex data, and improves the accuracy and robustness of prediction.
[0028] Typical Traffic Pattern Memory: Introduces a typical traffic pattern memory bank to dynamically capture hidden dynamic spatial correlations between nodes, further enhancing the model's prediction ability.
[0029] Attention Mechanism: Dynamically adjusts the weights of node features, highlights the relationships between important nodes, captures global dependencies between nodes, and compensates for the limitations of graph convolutional layers that can only capture local relationships.
[0030] (3) Stronger ability to handle emergencies and abnormal situations
[0031] Dynamically update the adjacency matrix: This enables the model to flexibly adapt to changes in traffic flow, better respond to emergencies and abnormal situations, and improve the accuracy and robustness of predictions.
[0032] (4) Model interpretability is stronger
[0033] Multi-module design: Traffic flow prediction is decomposed into multiple modules, each responsible for a specific function, making the model clearer, easier to understand, and more interpretable.
[0034] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings, in which:
[0036] Figure 1 Flowchart of the traffic flow prediction method based on MM-DMGCN;
[0037] Figure 2 The overall model diagram of the traffic flow prediction method based on MM-DMGCN;
[0038] Figure 3 Schematic diagram of the static adjacency matrix generation process;
[0039] Figure 4 Update the model graph for the dynamic adjacency matrix;
[0040] Figure 5 Updated model diagrams for historically representative traffic patterns interaction. DETAILED DESCRIPTION
[0041] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0042] Among them, the accompanying drawings are only for illustrative purposes and represent only schematic diagrams rather than actual pictures, and should not be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the dimensions of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the accompanying drawings.
[0043] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "back", etc. indicating directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. They 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 operate in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0044] Figure 1 FIG. 1 shows a flow chart of a traffic flow prediction method according to an embodiment of the present invention. Figure 1 As shown, the method includes: step 1, data acquisition and data preprocessing, including infrared sensors, traffic cameras or other data acquisition equipment, obtaining raw traffic flow data, cleaning, denoising and normalizing the raw data set to ensure data quality and consistency, dividing the processed data set into traffic flow data with multiple periodic patterns and constructing traffic network signals and adjacency matrices based on the connectivity between sensor nodes. Step 2, sending the constructed traffic flow data with multiple periodic patterns into the time series feature and periodic feature extraction module to capture the flow change characteristics of short-term patterns and daily and periodic patterns, and fusing the two features to form a comprehensive feature vector to provide input for subsequent dynamic spatial correlation capture. Based on the fused comprehensive feature vector, a dynamic graph convolutional neural network is used to extract the dynamic spatial correlation in traffic flow. Step 3, the acquired spatiotemporal characteristics of traffic flow are input into the prediction model for training to obtain the prediction results of traffic flow.
[0045] The traffic flow data of the multiple periodic modes described in step 1 include short-term mode, daily mode, and weekly mode. The short-term mode represents the traffic flow observation records of adjacent time slices, and the daily mode and weekly mode represent the historical traffic flow observation records in the same weekly and monthly cycles as the prediction target. The traffic data of the short-term mode is expressed as:
[0046] [X t-T-1 ,X t-T ,...,X t-1 ,X t] (1)
[0047] The traffic data matrices for daily and weekly modes are as follows:
[0048]
[0049] The purpose of traffic prediction is to use the historical traffic data series X = [X t-T-1 ,X t-T ,...,X t-1 ,X t ] to predict the future traffic signal sequence Y = [Y t-T-1 ,Y t-T ,...,Y t-1 ,Y t This process is essentially a mapping process, mapping the traffic data of a period of history to the traffic data of a period of time in the future. Therefore, this process can be defined as:
[0050] [Y t-T-1 ,Y t-T ,...,Y t-1 ,Y t ]=F([X t-T-1 ,X t-T ,...,X t-1 ,X t ]) (4)
[0051] Where F(·) is a learnable neural network model, and our goal is to obtain a more effective network model through training.
[0052] Figure 2 FIG. 1 shows a model diagram of the traffic flow prediction method according to an embodiment of the present invention. Figure 2 As shown in Figure 1, the model primarily consists of a TFEM, a Bi-MRNM, an MDGCN, and an output module. For short-term patterns, they are fed into a temporal feature capture module to capture their temporal correlations. For daily and weekly patterns, they are fed into a periodic feature capture module to capture the periodic characteristics of the input data. These two features are then fused to form a comprehensive feature representation, which is then used as a dynamic graph convolution module to extract hidden long-term dynamic spatiotemporal dependencies.
[0053] 1. Short-term pattern temporal correlation capture process based on TFEM
[0054] In the traffic flow prediction model, directly using the original timestamp as input may not be able to fully express the complex relationships and patterns of time. By using time embedding coding, time information can be converted into continuous and periodic feature representations to help the model better understand changes in the time dimension. Combining time coding features with node features (such as speed and flow) can be achieved through feature splicing or addition operations. This combination can help the model better capture the relationship between time and space features and improve prediction accuracy. Specifically, trigonometric functions can be used to generate a unique time embedding vector for each time step t, and simple vector operations can be used to model the relative position relationship between time steps. This process is defined as:
[0055]
[0056]
[0057] Where d is the dimension index of the current embedding vector. model is the total embedding dimension. The generated time embedding vector is fused with the input node features as the input of the temporal aggregation convolution module. This module aims to capture the complex temporal correlation in the high-dimensional spatiotemporal representation through the convolution sliding window and aggregate and reduce the dimensionality of the temporal features. First, a one-dimensional convolution operation is applied to the input layer to extract preliminary temporal features; then, through multiple hidden layers, higher-order temporal features are further extracted; in each layer, an activation function is applied to enhance the nonlinear expression capability, and finally a rich temporal feature representation H is generated. T1 .
[0058] 2. Design of a daily cycle pattern feature extraction model based on Bi-MRNM
[0059] The design of the Bi-MRNM-based daily cycle pattern feature extraction model consists of two main components: First, Bi-MRNM captures data dependencies based on the LSTM and GRU bidirectional architecture; second, Bi-MRNM improves on the GRU with the GCN. Because traffic flow, as a time series, has a strong periodicity, the Bi-MRNM input sequence for extracting daily cycle features is centered on the last time slice of the input sequence at the same time yesterday, extending forward and backward by m time intervals.
[0060] In order to improve the computational efficiency and the convergence speed of the model, the present invention introduces a two-layer parallel GRU and LSTM network structure, one layer from left to right (forward LSTM layer) and the other layer from right to left (backward GRU layer), so that the time dependencies in both the forward and backward directions can be taken into account at the same time. Among them, GRU is a variant of LSTM, which is used to solve the problems of gradient vanishing and gradient explosion that occur in traditional RNN when processing long time series. GRU controls the flow of information by introducing update gates and reset gates, thereby achieving effective modeling of time series data, retaining the ability to capture time dependencies, and reducing computational complexity. In order to further enhance the model's ability to capture time dependencies, the present invention extends the fully connected operation of the backward GRU layer to the graph convolutional network. Specifically, each GRU unit contains a GCN operation, and the calculation process of DGCGRU can be defined as:
[0061]
[0062] Among them, z t is the update gate, which determines how much of the hidden state of the current time step comes from the hidden state of the previous time step, σ is the sigmoid activation function, [h t-1 ,x t ] represents the concatenation of the previous hidden state and the current input; z t It is a reset gate that controls the influence of the hidden state of the previous time step on the candidate hidden state; is a candidate hidden state, which combines the current input and the hidden state of the previous time step, and controls the flow of information by resetting the gate; h t is the hidden state of the current time step, which is controlled by the update gate to be a linear combination of the current candidate hidden state and the hidden state of the previous time step; W z and b z are the weight matrices and bias vectors for each definition process, and G(·) represents the graph convolution operation. In the backward GRU layer, the introduction of GCN ensures that the hidden state at each time step depends not only on the preceding and following information in the time series but also on the spatial relationships between nodes, thereby capturing more complex spatiotemporal dependencies. This improvement allows for more effective extraction of the periodic and spatiotemporal features inherent in traffic flow data.
[0063] In Bi-MRNM, the input data will pass through the forward LSTM layer and the backward GRU layer to generate two hidden state sequences H f and H b , these two hidden state sequences are concatenated at each time step, providing richer time-dependent features Finally, the time correlation feature vector of the fused short-term pattern and daily and weekly pattern is used as the input feature H of the subsequent dynamic image convolution module. SThe process can be defined as:
[0064] H S = concat(H T1 ,H T2 ) (8)
[0065] where concat(·) denotes the feature concatenation operation, H T1 and H T2 are concatenated in the feature dimension.
[0066] 3. Dynamic spatio-temporal feature extraction module design with typical traffic pattern memory
[0067] The dynamic spatio-temporal feature extraction module design with typical traffic pattern memory mainly includes an adjacency matrix generation and update module, a diffusion graph convolution layer, a fully connected layer, an attention layer, a traffic pattern interaction layer, a graph generator, and an output layer. The design aims to dynamically capture the spatial correlation between nodes to improve the accuracy and robustness of traffic flow prediction.
[0068] (1) Adjacency matrix generation and update module
[0069] The adjacency matrix definition module mainly includes a static matrix definition module and a dynamic matrix definition module. As shown in Figure 3 , the static matrix mainly considers distance-based graphs and space structure-based graphs.
[0070] (a) Distance-based graphs are constructed by the Haversine distance between sensor nodes and a threshold Gaussian kernel. The definition
[0071] is shown as follows:
[0072]
[0073] where represents the Haversine distance between nodes i and j on the road; σ represents the standard deviation of the metric; ε represents the threshold value that adjusts the sparsity of the distance-based graph adjacency matrix distribution.
[0074] (b) The space structure-based graph is constructed by calculating the correlation of the hierarchical structure of the nodes in the distance graph to extract distance space information. Specifically, first, a structure-aware embedding vector E is derived by performing random walk on the hierarchical graph of struc2vec, and then the hyperbolic distance function is used to measure the correlation between embedding vectors to preserve the hierarchical and local structure information of the derived embedding. The spatial distance index between sensor nodes can be defined as follows:
[0075]
[0076] where Ei ,E j represents the sensor embedding vector; arcosh(·) represents the inverse hyperbolic cosine function. After obtaining the spatial distance index, the threshold Gaussian kernel is also used to construct the static spatial matrix. The definition is as follows:
[0077]
[0078] In order to prevent the introduction of unnecessary or even negative information into the node representation in the message passing module, the present invention considers learning pre-connected edges in distance-based graphs and structure-based graphs, and uses predefined distance-based and structure-based adjacency matrices to multiply the learnable matrix. Figure 3 As shown in Figure 2, the learnable matrix consists of the product of two node embeddings G1 and G2. Its definition is as follows:
[0079]
[0080] in To learn the matrix, updates are done via backpropagation during the training phase. By dynamically adjusting the connections of static matrices through the Hadamard inner product, the impact of incorrect or incomplete prior knowledge is alleviated.
[0081] The correlation between nodes in the road network changes with the characteristics of traffic flow. In order to simulate the changes in the relationship between nodes at different times, the present invention uses a dynamic adjacency matrix A I To replace the originally defined static matrix A0, where A0 = A sta .
[0082] like Figure 4 As shown in the figure, the Dynamic Adjacency Matrix Update Module (DAMUM) implements this process. Specifically, first, the input road network flow features and the adjacency matrix are reshaped: 1. The adjacency matrix is encoded, then expanded and repeated to match the length of the time step. 2. The road network flow and the encoded adjacency matrix are spliced in the feature dimension to form a combined feature. These combined features will be passed as input to the GRU recurrent module. Then, each layer of GRU will process these combined features, extract the temporal correlations therein, and generate new hidden representations. Finally, the last hidden state of the GRU is processed by the linear layer to generate a new dynamic adjacency matrix A. I This dynamic adjacency matrix can better reflect the time-varying relationship between nodes, thereby improving the model's ability to capture traffic flow characteristics and prediction accuracy.
[0083] (2) Diffusion graph convolution layer
[0084] DGCL receives the hidden layer features H S and the dynamic adjacency matrix A I , generating new node representations. The core idea of DGCL is to propagate information in the graph through a diffusion process, that is, information starts from a node and propagates layer by layer through its neighboring nodes to capture the local and global structural information of the node.
[0085] The present invention uses a random walk diffusion process to propagate information. In DGCL, the convolution operation combines the characteristics of a node with the characteristics of its neighboring nodes by applying the diffusion kernel multiple times. The specific process is defined as follows:
[0086]
[0087] Among them, H (l) is the node feature matrix of the lth layer, K is the order of diffusion, P is the diffusion kernel, W (l) is the weight matrix of the lth layer, σ is the activation function, α k is the weight coefficient for one-step diffusion. By introducing a multi-order diffusion kernel, we can capture not only the local neighborhood information of a node but also the global graph structure. Furthermore, DGCL can capture high-order relationships between nodes, thereby improving the model's expressiveness and predictive performance.
[0088] (3) Fully connected layer
[0089] After the diffusion graph convolution layer, the feature representation H is obtained Dif =DGCN(H S ,A I ). Subsequently, a fully connected layer (FullyConnectedLayer) is added after the diffusion graph convolution. The functions of the fully connected layer after the diffusion graph convolution mainly include feature transformation and extraction, nonlinear transformation, feature fusion, and feature dimension adjustment. By introducing the fully connected layer, the expressive power of the model can be enhanced, and the complex patterns in the data can be better captured, thereby improving the performance of the prediction task. The specific process can be defined as:
[0090]
[0091] Where σ is the activation function, W is the weight matrix, and b is the bias vector.
[0092] (4) Attention layer
[0093] First, the embedded feature H∈R N×D (N represents the number of nodes, D represents the feature dimension) is mapped to a high-dimensional potential subspace to generate subspace, where the mapping is implemented using a feedforward neural network. The process can be defined as:
[0094]
[0095] in, is the projection matrix to be learned. Subsequently, the V space feature vector is sent to the Feature Pattern Update Module (FPUM) to perform a "memory-data" correlation analysis with the typical traffic pattern memory library to obtain a new feature representation Among them, ψ(·) represents the update process, M t It is a typical traffic pattern memory library. Then calculate the dot product of the query matrix Q and the key matrix K and divide it by the scaling factor Then apply the softmax function to normalize the weights to get the attention distribution. Finally, the normalized weight matrix is updated to the value matrix The weighted sum process can be defined as follows:
[0096]
[0097] Definition of the present invention in, is the updated feature matrix. Through the attention mechanism, the model can dynamically adjust the weights according to the importance of node features and highlight the relationship between key nodes. The attention mechanism can capture the global dependency between nodes, making up for the deficiency of the graph convolution layer that can only capture local relationships. Finally, the feature matrix H obtained by the attention layer is Att Feed it into the graph generator to generate a dynamic adjacency matrix that the model can train.
[0098] (5) Typical traffic mode interaction layer
[0099] like Figure 5 As shown, the present invention uses the idea of memory network to propose a typical traffic pattern memory bank (MemoryBank, MB). The memory bank is designed to memorize the typical features of the samples seen for further pattern matching. During the interaction between the subspace and MB, first, the feature vector in the V space is used as the query vector At the same time, read the characteristic pattern p in MB m ; Then, the matching probability between the query vector and this feature pattern is calculated, and the memory items with matching probability are weighted. The process can be defined as:
[0100]
[0101] Among them, k represents the query vector index, the maximum is max; m represents the MB feature pattern set; Represents the MB feature pattern index; Represents the set of matching probabilities between the query vector and MB.
[0102] Finally, the pattern matching vector in the memory is calculated based on the weighted average of the matching probabilities in the probability set. This is then fed into the original item in the V space to update the corresponding feature matching vector. The specific process can be defined as:
[0103]
[0104] in, Representatives and Matched MB feature pattern; f m represents the feature space pattern update function; Represents the updated feature space.
[0105] (6) Graph Generator
[0106] The graph generator mainly consists of three parts: Multi-Layer Perceptron (MLP), Gumbel Softmax layer, and Masked Fill layer. First, MLP is used to generate the initial dynamic adjacency matrix A. L , where A L =MLP(H Att ). Then, Gumbel Softmax is applied to generate samples from the discrete distribution; Gumbel Softmax is an approximate sampling method that allows for discrete selection in neural networks. Since it is differentiable, backpropagation can be used during training. The process can be defined as:
[0107]
[0108] Among them, g i Represents A L Added Gumbel noise; u i is a value sampled from the uniform distribution U(0,1); A pro represents the probability matrix generated by Gumbel Softmax, and τ is the temperature parameter.
[0109] Finally, the MaskedFill layer is used to perform a mask operation on the generated adjacency matrix to ensure that the diagonal elements are zero, that is, self-connections are not considered. The process can be defined as follows:
[0110]
[0111] Finally, in order to ensure the symmetry and stability of the generated adjacency matrix, the present invention performs dy Perform symmetric operation. At the same time, the generated dynamic adjacency matrix Ady With the initial adjacency matrix A sta Fusion is performed to further improve the performance and robustness of the model. The specific process can be defined as follows:
[0112]
[0113] A F =αA dy +(1-α)A sta (twenty three)
[0114] Here, α is a weight parameter that controls the fusion ratio of the dynamic adjacency matrix and the initial adjacency matrix. Through this fusion strategy, the spatiotemporal relationship between nodes can be dynamically captured while preserving the initial static structural information.
[0115] This symmetrization and fusion strategy ensures the stability and symmetry of the adjacency matrix, making the model more accurate and robust in capturing the dynamic spatial relationship between nodes in the transportation network. F After that, it and MDGCN are input into feature H S The data are then fed into a graph convolutional network for processing to form a new node feature representation. This design allows the model to retain the original information of the input features and effectively integrate the spatial correlation captured by the dynamic adjacency matrix, thereby improving the performance of traffic flow prediction.
[0116] (7) Prediction output layer
[0117] The features processed by MDGCN are sent to the prediction output layer to complete the final traffic flow prediction. The prediction output layer consists of a fully connected layer and a regression layer. The fully connected layer performs a linear transformation on the input node features and introduces nonlinear features through the activation function; the regression layer maps the features output by the fully connected layer to the final prediction result [Y t-T-1 ,Y t-T ,...,Y t-1 ,Y t ].
[0118] 4. System Process
[0119] The traffic flow prediction method based on MM-DMGCN has the following specific steps:
[0120] Steps 601-605: initialization phase;
[0121] Step 601: Algorithm initialization;
[0122] Step 602: Roadside sensors collect data;
[0123] Step 603: pre-processing the collected traffic data;
[0124] Step 604: Constructing a road network signal and initializing an adjacency matrix;
[0125] Step 605: sampling the road network signal;
[0126] Steps 606-610: multi-mode temporal feature capture phase;
[0127] Step 606: Perform time embedding coding on the sequence data;
[0128] Step 607: Time series aggregation convolution operation;
[0129] Step 608: If the short-term pattern features and the daily cycle pattern features have achieved feature fusion, then execute step 611; otherwise, execute step 609;
[0130] Step 609: Create road network data in daily and periodic modes;
[0131] Step 610: Perform Bi-MRNM model training;
[0132] Steps 611-616: dynamic spatial correlation feature capture stage;
[0133] Step 611: Create a static matrix;
[0134] Step 612: Generate a dynamic adjacency matrix;
[0135] Step 613: Perform diffusion graph convolution operation on the fused features;
[0136] Step 614: attention calculation;
[0137] Step 615: Apply MB to perform feature operations;
[0138] Step 616: Obtain dynamic spatial correlation features;
[0139] Steps 617-620: output prediction stage;
[0140] Step 617: Model training;
[0141] Step 618: If the model meets the quality requirements, execute step 415, otherwise repeat step 405;
[0142] Step 619: Output prediction;
[0143] Step 620: The algorithm ends.
[0144] Finally, it is to be explained that the above embodiments are only used to illustrate the technical solutions of the present application but not to limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalently replaced without departing from the purpose and scope of the present application, and all should be covered in the scope of the claims of the present application.
Claims
1. A traffic flow prediction method based on a multi-mode dynamic memory graph convolutional network, characterized by: The method comprises the following steps: S1: A temporal feature extraction model based on an aggregated convolutional network, which captures the temporal correlation in high-dimensional spatiotemporal data through temporal embedding coding and temporal aggregate convolution and integrates it into the feature dimension; S2: A periodic feature capture model based on a bidirectional memory recurrent network module (Bi-MRNM). This model combines a long short-term memory network (LSTM) and an improved gated recurrent unit (GRU) to capture temporal dependencies in both the forward and backward directions and extract periodic variation features. The Bi-MRNM module includes: The forward long short-term memory network LSTM layer is used to process forward time series data; Backward gated recurrent unit (GRU) layer, used to process backward time series data; The feature fusion module fuses the outputs of the forward LSTM layer and the backward GRU layer to form a comprehensive feature representation; S3: A dynamic graph convolutional model based on typical traffic patterns. By combining a diffusion graph convolution layer, an attention mechanism, and typical traffic patterns, it dynamically captures the spatial correlation between nodes and generates a new dynamic adjacency matrix. The dynamic graph convolution model includes: Diffusion Graph Convolutional Layer (DGCL) propagates information in the graph through a diffusion process, capturing the local and global structural information of nodes; The fully connected layer performs nonlinear transformation and feature fusion on the features output by the diffusion graph convolution layer; The attention layer dynamically adjusts the weights based on the importance of node features to highlight the relationships between key nodes; The typical traffic pattern interaction layer interacts node features with the typical traffic pattern memory library to enhance the model's ability to capture the hidden dynamic spatial correlations between nodes; Graph generator, which generates a new dynamic adjacency matrix to reflect the node connectivity that changes over time; S4: A dynamic adjacency matrix update method based on the gated recurrent unit (GRU) recurrent network uses the GRU gating mechanism to update the adjacency matrix to reflect the node connection relationship that changes over time; S5: Traffic flow prediction method based on the multi-mode dynamic memory graph convolutional network MM-DMGCN. The prediction output module integrates the features extracted and processed by the aforementioned modules to finally generate a traffic flow prediction result. The prediction output module consists of a fully connected layer and a regression layer. It performs linear transformation and mapping on the features processed by the multi-mode dynamic memory graph convolutional network MM-DMGCN to finally generate a traffic flow prediction result.
2. The traffic flow prediction method based on a multi-mode dynamic memory graph convolutional network according to claim 1 is characterized by: In S1, the temporal feature extraction model adopts time embedding coding to assist the temporal aggregation convolution network to generate a time embedding vector and fuse it with the input node features as the input of the temporal aggregation convolution module. The temporal aggregation convolution module captures the complex temporal correlation in the high-dimensional spatiotemporal representation through the convolution sliding window, and aggregates and reduces the dimensionality of the temporal features.
3. The traffic flow prediction method based on a multi-mode dynamic memory graph convolutional network according to claim 1 is characterized by: In the S4, the dynamic adjacency matrix update method designs a spatial structure-based adjacency matrix definition method, extracts distance space information by calculating the correlation of the node hierarchy in the distance graph, more comprehensively characterizes the spatial correlation between nodes, and uses the GRU gating mechanism to dynamically update the adjacency matrix to reflect the node connection relationship that changes over time.
4. The traffic flow prediction method based on a multi-mode dynamic memory graph convolutional network according to claim 1 is characterized by: The temporal feature extraction model includes: The time embedding encoding module converts timestamps into continuous and periodic feature representations; The temporal aggregation convolution module captures the complex temporal correlations in high-dimensional spatiotemporal representations through a convolution sliding window and aggregates and reduces the dimensionality of temporal features.
5. The traffic flow prediction method based on a multi-mode dynamic memory graph convolutional network according to claim 1 is characterized by: The dynamic adjacency matrix updating method comprises: Static matrix definition module, defining distance-based graphs and spatial structure-based graphs; The dynamic matrix definition module dynamically updates the adjacency matrix through the GRU gating mechanism to reflect the node connection relationship that changes over time; The adjacency matrix fusion module fuses the static adjacency matrix and the dynamic adjacency matrix to improve the performance and robustness of the model.
Citation Information
Patent Citations
Short-term traffic flow control method based on graph convolution recurrent neural network
CN110827544A
Multi-information fusion space-time diagram convolution traffic flow prediction method
CN116258258A
Cited By
Time-varying graph neural network traffic flow prediction method based on dynamic memory bank
CN121171043A
A Time-Varying Graph Neural Network-Based Traffic Flow Prediction Method Based on Dynamic Memory
CN121171043B