Traffic flow prediction method, device and medium based on graph isomorphic spatiotemporal network

Through the graph isomorphic spatiotemporal network method, combined with spatial dependency modeling, temporal dependency modeling and feature fusion modules, the problem of insufficient spatial and temporal feature extraction in existing traffic flow prediction is solved, more accurate traffic flow prediction is achieved, and the effect of traffic management and planning is improved.

CN119169817BActive Publication Date: 2025-09-30FUJIAN NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411281707.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-09-30
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods based on graph neural networks find it difficult to effectively capture complex nonlinear spatial relationships and temporal characteristics at different scales, resulting in insufficient prediction accuracy and reliability. This is especially true when dealing with long-distance spatial dependencies and multi-level spatial interaction features, which affects the effectiveness of traffic management and planning.

Method used

A method based on graph isomorphic spatiotemporal networks is adopted, including a spatial dependency modeling module, a temporal dependency modeling module and a spatiotemporal feature fusion module. Complex nonlinear spatial dependencies are extracted through graph isomorphic networks, and temporal features of different scales are extracted by combining a dual-branch temporal convolutional network and a gating mechanism. The dynamic fusion of spatial and temporal features is achieved through a gated recurrent unit.

Benefits of technology

It significantly improves the accuracy and reliability of traffic flow forecasts, can better capture short-term and long-term traffic flow changes, and enhances the effectiveness and accuracy of traffic management and planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169817B_ABST
    Figure CN119169817B_ABST
Patent Text Reader

Abstract

The present invention discloses a traffic flow prediction method, device, and medium based on a graph isomorphic spatiotemporal network. The method comprises: constructing a graph isomorphic spatiotemporal network model, the graph isomorphic spatiotemporal network model comprising a spatial dependency modeling module, a temporal dependency modeling module, and a spatiotemporal feature fusion module; training the graph isomorphic spatiotemporal network model; inputting preprocessed historical traffic flow data and road network data into the trained graph isomorphic spatiotemporal network model; extracting spatial features using the spatial dependency modeling module; extracting temporal features using the temporal dependency modeling module; fusing spatial and temporal features using the spatiotemporal feature fusion module; and mapping the fused spatial and temporal features to a prediction result to obtain a traffic flow prediction value for a certain future period. The present invention can improve the accuracy of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a traffic flow prediction method, device and medium based on a graph isomorphic spatiotemporal network. Background Art

[0002] Traffic flow prediction is a core task of intelligent transportation systems (ITS), crucial for alleviating traffic congestion, optimizing transportation resource allocation, and improving urban traffic management. However, accurate traffic flow prediction remains a significant challenge due to the spatiotemporal dynamics and nonlinear characteristics of traffic data, as well as the complexity of road network topology.

[0003] Compared with traditional traffic forecasting methods, deep learning-based traffic flow forecasting offers significant advantages in improving prediction accuracy, capturing complex spatiotemporal dependencies, and adapting to nonlinear traffic patterns. Consequently, deep learning methods have become a mainstream trend in traffic flow forecasting. However, as urban transportation networks expand in size and complexity, the challenges facing traffic flow forecasting also increase. Traffic flow data exhibits highly dynamic, nonlinear characteristics, and complex topological structures in both temporal and spatial distribution. This poses significant challenges to traditional deep learning models, impacting the accuracy and reliability of forecasts.

[0004] The introduction of Graph Neural Networks (GNNs) provides a new approach to processing non-Euclidean data structures such as traffic networks. It can better utilize the topological information of traffic networks and improve prediction accuracy. However, existing GNN-based methods still have some limitations. First, in terms of spatial dependency modeling, it is difficult to fully express complex nonlinear spatial relationships, especially when capturing long-distance spatial dependencies and multi-level spatial interaction features. Second, in terms of temporal dependency modeling, existing methods often find it difficult to effectively capture both short-term fluctuations and long-term trends at the same time, affecting the accurate prediction of traffic flow changes over a long time span in the future.

[0005] A good traffic flow prediction model should be able to simultaneously handle complex spatial dependencies and temporal characteristics at different scales, playing a crucial role in traffic management and planning optimization. However, due to the limitations of existing models in extracting and integrating spatial and temporal features, large errors can occur when predicting peak-period traffic flows, seriously impacting the effectiveness of traffic management decisions. Furthermore, if the model cannot effectively capture long-term temporal dependencies, it will be difficult to accurately predict traffic trends over extended periods of time, hindering the development of long-term traffic plans.

[0006] Currently, no research has proposed effective solutions to the common problems of insufficient spatial dependency modeling and difficulty extracting temporal features at different scales in traffic flow prediction. The most relevant research involves traffic flow prediction methods based on graph convolutional networks. While these methods have improved spatial dependency modeling to some extent, they still fail to effectively capture complex nonlinear spatial relationships and extract temporal features at different scales. Summary of the Invention

[0007] In view of this, the purpose of the present invention is to propose a traffic flow prediction method based on graph isomorphic spatiotemporal networks, which aims to effectively capture the complex nonlinear spatial dependencies and temporal characteristics of different scales in the traffic network, and realize the effective fusion of spatial and temporal information, thereby improving the accuracy of traffic flow prediction.

[0008] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:

[0009] The present invention provides a traffic flow prediction method based on a graph isomorphic spatiotemporal network, comprising the following steps:

[0010] Step 1: construct a graph isomorphic spatiotemporal network model, which includes a spatial dependency modeling module, a temporal dependency modeling module, and a spatiotemporal feature fusion module;

[0011] Step 2: training the graph isomorphic spatiotemporal network model;

[0012] Step 3: Input the pre-processed historical traffic flow data and road network data into the trained graph isomorphic spatiotemporal network model;

[0013] Step 4: extracting spatial features through the spatial dependency modeling module;

[0014] Step 5: extracting time features through the time-dependent modeling module;

[0015] Step 6: Fusing spatial features and temporal features through the spatiotemporal feature fusion module;

[0016] Step 7: Map the fused spatial and temporal features to the prediction results to obtain the traffic flow prediction value for a certain period of time in the future.

[0017] Furthermore, in step 2, the graph isomorphic spatiotemporal network model is trained using a preset loss function and optimization algorithm until the graph isomorphic spatiotemporal network model converges; specifically, the training includes:

[0018] Step 21: input a training set into the graph isomorphic spatiotemporal network model for training, wherein the training set includes historical traffic flow data and road network data;

[0019] Step 22: During the training of the graph isomorphic spatiotemporal network model, the mean absolute error and root mean square error are used as loss functions to measure the difference between the predicted value and the true value. The formula is as follows:

[0020]

[0021] Among them, MAE represents the mean absolute error, n represents the number of samples, i represents the i-th element, and RMSE represents the root mean square error. Represents the predicted value, y i represents the true value;

