A traffic flow prediction method based on dynamic graph convolutional recurrent network

Through the improved method of dynamic graph convolution recurrent network, the problem of neglecting spatial and temporal dynamic correlation in traffic flow prediction is solved, and higher prediction accuracy is achieved.

CN120279714BActive Publication Date: 2025-09-02JIAHE CO CREATION (DALIAN) INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510764002.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-02
Estimated Expiration
2045-06-10

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods ignore the spatial and temporal correlation in traffic flow, resulting in insufficient prediction accuracy.

Method used

Using a method based on dynamic graph convolution recurrent network, the adaptive graph convolution recurrent network AGCRN model is used, combined with the dynamic graph generation module, dynamic graph convolution gated recursive unit and residual correction module, to capture the spatiotemporal characteristics of the traffic network and gradually refine the traffic change mode.

Benefits of technology

It improves the accuracy of traffic flow prediction, can better capture the dynamic characteristics of the traffic network, and enhances the model's evaluation ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279714B_ABST
    Figure CN120279714B_ABST
Patent Text Reader

Abstract

The present invention discloses a traffic flow prediction method based on a dynamic graph convolutional recurrent network, which belongs to the field of traffic information technology. The method includes: obtaining historical traffic flow data, preprocessing the data, and constructing a data set; improving the AGCRN model, first adding a dynamic filter of a self-attention mechanism to the graph generation part of the adaptive graph convolutional recurrent network AGCRN to capture dynamic spatial features, then adding a dynamic graph generation module to the gated recursive unit part to capture periodic time dependencies, and finally adding a residual correction module to the adaptive graph convolutional recurrent network AGCRN to extract error features. The improved AGCRN model is trained until predetermined performance indicators are achieved to obtain a traffic flow prediction model; and the traffic flow prediction model is used to predict the flow of a traffic road network. The present invention improves the accuracy of traffic network flow prediction by improving the graph convolutional network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of traffic information technology, and in particular relates to a traffic flow prediction method based on a dynamic graph convolutional recurrent network. Background Art

[0002] With the rapid development of society, economy, and urbanization, the number of cars in cities is showing an explosive growth trend. Traffic volume is increasing, leading to traffic congestion and frequent traffic accidents, which pose numerous challenges to urban management and residents' lives. Therefore, accurate traffic forecasting is particularly important. Accurate and timely prediction of traffic flow has become an urgent task in the field of intelligent transportation research in the big data era.

[0003] However, the complex spatiotemporal characteristics of road networks make traffic flow forecasting a challenging task. Existing methods often rely on predefined static adjacency matrices and treat spatial and temporal features separately, ignoring the coupling between them. This results in models failing to accurately capture the complex spatiotemporal dynamic correlations in traffic flow. Therefore, accurately capturing these dynamic correlations is crucial for practical application. Summary of the Invention

[0004] The purpose of the present invention is to solve the problems existing in the existing traffic flow prediction and propose a traffic flow prediction method based on a dynamic graph convolutional recurrent network to improve the accuracy of traffic flow prediction.

[0005] To achieve the above objectives, the present invention provides a technical solution as follows: a traffic flow prediction method based on a dynamic graph convolutional recurrent network, comprising the following steps:

[0006] S1: Obtain historical traffic flow data, preprocess it using the sliding window method, and construct a dataset;

[0007] S2: Taking the adaptive graph convolutional recurrent network AGCRN model as the base model, a dynamic graph generation module is embedded before the gated recurrent unit GRU in the codec of the base model to obtain a dynamic graph convolution gated recurrent unit. At least two dynamic graph convolution gated recurrent units are stacked to form a dynamic graph convolution recurrent module, and the output of the previous stage dynamic graph convolution gated recurrent unit is used as the next stage input. A dynamic filter based on the self-attention mechanism is added to the dynamic graph generation module; at the same time, a residual correction module is added to the tail of the base model; the residual correction module is configured to receive the first-stage prediction result output by the codec and the original model input, calculate the residual signal according to the first-stage prediction result and the original model input, perform secondary encoding and decoding correction on the residual signal to obtain the second-stage prediction result, and add the two-stage prediction results to obtain the final traffic flow prediction result;

