Traffic flow prediction method and device based on graph isomorphic space-time network, and medium
Through the traffic flow prediction method based on graph isomorphic spatiotemporal network, combined with graph isomorphic network and dual-branch time convolution network, the existing methods are solved in capturing complex spatial relationships and temporal feature extraction, and more accurate traffic is achieved Flow prediction improves prediction accuracy and model generalization capabilities.
Patent Information
- Application Number
- CN202411281707.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-13
AI Technical Summary
Existing traffic flow prediction methods have shortcomings in capturing complex nonlinear spatial relationships and time characteristics at different scales, resulting in the impact of prediction accuracy and reliability, especially when dealing with long-distance spatial dependence and multi-level spatial interaction characteristics. flow.
Using the traffic flow prediction method based on graph isomorphic spatiotemporal network, the space-dependent modeling module, time-dependent modeling module and spatiotemporal feature fusion module are constructed, combined with graph isomorphic network and dual-branch temporal convolution network structure, extract and fuse space and time features to effectively capture and fusion of complex nonlinear spatial dependencies and time features in the traffic network and different scales.
It significantly improves the accuracy and performance of traffic flow prediction, can make more accurate predictions of traffic flow in the short and long term, improves the generalization ability and computing efficiency of the model, and overcomes the existing methods when dealing with complex spatiotemporal patterns. Difficult, showing good generalization and practical value.
Smart Images