[0022] Step 23: Use the Adam optimizer to update the parameters of the graph isomorphic spatiotemporal network model, and set the initial learning rate to the preset value;

[0023] Step 24: Use the early stopping strategy to control the stopping time of the training process. That is, when the loss on the training set does not improve within m1 consecutive epochs, stop the training process. m1 is a positive integer and the value of m1 is set according to the training process.

[0024] Step 25: Use the learning rate decay strategy to control the learning rate of the training process, that is, reduce the learning rate to half of the original rate every m2 epochs, where m2 is a positive integer and the value of m2 is set according to the training process;

[0025] Step 26: When the difference between the predicted value and the true value after training is within the error range, it indicates that the graph isomorphic spatiotemporal network model has been trained.

[0026] Furthermore, the step 4 specifically includes:

[0027] Step 41: The pre-processed historical traffic flow data is represented as time series data, and the pre-processed road network data is represented as an adjacency matrix; the historical traffic flow data represented as time series data and the road network data represented as an adjacency matrix are input into a spatial dependency modeling module;

[0028] Step 42: The spatial dependency modeling module extracts the relationship between node features and the topological structure diagram from the historical traffic flow data and the road network data, and captures the nonlinear spatial dependency relationship between the node features and the topological structure diagram, and obtains the spatial features as the output of the spatial dependency modeling module.

[0029] Furthermore, the step 42 specifically includes:

[0030] Step 421: The spatial dependency modeling module includes sequentially connected multi-layer graph isomorphism networks, and two adjacent multi-layer graph isomorphism networks are connected via residual connections.

[0031] Step 422: The historical traffic flow data and road network data are used as inputs for a first-layer graph isomorphism network. A topological graph is constructed based on the road network data, where nodes represent sensors or road segments and edges represent connections between nodes. Time series data corresponding to each node in the historical traffic flow data is used as initial node features for the first-layer graph isomorphism network.

[0032] Step 423: For each node feature inputted by the graph isomorphism network of the current layer, the current node feature is used as the central node feature, and the neighbor node features and the central node feature are aggregated using an aggregation function to obtain the aggregated node feature.

[0033] Step 424: input the aggregated node features into a multi-layer perceptron for nonlinear transformation;

[0034] Step 425: Using the output of the multilayer perceptron as the updated node feature;

[0035] Step 426: Repeat steps 423 to 425 to iteratively update each node feature of the current layer graph isomorphism network input, and obtain all updated node features in the current layer graph isomorphism network as output features;

[0036] Step 427: For the graph isomorphism network of the first layer, the output features of the first layer graph isomorphism network are input to the graph isomorphism network of the second layer; for the graph isomorphism networks of the second layer and thereafter, the output features of the current layer graph isomorphism network and the input features of the current layer graph isomorphism network are added together, and the result is input to the graph isomorphism network of the next layer;

[0037] Step 428: Repeat steps 423 to 427 until all layers of graph isomorphism networks are calculated, and the output features of the last layer of graph isomorphism networks are used as the final output of the spatial dependency modeling module.

[0038] Furthermore, the process of step 423 to step 425 is expressed as follows:

[0039]

[0040] Among them, h p (l) Indicates that the feature of a node in the l-th layer graph isomorphic network is used as the feature of the central node p, ε (l) represents the learnable parameters of the l-th layer graph isomorphism network, N(p) represents the set of neighbor nodes of the central node p, j q (l) Represents the features of neighbor nodes q of the central node p in the l-th layer graph isomorphism network, MLP (l) is the multi-layer perceptron of the l-th layer graph isomorphism network, Represents the node features after the updated features of the central node p in the l-th layer graph isomorphism network.

[0041] Furthermore, the spatial dependency modeling module includes two layers of graph isomorphic networks. For each node, the output features of the corresponding node of the first layer of graph isomorphic network are spliced ​​with the node features of historical traffic flow data and used as the input features of the corresponding node of the second layer of graph isomorphic network, thereby realizing residual connection between the two layers of the graph isomorphic network.

[0042] Furthermore, the step 5 specifically includes:

[0043] Step 51: The temporal dependency modeling module includes a dual-branch temporal convolutional network structure and a gating mechanism. The dual-branch temporal convolutional network structure includes a short-term dependency branch structure and a long-term dependency branch structure. The gating mechanism includes a splicing layer, a gating unit, and a fusion layer connected in sequence.

[0044] Step 52: Use the output of the spatial dependency modeling module as input of the short-term dependency branch structure and the long-term dependency branch structure, respectively.

[0045] The short-term dependency branch structure includes at least one temporal convolution layer, which performs a causal convolution operation using a first convolution kernel and a first dilation rate, and is expressed as follows:

[0046]

[0047] Among them, y st represents the output feature of the short-term dependent branch structure, i represents the i-th element, k1 is the size of the first convolution kernel, w 1i represents the weight of the first convolution kernel, d1 represents the first expansion rate, d1i represents the time step that needs to be traced back when calculating the convolution operation, t represents the time step, t-d1i represents a time point on the time axis, x t-d1i Represents the features of the spatial features at time step t-d1i;

[0048] The long-term dependency branch structure includes at least one temporal convolution layer, which uses a second convolution kernel and a second dilation rate to perform a causal convolution operation, which is expressed as follows:

[0049]

[0050] Among them, y lt represents the output feature of the long-term dependent branch structure, i represents the i-th element, k2 is the size of the second convolution kernel, w 2irepresents the weight of the second convolution kernel, d2 represents the second expansion rate, d2i represents the time step that needs to be traced back when calculating the convolution operation, t represents the time step, t-d2i represents a time point on the time axis, x t-d2i Represents the features of the spatial features at time step t-d2i;

[0051] Step 53: Output feature y of short-term dependent branch structure st And the output feature y of the long-term dependent branch structure lt The input is sent to the gating mechanism for splicing, gating and fusion calculations to obtain the temporal features as the output of the time-dependent modeling module;

[0052] The calculation process of the gating mechanism is expressed as follows:

[0053] g=σ(W g [y st ,y lt ]+b g )

[0054]

[0055] Among them, σ represents the Sigmoid activation function, W g and b g represents a learnable parameter, [·,·] represents a feature concatenation operation, g represents a gate weight, Represents element multiplication operation, y represents y st and y lt The comprehensive output is adaptively generated by the gating mechanism.

[0056] Furthermore, the step 6 specifically includes:

[0057] Step 61: The spatial features output by the spatial dependency modeling module and the temporal features output by the temporal dependency modeling module are used as inputs of a spatiotemporal feature fusion module.