[0008] S3: Train the improved adaptive graph convolutional recurrent network (AGCRN) model until it reaches the predetermined performance index and obtains a traffic flow prediction model.

[0009] S4: Use traffic flow prediction models to predict traffic flow in traffic networks.

[0010] Furthermore, in step S1, the process of preprocessing using the sliding window method is as follows: the time series data is divided into input-output sample pairs according to a historical window of 12 time steps, where each input is 12 consecutive time steps and the output is the next 12 time steps.

[0011] Furthermore, the improved adaptive graph convolutional recurrent network AGCRN model includes a model input layer, a first-level encoder-decoder and a residual correction module, wherein the model input layer performs node embedding learning based on the input historical traffic flow data to generate an initial node embedding, and then inputs the historical traffic flow data and the initial node embedding into the first-level encoder-decoder and the residual correction module; the encoder in the first-level encoder-decoder first extracts features from the historical traffic flow data through a dynamic graph convolutional recurrent module, and then performs residual connection and layer normalization, and then performs residual connection and layer normalization again after hidden layer processing to achieve encoding; the decoder in the first-level encoder-decoder first extracts features from the historical traffic flow data through a dynamic graph convolutional recurrent module, and then performs residual connection and layer normalization, and then aligns the output of the encoder through a multi-head attention layer, and then performs residual connection and layer normalization, and finally performs residual connection and layer normalization again after hidden layer processing, and decodes to obtain the first-stage prediction result; finally, the historical traffic flow data and the first-stage prediction result are processed by the residual correction module to obtain the final traffic flow prediction result;

[0012] It should be noted that the historical traffic flow data and initial node embedding as the original input are directly input separately. The first-level codec and residual correction module extract the features of the historical traffic flow data, and the initial node embedding is used to assist in extracting features.

[0013] Among them, the first-level codec includes encoders and A decoder, The encoders are stacked in order, and each encoder processes the output of the previous level and gradually extracts higher-order features; The decoders are connected in series in the order of generation; the output of the previous decoder serves as the input of the next decoder.

[0014] The residual correction module includes a residual signal extraction layer, a secondary codec and a prediction result merging layer, and the secondary codec and the primary codec have the same internal network structure.

[0015] Furthermore, the following formula is run in the dynamic graph generation module:

[0016] ;

[0017] ;

[0018] ;

[0019] ;

[0020] in, is the time step The dynamic signal obtained after filtering; express Activation function; 、 and They are query matrix, key matrix and value matrix respectively; Represents matrix transpose; is the embedding dimension; express Activation function; Represents an element-by-element multiplication operation; dynamic signal Embedded with the initial node Multiply element-wise to generate dynamic node embeddings for each time step ; is in the time step The dynamic Laplace matrix at is generated by calculating the similarity between nodes and performing normalization processing using the Laplace matrix construction method; the normalization processing of the Laplace matrix is ​​a prior art and will not be described in detail here; express Activation function; is the degree matrix; is the time step Input; static adjacency matrix For the initialized support matrix, combined Calculate through multi-channel graph convolution to obtain dynamic graph convolution features ,in is the weight, is the bias matrix, Matrix splicing.

[0021] Furthermore, the following formula is run in the dynamic graph convolution gated recurrent unit:

[0022] ;

[0023] ;

[0024] ;

[0025] in is the time step Input; is the time step Output; represents the sigmoid activation function, represents feature splicing, Indicates matrix partitioning, splitting out the update gate and reset gate , Generate module for dynamic graph, candidate hidden state Calculated by input features and updated hidden state, according to the reset gate and candidate hidden states The weighted update is used to obtain the final hidden state.

[0026] The following formula is run in the residual correction module:

[0027] ;

[0028] ;

[0029] ;

[0030] in It is the output of the first-stage codec, and the first-stage prediction result is obtained through spatiotemporal convolution , It is a spatiotemporal convolution, and the residual signal is modeled twice in the second stage. is the original model input, It is a secondary codec, and the secondary prediction result is obtained by residual calculation ; The two-stage prediction results are combined to obtain the final prediction .