Figure CN119169817A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a traffic flow prediction method, device and medium based on a graph isomorphic spatiotemporal network. Background Art
[0002] Traffic flow prediction is one of the core tasks of intelligent transportation systems, and is of great significance for alleviating traffic congestion, optimizing traffic resource allocation, and improving urban traffic management. However, due to the spatiotemporal dynamics and nonlinear characteristics of traffic data and the complexity of the road network topology, accurate traffic flow prediction still faces huge challenges.
[0003] Compared with traditional traffic forecasting methods, traffic flow forecasting based on deep learning has significant advantages in improving forecasting accuracy, capturing complex spatiotemporal dependencies, and adapting to nonlinear traffic patterns. Therefore, deep learning methods have become the mainstream trend in the field of traffic flow forecasting. However, with the expansion of the scale and complexity of urban transportation networks, the challenges faced by traffic flow forecasting have also increased. Traffic flow data has a high degree of dynamics, nonlinear characteristics, and complex topological structures in spatiotemporal distribution, which brings huge challenges to traditional deep learning models and affects the accuracy and reliability of forecasts.
[0004] The introduction of Graph Neural Network (GNN) provides a new idea for 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 in 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 short-term fluctuations and long-term trends at the same time, affecting the accurate prediction of traffic flow changes over a longer time span in the future.
[0005] A good traffic flow prediction model should be able to handle complex spatial dependencies and temporal features of different scales at the same time, which plays a vital role in traffic management and planning optimization. However, due to the shortcomings of existing models in the extraction and fusion of spatial and temporal features, large errors may occur when predicting peak traffic flow, seriously affecting the effectiveness of traffic management decisions. In addition, if the model cannot effectively capture long-term temporal dependencies, it will be difficult to accurately predict traffic trends over a long period of time in the future, affecting the formulation of long-term traffic planning.
[0006] Regarding the common problems of insufficient spatial dependency modeling and difficulty in extracting temporal features at different scales in traffic flow prediction, no relevant research work has yet proposed an effective solution that takes both into account. The most relevant research work is the traffic flow prediction method based on graph convolutional networks. These methods have improved spatial dependency modeling to a certain extent, but they still fail to effectively solve the problem of capturing complex nonlinear spatial relationships and extracting 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 network, 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, so as to improve 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 graph isomorphic spatiotemporal network, comprising the following steps:
[0010] Step 1: construct a graph isomorphic spatiotemporal network model, wherein the graph isomorphic spatiotemporal network model 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 preprocessed 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 the spatial features and the temporal features through the spatiotemporal feature fusion module;
[0016] Step 7: Map the fused spatial features 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 an optimization algorithm until the graph isomorphic spatiotemporal network model converges; specifically, the step includes:
[0018] Step 21, inputting 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 the 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 a 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, where 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 trained predicted value and the true value 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 preprocessed historical traffic flow data is represented by time series data, and the preprocessed road network data is represented by an adjacency matrix; the historical traffic flow data represented by time series data and the road network data represented by the adjacency matrix are input into a spatial dependency modeling module;
[0028] Step 42, the spatial dependency modeling module extracts the relationship between the 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 in the 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 multiple layers of graph isomorphism networks connected in sequence, and two adjacent layers of the multiple layers of graph isomorphism networks are connected via residual connections;
[0031] Step 422: The historical traffic flow data and the road network data are used as inputs of the first-layer graph isomorphic network, and a topological structure graph is constructed according to the road network data, wherein nodes represent sensors or road sections, and edges represent connections between nodes; and the time series data corresponding to each node in the historical traffic flow data is used as the initial node features of the first-layer graph isomorphic 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 its neighbor node features and the central node feature are aggregated by an aggregation function as 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, repeating steps 423 to 425 to iteratively update each node feature of the current layer graph isomorphic network input, and obtaining all updated node features in the current layer graph isomorphic network as output features;
[0036] Step 427: For the graph isomorphism network of the first layer, the output features of the graph isomorphism network of the first layer are input into the graph isomorphism network of the second layer; for the graph isomorphism networks of the second layer and thereafter, the output features of the graph isomorphism network of the current layer are added to the input features of the graph isomorphism network of the current layer, and the result is input into 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 by the formula:
[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 features of the central node p in the l-th layer graph isomorphic network are updated.
[0041] Furthermore, the spatial dependency modeling module includes two layers of graph isomorphic networks. For each node, the output features of the corresponding nodes of the first layer of graph isomorphic networks are concatenated with the node features of historical traffic flow data as input features of the corresponding nodes of the second layer of graph isomorphic networks, thereby realizing residual connection between the two layers of graph isomorphic networks.
[0042] Furthermore, the step 5 specifically includes:
[0043] Step 51, the time-dependent modeling module includes a dual-branch time convolutional network structure and a gating mechanism, the dual-branch time convolutional network structure includes a short-term dependency branch structure and a long-term dependency branch structure, and the gating mechanism includes a splicing layer, a gating unit, and a fusion layer connected in sequence;
[0044] Step 52: using 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, wherein:
[0045] The short-term dependency branch structure includes at least one temporal convolution layer, and the temporal convolution layer uses a first convolution kernel and a first dilation rate to perform a causal convolution operation, which is expressed by the following formula:
[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, and 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, and x t-d1i Represents the features of the spatial features at time step t-d1i;
[0048] The long-term dependent branch structure includes at least one temporal convolution layer, and the temporal convolution layer uses a second convolution kernel and a second dilation rate to perform a causal convolution operation, which is expressed by the following formula:
[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, and 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, and x t-d2i Represents the features of the spatial features at time step t-d2i;
[0051] Step 53: Output feature y of the 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, and the temporal features are obtained as the output of the temporal dependency 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 gating weight, Represents element multiplication operation, y represents y st and lt The comprehensive output is adaptively generated by the gating mechanism.
[0056] Furthermore, the step 6 specifically includes:
[0057] Step 61: using the spatial features output by the spatial dependency modeling module and the temporal features output by the temporal dependency modeling module 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 a gating mechanism of the gated recurrent unit structure to achieve fusion of spatiotemporal information.
[0059] The updating process of the gated recurrent unit (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 the 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, 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, 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 the graph isomorphism spatiotemporal network model (GISTN model), comprehensively considers the prediction accuracy, computational efficiency and model generalization ability, can make more accurate short-term and long-term predictions of traffic flow, and significantly improves 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; wherein, the proposed spatial dependency modeling module adopts the graph isomorphism network (GIN) to significantly enhance the model's ability to capture complex nonlinear spatial dependencies, so as to better capture the complex nonlinear spatial relationships in the traffic network, and effectively solve the problem of capturing long-distance spatial dependencies and multi-level spatial interaction features; the design of the temporal dependency modeling module adopts a dual-branch temporal convolutional network structure and a gating mechanism to extract different scale temporal features in traffic flow data, realizes the adaptive capture of short-term fluctuations and long-term trends, and overcomes the difficulties of existing methods in dealing with long-term temporal dependencies and different scale temporal patterns; the proposed spatiotemporal feature fusion module adopts a fusion mechanism based on a gated recurrent unit to realize the dynamic integration of spatial and temporal features, fully utilizes the complementarity of the two, and significantly enhances the model's learning ability for complex spatiotemporal patterns. Experimental results show that the prediction accuracy of the GISTN model on multiple public data sets is significantly better than that of existing methods, and it performs well in different prediction time scales and different urban scenarios, showing good generalization and practical value. These improvements provide strong support for the development of intelligent transportation systems and provide reliable technical guarantees for alleviating traffic congestion, optimizing traffic 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.
[0070] Figure 1 It is a flowchart of a traffic flow prediction method based on 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 in an embodiment of the present invention.
[0073] Figure 4It is a structural diagram of the time-dependent modeling module provided in an embodiment of the present invention.
[0074] Figure 5 It is a structural diagram of the GRU unit in the spatiotemporal feature fusion module provided in an embodiment of the present invention.
[0075] Figure 6 It is a comparison chart of 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 of the impact of different numbers of GIN layers on model performance provided by an embodiment of the present invention.
[0077] Figure 8 It is a schematic diagram of an electronic device provided by an embodiment of the present invention.
[0078] Fig. 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 further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0080] See also 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 turn 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 is responsible for capturing the complex nonlinear spatial relationships in the traffic network; the temporal dependency modeling module extracts temporal features of different scales; and the spatiotemporal feature fusion module realizes the dynamic integration of spatial and temporal features to generate a comprehensive spatiotemporal representation. This modular design enables the GISTN model to fully consider the spatiotemporal characteristics of traffic flow, providing a solid foundation for accurate prediction.
[0083] The GISTN model proposed in the present invention 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 an optimization algorithm until the graph isomorphic spatiotemporal network model converges; specifically, the training includes:
[0086] Step 21, inputting 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 process 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 trained predicted value and the true value is within the error range, it indicates that the graph isomorphic spatiotemporal network model has been trained.
[0094] Step 3: Input the preprocessed 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 preprocessed historical traffic flow data is represented by time series data, and the preprocessed road network data is represented by an adjacency matrix; the historical traffic flow data represented by time series data and the road network data represented by the adjacency matrix are input into a spatial dependency modeling module;
[0098] Step 42, the spatial dependency modeling module extracts the relationship between the 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 in the 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 multi-layer graph isomorphic network connected in sequence, and two adjacent layers of multi-layer graph isomorphic networks are connected by residuals; the present invention uses a graph isomorphic network to model the spatial dependency relationship of the traffic network. Compared with the traditional graph convolutional network, GIN can more accurately extract the complex relationship between node features and topological structures through learnable aggregation functions, thereby more effectively capturing the complex nonlinear spatial dependency relationship in the traffic network, which is crucial for accurately predicting traffic flow.
[0101] Step 422: The historical traffic flow data and the road network data are used as inputs of the first-layer graph isomorphic network, and a topological structure graph is constructed according to the road network data, wherein nodes represent sensors or road sections, and edges represent connections between nodes; and the time series data corresponding to each node in the historical traffic flow data is used as the initial node features of the first-layer graph isomorphic 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 topological structure graphs is the core function of GIN. Specifically:
[0103] Constructing a topological structure graph: First, a topological structure graph is constructed based on the road network data, where nodes represent sensor nodes and edges represent the 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 the feature vector of each node by iteratively aggregating the information of neighboring nodes. In this process, GIN uses learnable parameters to learn the complex relationship between node features and topological structures. In other words, it learns which neighboring nodes have a greater impact on the central node and how to combine the information of neighboring nodes to update the features of the central node.
[0106] Step 423: for each node feature input by 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 features are aggregated by an aggregation function as the 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 schematic diagram of the node information aggregation process of the graph isomorphism network (GIN) described in 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; then the figure shows how to aggregate information from neighbor nodes (nodes 2, 3, 4, 5 and 6). This process represents the way 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 fused to update and 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, repeating steps 423 to 425 to iteratively update each node feature of the current layer graph isomorphic network input, and obtaining all updated node features in the current layer graph isomorphic network as output features;
[0111] Step 427: For the graph isomorphism network of the first layer, the output features of the graph isomorphism network of the first layer are input into the graph isomorphism network of the second layer; for the graph isomorphism networks of the second layer and thereafter, the output features of the graph isomorphism network of the current layer are added to the input features of the graph isomorphism network of the current layer, and the result is input into 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 of step 423 to step 425 is expressed by the formula:
[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 features of the central node p in the l-th layer graph isomorphic network are updated.
[0116] The above formula describes how GIN updates node features: First, the learnable parameter ε (l) The weight of the central node's own features is adjusted, and then the adjusted features of the central node p are added to the features of all its neighboring nodes, and 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 traffic networks.
[0117] Among them, the learnable parameter ε in GIN (l) It is adjusted through the back propagation algorithm and gradient descent algorithm in the model training process: During the model training process, first forward propagation is performed based on the input historical traffic flow data and road network data to calculate the model's prediction results. Compare the model prediction results with the actual traffic flow data and calculate the prediction error, such as using the mean square error (MSE). Based on the calculated prediction error, the error signal is passed back to each layer of GIN layer by layer through the back propagation 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) The value of makes the prediction error of the model gradually decrease. 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 isomorphic network. For the first-layer graph isomorphic 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. When 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-mentioned update method to obtain the output of the second-layer graph isomorphism network. The output and input of the second-layer graph isomorphism network are added together as the input of the third-layer graph isomorphism network.
[0120] For the third-layer graph isomorphism network, the output of the second-layer graph isomorphism network and the input of the second-layer graph isomorphism network are added together and input into the third-layer graph isomorphism network. The feature of each node in the third-layer graph isomorphism network is updated according to the above-mentioned updating method to obtain the output of the third-layer graph isomorphism network. The subsequent updating 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 isomorphic network, the new node 1-11 features are used as the initial node features of the second-layer graph isomorphic network. The same method as the first-layer graph isomorphic network is used to update each node feature of the second-layer graph isomorphic network in sequence, and finally the final output of the second-layer graph isomorphic 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 topological structure graphs, and capture the nonlinear spatial dependency relationships therein, obtaining 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 road network location and surrounding connection relationship.
[0124] Nonlinear spatial dependency: emphasizes the nonlinear characteristics of this relationship. That is, the traffic flow information of a node is not only affected by its immediate neighboring nodes, but may also be affected by more distant nodes, and 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) usually use a fixed average or weighted average function to aggregate neighbor node information. This linear aggregation method is difficult to capture the complex nonlinear interaction relationship between nodes.
[0127] GIN's breakthrough: GIN introduces learnable aggregation functions, such as multi-layer perceptron (MLP), which breaks through the limitations of linear aggregation. MLP can fit any nonlinear function, thereby more flexibly learning the aggregation method of neighbor node information and capturing the potential nonlinear influence relationship 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 relationship is nonlinear. For example, when B and C are congested at the same time, the impact on A is much greater than the combined impact of the two being congested separately. Traditional GCN cannot accurately model this nonlinear relationship, but GIN can learn a nonlinear function through MLP to more accurately describe this complex influence relationship.
[0129] (2) Multi-layer network structure: capturing high-order dependencies.
[0130] Limitations of single-layer GIN: Single-layer GIN can only capture the relationship between a node and its direct neighbors. However, the impact 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, two layers of GIN can capture the relationship between a node and its second-order neighbors, three layers of GIN can capture the relationship between 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: Assume that the congestion level of node A is not only affected 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 pass the information of D and E to A through B and C as a bridge, thereby learning this more complex nonlinear dependency.
[0133] In this embodiment, the spatial dependency modeling module includes two layers of graph isomorphic networks (GIN), and each layer of graph isomorphic 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. The 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 transportation network;
[0134] For each node, the output features of the corresponding nodes of the first-layer graph isomorphic network are spliced with the node features of the historical traffic flow data as the input features of the corresponding nodes of the second-layer graph isomorphic network, and the two layers of the graph isomorphic network are connected through residual connections. Residual connections are a common technology in deep learning models, which are used to solve the gradient disappearance problem and enhance the learning ability of the model. In the present invention, residual connections are added between the two layers of GIN structure, and their functions are as follows:
[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 vanishing 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 the information flow and the model’s learning and expressiveness of historical traffic flow data, allowing 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 structure and a gating mechanism, wherein the dual-branch temporal convolutional network structure includes a short-term dependency branch structure and a long-term dependency branch structure, which are used to capture features of different time scales respectively; the gating mechanism includes a sequentially connected splicing layer, a gating unit and a fusion layer, which are used to adaptively fuse features from two TCN branches to generate a more comprehensive temporal feature representation; the temporal dependency modeling module adopts 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 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 the figure, the dual-branch temporal convolutional network structure includes a short-term dependency branch (TCN-short) structure and a long-term dependency branch (TCN-long) structure. The short-term dependency branch structure uses a smaller convolution kernel and a smaller dilation rate, mainly used to capture local temporal patterns. The long-term dependency branch structure uses a larger convolution kernel and a larger dilation rate to capture a wider range of temporal dependencies. This dual-branch design enables the model to simultaneously consider features of different time scales.
[0142] Step 52: using 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, wherein:
[0143] The short-term dependency branch structure includes at least one temporal convolution layer, and the temporal convolution layer uses a first convolution kernel and a first dilation rate to perform a causal convolution operation, which is expressed by the following formula:
[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 be no greater 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 dependent branch structure includes at least one temporal convolution layer, and the temporal convolution layer uses a second convolution kernel and a second dilation rate to perform a causal convolution operation, which is expressed by the following formula:
[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 timeline, 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 is 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 the time series.
[0152] Preferably, in order 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 promotes the training of deep networks.
[0153] Step 53: Output feature y of the 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 calculation 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 gating weight, Represents element multiplication operation, y represents y st and lt The comprehensive output is adaptively generated by the gating mechanism.
[0158] With this design, the time-dependent modeling module is able to adaptively fuse features of 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 short-term fluctuations and long-term trends, thereby improving the accuracy of predictions. The output of this module is a rich temporal feature representation, which provides an important foundation for subsequent spatiotemporal feature fusion.
[0159] Step 6: Fusing the spatial features and the temporal features through the spatiotemporal feature fusion module;
[0160] In this embodiment, step 6 specifically includes:
[0161] Step 61: using the spatial features output by the spatial dependency modeling module and the temporal features output by the temporal dependency modeling module 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, dynamically adjusts the importance of different features through the GRU gating mechanism, and realizes the effective fusion of spatiotemporal information.
[0164] The updating process of the gated recurrent unit (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 the 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, effectively integrating 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, so as to achieve 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 the spatial dependencies, but also includes the dynamic changes of the time series, so as to better capture the complex patterns of traffic flow.
[0171] Step 7: Map the fused spatial features 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 GRU to a fully connected layer using a linear activation function, and use the linear activation function to map the fused high-dimensional spatial features 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 of each node in the next hour.
[0173] In the actual prediction process, the steps for using the GISTN model are as follows: First, the pre-processed historical traffic flow data and road network data are input into the model. Then, the spatial and temporal features are extracted respectively through the spatial dependency modeling module and the temporal dependency modeling module. Next, the extracted features are fused using the spatiotemporal feature fusion module. Finally, the fused features are mapped to the prediction results through the fully connected layer to obtain the traffic flow prediction value for a period of time in the future. This series of steps realizes end-to-end processing from raw data to the final prediction results, fully utilizing the advantages of each module of the GISTN model to ensure the accuracy and reliability of the prediction results.
[0174] In order to verify 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, STGCN, etc., 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 Figure 2, 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 the figure, the experimental results show that the two-layer GIN structure can achieve a good balance between capturing spatial dependencies and controlling model complexity.
[0176] In order to further verify the effectiveness of each module in the GISTN model, several variant models were designed 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 GRU), and GISTN-NT (removing the temporal dependency modeling module). Experimental results show that GISTN outperforms these variant models at various prediction durations, confirming the importance of the spatial dependency modeling module, the temporal dependency modeling module, and the spatiotemporal feature fusion module. In particular, the advantage of GISTN over GISTN-GCN highlights 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 Fig. 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, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0182] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, 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 in that: The steps include: Step 1: construct a graph isomorphic spatiotemporal network model, wherein the graph isomorphic spatiotemporal network model 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 preprocessed 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; Step 5: extracting time features through the time-dependent modeling module; Step 6: Fusing the spatial features and the temporal features through the spatiotemporal feature fusion module; Step 7: Map the fused spatial features and temporal features to the prediction results to obtain the traffic flow prediction value for a certain period of time in the future.
2. A traffic flow prediction method based on graph isomorphic spatiotemporal network as claimed in claim 1, characterized in that: In the step 2, the graph isomorphic spatiotemporal network model is trained using a preset loss function and an optimization algorithm until the graph isomorphic spatiotemporal network model converges; specifically, the step includes: Step 21, inputting 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 the 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: 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; Step 23: Use the Adam optimizer to update the parameters of the graph isomorphic spatiotemporal network model, and set the initial learning rate to a 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, where 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 trained predicted value and the true value 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 4 specifically includes: Step 41: the preprocessed historical traffic flow data is represented by time series data, and the preprocessed road network data is represented by an adjacency matrix; the historical traffic flow data represented by time series data and the road network data represented by the 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 diagram from the historical traffic flow data and the road network data, and captures the nonlinear spatial dependency relationship in the relationship between the node features and the topological structure diagram, and obtains the spatial features as the output of the spatial dependency modeling module.
4. The traffic flow prediction method based on graph isomorphic spatiotemporal network as claimed in claim 3, characterized in that: The step 42 specifically includes: Step 421, the spatial dependency modeling module includes multiple layers of graph isomorphism networks connected in sequence, and two adjacent layers of the multiple layers of graph isomorphism networks are connected via residual connections; Step 422: The historical traffic flow data and the road network data are used as inputs of the first-layer graph isomorphic network, and a topological structure graph is constructed according to the road network data, wherein nodes represent sensors or road sections, and edges represent connections between nodes; and the time series data corresponding to each node in the historical traffic flow data is used as the initial node features of the first-layer graph isomorphic 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 its neighbor node features and the central node feature are aggregated by an aggregation function as the aggregated node feature; Step 424, input the aggregated node features into a multi-layer perceptron for nonlinear transformation; Step 425: using the output of the multilayer perceptron as the updated node feature; Step 426, repeating steps 423 to 425 to iteratively update each node feature of the current layer graph isomorphic network input, and obtaining all updated node features in the current layer graph isomorphic network as output features; Step 427: For the graph isomorphism network of the first layer, the output features of the graph isomorphism network of the first layer are input into the graph isomorphism network of the second layer; for the graph isomorphism networks of the second layer and thereafter, the output features of the graph isomorphism network of the current layer are added to the input features of the graph isomorphism network of the current layer, and the result is input into 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.
5. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 4, characterized in that: The process of step 423 to step 425 is expressed by the formula: in, 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, 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 isomorphic network.
6. The traffic flow prediction method based on graph isomorphic spatiotemporal network as claimed in claim 3, characterized in that: The spatial dependency modeling module includes two layers of graph isomorphic networks. For each node, the output features of the corresponding nodes of the first layer of graph isomorphic networks are concatenated with the node features of historical traffic flow data as the input features of the corresponding nodes of the second layer of graph isomorphic networks, thereby realizing residual connection between the two layers of graph isomorphic networks.
7. The traffic flow prediction method based on graph isomorphic spatiotemporal network according to claim 1, characterized in that: The step 5 specifically includes: Step 51, the time-dependent modeling module includes a dual-branch time convolutional network structure and a gating mechanism, the dual-branch time convolutional network structure includes a short-term dependency branch structure and a long-term dependency branch structure, and the gating mechanism includes a splicing layer, a gating unit, and a fusion layer connected in sequence; Step 52: using 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, wherein: The short-term dependency branch structure includes at least one temporal convolution layer, and the temporal convolution layer uses a first convolution kernel and a first dilation rate to perform a causal convolution operation, which is expressed by the following formula: 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 w 1i represents the weight of the first convolution kernel, d1 represents the first dilation 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, and x t-d1i Represents the features of the spatial features at time step t-d1i; The long-term dependent branch structure includes at least one time convolution layer, and the time convolution layer uses a second convolution kernel and a second dilation rate to perform a causal convolution operation, which is expressed by the following formula: 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, W2i represents 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, and x t-d2i Represents the features of the spatial features at time step t-d2i; Step 53: Output feature y of the short-term dependent branch structure st And the output feature yl of the long-term dependent branch structure t The input is sent to the gating mechanism for splicing, gating and fusion calculations, and the temporal features are obtained as the output of the temporal dependency modeling module; The calculation process of the gating mechanism is expressed as follows: g=σ(W g [y st ,y lt ]+b g ) Among them, σ represents the Sigmoid activation function, W g and b g represents a learnable parameter, [·,·] represents a feature concatenation operation, g represents a gating weight, Represents element multiplication operation, y represents y st and lt The comprehensive output is adaptively generated by the gating mechanism.
8. 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: using the spatial features output by the spatial dependency modeling module and the temporal features output by the temporal dependency modeling module 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 a gating mechanism of the gated recurrent unit structure to achieve fusion of spatiotemporal information. The updating process of the gated recurrent unit structure is expressed as follows: z t =σ(W z ·[h t-1 ,s t ]+b z ) r t =σ(W r ·[h t-1 ,s t ]+b r ) 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 the 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.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for traffic flow prediction based on graph isomorphic spatiotemporal network as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a traffic flow prediction method based on a graph isomorphic spatiotemporal network as described in any one of claims 1 to 8 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
Traffic flow prediction method and system based on trend space-time diagram convolution, and medium
CN116895157A
Traffic flow prediction method based on fusion of space-time adaptive graph learning and dynamic graph convolution
CN117392846A
Traffic flow prediction method based on time-varying fusion graph convolutional network
CN118262517A
Cited By
Traffic prediction method based on adaptive semantic enhancement space-time diagram network
CN120632366A
A Traffic Prediction Method Based on Adaptive Semantic Augmentation Spatiotemporal Graph Network
CN120632366B