[0058] Step 62: The spatiotemporal feature fusion module adopts a gated recurrent unit structure, and dynamically adjusts the spatial and temporal features through the gating mechanism of the gated recurrent unit structure to achieve the fusion of spatiotemporal information.

[0059] The updating process of the GRU structure is expressed as follows:

[0060] z t =σ(W z ·[h t-1 , s t ]+b z )

[0061] r t =σ(Wr ·[h t-1 , s t ]+b r )

[0062]

[0063]

[0064] Among them, z t represents the update gate, σ represents the Sigmoid activation function, h t-1 represents the hidden state at time t-1, s t Represents the input vector composed of spatial features and temporal features; r t Represents the reset gate, represents the candidate hidden state at time t, tanh represents the tanh activation function, Represents element-wise multiplication operation, h t represents the final candidate hidden state at time t, W z 、W r and W h represents the learnable parameter matrix, b z 、b r and b h Represents the bias vector.

[0065] The present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a traffic flow prediction method based on a graph isomorphic spatiotemporal network as described above is implemented.

[0066] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned traffic flow prediction method based on graph isomorphic spatiotemporal network.

[0067] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:

[0068] The present invention, through the design of a graph isomorphic spatiotemporal network model (GISTN model), comprehensively considers prediction accuracy, computational efficiency, and model generalization ability, enabling more accurate short-term and long-term traffic flow prediction, significantly improving the performance of traffic flow prediction. The GISTN model includes a spatial dependency modeling module, a temporal dependency modeling module, and a spatiotemporal feature fusion module. The proposed spatial dependency modeling module uses a graph isomorphism network (GIN) to significantly enhance the model's ability to capture complex nonlinear spatial dependencies, thereby better capturing complex nonlinear spatial relationships in traffic networks and effectively solving the problem of capturing long-range spatial dependencies and multi-level spatial interaction features. The proposed temporal dependency modeling module uses a dual-branch temporal convolutional network structure and a gating mechanism to extract temporal features of different scales from traffic flow data, achieving adaptive capture of short-term fluctuations and long-term trends, overcoming the difficulties of existing methods in dealing with long-term temporal dependencies and temporal patterns of different scales. The proposed spatiotemporal feature fusion module uses a fusion mechanism based on gated recurrent units to achieve dynamic integration of spatial and temporal features, fully leveraging their complementarity and significantly enhancing the model's ability to learn complex spatiotemporal patterns. Experimental results demonstrate that the GISTN model significantly outperforms existing methods in prediction accuracy across multiple public datasets, performing well across different prediction timescales and urban scenarios, demonstrating good generalization and practical value. These improvements provide strong support for the development of intelligent transportation systems and offer reliable technical support for alleviating traffic congestion, optimizing transportation resource allocation, and improving urban traffic management. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0070] Figure 1 This is a flowchart of a traffic flow prediction method based on a graph isomorphic spatiotemporal network provided by an embodiment of the present invention.

[0071] Figure 2 It is an overall architecture diagram of the Graph Isomorphic Spatiotemporal Network (GISTN) model provided by an embodiment of the present invention.

[0072] Figure 3 It is a schematic diagram of the GIN node information aggregation process in the spatial dependency modeling module provided by an embodiment of the present invention.

[0073] Figure 4It is a structural diagram of the time-dependent modeling module provided by an embodiment of the present invention.

[0074] Figure 5 This is a structural diagram of the GRU unit in the spatiotemporal feature fusion module provided by an embodiment of the present invention.

[0075] Figure 6 This is a comparison chart showing the impact of different GIN hidden layer dimensions on model performance provided by an embodiment of the present invention.

[0076] Figure 7 This is a comparison chart showing the impact of different numbers of GIN layers on model performance, provided by an embodiment of the present invention.

[0077] Figure 8 is a schematic diagram of an electronic device provided by an embodiment of the present invention.

[0078] Figure 9 It is a schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0079] The present invention will be described in further detail below with reference to the accompanying drawings and examples. It is particularly noted that the following examples are intended only to illustrate the present invention and are not intended to limit the scope of the present invention. Similarly, the following examples are only some embodiments of the present invention and are not intended to be exhaustive. All other embodiments obtained by those of ordinary skill in the art without creative effort are intended to fall within the scope of protection of the present invention.

[0080] See Figure 1-Figure 7 The present invention provides a traffic flow prediction method based on a Graph Isomorphism Spatio-Temporal Network (GISTN), comprising the following steps:

[0081] Step 1: Construct a graph isomorphic spatiotemporal network model (GISTN model), which includes a spatial dependency modeling module, a temporal dependency modeling module, and a spatiotemporal feature fusion module. The GISTN model takes historical traffic flow data and road network data as input, processes and integrates information in sequence through these three core modules, and finally outputs traffic flow prediction results for a period of time in the future.

[0082] Specifically, the spatial dependency modeling module captures the complex nonlinear spatial relationships within the traffic network; the temporal dependency modeling module extracts temporal features at different scales; and the spatiotemporal feature fusion module dynamically integrates spatial and temporal features to generate a comprehensive spatiotemporal representation. This modular design enables the GISTN model to comprehensively consider the spatiotemporal characteristics of traffic flow, providing a solid foundation for accurate prediction.

[0083] The GISTN model proposed in this paper comprehensively considers prediction accuracy, computational efficiency and model generalization ability, and can make more accurate short-term and long-term predictions of traffic flow.

[0084] Step 2: training the graph isomorphic spatiotemporal network model; the training process of the graph isomorphic spatiotemporal network model adopts an end-to-end approach, and uses a back-propagation algorithm to optimize model parameters.

[0085] In this embodiment, in step 2, the graph isomorphic spatiotemporal network model is trained using a preset loss function and optimization algorithm until the graph isomorphic spatiotemporal network model converges; specifically, the training includes:

[0086] Step 21: input a training set into the graph isomorphic spatiotemporal network model for training, wherein the training set includes historical traffic flow data and road network data;

[0087] Step 22: During the training of the graph isomorphic spatiotemporal network model, the mean absolute error (MAE) and the root mean square error (RMSE) are used as loss functions to measure the difference between the predicted value and the true value. The formula is as follows:

[0088]

[0089] Among them, MAE represents the mean absolute error, n represents the number of samples, i represents the i-th element, and RMSE represents the root mean square error. Represents the predicted value, y i represents the true value;

[0090] Step 23: Use the Adam optimizer to update the parameters of the graph isomorphic spatiotemporal network model. The initial learning rate is set to a preset value, for example, the initial learning rate is set to 0.005.

[0091] Step 24: Use the early stopping strategy to control the stopping time of the training process. That is, when the loss on the training set does not improve within m1 consecutive epochs, stop the training process. m1 is a positive integer and the value of m1 is set according to the training process. For example, when the loss on the validation set does not improve within 20 consecutive epochs, stop the training process. The purpose of using the early stopping strategy is to prevent overfitting.