[0031] Compared with the existing technology, the present invention proposes a traffic flow prediction method based on dynamic graph convolutional recurrent network with the following advantages:

[0032] 1. The dynamic graph generation method provided by the present invention is aimed at generating dynamic graph structures. Through the self-attention mechanism, this method can model the relationship between any two positions in a sequence and adaptively assign importance to different elements in the input of the dynamic graph generation module. This enables adaptive construction and dynamic updating of the graph structure, enhances the ability to represent important information, and improves the accuracy of model evaluation.

[0033] 2. The dynamic graph convolutional gated recurrent unit provided by this invention can capture the spatial and temporal characteristics of dynamic traffic networks, improving the accuracy of model evaluation;

[0034] 3. The residual correction module provided by the present invention gradually refines the flow change pattern through a two-level prediction mechanism, thereby improving the accuracy of model evaluation;

[0035] In summary, the method proposed in the present invention improves the accuracy of traffic flow prediction and can be promoted in the field of traffic flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flow chart of the traffic flow prediction method based on dynamic graph convolutional recurrent network of the present invention;

[0037] Figure 2 This is a schematic diagram of the network structure of the improved AGCRN model adopted by the present invention;

[0038] Figure 3 This is a schematic diagram of the network structure of the dynamic graph convolution cycle module;

[0039] Figure 4 This is a flow chart of the dynamic graph generation method adopted by the present invention;

[0040] Figure 5 This is a schematic diagram of the structure of the dynamic graph generation module of the present invention;

[0041] Figure 6 Schematic diagram of the dynamic graph convolution gated recursive unit structure of the present invention;

[0042] Figure 7 This is a flowchart of the residual correction module used in the present invention;

[0043] Figure 8 The training and validation loss graphs of the improved AGCRN model of the present invention;

[0044] Figure 9 This is a model evaluation result diagram of the index values ​​of the improved AGCRN model of the present invention on the PEMS04 dataset. DETAILED DESCRIPTION

[0045] To make the objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the present invention are described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the present invention is not limited to the following embodiments, and specific implementation methods can be determined based on the technical solutions of the present invention and actual conditions. To avoid obscuring the essence of the present invention, well-known methods, processes, and procedures are not described in detail.

[0046] The present invention first adds a dynamic filter based on the self-attention mechanism to the graph generation part of the adaptive graph convolutional recurrent network (AGCRN) to capture dynamic spatial features, then adds a dynamic graph generation module to the gated recurrent unit part to capture periodic time dependencies, and finally adds a residual correction module to the adaptive graph convolutional recurrent network (AGCRN) to extract error features, effectively improving the accuracy of traffic flow prediction.

[0047] Figure 1 The following is a flow chart of a traffic flow prediction method based on a dynamic graph convolutional recurrent network. The specific steps of the method are as follows:

[0048] S1: Obtain historical traffic flow data, preprocess it, and construct a dataset;

[0049] S1-1: Acquire historical traffic flow data. The source of the historical traffic flow data is traffic flow data acquired by road sensors or a public data set. The present invention uses the public data set PEMS04.

[0050] S1-2: Preprocess the PEMS04 dataset and split it into sliding windows. The historical window data of every 12 time steps forms the input vector of the model, which is used to predict the data of the next 12 time steps (that is, the time series data is split into input-output sample pairs according to the historical window of 12 time steps. Each input is 12 consecutive time steps, and the output is the next 12 time steps).