[0092] Step 25: Use a learning rate decay strategy to control the learning rate of the training process. That is, reduce the learning rate to half of the original rate every m2 epochs, where m2 is a positive integer and the value of m2 is set according to the training process. For example, reduce the learning rate to half of the original rate every 50 epochs. The purpose of using a learning rate decay strategy is to help the model converge better in the later stages of training.

[0093] Step 26: When the difference between the predicted value and the true value after training is within the error range, it indicates that the graph isomorphic spatiotemporal network model has been trained.

[0094] Step 3: Input the pre-processed historical traffic flow data and road network data into the trained graph isomorphic spatiotemporal network model;

[0095] Step 4: extracting spatial features through the spatial dependency modeling module;

[0096] In this embodiment, step 4 specifically includes:

[0097] Step 41: The pre-processed historical traffic flow data is represented as time series data, and the pre-processed road network data is represented as an adjacency matrix; the historical traffic flow data represented as time series data and the road network data represented as an adjacency matrix are input into a spatial dependency modeling module;

[0098] Step 42: The spatial dependency modeling module extracts the relationship between node features and the topological structure diagram from the historical traffic flow data and the road network data, and captures the nonlinear spatial dependency relationship between the node features and the topological structure diagram, and obtains the spatial features as the output of the spatial dependency modeling module.

[0099] In this embodiment, step 42 specifically includes:

[0100] Step 421: The spatial dependency modeling module includes a sequentially connected multi-layer graph isomorphism network, with adjacent layers of the multi-layer graph isomorphism network connected via residual connections. The present invention uses graph isomorphism networks to model the spatial dependencies of transportation networks. Compared to traditional graph convolutional networks (GINs), GINs utilize learnable aggregation functions to more accurately extract the complex relationships between node features and topological structures, thereby more effectively capturing the complex nonlinear spatial dependencies in transportation networks, which is crucial for accurately predicting traffic flows.

[0101] Step 422: The historical traffic flow data and road network data are used as inputs for a first-layer graph isomorphism network. A topological graph is constructed based on the road network data, where nodes represent sensors or road segments and edges represent connections between nodes. Time series data corresponding to each node in the historical traffic flow data is used as initial node features for the first-layer graph isomorphism network.

[0102] In traffic flow prediction, nodes usually represent sensors or road sections in the road network, and node features refer to traffic flow information related to these sensors or road sections, such as vehicle speed, flow, density, etc. Therefore, node features are extracted from historical traffic flow data. The topological structure refers to the connection relationship between each node in the road network, which can be represented by a graph to form a topological structure graph. The nodes in the topological structure graph represent sensors or road sections, and the edges represent the connections between them. Therefore, the topological structure graph is obtained from the road network data. Extracting the complex relationship between node features and the topological structure graph is the core function of GIN. Specifically:

[0103] Constructing a topology graph: First, a topology graph is constructed based on the road network data, where nodes represent sensor nodes and edges represent connections between them.

[0104] Initialize node features: Use the time series data (such as traffic speed) corresponding to each node in the historical traffic flow data as the initial node features.

[0105] GIN Aggregates Information: GIN updates each node's feature vector by iteratively aggregating information from neighboring nodes. In this process, GIN uses learnable parameters to learn the complex relationship between node features and topology. In other words, it learns which neighboring nodes have the greatest influence on the central node and how to incorporate information from these neighboring nodes to update the central node's features.

[0106] Step 423: For each node feature input to the graph isomorphism network of the current layer, the current node feature is used as the central node feature, and its neighbor node features and the central node feature are aggregated using an aggregation function to form an aggregated node feature; during the aggregation process, the graph isomorphism network uses learnable parameters to learn the relationship between the node features and the topological structure graph;

[0107] like Figure 3 As shown in the figure, the diagram of the node information aggregation process of the graph isomorphism network (GIN) at the current layer shows the core operation of this module. Taking node 1 as an example, the feature of node 1 is the central node feature, and the features of nodes 2, 3, 4, 5 and 6 adjacent to node 1 are used as neighbor node features; the figure shows how to aggregate information from neighboring nodes (nodes 2, 3, 4, 5 and 6). This process represents how GIN captures spatial dependencies in the entire transportation network. Similarly, when the feature of node 2 is the central feature, the features of nodes 1 and 3 are used as its neighbor node features; when the feature of node 6 is the central feature, the features of nodes 1, 8, 9 and 10 are used as its neighbor node features; the judgment of other nodes as central nodes will not be repeated here. Each node needs to be treated as a central node and its corresponding neighbor nodes need to be updated to form a new node.

[0108] Step 424: input the aggregated node features into a multi-layer perceptron for nonlinear transformation;

[0109] Step 425: Using the output of the multilayer perceptron as the updated node feature;

[0110] Step 426: Repeat steps 423 to 425 to iteratively update each node feature of the current layer graph isomorphism network input, and obtain all updated node features in the current layer graph isomorphism network as output features;

[0111] Step 427: For the graph isomorphism network of the first layer, the output features of the first layer graph isomorphism network are input to the graph isomorphism network of the second layer; for the graph isomorphism networks of the second layer and thereafter, the output features of the current layer graph isomorphism network and the input features of the current layer graph isomorphism network are added together, and the result is input to the graph isomorphism network of the next layer;

[0112] Step 428: Repeat steps 423 to 427 until all layers of graph isomorphism networks are calculated, and the output features of the last layer of graph isomorphism networks are used as the final output of the spatial dependency modeling module.

[0113] In this embodiment, the process from step 423 to step 425 is expressed as follows:

[0114]

[0115] Among them, h p (l) Indicates that the feature of a node in the l-th layer graph isomorphic network is used as the feature of the central node p, ε (l) represents the learnable parameters of the l-th layer graph isomorphism network, N(p) represents the set of neighbor nodes of the central node p, and h q (l) Represents the features of neighbor nodes q of the central node p in the l-th layer graph isomorphism network, MLP (l) is the multi-layer perceptron of the l-th layer graph isomorphism network, Represents the node features after the updated features of the central node p in the l-th layer graph isomorphism network.

[0116] The above formula describes how GIN updates node features: First, the learnable parameter ε (l) The weights of the central node's features are adjusted, and then the adjusted features of the central node p are added to the features of all its neighboring nodes. Finally, the result is input into a multi-layer perceptron for nonlinear transformation. This design enables GIN to effectively capture complex nonlinear spatial dependencies, especially when processing data with complex topological structures such as transportation networks.

[0117] Among them, the learnable parameter ε in GIN (l) It is adjusted through the backpropagation algorithm and gradient descent algorithm during the model training process: During the model training process, forward propagation is first performed based on the input historical traffic flow data and road network data to calculate the model's prediction results. The model prediction results are compared with the actual traffic flow data, and the prediction error is calculated, for example, using the mean square error (MSE). Based on the calculated prediction error, the error signal is passed back to each layer of the GIN layer by layer through the backpropagation algorithm, and the contribution of each learnable parameter to the error, that is, the gradient, is calculated. Finally, the gradient descent algorithm is used to update the learnable parameter ε according to the gradient direction and size. (l) By continuously iterating the above training process, GIN can learn the optimal learnable parameter ε. (l) , thus better capturing the nonlinear spatial dependencies in transportation networks.

[0118] For example, the features of nodes 1-11 are obtained from historical traffic flow data as the initial node features of the first-layer graph isomorphism network. For the first-layer graph isomorphism network, the features of node 1 are first updated as the central node features. The process is: p (1) is the feature of node 1 in the historical traffic flow data, h q (1) To obtain the neighbor node features adjacent to node 1 from the established topological structure graph, and substitute them into the above formula to calculate the updated result of node 1 features of the first-layer graph isomorphic network Similarly, the features of nodes 2-11 are updated according to the above formula. After the features of nodes 1-11 of the first-layer graph isomorphism network are updated, the updated results are used as the output of the first-layer graph isomorphism network.

[0119] For the second-layer graph isomorphism network, the output of the first-layer graph isomorphism network is the updated features of nodes 1-11. The output of the first-layer graph isomorphism network is directly input into the second-layer graph isomorphism network. The features of each node in the second-layer graph isomorphism network are updated according to the above update method to obtain the output of the second-layer graph isomorphism network. The result of adding the output and input of the second-layer graph isomorphism network is used as the input of the third-layer graph isomorphism network.

[0120] For the third-layer graph isomorphism network, the result of adding the output of the second-layer graph isomorphism network and the input of the second-layer graph isomorphism network is input into the third-layer graph isomorphism network, and the features of each node in the third-layer graph isomorphism network are updated according to the above-mentioned update method to obtain the output of the third-layer graph isomorphism network; the subsequent update methods are similar.

[0121] After concatenating the node 1-11 features obtained from the historical traffic flow data with the node 1-11 features finally output by the first-layer graph isomorphism network, the new node 1-11 features are used as the initial node features of the second-layer graph isomorphism network. The same method as the first-layer graph isomorphism network is used to update each node feature of the second-layer graph isomorphism network in sequence, and finally the final output of the second-layer graph isomorphism network is obtained, and so on.

[0122] Through the above steps, the spatial dependency modeling module can effectively extract the relationship between node features and the topological structure graph, capture the nonlinear spatial dependencies, and obtain node features containing rich spatial information. These features will be used for subsequent temporal feature extraction and prediction.

[0123] The relationship between node characteristics and topological structure diagram: refers to the connection between the traffic flow information of the node and its location in the road network and the surrounding connection relationship.

[0124] Nonlinear spatial dependency emphasizes the nonlinear nature of this relationship. That is, the traffic flow information of a node is not only affected by its immediate neighbors, but may also be affected by nodes further away. Moreover, this influence is not a simple linear superposition, but a more complex nonlinear relationship.

[0125] (1) Learnable aggregation functions: breaking through linear limitations.

[0126] Limitations of traditional GCN: Traditional graph convolutional networks (GCN) typically use a fixed average or weighted average function to aggregate neighbor node information. This linear aggregation method is difficult to capture the complex nonlinear interactions between nodes.

[0127] GIN's breakthrough: GIN introduces learnable aggregation functions, such as the multi-layer perceptron (MLP), which breaks through the limitations of linear aggregation. MLP can fit arbitrary nonlinear functions, allowing for more flexible learning of how to aggregate neighbor node information and capture potential nonlinear influences between nodes.

[0128] For example, suppose the congestion level of node A is affected by the congestion levels of its neighboring nodes B and C, and this influence is nonlinear. For example, when both B and C are congested, the impact on A is much greater than the combined effect of either being congested individually. Traditional GCNs cannot accurately model this nonlinear relationship, but GINs, through MLP, can learn a nonlinear function that more accurately describes this complex influence relationship.

[0129] (2) Multi-layer network structure: capturing high-order dependencies.

[0130] Limitations of single-layer GIN: A single-layer GIN can only capture the relationship between a node and its immediate neighbors. However, the influence between nodes in a traffic network is often transitive. For example, congestion at node A may affect node D, which is not adjacent to it, through intermediate nodes B and C.

[0131] Advantages of multi-layer GIN: By stacking multiple GIN layers, the model can capture higher-order dependencies between nodes. For example, a two-layer GIN can capture the relationship between a node and its second-order neighbors, a three-layer GIN can capture the relationship between its third-order neighbors, and so on. This ability to capture high-order dependencies enables GIN to model complex nonlinear propagation patterns in traffic networks, such as the diffusion and dissipation of congestion.

[0132] For example, suppose the congestion level of node A is affected not only by its direct neighbor nodes B and C, but also by B and C's neighbor nodes D and E. A single-layer GIN cannot capture the relationship between A and D and E, while a two-layer GIN can use B and C as bridges to pass the information of D and E to A, thereby learning this more complex nonlinear dependency.

[0133] In this embodiment, the spatial dependency modeling module includes two layers of graph isomorphism networks (GINs), and each layer of graph isomorphism networks performs the above-mentioned aggregation operation, wherein historical traffic flow data is used as the input of the first layer of GIN to initialize node features. Subsequently, the node features are updated in each layer of GIN, and the updated features are passed to the next layer of GIN, indirectly affecting the calculation of subsequent layers. Road network data is used as the input of the first layer of GIN to construct a topological structure graph and define the neighbor relationship between nodes. This topological structure graph information will be shared by all layers of GIN to ensure that the topological relationship of the road network is taken into account in the calculation of each layer of GIN. The spatial dependency modeling module adopts a two-layer GIN structure to expand the receptive field of the model and capture multi-order neighbor information, thereby more comprehensively understanding the spatial structure of the traffic network;

[0134] For each node, the output features of the corresponding node in the first-layer graph isomorphism network are concatenated with the node features of the historical traffic flow data and used as the input features of the corresponding node in the second-layer graph isomorphism network. A residual connection is implemented between the two layers of the graph isomorphism network. Residual connection is a common technique in deep learning models that is used to solve the gradient vanishing problem and enhance the learning ability of the model. In this invention, a residual connection is added between the two layers of the GIN structure, which has the following functions:

[0135] (1) Alleviating the vanishing gradient problem: Residual connections provide a shortcut for information transmission, allowing gradients to be back-propagated to shallow networks more effectively, thus avoiding the problem of gradients gradually disappearing in multi-layer networks.