[0051] S2: Improve the adaptive graph convolutional recurrent network AGCRN to obtain an improved AGCRN model; the network structure diagram of the improved AGCRN model is as follows Figure 2 As shown, it includes a model input layer, a first-level codec and a residual correction module, wherein the model input layer performs node embedding learning based on the input historical traffic flow data to generate initial node embedding, and then inputs the historical traffic flow data and the initial node embedding into the first-level codec and the residual correction module; wherein the first-level codec includes encoders and A decoder, The encoders are stacked in order, and each encoder processes the output of the previous level and gradually extracts higher-order features; The decoders are connected in series in the order of generation; the output of the previous decoder is used as the input of the next stage. The encoder in the first-stage codec first extracts features from the historical traffic flow data through the dynamic graph convolution cycle module, and then performs residual connection and layer normalization, and then performs residual connection and layer normalization after hidden layer processing to achieve encoding; the decoder in the first-stage codec first extracts features from the historical traffic flow data through the dynamic graph convolution cycle module, and then performs residual connection and layer normalization, and then aligns it with the output of the encoder through the multi-head attention layer, and then performs residual connection and layer normalization, and finally performs residual connection and layer normalization after hidden layer processing, and decodes to obtain the first-stage prediction result; finally, the historical traffic flow data and the first-stage prediction result are processed by the residual correction module to obtain the final traffic flow prediction result;

[0052] like Figure 2 As shown, the residual correction module includes a residual signal extraction layer, a secondary codec and a prediction result merging layer, and the secondary codec and the primary codec have the same internal network structure.

[0053] like Figure 3 As shown in the figure, the dynamic graph convolution cycle module is composed of a stack of dynamic graph convolution gated recursive units, and the output of the previous dynamic graph convolution gated recursive unit is used as the output input of the next dynamic graph convolution gated recursive unit. The dynamic graph convolution gated recursive unit is embedded in the dynamic graph generation module, and a dynamic filter based on the self-attention mechanism is added to the dynamic graph generation module.

[0054] S2-1: Add a dynamic filter based on the self-attention mechanism after the input of the dynamic graph generation module to convert the pre-processed traffic flow data (a four-dimensional vector , is the batch size, which indicates the number of samples input in one training; Indicates the time length of the input sequence; is the number of nodes, which represents the number of sensor nodes in the transportation network; is the hidden state dimension, which represents the feature dimension of each node in the model) and is put into the dynamic filter for processing to obtain the dynamic signal; then, it is multiplied element-by-element with the initial node embedding to obtain the dynamic node embedding; then, the dynamic adjacency matrix is ​​generated by the dynamic node embedding; finally, the dynamic graph convolution feature is obtained by convolution calculation; it should be noted that the initial node embedding refers to the initial vector representation assigned to the node before the model training starts, which belongs to the existing technology and will not be described in detail.

[0055] In step S2-1, the dynamic graph generation module is improved, and the specific steps are as follows:

[0056] In dynamic graph generation, a dynamic filter based on the self-attention mechanism is used. After input, the data is first filtered by the dynamic filter based on the self-attention mechanism, and then the dynamic graph convolution features are calculated through graph convolution with a Chebyshev polynomial kernel. The self-attention mechanism can model the relationship between any two positions in the sequence, adaptively assigning importance to different elements in the dynamic graph generation module input, and enhancing the ability to represent important information.

[0057] Figure 4 A flowchart of the dynamic graph generation method proposed according to an example of the present invention is presented. Traffic flow data is first used to generate initial node embeddings through node embedding learning, and then spatiotemporal attention is obtained through dynamic filters. Then, a dynamic graph is generated based on the attention weights.

[0058] The formula for generating the dynamic graph structure of the present invention is calculated as follows:

[0059] (1);

[0060] (2);

[0061] (3);

[0062] (4);

[0063] in, is the time step The dynamic signal obtained after filtering; express Activation function; 、 and They are query matrix, key matrix and value matrix respectively; Represents matrix transpose; is the embedding dimension; express Activation function; Represents an element-by-element multiplication operation; dynamic signal Embedded with the initial node Multiply element-wise to generate dynamic node embeddings for each time step ; is in the time step The dynamic Laplace matrix at is generated by calculating the similarity between nodes and performing normalization processing using the Laplace matrix construction method; the normalization processing of the Laplace matrix is ​​a prior art and will not be described in detail here; express Activation function; is the degree matrix; is the time step Input; static adjacency matrix For the initialized support matrix, combined Calculate through multi-channel graph convolution to obtain dynamic graph convolution features ,in is the weight, is the bias matrix, Matrix splicing.