[0136] (2) Enhanced model expressiveness: Residual connections allow the model to retain original information while learning new features, avoiding the loss of important features during information transmission. This enables the second-layer GIN to simultaneously utilize the output features of the first-layer GIN and the original node features, further increasing information flow and the model's ability to learn and express historical traffic flow data, enabling the model to learn more complex relationships and improving the model's expressiveness.

[0137] Through this design, the spatial dependency modeling module can effectively capture the complex nonlinear spatial dependencies in the transportation network, providing a basis for subsequent temporal feature extraction and spatiotemporal fusion.

[0138] Step 5: extracting time features through the time-dependent modeling module;

[0139] In this embodiment, step 5 specifically includes:

[0140] Step 51: The temporal dependency modeling module includes a dual-branch temporal convolutional network (TCN) structure and a gating mechanism. The dual-branch TCN structure includes a short-term dependency branch structure and a long-term dependency branch structure, respectively, for capturing features at different time scales. The gating mechanism includes a sequentially connected splicing layer, a gating unit, and a fusion layer, which adaptively fuses features from the two TCN branches to generate a more comprehensive temporal feature representation. The temporal dependency modeling module uses a dual-branch temporal convolutional network (TCN) structure and a gating mechanism to model the temporal dependency of traffic flow. This design can effectively capture both short-term fluctuations and long-term trends in traffic flow data, which is crucial for accurately predicting traffic flow.

[0141] like Figure 4 As shown in Figure 1, the dual-branch temporal convolutional network architecture consists of a short-term dependency branch (TCN-short) and a long-term dependency branch (TCN-long). The short-term dependency branch uses smaller convolution kernels and a smaller dilation rate, primarily capturing local temporal patterns. The long-term dependency branch uses larger convolution kernels and a larger dilation rate to capture a wider range of temporal dependencies. This dual-branch design enables the model to simultaneously consider features at different time scales.

[0142] Step 52: Use the output of the spatial dependency modeling module as input of the short-term dependency branch structure and the long-term dependency branch structure, respectively.

[0143] The short-term dependency branch structure includes at least one temporal convolution layer, which performs a causal convolution operation using a first convolution kernel and a first dilation rate, and is expressed as follows:

[0144]

[0145] Among them, y st represents the output feature of the short-term dependent branch structure, i represents the i-th element, k1 is the size of the first convolution kernel, and the size of the first convolution kernel is set to 2 or 3; w 1i represents the weight of the first convolution kernel, d1 represents the first expansion rate, and the first expansion rate is set to no more than 2 (such as 1 or 2); d1i represents the time step that needs to be traced back when calculating the convolution operation, t represents the time step, t-d1i represents a time point on the time axis, and x t-d1i Represents the features of the spatial features at time step t-d1i;

[0146] The long-term dependency branch structure includes at least one temporal convolution layer, which uses a second convolution kernel and a second dilation rate to perform a causal convolution operation, which is expressed as follows:

[0147]

[0148] Among them, y lt represents the output feature of the long-term dependent branch structure, i represents the i-th element, k2 is the size of the second convolution kernel, and the size of the second convolution kernel is set to 5 or 7; w 2i represents the weight of the second convolution kernel, d2 represents the second expansion rate, and the second expansion rate is set to be greater than 2 (4 or 6); d2i represents the time step that needs to be traced back when calculating the convolution operation, t represents the time step, t-d2i represents a time point on the time axis, and x t-d2i Represents the features of the spatial features at time step t-d2i;

[0149] Time step t refers to a discrete time point in a time series, representing the time sequence of traffic flow data. For example, t = 1 represents the first time step, t = 2 represents the second time step, and so on. In the present invention, if a time granularity of 15 minutes is used to predict traffic flow, then: each time step represents a 15-minute time point. Assuming that we collect 24 hours of traffic flow data, there will be 24 hours * 60 minutes / hour / 15 minutes / time step = 96 time steps. For example, it represents the traffic flow information in the time period from 00:00 to 00:15, the traffic flow information in the time period from 00:15 to 00:30, and so on.

[0150] The main difference between the two branches lies in the different settings of the convolution kernel size (k1 and k2) and dilation rate (d1 and d2), which enables them to extract features at different time scales. TCN-short: uses smaller convolution kernels and dilation rates, focusing on capturing local short-term dependencies between adjacent time steps. TCN-long: uses larger convolution kernels and dilation rates, which can span more time steps and capture global long-term trends over longer distances. In addition to the size and dilation rate of the convolution kernel, other parameters, such as the weight of the convolution kernel, can be different in the two branches, which means that they will learn different temporal feature representations according to their respective goals.

[0151] Causal convolution is a special convolution operation that ensures that when the model predicts the output of a certain time step, it only uses the information of that time step and before, and does not use future information, which conforms to the causal relationship of time series.

[0152] Preferably, to enhance the learning ability of the model, a residual connection is introduced between the short-term dependency branch structure and the long-term dependency branch structure. This design helps alleviate the gradient vanishing problem and facilitates the training of deep networks.

[0153] Step 53: Output feature y of short-term dependent branch structure st And the output feature y of the long-term dependent branch structure lt The input is fed into the gating mechanism for splicing, gating, and fusion calculations to obtain the temporal features as the output of the temporal dependency modeling module; the gating mechanism is used to adaptively fuse the multi-scale features from the two TCN branches (short-term dependency branch structure and long-term dependency branch structure);

[0154] The calculation process of the gating mechanism is expressed as follows:

[0155] g=σ(W g [y st ,y lt ]+b g )

[0156]

[0157] Among them, σ represents the Sigmoid activation function, W g and b g represents a learnable parameter, [·,·] represents a feature concatenation operation, g represents a gate weight, Represents element multiplication operation, y represents y st and y lt The comprehensive output is adaptively generated by the gating mechanism.

[0158] Through this design, the Time Dependent Modeling module adaptively fuses features at different time scales to generate a more comprehensive temporal feature representation. This enables the model to better understand the temporal dynamics of traffic flow, including both short-term fluctuations and long-term trends, thereby improving forecast accuracy. The module's output is a rich temporal feature representation, providing an important foundation for subsequent spatiotemporal feature fusion.

[0159] Step 6: Fusing spatial features and temporal features through the spatiotemporal feature fusion module;

[0160] In this embodiment, step 6 specifically includes:

[0161] Step 61: The spatial features output by the spatial dependency modeling module and the temporal features output by the temporal dependency modeling module are used as inputs of a spatiotemporal feature fusion module.

[0162] Step 62: The spatiotemporal feature fusion module adopts a gated recurrent unit (GRU) structure, and dynamically adjusts the spatial and temporal features through the gating mechanism of the gated recurrent unit (GRU) structure to achieve the fusion of spatiotemporal information; GRU can effectively integrate the features from the spatial dependency modeling module and the temporal dependency modeling module, learn complex spatiotemporal interaction relationships, and thus generate a comprehensive spatiotemporal representation.

[0163] like Figure 5 As shown in Figure 1, the core of the spatiotemporal feature fusion module is the GRU structure. This module receives the output features of the spatial dependency modeling module and the temporal dependency modeling module. Using the GRU's gating mechanism, it dynamically adjusts the importance of different features, achieving effective fusion of spatiotemporal information.

[0164] The updating process of the GRU structure is expressed as follows:

[0165] z t =σ(W z ·[h t-1 , s t ]+b z )

[0166] r t =σ(W r ·[h t-1 , s t ]+b r )

[0167]

[0168] Among them, z t represents the update gate, σ represents the Sigmoid activation function, h t-1 represents the hidden state at time t-1, s tRepresents the input vector composed of spatial features and temporal features; r t Represents the reset gate, represents the candidate hidden state at time t, tanh represents the tanh activation function, Represents element-wise multiplication operation, h t represents the final candidate hidden state at time t, W z 、W r and W h represents the learnable parameter matrix, b z 、b r and b h Represents the bias vector.

[0169] Through the above update process, the GRU structure can dynamically adjust the importance of features according to the current input and historical information, and effectively integrate spatial and temporal information. Specifically, the reset gate r t Controls the influence of the previous hidden state on the current candidate hidden state, and updates the gate z t It determines to what extent the new hidden state should be updated. GRU uses the reset gate r t and update gate z t To dynamically control the influence of historical information and current input information on the final hidden state, thereby achieving adaptive adjustment of feature importance. This mechanism enables GRU to flexibly handle long-term dependencies while effectively fusing features from different sources.

[0170] Through this design, the spatiotemporal feature fusion module can fully utilize the complementarity of spatial and temporal information to generate a more comprehensive and accurate spatiotemporal representation. This fusion not only considers spatial dependencies but also incorporates the dynamic changes of time series, thus better capturing the complex patterns of traffic flow.

[0171] Step 7: Map the fused spatial and temporal features to the prediction results to obtain the traffic flow prediction value for a certain period of time in the future.

[0172] The fused features output by the spatiotemporal feature fusion module contain rich spatiotemporal information. We pass the output features of the GRU to a fully connected layer using a linear activation function, and use the linear activation function to map the fused high-dimensional spatial and temporal features to the required prediction dimension, thereby generating accurate traffic flow prediction results. The output of the fully connected layer is the prediction result of the model, such as the predicted traffic speed value for each node in the next hour.

[0173] In the actual prediction process, the GISTN model is used as follows: First, preprocessed historical traffic flow data and road network data are input into the model. Then, spatial and temporal features are extracted using the spatial dependency modeling module and the temporal dependency modeling module, respectively. The extracted features are then fused using the spatiotemporal feature fusion module. Finally, a fully connected layer maps the fused features to the prediction results, yielding traffic flow forecasts for the future period. This series of steps enables end-to-end processing from raw data to final prediction results, fully leveraging the strengths of each module in the GISTN model to ensure the accuracy and reliability of the prediction results.

[0174] To validate the effectiveness of the GISTN model, experiments were conducted on multiple public datasets, including SZ-TAXI, LOS-LOOP-SMALL, and PeMSD7(M). Experimental results show that GISTN outperforms multiple baseline methods, including ARIMA, SVR, GRU, DCRNN, and STGCN, at different prediction times (15 minutes, 30 minutes, and 60 minutes).

[0175] We also explored the impact of key hyperparameters of the model on performance. Figure 6 As shown in , the choice of hidden layer dimension in GIN has a significant impact on model performance. Experiments show that when the hidden layer dimension is 64, the model achieves the best balance between prediction accuracy and computational efficiency. Figure 7 As shown in Figure 3, the experimental results show that the two-layer GIN structure can achieve a good balance between capturing spatial dependencies and controlling model complexity.

[0176] To further validate the effectiveness of each module in the GISTN model, we designed several variant models for comparative experiments. We compared the performance of GISTN with variants such as GISTN-GCN (replacing GIN with GCN), GISTN-NG (removing the spatial dependency modeling module), GISTN-NR (removing the GRU), and GISTN-NT (removing the temporal dependency modeling module). Experimental results show that GISTN outperforms these variant models across various prediction horizons, confirming the importance of the spatial dependency modeling module, the temporal dependency modeling module, and the spatiotemporal feature fusion module. In particular, the advantages of GISTN over GISTN-GCN highlight the superiority of GIN in capturing complex nonlinear spatial dependencies.

[0177] These experimental results fully demonstrate the effectiveness and superiority of the GISTN model in traffic flow prediction tasks, and also verify the important role of each key component of the model.

[0178] like Figure 8As shown, an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the above-mentioned traffic flow prediction method based on graph isomorphic spatiotemporal network is implemented.

[0179] like Figure 9 As shown, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned traffic flow prediction method based on graph isomorphic spatiotemporal network.