[0064] Figure 5 A structural diagram of a dynamic graph generation module proposed according to an example of the present invention is presented.

[0065] S2-2: The dynamic graph convolution loop module is composed of multiple stacked dynamic graph convolution gated recursive units. After dynamic graph generation and gated calculation, the output of the dynamic graph convolution loop module is obtained.

[0066] In step S2-2, the dynamic graph convolution gated recurrent unit (GRU) is improved. A variant of the GRU technology is used in the dynamic graph convolution recurrent network. By combining the dynamic graph generation module with the GRU, a dynamic graph convolution gated recurrent unit (GRU) is obtained. This unit focuses on the dynamic spatial relationships and time series changes between nodes, and can capture the spatial and temporal characteristics of dynamic traffic networks. It should be noted that the GRU (Gated Recurrent Unit) is an improved recurrent neural network (RNN) and is currently available.

[0067] The structure of the dynamic graph convolution gated recurrent unit (AGCRU) of the present invention is as follows: Figure 6 As shown, Figure 6 middle is the dynamic graph convolution gated recurrent unit at time step Input, is the dynamic graph convolution gated recurrent unit at time step Input, is the dynamic graph convolution gated recurrent unit at time step The input of yes The abbreviation of is the initial node embedding, is the history window size. The formula for the dynamic graph convolution gated recurrent unit is calculated as follows:

[0068] (5);

[0069] (6);

[0070] (7);

[0071] in is the time step Input; is the time step Output; represents the sigmoid activation function, represents feature splicing, Indicates matrix partitioning, splitting out the update gate and reset gate , Generate module for dynamic graph, candidate hidden state Calculated by input features and updated hidden state, according to the reset gate and candidate hidden states The weighted update is used to obtain the final hidden state.

[0072] S2-3: Improve the adaptive graph convolutional recurrent network (AGCRN) by adding a residual correction module after the main network to obtain the optimized network for training;

[0073] In step S2-3, the adaptive graph convolutional recurrent network (AGCRN) is modified by adding a residual correction module after the main network for time series prediction, forming a dual encoder-decoder residual architecture. The residual correction calculation is performed on the first-stage prediction results and the original model input, and then sent to the secondary encoder-decoder for error feature extraction.

[0074] The residual correction module of the present invention is calculated as follows:

[0075] (8);

[0076] (9);

[0077] (10);

[0078] in It is the output of the first-stage codec, and the first-stage prediction result is obtained through spatiotemporal convolution , It is a spatiotemporal convolution, and the residual signal is modeled twice in the second stage. is the original model input, It is a secondary codec, and the secondary prediction result is obtained by residual calculation ; The two-stage prediction results are combined to obtain the final prediction The structure gradually refines the traffic change pattern through a two-level prediction mechanism, which is particularly suitable for dynamic adaptation to sudden traffic events.

[0079] The residual correction module flow chart of the present invention is as follows: Figure 7shown.

[0080] S3: training the improved AGCRN model until the improved AGCRN model reaches a predetermined performance index, thereby obtaining a trained traffic flow prediction model;

[0081] In step S3, the improved AGCRN model is trained, the number of iterations is set to 300, the early stopping mechanism is used, the patience value is set to 15, the initial learning rate is 0.003, and the number of batch sizes is set to 64. During the training process, the loss function used is .

[0082] The training loss and validation loss results of the PEMS04 Dataset of this invention are as follows Figure 8 As shown, we can see that the loss function of this model and its convergence speed are very good.

[0083] The indicators used in this invention are three common indicators for measuring the performance of prediction models:

[0084] Mean absolute error ( ): It is the average of the absolute errors between the predicted value and the true value. It is less sensitive to outliers and reflects the average prediction error. The calculation formula is as follows:

[0085] (11);

[0086] in For the The predicted value of the sample, For the The true value of the sample, is the number of samples.

[0087] Root mean square error ( ): It is the square root of the average of the squared errors between the predicted value and the true value. It penalizes larger errors more severely and can better reflect the performance of the model under larger errors. The calculation formula is as follows:

[0088] (12);

[0089] in For the The predicted value of the sample, For the The true value of the sample, is the number of samples.

[0090] Mean absolute percentage error ( ): It is the average of the absolute percentage errors between the predicted values ​​and the true values. It provides a measure of relative error and is easy to compare with other datasets or models. The calculation formula is as follows:

[0091] (13);

[0092] in For the The predicted value of the sample, For the The true value of the sample, is the number of samples.

[0093] The three indicators of this model are as follows Figure 9 shown.

[0094] Table 1 is a comparison table of this model and existing posture estimation models.

[0095] Table 1 Comparison between this model and existing posture estimation models

[0096]

[0097] The numerical values ​​and specific content of the comparison model are published at:

[0098] Comparison model [1]: Weng W, Fan J, Wu H, et al. A decomposition dynamic graph convolutional recurrent network for traffic forecasting [J]. Pattern Recognition, 2023, 142: 109670. (Weng W, Fan J, Wu H, et al. A decomposition dynamic graph convolutional recurrent network for traffic forecasting [J]. Pattern Recognition, 2023, 142: 109670.)

[0099] Comparison model [2]: Choi J, Choi H, Hwang J, et al. Graph neural controlled differential equations for traffic forecasting [C] / / Proceedings of the AAAI conference on artificial intelligence. 2022, 36(6): 6367-6374. (Choi J, ChoiH, Hwang J, et al. Graph neural controlled differential equations for traffic forecasting [C] / / Proceedings of the AAAI conference on artificial intelligence. 2022, 36(6): 6367-6374.)

[0100] Comparison model [3]: Fang Z, Long Q, Song G, et al. Spatial-temporal graph ode networks for traffic flow forecasting [C] / / Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining. 2021: 364-373. (Fang Z, Long Q, Song G, et al. Spatial-temporal graph ode networks for traffic flow forecasting [C] / / Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining. 2021: 364-373.)

[0101] Comparison model [4]: ​​Bai L, Yao L, Li C, et al. Adaptive graph convolutional recurrent network for traffic forecasting [J]. Advances in neural information processing systems, 2020, 33: 17804-17815. (Bai L, Yao L, Li C, et al. Adaptive graph convolutional recurrent network for traffic forecasting [J]. Advances in neural information processing systems, 2020, 33: 17804-17815.)

[0102] Comparison model [5]: Song C, Lin Y, Guo S, et al. Spatial-temporal synchronous graph convolutional networks: A new framework for spatial-temporal network data forecasting [C] / / Proceedings of the AAAI conference on artificial intelligence. 2020, 34(01): 914-921. (Song C, Lin Y, Guo S, et al. Spatial-temporal synchronous graph convolutional networks: A new framework for spatial-temporal network data forecasting [C] / / Proceedings of the AAAI conference on artificial intelligence. 2020, 34(01): 914-921.)

[0103] S4: Use the trained traffic flow prediction model to predict traffic flow.

[0104] As can be seen from Table 1, the accuracy of this model is higher than that of the existing traffic flow prediction model.

[0105] The present invention is described by way of certain embodiments. It will be appreciated by those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to suit specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be protected by the present invention.

Claims

1. A traffic flow prediction method based on dynamic graph convolutional recurrent network, characterized in that: The steps include: S1: Obtain historical traffic flow data, preprocess it using the sliding window method, and construct a dataset; S2: Taking the adaptive graph convolutional recurrent network AGCRN model as the base model, a dynamic graph generation module is embedded before the gated recurrent unit GRU in the codec of the base model to obtain a dynamic graph convolution gated recurrent unit. At least two dynamic graph convolution gated recurrent units are stacked to form a dynamic graph convolution recurrent module, and the output of the previous stage dynamic graph convolution gated recurrent unit is used as the next stage input. A dynamic filter based on the self-attention mechanism is added to the dynamic graph generation module; at the same time, a residual correction module is added to the tail of the base model; the residual correction module is configured to receive the first-stage prediction result and the original model input, calculate the residual signal according to the first-stage prediction result and the original model input, perform secondary encoding and decoding correction on the residual signal to obtain the second-stage prediction result, and add the two-stage prediction results to obtain the final traffic flow prediction result; S3: Train the improved adaptive graph convolutional recurrent network (AGCRN) model until it reaches the predetermined performance index and obtains a traffic flow prediction model. S4: Use traffic flow prediction models to predict traffic flow in the traffic network; The improved adaptive graph convolutional recurrent network AGCRN model includes a model input layer, a first-level encoder-decoder and a residual correction module, wherein the model input layer performs node embedding learning based on the input historical traffic flow data to generate initial node embedding, and then inputs the historical traffic flow data and the initial node embedding into the first-level encoder-decoder and the residual correction module; the encoder in the first-level encoder-decoder first extracts features from the historical traffic flow data through a dynamic graph convolutional recurrent module, and then performs residual connection and layer normalization, and then performs residual connection and layer normalization again after hidden layer processing to achieve encoding; the decoder in the first-level encoder-decoder first extracts features from the historical traffic flow data through a dynamic graph convolutional recurrent module, and then performs residual connection and layer normalization, and then aligns the output of the encoder through a multi-head attention layer, and then performs residual connection and layer normalization, and finally performs residual connection and layer normalization again after hidden layer processing, and decodes to obtain the first-stage prediction result; finally, the historical traffic flow data and the first-stage prediction result are processed by the residual correction module to obtain the final traffic flow prediction result; The residual correction module includes a residual signal extraction layer, a secondary codec and a prediction result merging layer, and the secondary codec and the primary codec have the same internal network structure; Run the following formula in the dynamic graph generation module: ; ; ; ; in, is the time step The dynamic signal obtained after filtering; express Activation function; 、 and They are query matrix, key matrix and value matrix respectively; Represents matrix transpose; is the embedding dimension; express Activation function; Represents an element-by-element multiplication operation; dynamic signal Embedded with the initial node Multiply element-wise to generate dynamic node embeddings for each time step ; is in the time step The dynamic Laplace matrix at is generated by calculating the similarity between nodes and normalizing them using the Laplace matrix construction method; express Activation function; is the degree matrix; is the time step Input; static adjacency matrix For the initialized support matrix, combined Calculate through multi-channel graph convolution to obtain dynamic graph convolution features ,in is the weight, is the bias matrix, For matrix splicing; The following formula is run in the dynamic graph convolution gated recurrent unit: ; ; ; in is the time step Input; is the time step Output; represents the sigmoid activation function, represents feature splicing, Indicates matrix partitioning, splitting out the update gate and reset gate , Generate module for dynamic graph, candidate hidden state Calculated by input features and updated hidden state, according to the reset gate and candidate hidden states Weighted update to get the final hidden state; The following formula is run in the residual correction module: ; ; ; in It is the output of the first-stage codec, and the first-stage prediction result is obtained through spatiotemporal convolution , It is a spatiotemporal convolution, and the residual signal is modeled twice in the second stage. is the original model input, It is a secondary codec, and the secondary prediction result is obtained by residual calculation ; The two-stage prediction results are combined to obtain the final prediction .

2. The traffic flow prediction method based on dynamic graph convolutional recurrent network according to claim 1 is characterized in that: In step S1, the process of preprocessing using the sliding window method is as follows: the time series data is divided into input-output sample pairs according to the historical window of 12 time steps, each input is 12 consecutive time steps, and the output is the next 12 time steps.

3. The traffic flow prediction method based on dynamic graph convolutional recurrent network according to claim 1 is characterized in that: The first level codec includes encoders and A decoder, The encoders are stacked in order, and each encoder processes the output of the previous level; The decoders are connected in series in the order of generation; the output of the previous decoder serves as the input of the next decoder.

Citation Information

Patent Citations

  • Method for predicting traffic flow by using spatial dynamic graph convolutional network

    CN115482656A

  • Periodic adaptive graph convolution circulation network traffic flow prediction method

    CN117291780A