[0180] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0182] The above descriptions are only some embodiments of the present invention and do not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A traffic flow prediction method based on graph isomorphic spatiotemporal network, characterized by: The steps include: Step 1: construct a graph isomorphic spatiotemporal network model, which includes a spatial dependency modeling module, a temporal dependency modeling module, and a spatiotemporal feature fusion module; Step 2: training the graph isomorphic spatiotemporal network model; Step 3: Input the pre-processed historical traffic flow data and road network data into the trained graph isomorphic spatiotemporal network model; Step 4: extracting spatial features through the spatial dependency modeling module; Specifically include: Step 41: The pre-processed historical traffic flow data is represented as time series data, and the pre-processed road network data is represented as an adjacency matrix; the historical traffic flow data represented as time series data and the road network data represented as an adjacency matrix are input into a spatial dependency modeling module; Step 42: The spatial dependency modeling module extracts the relationship between the node features and the topological structure graph from the historical traffic flow data and the road network data, and captures the nonlinear spatial dependency relationship between the node features and the topological structure graph, and obtains the spatial features as the output of the spatial dependency modeling module; Step 5: extracting time features through the time-dependent modeling module; specifically including: Step 51: The temporal dependency modeling module includes a dual-branch temporal convolutional network structure and a gating mechanism. The dual-branch temporal convolutional network structure includes a short-term dependency branch structure and a long-term dependency branch structure. The gating mechanism includes a splicing layer, a gating unit, and a fusion layer connected in sequence. Step 52: Use the output of the spatial dependency modeling module as input of the short-term dependency branch structure and the long-term dependency branch structure, respectively. The short-term dependency branch structure includes at least one temporal convolution layer, which performs a causal convolution operation using a first convolution kernel and a first dilation rate, and is expressed as follows: in, represents the output features of the short-term dependent branch structure, Indicates the elements, k 1 is the size of the first convolution kernel, represents the weight of the first convolution kernel, represents the first expansion rate, Indicates the time step that needs to be traced back when calculating the convolution operation. represents the time step, Indicates a point in time on the timeline. Represents the spatial features at the time step t Characteristics of time; The long-term dependency branch structure includes at least one temporal convolution layer, which uses a second convolution kernel and a second dilation rate to perform a causal convolution operation, which is expressed as follows: in, represents the output features of the long-term dependent branch structure, Indicates the elements, k 2 is the size of the second convolution kernel, represents the weight of the second convolution kernel, represents the second expansion rate, Indicates the time step that needs to be traced back when calculating the convolution operation. represents the time step, Indicates a point in time on the timeline. Represents the spatial features at the time step t Characteristics of time; Step 53: Output features of short-term dependent branch structures and output features of long-term dependent branch structures The input is sent to the gating mechanism for splicing, gating and fusion calculations to obtain the temporal features as the output of the time-dependent modeling module; The calculation process of the gating mechanism is expressed as follows: in, represents the Sigmoid activation function, and represents the learnable parameters, represents the feature concatenation operation, represents the gate weight, represents the element-wise multiplication operation, express and Comprehensive output adaptively generated by the gating mechanism; Step 6: Fusing spatial features and temporal features through the spatiotemporal feature fusion module; Step 7: Map the fused spatial and temporal features to the prediction results to obtain the traffic flow prediction value for a certain period of time in the future.

2. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 1, characterized in that: In the step 2, the graph isomorphic spatiotemporal network model is trained using a preset loss function and optimization algorithm until the graph isomorphic spatiotemporal network model converges; specifically, the step includes: Step 21: input a training set into the graph isomorphic spatiotemporal network model for training, wherein the training set includes historical traffic flow data and road network data; Step 22: During the training of the graph isomorphic spatiotemporal network model, the mean absolute error and root mean square error are used as loss functions to measure the difference between the predicted value and the true value. The formula is as follows: in, MAE represents the mean absolute error, n represents the number of samples, i Indicates the i elements, RMSE represents the root mean square error, represents the predicted value, represents the true value; Step 23: Use the Adam optimizer to update the parameters of the graph isomorphic spatiotemporal network model, and set the initial learning rate to the preset value; Step 24: Use the early stopping strategy to control the stopping time of the training process. That is, when the loss on the training set does not improve within m1 consecutive epochs, stop the training process. m1 is a positive integer and the value of m1 is set according to the training process. Step 25: Use the learning rate decay strategy to control the learning rate of the training process, that is, reduce the learning rate to half of the original rate every m2 epochs, where m2 is a positive integer and the value of m2 is set according to the training process; Step 26: When the difference between the predicted value and the true value after training is within the error range, it indicates that the graph isomorphic spatiotemporal network model has been trained.

3. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 1, characterized in that: The step 42 specifically includes: Step 421: The spatial dependency modeling module includes sequentially connected multi-layer graph isomorphism networks, and two adjacent multi-layer graph isomorphism networks are connected via residual connections. Step 422: The historical traffic flow data and road network data are used as inputs for a first-layer graph isomorphism network. A topological graph is constructed based on the road network data, where nodes represent sensors or road segments and edges represent connections between nodes. Time series data corresponding to each node in the historical traffic flow data is used as initial node features for the first-layer graph isomorphism network. Step 423: For each node feature inputted by the graph isomorphism network of the current layer, the current node feature is used as the central node feature, and the neighbor node features and the central node feature are aggregated using an aggregation function to obtain the aggregated node feature. Step 424: input the aggregated node features into a multi-layer perceptron for nonlinear transformation; Step 425: Use the output of the multilayer perceptron as the updated node feature; Step 426: Repeat steps 423 to 425 to iteratively update each node feature of the current layer graph isomorphism network input, and obtain all updated node features in the current layer graph isomorphism network as output features; Step 427: For the graph isomorphism network of the first layer, the output features of the first layer graph isomorphism network are input to the graph isomorphism network of the second layer; for the graph isomorphism networks of the second layer and thereafter, the output features of the current layer graph isomorphism network and the input features of the current layer graph isomorphism network are added together, and the result is input to the graph isomorphism network of the next layer; Step 428: Repeat steps 423 to 427 until all layers of graph isomorphism networks are calculated, and the output features of the last layer of graph isomorphism networks are used as the final output of the spatial dependency modeling module.

4. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 3, characterized in that: The process of step 423 to step 425 is expressed by the formula: in, Indicates the l A node feature in a layer graph isomorphic network is used as a central node p feature, Indicates the l Learnable parameters of layer graph isomorphism networks, Represents the central node p The set of neighbor nodes of Indicates the l Central nodes in layer graph isomorphic networks p Neighbor nodes Features, It is l Multilayer Perceptron with Layer Graph Isomorphic Network, Indicates the l The central node in the layer graph isomorphic network p Node features after feature update.

5. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 1, characterized in that: The spatial dependency modeling module includes two layers of graph isomorphic networks. For each node, the output features of the corresponding node of the first layer of graph isomorphic network are spliced ​​with the node features of historical traffic flow data and used as the input features of the corresponding node of the second layer of graph isomorphic network, realizing residual connection between the two layers of the graph isomorphic network.

6. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 1, characterized in that: The step 6 specifically includes: Step 61: The spatial features output by the spatial dependency modeling module and the temporal features output by the temporal dependency modeling module are used as inputs of a spatiotemporal feature fusion module. Step 62: The spatiotemporal feature fusion module adopts a gated recurrent unit structure, and dynamically adjusts the spatial and temporal features through the gating mechanism of the gated recurrent unit structure to achieve the fusion of spatiotemporal information. The updating process of the gated recurrent unit structure is expressed as follows: ( [ + ) (1- ) + in, represents the update gate, represents the Sigmoid activation function, express The hidden state of the moment, Represents the input vector composed of spatial features and temporal features; Represents the reset gate, express The candidate hidden state at time t, tanh represents the tanh activation function, represents the element-wise multiplication operation, express The final candidate hidden state at time t, 、 and represents the learnable parameter matrix, 、 and Represents the bias vector.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for traffic flow prediction based on graph isomorphic spatiotemporal network according to any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for traffic flow prediction based on a graph isomorphic spatiotemporal network according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Traffic prediction method based on multi-scale space-time fusion graph network

    CN115240425A

  • Traffic flow prediction method of space-time attention graph convolutional network based on multi-feature fusion

    CN116168548A