A traffic prediction system and method based on a spatiotemporal gating hypergraph convolution network
By constructing a geographic traffic map and a traffic hypergraph, and using vertex convolution and hyperedge convolution networks, combined with a spatiotemporally aware channel attention mechanism, the problem of unexplored high-order spatial correlations and data type interactions in existing traffic prediction methods is solved, thus achieving more accurate traffic flow prediction.
Patent Information
- Application Number
- CN202211392924.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-11-08
AI Technical Summary
Existing traffic prediction methods cannot effectively uncover the high-order spatial correlations between road nodes and the intrinsic interactions between different types of traffic data, resulting in inaccurate traffic predictions.
A traffic prediction system based on spatiotemporally gated hypergraph convolutional network is adopted. By constructing a geographic traffic map and a traffic hypergraph, high-order spatial correlations are mined using vertex convolution and hyperedge convolution. A spatiotemporally aware channel attention mechanism is designed to mine the correlations of different types of traffic data.
It improves the accuracy of traffic forecasting, enabling better prediction of future traffic flows, helping traffic management and travelers to make plans, optimize resource allocation, and reduce traffic congestion and accidents.
Smart Images

Figure CN115905629B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of artificial intelligence, and particularly relates to a traffic prediction system and method based on a spatio-temporal gated hypergraph convolution network. BACKGROUND
[0002] Motor vehicles have become an indispensable means of transportation for many families. The increase in the number of motor vehicles has led to traffic congestion, frequent traffic accidents and other problems, which not only affect people's travel plans and travel safety, but also reduce the operating efficiency of the traffic network and exacerbate the pollution of the ecological environment. Accurate traffic prediction can provide prospective basis for traffic managers to better induce traffic flow distribution to avoid traffic congestion and accidents; can provide reference for travelers to make travel plans; and can provide basis for taxi, online car-hailing, shared bicycle and other enterprises to better allocate resources to meet travel demand. Since accurate traffic prediction can help people travel green and save time cost, traffic prediction has become an important research hotspot in intelligent transportation systems.
[0003] Most existing methods represent the road network using a traditional graph structure. However, each edge in the traditional graph structure can only connect two nodes, i.e., each edge only represents the relationship between two nodes. However, the interaction between road nodes is not necessarily pairwise (binary relationship), but can also be high-order (multi-element relationship). For example, a road can connect multiple nodes that collect traffic data. Therefore, the traditional graph structure has limitations in extracting high-order relationships between nodes, and how to mine the high-order spatial correlation between road nodes is a key problem. In addition, there is a correlation between different types of traffic data, for example, traffic flow is inversely proportional to speed and proportional to occupancy. However, most existing works ignore the inherent interaction between different types of traffic data. Therefore, how to mine the correlation between different types of traffic data is another key problem. The goal of the present application is to solve these key problems. SUMMARY
[0004] To solve the above technical problems, the present application provides a traffic prediction system and method based on a spatio-temporal gated hypergraph convolution network.
[0005] The technical scheme adopted by the system of the present application is a traffic prediction system based on a spatio-temporal gated hypergraph convolution network, comprising: a central server, a plurality of traffic flow sensors;
[0006] The plurality of traffic flow sensors are sequentially deployed at a plurality of road nodes in the city;
[0007] The central server is sequentially wirelessly connected with the plurality of traffic flow sensors;
[0008] The traffic flow sensor is used to collect the traffic flow of the road node and wirelessly transmit to the central server.
[0009] The central server combines the traffic flows of multiple road nodes to realize the prediction of the traffic flow by a traffic prediction method based on a spatio-temporal gated hypergraph convolution network.
[0010] The technical scheme adopted by the method of the application is a traffic prediction system based on a spatio-temporal gated hypergraph convolution network, comprising the following steps:
[0011] Step 1: constructing a geographic traffic graph according to the connectivity between road nodes;
[0012] Step 2: constructing a traffic hypergraph to model the high-order spatial correlation between multiple nodes;
[0013] Step 3: dividing the traffic flow data of each road node at multiple historical time steps by a sliding window division method to obtain multiple groups of road node traffic flow samples, and constructing the real traffic flow data of each group of road node traffic flow samples;
[0014] Step 4: constructing a spatio-temporal gated hypergraph convolution network traffic prediction model in combination with the geographic traffic graph and the traffic hypergraph, inputting each group of road node traffic flow samples into the spatio-temporal gated hypergraph convolution network traffic prediction model in turn for prediction to obtain the predicted traffic flow data of each group of road node traffic flow samples, constructing a spatio-temporal gated hypergraph convolution network loss function model in combination with the real traffic flow data of each group of road node traffic flow samples, and obtaining an optimized spatio-temporal gated hypergraph convolution network traffic prediction model through Adam algorithm optimization training;
[0015] Step 5: the central server collects the traffic flow of each road node at multiple time points in real time through the multiple traffic flow sensors, and predicts the real-time collected traffic flow of each road node at multiple time points through the optimized spatio-temporal gated hypergraph convolution network traffic prediction model to obtain the traffic flow of each road node at future multiple time points.
[0016] As a preferred, the geographic traffic graph constructed according to the connectivity between road nodes in step 1 is specifically as follows:
[0017] Each traffic flow sensor is defined as each node in the geographic traffic graph;
[0018] The connectivity between road nodes in the city is defined as the adjacency relationship between any two nodes in the geographic traffic graph;
[0019] The geographic traffic graph is represented as:
[0020] G=(V,A),
[0021] V={v1,v2,...,v N};
[0022] Where G represents the geographic transportation map, V represents the set of nodes in the geographic transportation map, N is the number of nodes in the set of nodes in the geographic transportation map, and v i Let A represent the i-th node in the set of nodes of the geographic transportation map, and let A denote the adjacency matrix, A∈R. N×N R N×N Represents an N x N two-dimensional matrix, if node v i With v j If the nodes are connected, then A[i, j] = 1, if node v i With v j If the two sides are not connected, then A[i,j]=0;
[0023] Preferably, the traffic hypermap described in step 2 is represented as follows:
[0024] G h =(V, ξ),
[0025] V = {v1, v2, ..., v} N},
[0026] ξ = {e1, e2, ..., e M};
[0027] Among them, G h This represents the transportation hypergraph, where V represents the set of nodes in the geographic transportation graph. i Let ξ represent the i-th node in the node set of the geographic transportation map, and let e represent the set of hyperedges in the transportation hypergraph. j Let M represent the j-th superedge in the set of superedges of the transportation supergraph, M represent the number of superedges in the set of superedges of the transportation supergraph, and N represent the number of nodes in the set of nodes of the geographic transportation graph.
[0028] The specific construction process of the hyperedge set of the traffic hypergraph is as follows:
[0029] A set of structural hyperedges is constructed based on the adjacency matrix of the geographic transportation map using the KNN algorithm. Each structural hyperedge in the set reflects the structural connectivity between multiple nodes in the node set of the geographic transportation map.
[0030] A semantic hyperedge set is constructed based on the traffic flow of each node in the node set of the geographic traffic map using the K-means algorithm. Each semantic hyperedge in the semantic hyperedge set reflects the contextual semantic similarity between multiple nodes in the node set of the geographic traffic map.
[0031] Construct the hyperedge set of the transportation hypergraph based on the structural hyperedge set and the semantic hyperedge set;
[0032] The set of hyperedges in the traffic hypergraph consists of structural hyperedges and semantic hyperedges;
[0033] As preferred, the plurality of road node traffic flow samples in step 3 are specifically as follows:
[0034]
[0035] χ t = (X t,1 , X t,2 ,..., X t,N ), t ∈ [1, T]
[0036] InData p represents the pth road node traffic flow sample, S represents the number of road node traffic flow samples, χ (p-1)+k represents the kth traffic flow data in the pth road node traffic flow sample, i.e., the (p-1)+kth historical time step traffic flow data of each road node, k ∈ [1, T h ], T h represents the length of each road node traffic flow sample, χ t represents the traffic flow data of each road node at the tth historical time step, T represents the number of historical time steps, X t,i represents the traffic flow data of the ith road node at the tth historical time step, i ∈ [1, N], N represents the number of nodes in the node set of the geographical traffic graph.
[0037] Step 3: The real traffic flow data of each road node traffic flow sample is constructed, specifically as follows:
[0038] The real traffic flow data of the pth road node traffic flow sample is:
[0039]
[0040] In which, T f represents the prediction time step length of each road node traffic flow sample, OutData p represents the real traffic flow data of the pth road node traffic flow sample.
[0041] As preferred, the spatio-temporal gated hypergraph convolution network traffic prediction model constructed in step 4 is specifically as follows:
[0042] The spatio-temporal gated hypergraph convolution network traffic prediction model comprises: a convolutional neural network, an encoder time block, an encoder space block, a decoder time block, a decoder space block, and a spatio-temporal perception channel attention mechanism.
[0043] The convolutional neural network, the encoder time block, the encoder space block, the decoder time block, the decoder space block, and the spatio-temporal perception channel attention mechanism are sequentially cascaded.
[0044] The convolutional neural network is configured to obtain high-dimensional features of each group of road node traffic flow samples by passing the group of road node traffic flow samples through the convolutional neural network, and output the high-dimensional features to the encoder time block.
[0045] The encoder time block is configured to obtain encoded time features of each group of road node traffic flow samples by modeling time correlation based on the high-dimensional features of each group of road node traffic flow samples, and output the encoded time features to the encoder space block.
[0046] The encoder space block is configured to obtain encoded space features of each group of road node traffic flow samples by modeling space correlation based on the encoded time features of each group of road node traffic flow samples, and output the encoded space features to the decoder time block.
[0047] The decoder time block is configured to obtain decoded time features of each group of road node traffic flow samples by modeling time correlation based on the encoded space features of each group of road node traffic flow samples, and output the decoded time features to the decoder space block.
[0048] The decoder space block is configured to obtain decoded space features of each group of road node traffic flow samples by modeling space correlation based on the decoded time features of each group of road node traffic flow samples, and output the decoded space features to the spatio-temporal perception channel attention mechanism.
[0049] The spatio-temporal perception channel attention mechanism is configured to mine spatio-temporal correlation and channel feature correlation by passing the decoded space features of each group of road node traffic flow samples through the spatio-temporal perception channel attention mechanism, and map the decoded space features to an output to obtain predicted traffic flow data of each group of road node traffic flow samples.
[0050] The encoder time block and the decoder time block have the same structure and function.
[0051] The encoder space block and the decoder space block have the same structure and function.
[0052] Further, the encoder time block is composed of a time gated convolution module, a time attention mechanism module, and a time attention fusion module.
[0053] The time gated convolution module and the time attention mechanism module are connected in parallel, and further connected in cascade with the time attention fusion module.
[0054] The time gated convolution module selects a time gated convolutional neural network model, and is configured to obtain local time correlation of each group of road node traffic flow samples by modeling local time correlation based on the high-dimensional features of each group of road node traffic flow samples, and output the local time correlation to the time attention fusion module.
[0055] The time attention mechanism module selects a time attention mechanism to obtain the global time correlation of each group of road node traffic flow samples by modeling the high-dimensional features of each group of road node traffic flow samples, and outputs it to the time attention fusion module.
[0056] The time attention fusion module selects an attention mechanism to fuse the local time correlation and global time correlation of each group of road node traffic flow samples to obtain the encoded time features of each group of road node traffic flow samples, and outputs them to the encoder spatial block.
[0057] Furthermore, the encoder spatial block is composed of a spatial gated convolution module, a hypergraph convolution module, and a spatial attention fusion module;
[0058] The spatial gated convolution module and the hypergraph convolution module are connected in parallel and further cascaded with the spatial attention fusion module;
[0059] The spatial gated convolution module selects a spatial gated convolutional neural network model to model the pairwise spatial correlation of each group of road node traffic flow samples by encoding the temporal features of each group of road node traffic flow samples, and outputs it to the spatial attention fusion module.
[0060] The hypergraph convolution module selects a hypergraph convolutional neural network model to model the encoded temporal features of each group of road node traffic flow samples to obtain the high-order spatial correlation of each group of road node traffic flow samples, and outputs it to the spatial attention fusion module.
[0061] The hypergraph convolutional neural network model is composed of cascaded vertex convolutional modules and hyperedge convolutional modules.
[0062] The vertex convolution module employs a multi-head attention mechanism to aggregate the information of each node connected to each hyperedge in the hyperedge set of the traffic hypergraph to that hyperedge, as follows:
[0063] Construct the set of nodes contained in each hyperedge of the traffic hypergraph:
[0064] If the m-th hyperedge in the hyperedge set of the transportation hypergraph contains the k nodes in the node set of the geographic transportation graph... m There are nodes, m∈[1,M], where M represents the number of hyperedges in the hyperedge set of the traffic hypergraph. Then, the set of nodes contained in the m-th hyperedge of the hypergraph is:
[0065]
[0066] in, represents the kth node in the node set contained in the mth superedge in the superedge set of the traffic hypergraph, i.e., the lth node in the node set of the geographic traffic graph; k
[0067] The transformation matrix of the vertex convolution of the hth attention head is calculated by the multi-head attention mechanism, and the specific process is as follows:
[0068]
[0069] wherein, represents a two-dimensional matrix of km rows and km columns;
[0070]
[0071] wherein, h represents a head index, H represents the number of attention heads, D is the number of output channels of each layer of neural network, represents the i th row and j th column of the transformation matrix of the h th attention head, which represents the similarity between the i th node in the node set contained in the m th superedge in the superedge set of the traffic hypergraph and the j th node in the node set contained in the m th superedge in the superedge set of the traffic hypergraph, represents the training parameter used to obtain the query in the hth attention head, represents the training parameter used to obtain the key in the hth attention head, represents the feature of the i th node in the node set contained in the m th superedge in the superedge set of the traffic hypergraph, represents the feature of the j th node in the node set contained in the m th superedge in the superedge set of the traffic hypergraph.
[0072] The softmax function is used to normalize The normalized The specific process is as follows:
[0073]
[0074] wherein, represents the similarity between the i th node in the node set contained in the m th superedge in the superedge set of the traffic hypergraph and the k th node in the node set contained in the m th superedge in the superedge set of the traffic hypergraph, k m represents the k m th node contained in the m th superedge in the superedge set of the traffic hypergraph;
[0075] The normalized transformation matrix of the vertex convolution of the hth attention head is as follows:
[0076]
[0077] wherein, represents the km row k m a two-dimensional matrix of columns, the i-th row and the j-th column of will be as a weight matrix to calculate the weighted sum of all node features contained in the m-th superedge in the superedge set of the traffic supergraph, thereby obtaining the feature of the m-th superedge in the superedge set of the traffic supergraph, specifically:
[0078] X m * = reshape(X m ), m ∈ [1, k m ],
[0079]
[0080] where reshape(*) represents reshaping, conv1(*) represents convolution operation, is the input of vertex convolution, that is, the encoded temporal feature of each group of road node traffic flow samples obtained through the temporal attention fusion module, represents the feature of the k m nodes contained in the m-th superedge in the superedge set of the traffic supergraph, represents a three-dimensional vector, and the dimensions are k m , T h , D, T □ represents the length of each group of road node traffic flow samples, and D is the number of output channels of each layer of neural network, and a two-dimensional vector with dimensions k m , (T h *D) is obtained by reshaping X m , is the feature of the m-th superedge in the superedge set of the traffic supergraph, and || represents concatenating H attention heads, represents the training parameters used to obtain values in the h-th attention head;
[0081] The superedge convolution module selects a multi-head attention mechanism to aggregate the features of the superedges in the superedge set of the traffic supergraph to the centroid, specifically as follows:
[0082] Construct the superedge set of each node in the node set of the connected geographic traffic graph:
[0083] For each node in the node set of the geographic traffic graph, construct the superedge set connected to the node: if the k i superedges in the superedge set of the traffic supergraph connect the i-th node v i, i ∈ [1, N], N represents the number of nodes in the node set of the geographic traffic graph, and the hyperedge set connected to the i-th node v i of the node set of the geographic traffic graph is:
[0084]
[0085] wherein the node v i is referred to as the centroid of ξ , and represents the k-th hyperedge in the hyperedge set connected to the i-th node of the node set of the geographic traffic graph, i.e., the l-th hyperedge in the hyperedge set of the traffic hypergraph; k
[0086] The transformation matrix of the hyperedge convolution of the h-th attention head is calculated through the multi-head attention mechanism, and is specifically as follows:
[0087]
[0088] wherein, represents a two-dimensional matrix of k i rows and k i columns;
[0089]
[0090] wherein, h represents a head index, H represents the number of attention heads, D is the number of output channels of each layer of neural network, represents the i-th row and j-th column of the transformation matrix of the h-th attention head, and represents the similarity between the i-th hyperedge in the hyperedge set connected to the i-th node of the node set of the geographic traffic graph and the j-th hyperedge in the hyperedge set connected to the i-th node of the node set of the geographic traffic graph, represents the training parameter used to obtain the query in the h-th attention head, represents the training parameter used to obtain the key in the h-th attention head, represents the feature of the i-th hyperedge in the hyperedge set connected to the i-th node of the node set of the geographic traffic graph, represents the feature of the j-th hyperedge in the hyperedge set connected to the i-th node of the node set of the geographic traffic graph.
[0091] is then normalized by using a softmax function The normalized is specifically as follows:
[0092]
[0093] wherein, This represents the similarity between the i-th superedge in the set of superedges connecting the i-th node in the set of nodes in the geographic transportation map and the k-th superedge in the set of superedges connecting the i-th node in the set of nodes in the geographic transportation map; k i Let k represent the set of superedges in the traffic hypergraph. i A hyperedge connects the i-th node in the set of nodes of the geographic transportation map;
[0094] The normalized transformation matrix of the hyperedge convolution of the h-th attention head is as follows:
[0095]
[0096] in, Indicates k i line k i A two-dimensional matrix of columns, The i-th row and j-th column is Will The weight matrix is used to compute the k edges in the hyperedge set of the transportation hypergraph connecting the i-th node in the set of nodes of the geographic transportation map. i The weighted sum of the superedges yields the feature representation of the i-th node in the node set of the geographic transportation map, specifically:
[0097] H i * =reshape(H i ), i∈[1, k i ],
[0098]
[0099] Here, reshape(*) represents reshaping the shape, and conv2(*) represents the convolution operation. Let k represent the kth node in the hyperedge set of the transportation hypergraph that connects the i-th node in the set of nodes of the geographic transportation graph. i Features of a superedge Represents a three-dimensional vector with dimensions k. i T h D, T □ H represents the length of traffic flow samples for each road node, and D is the number of output channels for each layer of the neural network. i Recombining to obtain a two-dimensional vector The dimensions are k i 、(T h *D), HC vi It is the i-th node v in the node set of the geographic transportation map. i The feature representation, || represents concatenating H attention heads. This represents the training parameters used to obtain values in the h-th attention head;
[0100] The spatial attention fusion module selects an attention mechanism to fuse the pairwise spatial correlations and the higher-order spatial correlations of each group of road node traffic flow samples to obtain the encoded spatial features of each group of road node traffic flow samples, and outputs them to the decoder time block.
[0101] Furthermore, the spatiotemporal awareness channel attention mechanism consists of a spatiotemporal convolutional neural network, global average pooling, a convolutional neural network with ReLU activation function, and a convolutional neural network with Sigmoid activation function.
[0102] The spatiotemporal convolutional neural network, global average pooling, convolutional neural network with ReLU activation function, and convolutional neural network with Sigmoid activation function are cascaded in sequence.
[0103] The spatiotemporal convolutional neural network, employing a spatiotemporal kernel, simultaneously models temporal and spatial correlations to obtain the spatiotemporal characteristics of traffic flow for each group of road nodes. And output to global average pooling, where Represents a three-dimensional vector with dimensions N and T respectively. f D and N are the number of nodes in the node set of the geographic transportation map, and T is the number of nodes in the map. f This represents the prediction time step for traffic flow samples at each road node, where D is the number of output channels in each layer of the neural network. This is achieved by analyzing the spatiotemporal features X of the traffic flow at each road node. st The spatiotemporal characteristics of traffic flow transformation for each group of road nodes are obtained by reorganization. in This represents a two-dimensional vector with dimensions (N*T) f D;
[0104] The global average pooling method is selected to extract the spatiotemporal characteristics of traffic flow from each group of road nodes. st The channel features X of traffic flow for each group of road nodes are obtained by global average pooling. p ∈R 1×1×D The output is fed into a convolutional neural network with ReLU activation, where R... 1×1×D This represents a three-dimensional vector with dimensions 1, 1, and D, where D is the number of output channels in each layer of the neural network.
[0105] The convolutional neural network with ReLU activation function is selected by changing the channel features X of traffic flow at each road node. p ∈R 1×1×D The channel dimension is obtained And the output is fed into a convolutional neural network with a sigmoid activation function, where This represents a three-dimensional vector with dimensions 1, 1, and 1 respectively. D is the number of output channels in each layer of the neural network;
[0106] The convolutional neural network with the Sigmoid activation function is selected by changing the convolutional neural network and the Sigmoid activation function. The channel dimension is obtained as X p2 ∈R 1×1×D , where R 1×1×D This represents a three-dimensional vector with dimensions 1, 1, and D, where D is the number of output channels in each layer of the neural network. This is achieved by analyzing X... p2 Reorganization yields the channel attention matrix X p2 * ∈R D×1 R D×1 This represents a two-dimensional vector with dimensions D and 1 respectively;
[0107] Spatiotemporal characteristics of traffic flow transformation at each road node and channel attention matrix X p2 * Multiply to get the result in This represents a two-dimensional vector with dimensions (N*T) f D, N are the number of nodes in the node set of the geographic transportation map, and T is the number of nodes in the node set. f This represents the prediction time step for traffic flow samples at each road node, where D is the number of output channels in each layer of the neural network. This is achieved by analyzing X... o The traffic flow data for each group of road node traffic flow samples is obtained by reorganizing the data.
[0108] The loss function model described in step 4 is defined as follows:
[0109]
[0110] Where S represents the number of traffic flow samples at road nodes, and T f N represents the prediction time step for traffic flow samples at each road node, where N is the distance between the points in the road.
[0111] The number of nodes in the node set of the traffic map. This represents the k-th actual traffic flow data in the traffic flow sample of the i-th road node in the p-th group, i.e., the (p-1)+T-th actual traffic flow data. h +k predicted time steps for each road node's actual traffic flow data. This represents the k-th predicted traffic flow data in the traffic flow sample of the i-th road node in the p-th group.
[0112] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0113] Each edge in the traditional graph structure can only connect two nodes, that is, each edge only represents the relationship between two nodes, and there is a limitation in mining the high-order spatial correlation between nodes. Unlike other traffic prediction models, the present application constructs a traffic hypergraph, each hyperedge in the hypergraph can connect multiple nodes, so that the high-order spatial correlation between road nodes can be mined. The hyperedge in the hypergraph includes a structural hyperedge and a semantic hyperedge. The structural hyperedge is used to represent the spatial structure connectivity, and the semantic hyperedge is used to encode the global context relationship between nodes in the road network, which is not limited by adjacent connection. On this basis, a hypergraph convolution network is designed, including vertex convolution and hyperedge convolution, to fully mine the high-order spatial correlation between nodes.
[0114] There is a correlation between different types of traffic data, but most existing works ignore the inherent interaction between different types of traffic data. The present application designs a spatiotemporal-aware channel attention mechanism, mines the hidden correlation between different types of traffic data, and explores the influence of different channel features on traffic flow while perceiving spatiotemporal information, to enhance the sensitivity to channel features. BRIEF DESCRIPTION OF DRAWINGS
[0115] Fig. 1 A method flowchart of the embodiment of the present application.
[0116] Fig. 2 A spatiotemporal gating hypergraph convolution network framework diagram based on the embodiment of the present application. DETAILED DESCRIPTION
[0117] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0118] In specific implementation, the method proposed in the technical solutions of the present application can be automatically run by computer software technology, and the system device of the method, such as a computer readable storage medium storing the corresponding computer program of the technical solutions of the present application and a computer device including the running of the corresponding computer program, should also be within the protection scope of the present application.
[0119] The technical solutions of the system in the embodiments of the present application are a traffic prediction system based on a spatiotemporal gating hypergraph convolution network, which comprises a center server and a plurality of traffic flow sensors.
[0120] a plurality of traffic flow sensors are sequentially arranged in a plurality of road nodes in a city;
[0121] the center server is sequentially wirelessly connected with the plurality of traffic flow sensors;
[0122] the traffic flow sensor is used to collect the traffic flow of the road node and wirelessly transmit to the center server;
[0123] the center server combines the traffic flow of the plurality of road nodes, and realizes the prediction of the traffic flow through a traffic prediction method based on a spatio-temporal gated hypergraph convolution network.
[0124] the model of the center server is a Tsinghua NF5280M5 server
[0125] the model of the traffic flow sensor is an LVD-6004 Hikvision ground inductance coil vehicle detector
[0126] The following will be combined Figs. 1-2 A traffic prediction method based on a spatio-temporal gated hypergraph convolution network is introduced, and the specific steps are as follows:
[0127] Step 1: Construct a geographical traffic graph according to the connectivity between road nodes;
[0128] Step 1: Construct a geographical traffic graph according to the connectivity between road nodes, specifically as follows:
[0129] Define each traffic flow sensor as each node in the geographical traffic graph;
[0130] Define the connectivity between road nodes in the city as the adjacency relationship between any two nodes in the geographical traffic graph;
[0131] The geographical traffic graph is represented as:
[0132] G=(V,A),
[0133] V={v1,v2,…,v N};
[0134] Wherein, G represents the geographical traffic graph, V represents the node set of the geographical traffic graph, N=358 is the number of nodes in the node set of the geographical traffic graph, v i represents the i-th node in the node set of the geographical traffic graph, A represents the adjacency matrix, A∈R N×N , R N×N represents a two-dimensional matrix of N rows and N columns, if the node v i is connected with v j , then A[i,j]=1, if the node v i is not connected with v jIf A[i, j] is not connected, then A[i, j] = 0;
[0135] Step 2: Construct a traffic hypergraph to model high-order spatial correlations between multiple nodes.
[0136] The traffic hypergraph is represented as:
[0137] G h = (V, ξ),
[0138] V = {v1, v2, …, v N},
[0139] ξ = {e 1, e2, e M};
[0140] Wherein, G h represents a traffic hypergraph, V represents a node set of a geographic traffic graph, v i represents an i-th node in the node set of the geographic traffic graph, ξ represents a hyperedge set of the traffic hypergraph, e j represents a j-th hyperedge in the hyperedge set of the traffic hypergraph, M represents a number of hyperedges in the hyperedge set of the traffic hypergraph, and N represents a number of nodes in the node set of the geographic traffic graph.
[0141] The hyperedge set of the traffic hypergraph is constructed in the following specific process:
[0142] The structural hyperedge set is constructed in combination with the adjacency matrix of the geographic traffic graph according to the KNN algorithm, and each structural hyperedge in the structural hyperedge set reflects structural connectivity between multiple nodes in the node set of the geographic traffic graph.
[0143] The semantic hyperedge set is constructed in combination with traffic flow of each node in the node set of the geographic traffic graph according to the K-mean algorithm, and each semantic hyperedge in the semantic hyperedge set reflects contextual semantic similarity between multiple nodes in the node set of the geographic traffic graph.
[0144] The hyperedge set of the traffic hypergraph is constructed according to the structural hyperedge set and the semantic hyperedge set.
[0145] The hyperedge set of the traffic hypergraph is composed of structural hyperedges and semantic hyperedges.
[0146] Step 3: The traffic flow data of each road node at multiple historical time steps is divided into multiple groups of road node traffic flow samples through a sliding window division method, and real traffic flow data of each group of road node traffic flow samples is constructed.
[0147] The multiple groups of road node traffic flow samples in step 3 are as follows:
[0148]
[0149] χ t = (X t,1 , X t,2 ,..., X t,N ), t e [1, T]
[0150] wherein InData p represents the p-th group of road node traffic flow samples, S represents the number of road node traffic flow samples, χ (p-1)+k represents the k-th traffic flow data in the p-th group of road node traffic flow samples, i.e., the traffic flow data of each road node at the (p-1)+k-th historical time step, k e [1, T h ], T h represents the length of each group of road node traffic flow samples, χ t represents the traffic flow data of each road node at the t-th historical time step, T represents the number of historical time steps, X t,i represents the traffic flow data of the i-th road node at the t-th historical time step, i e [1, N], N represents the number of nodes in the node set of the geographical traffic graph;
[0151] The real traffic flow data of each group of road node traffic flow samples is constructed according to step 3, and the specific process is as follows:
[0152] The real traffic flow data of the p-th group of road node traffic flow samples is:
[0153]
[0154] wherein T f represents the prediction time step length of each group of road node traffic flow samples, OutData p represents the real traffic flow data of the p-th group of road node traffic flow samples;
[0155] Step 4: A spatio-temporal gated hypergraph convolution network traffic prediction model is constructed in combination with the geographical traffic graph and the traffic hypergraph, each group of road node traffic flow samples is sequentially input into the spatio-temporal gated hypergraph convolution network traffic prediction model for prediction to obtain the predicted traffic flow data of each group of road node traffic flow samples, a spatio-temporal gated hypergraph convolution network loss function model is constructed in combination with the real traffic flow data of each group of road node traffic flow samples, and an optimized spatio-temporal gated hypergraph convolution network traffic prediction model is obtained through Adam algorithm optimization training;
[0156] The spatio-temporal gated hypergraph convolution network traffic prediction model constructed in step 4 has the following specific process:
[0157] The spatio-temporal gated hypergraph convolution network traffic prediction model comprises a convolutional neural network, an encoder time block, an encoder space block, a decoder time block, a decoder space block, and a spatio-temporal perception channel attention mechanism.
[0158] The convolutional neural network, the encoder time block, the encoder spatial block, the decoder time block, the decoder spatial block and the spatio-temporal perception channel attention mechanism are sequentially cascaded;
[0159] The convolutional neural network is configured to obtain high-dimensional features of each group of road node traffic flow samples by the convolutional neural network, and output the high-dimensional features to the encoder time block;
[0160] The encoder time block is configured to obtain encoded time features of each group of road node traffic flow samples by modeling time correlation based on the high-dimensional features, and output the encoded time features to the encoder spatial block;
[0161] The encoder spatial block is configured to obtain encoded spatial features of each group of road node traffic flow samples by modeling spatial correlation based on the encoded time features, and output the encoded spatial features to the decoder time block;
[0162] The decoder time block is configured to obtain decoded time features of each group of road node traffic flow samples by modeling time correlation based on the encoded spatial features, and output the decoded time features to the decoder spatial block;
[0163] The decoder spatial block is configured to obtain decoded spatial features of each group of road node traffic flow samples by modeling spatial correlation based on the decoded time features, and output the decoded spatial features to the spatio-temporal perception channel attention mechanism;
[0164] The spatio-temporal perception channel attention mechanism is configured to mine spatio-temporal correlation and channel feature correlation by the spatio-temporal perception channel attention mechanism based on the decoded spatial features of each group of road node traffic flow samples, and map the decoded spatial features to an output to obtain predicted traffic flow data of each group of road node traffic flow samples;
[0165] The encoder time block and the decoder time block are identical in structure and function;
[0166] The encoder spatial block and the decoder spatial block are identical in structure and function;
[0167] The encoder time block comprises a time gated convolution module, a time attention mechanism module and a time attention fusion module;
[0168] The time gated convolution module and the time attention mechanism module are connected in parallel, and further connected in cascade with the time attention fusion module;
[0169] The time-gated convolution module selects a time-gated convolutional neural network model to model local time correlation of the high-dimensional features of each group of road node traffic flow samples and output to the time attention fusion module;
[0170] The time attention mechanism module selects a time attention mechanism to model global time correlation of the high-dimensional features of each group of road node traffic flow samples and output to the time attention fusion module;
[0171] The time attention fusion module selects an attention mechanism to fuse the local time correlation of each group of road node traffic flow samples and the global time correlation of each group of road node traffic flow samples to obtain the encoded time features of each group of road node traffic flow samples and output to the encoder space block;
[0172] The encoder space block is composed of a spatial gated convolution module, a hypergraph convolution module, and a spatial attention fusion module;
[0173] The spatial gated convolution module and the hypergraph convolution module are connected in parallel and further connected in cascade with the spatial attention fusion module;
[0174] The spatial gated convolution module selects a spatial gated convolutional neural network model to model pairwise spatial correlation of the encoded time features of each group of road node traffic flow samples and output to the spatial attention fusion module;
[0175] The hypergraph convolution module selects a hypergraph convolutional neural network model to model high-order spatial correlation of the encoded time features of each group of road node traffic flow samples and output to the spatial attention fusion module;
[0176] The hypergraph convolutional neural network model is composed of a vertex convolution module and a hyperedge convolution module connected in cascade;
[0177] The vertex convolution module selects a multi-head attention mechanism to aggregate information of each node connected to each hyperedge in the hyperedge set of the traffic hypergraph to the hyperedge, specifically as follows:
[0178] The node set contained in each hyperedge in the hyperedge set of the traffic hypergraph is constructed:
[0179] If the mth hyperedge in the hyperedge set of the traffic hypergraph contains the kth node in the node set of the geographic traffic graph, the information of the kth node is aggregated to the mth hyperedge in the hyperedge set of the traffic hypergraph. mA node, m e [1, M], M represents the number of super edges in the super edge set of the traffic supergraph, and the node set contained in the mth super edge in the super edge set of the traffic supergraph is:
[0180]
[0181] wherein, represents the kth node in the node set contained in the mth super edge in the super edge set of the traffic supergraph, that is, the lth node in the node set of the geographic traffic graph, k A node;
[0182] The transformation matrix of the vertex convolution of the hth attention head is calculated by the multi-head attention mechanism, and the specific process is as follows:
[0183]
[0184] wherein, represents a two-dimensional matrix of km rows and km columns;
[0185]
[0186] wherein, h represents the head index, H represents the number of attention heads, D is the number of output channels of each layer of neural network, represents the i th row and j th column of the transformation matrix of the hth attention head, which represents the similarity between the i th node in the node set contained in the mth super edge in the super edge set of the traffic supergraph and the j th node in the node set contained in the mth super edge in the super edge set of the traffic supergraph, represents the training parameter used to obtain the query in the hth attention head, represents the training parameter used to obtain the key in the hth attention head, represents the feature of the i th node in the node set contained in the mth super edge in the super edge set of the traffic supergraph, represents the feature of the j th node in the node set contained in the mth super edge in the super edge set of the traffic supergraph.
[0187] The is normalized by the softmax function The normalized The specific process is as follows:
[0188]
[0189] wherein, represents the similarity between the i th node in the node set contained in the mth super edge in the super edge set of the traffic supergraph and the kth node in the node set contained in the mth super edge in the super edge set of the traffic supergraph, k m represents the kth node contained in the mth super edge in the super edge set of the traffic supergraph; m A node;
[0190] The normalized transformation matrix of the vertex convolution of the h-th attention head is as follows:
[0191]
[0192] in, Represents a two-dimensional matrix with km rows and km columns. The i-th row and j-th column is Will The weight matrix is used to calculate the weighted sum of the features of all nodes contained in the m-th hyperedge in the hyperedge set of the traffic hypergraph, thereby obtaining the features of the m-th hyperedge in the hyperedge set of the traffic hypergraph, specifically:
[0193] X m * =reshape(X) m ), m∈[1, k m ],
[0194]
[0195] Here, reshape(*) represents reshaping the shape, and conv1(*) represents the convolution operation. It is the input of the vertex convolution, that is, the encoded temporal features of each group of road node traffic flow samples obtained by the temporal attention fusion module, representing the k features contained in the m-th hyperedge of the traffic hypergraph hyperedge set. m The characteristics of each node Represents a three-dimensional vector with dimensions k. m T h D, T □ This represents the length of traffic flow samples for each road node, and D is the number of output channels for each layer of the neural network. This is achieved by analyzing X... m Recombining to obtain a two-dimensional vector The dimensions are k m 、(T h *D), It is the feature of the m-th superedge in the set of superedges of the traffic hypergraph, where || represents concatenating H attention heads. This represents the training parameters used to obtain values in the h-th attention head;
[0196] The hyperedge convolution module uses a multi-head attention mechanism to aggregate the features of the hyperedges in the hyperedge set of the traffic hypergraph to the centroid, as follows:
[0197] Construct the set of superedges connecting each node in the set of nodes of the geographic transportation map:
[0198] For each node in the node set of the geographical traffic graph, a hyperedge set connected to the node is constructed: if the kth hyperedge in the hyperedge set of the traffic hypergraph connects the ith node in the node set of the geographical traffic graph, then the kth hyperedge in the hyperedge set of the traffic hypergraph connects the ith node in the node set of the geographical traffic graph. i The kth hyperedge in the hyperedge set of the traffic hypergraph connects the ith node in the node set of the geographical traffic graph. i , i∈[1, N], N represents the number of nodes in the node set of the geographical traffic graph, then the hyperedge set of the ith node v i in the node set of the geographical traffic graph is:
[0199]
[0200] wherein the node v i is referred to as the centroid of ξ i , and represents the kth hyperedge in the hyperedge set connected to the ith node in the node set of the geographical traffic graph, i.e., the lth hyperedge in the hyperedge set of the traffic hypergraph. k
[0201] The transformation matrix of the hyperedge convolution of the hth attention head is calculated through the multi-head attention mechanism, and the specific process is as follows:
[0202]
[0203] wherein represents a two-dimensional matrix of k i rows and k i columns.
[0204]
[0205] wherein h represents the head index, H represents the number of attention heads, D is the number of output channels of each layer of neural network, represents the i th row and j th column of the transformation matrix of the h th attention head, which represents the similarity between the i th hyperedge in the hyperedge set connected to the ith node in the node set of the geographical traffic graph and the jth hyperedge in the hyperedge set connected to the ith node in the node set of the geographical traffic graph, represents the training parameter for obtaining the query in the hth attention head, represents the training parameter for obtaining the key in the hth attention head, represents the feature of the i th hyperedge in the hyperedge set connected to the ith node in the node set of the geographical traffic graph, represents the feature of the jth hyperedge in the hyperedge set connected to the ith node in the node set of the geographical traffic graph.
[0206] Then, the is normalized by using the softmax function The normalized is as follows:
[0207]
[0208] in, This represents the similarity between the i-th superedge in the set of superedges connecting the i-th node in the set of nodes in the geographic transportation map and the k-th superedge in the set of superedges connecting the i-th node in the set of nodes in the geographic transportation map; k i Let k represent the set of superedges in the traffic hypergraph. i A hyperedge connects the i-th node in the set of nodes of the geographic transportation map;
[0209] The normalized transformation matrix of the hyperedge convolution of the h-th attention head is as follows:
[0210]
[0211] in, Indicates k i line k i A two-dimensional matrix of columns, The i-th row and j-th column is Will The weight matrix is used to compute the k edges in the hyperedge set of the transportation hypergraph connecting the i-th node in the set of nodes of the geographic transportation map. i The weighted sum of the superedges yields the feature representation of the i-th node in the node set of the geographic transportation map, specifically:
[0212] H i * =reshape(H i ), i∈[1, k i ],
[0213]
[0214] Here, reshape(*) represents reshaping the shape, and conv2(*) represents the convolution operation. Let k represent the kth node in the hyperedge set of the transportation hypergraph that connects the i-th node in the set of nodes of the geographic transportation graph. i Features of a superedge Represents a three-dimensional vector with dimensions k. i T h D, T □ H represents the length of traffic flow samples for each road node, and D is the number of output channels for each layer of the neural network. i Recombining to obtain a two-dimensional vector The dimensions are k i 、(T h *D), HC vi It is the i-th node v in the node set of the geographic transportation map. iThe characteristic is that || represents concatenating H attention heads. This represents the training parameters used to obtain values in the h-th attention head;
[0215] The spatial attention fusion module selects an attention mechanism to fuse the pairwise spatial correlations and the higher-order spatial correlations of each group of road node traffic flow samples to obtain the encoded spatial features of each group of road node traffic flow samples, and outputs them to the decoder time block.
[0216] The spatiotemporal awareness channel attention mechanism consists of a spatiotemporal convolutional neural network, global average pooling, a convolutional neural network with ReLU activation function, and a convolutional neural network with Sigmoid activation function.
[0217] The spatiotemporal convolutional neural network, global average pooling, convolutional neural network with ReLU activation function, and convolutional neural network with Sigmoid activation function are cascaded in sequence.
[0218] The spatiotemporal convolutional neural network, employing a spatiotemporal kernel, simultaneously models temporal and spatial correlations to obtain the spatiotemporal characteristics of traffic flow for each group of road nodes. And output to global average pooling, where This represents a three-dimensional vector with dimensions N and T respectively. f D and N are the number of nodes in the node set of the geographic transportation map, and T is the number of nodes in the map. f This represents the prediction time step for traffic flow samples at each road node, where D is the number of output channels in each layer of the neural network. This is achieved by analyzing the spatiotemporal features X of the traffic flow at each road node. st The spatiotemporal characteristics of traffic flow transformation for each group of road nodes are obtained by reorganization. ,in This represents a two-dimensional vector with dimensions (N*T) f D;
[0219] The global average pooling method is selected to extract the spatiotemporal characteristics of traffic flow from each group of road nodes. st The channel features X of traffic flow for each group of road nodes are obtained by global average pooling. p ∈R 1×1×D The output is fed into a convolutional neural network with ReLU activation, where R... 1×1×D This represents a three-dimensional vector with dimensions 1, 1, and D, where D is the number of output channels in each layer of the neural network.
[0220] The convolutional neural network with ReLU activation function is selected by changing the channel features X of traffic flow at each road node. p ∈R1×1×D The channel dimension of X is obtained, and output to a convolutional neural network with a Sigmoid activation function, wherein represents a three-dimensional vector, and the dimensions are 1, 1, , and D is the number of output channels of each layer of the neural network.
[0221] The convolutional neural network with a Sigmoid activation function selects the convolutional neural network and the Sigmoid activation function by changing The channel dimension of X p2 ∈R 1×1×D , wherein R 1×1×D represents a three-dimensional vector, and the dimensions are 1, 1, D, D is the number of output channels of each layer of the neural network, and the channel attention matrix X p2 is obtained by reorganizing X p2 * ∈R D×1 , R D×1 represents a two-dimensional vector, and the dimensions are D, 1.
[0222] The spatio-temporal features of each group of road node traffic flow are transformed and the channel attention matrix X p2 * to obtain a result , wherein represents a two-dimensional vector, and the dimensions are (N*T f ), D, N is the number of nodes in the node set of the geographic traffic graph, T f represents the prediction time step of each group of road node traffic flow samples, D is the number of output channels of each layer of the neural network, and the predicted traffic flow data of each group of road node traffic flow samples is obtained by reorganizing X O
[0223] The loss function model in step 4 is defined as follows:
[0224]
[0225] , wherein S represents the number of road node traffic flow samples, T f represents the prediction time step of each group of road node traffic flow samples, N is the number of nodes in the node set of the geographic traffic graph, represents the kth real traffic flow data in the ith road node traffic flow sample in the pth group, that is, the real traffic flow data of each road node at the (p-1)+T h +k prediction time step, represents the kth predicted traffic flow data in the ith road node traffic flow sample in the pth group.
[0226] Step 5: The central server collects the traffic flow of each road node at multiple time points in real time through the plurality of traffic flow sensors, and predicts the traffic flow of each road node at multiple future time points through the optimized spatio-temporal gated hypergraph convolution network traffic prediction model.
[0227] It should be understood that parts not described in detail in the specification are all prior art.
[0228] Although the terms such as central server, traffic flow sensor are used more frequently in this paper, the possibility of using other terms is not excluded. The use of these terms is only for the convenience of describing the essence of the application, and it is against the spirit of the application to interpret them as any kind of additional limitation.
[0229] It should be understood that the above description of the preferred embodiments is more detailed and should not be considered as a limitation on the scope of patent protection of the application. Those skilled in the art can make substitutions or modifications without departing from the scope of protection claimed by the application, which falls within the scope of protection of the application. The scope of protection of the application shall be subject to the appended claims.
Claims
1. A spatio-temporal gated hypergraph convolutional network based traffic prediction system, characterized in that, The method comprises the following steps: a central server and a plurality of traffic flow sensors; sequentially deploying the plurality of traffic flow sensors on a plurality of road nodes in a city; wireless connection between the central server and the plurality of traffic flow sensors; the traffic flow sensors are used to collect traffic flow of the road nodes at a plurality of time points and wirelessly transmit the traffic flow to the central server; the central server is used to construct a traffic hypergraph, divide a plurality of historical time point road node traffic flows into a plurality of groups of road node traffic flow samples and real traffic flows by a sliding window division method, combine the traffic hypergraph to construct a spatio-temporal gated hypergraph convolution network traffic prediction model, optimize training of the spatio-temporal gated hypergraph convolution network traffic prediction model in combination with the plurality of groups of road node traffic flow samples and real traffic flows, and obtain an optimized spatio-temporal gated hypergraph convolution network traffic prediction model; the central server predicts the traffic flow of the road nodes at a plurality of time points by the optimized spatio-temporal gated hypergraph convolution network traffic prediction model to obtain the traffic flow of the road nodes at a plurality of future time points; the traffic hypergraph is represented as: G h =( V , the hyperedge set of the traffic hypergraph, and the specific construction process is as follows: ), V ={ v 1, v 2, …, v N}, constructing a structural hyperedge set according to a KNN algorithm in combination with an adjacency matrix of a geographic traffic graph, wherein each structural hyperedge in the structural hyperedge set reflects structural connectivity between a plurality of nodes in a node set of the geographic traffic graph; ={ e 1, e 2, …, e M}; wherein, G h denotes a transportation hypergraph, V denotes a set of nodes of a geographic transportation graph, v i denotes a i-th node of the set of nodes of the geographic transportation graph, i constructing a semantic hyperedge set according to a K-mean algorithm in combination with traffic flow of each node in the node set of the geographic traffic graph, wherein each semantic hyperedge in the semantic hyperedge set reflects contextual semantic similarity between a plurality of nodes in the node set of the geographic traffic graph; denotes a set of hyperedges of a transportation hypergraph, e j denotes a i-th hyperedge of the set of hyperedges of the transportation hypergraph, j M denotes a number of hyperedges of the set of hyperedges of the transportation hypergraph, N is a number of nodes of the set of nodes of the geographic transportation graph; constructing the hyperedge set of the traffic hypergraph according to the structural hyperedge set and the semantic hyperedge set; the hyperedge set of the traffic hypergraph is composed of structural hyperedges and semantic hyperedges. The method comprises the following steps: step 1: constructing a geographic traffic graph according to connectivity between road nodes; step 2: constructing a traffic hypergraph to model high-order spatial correlation between a plurality of nodes; 2. A method for spatiotemporal gated hypergraph convolution network based traffic prediction using the spatiotemporal gated hypergraph convolution network based traffic prediction system according to claim 1, characterized in that, step 3: dividing traffic flow data of each road node at a plurality of historical time steps by a sliding window division method to obtain a plurality of groups of road node traffic flow samples, and constructing real traffic flow data of each group of road node traffic flow samples; step 4: combining the geographic traffic graph and the traffic hypergraph to construct a spatio-temporal gated hypergraph convolution network traffic prediction model, inputting each group of road node traffic flow samples into the spatio-temporal gated hypergraph convolution network traffic prediction model in sequence for prediction to obtain predicted traffic flow data of each group of road node traffic flow samples, combining the real traffic flow data of each group of road node traffic flow samples to construct a spatio-temporal gated hypergraph convolution network loss function model, and optimizing training by an Adam algorithm to obtain an optimized spatio-temporal gated hypergraph convolution network traffic prediction model; step 5: the central server collects real-time traffic flow of each road node at a plurality of time points by the plurality of traffic flow sensors, and predicts the real-time traffic flow of each road node at a plurality of time points by the optimized spatio-temporal gated hypergraph convolution network traffic prediction model to obtain future traffic flow of each road node at a plurality of time points.
3. The traffic prediction method based on the spatio-temporal gated hypergraph convolution network according to claim 2, wherein: The geographical traffic graph is constructed according to the connectivity between road nodes in step 1, specifically as follows: Each traffic flow sensor is defined as each node in the geographical traffic graph; The connectivity between road nodes in the city is defined as the adjacency relationship between any two nodes in the geographical traffic graph; The geographical traffic graph is represented as: G =( V , A ), V ={ v 1, v 2, …, v N}; wherein, G denotes a geographical traffic graph, V denotes a set of nodes of a geographical traffic graph, N denotes a number of nodes of a set of nodes of a geographical traffic graph, v i denotes a i th node of a set of nodes of a geographical traffic graph, A denotes an adjacency matrix, A ∈ R N×N , R N×N denotes N a two-dimensional matrix of rows N columns, wherein v i if a node v j is connected to a node A [ i , j ]=1, if a node v i is not connected to a node v j , A [ i , j ]=0.
4. The traffic prediction method based on the spatio-temporal gated hypergraph convolution network according to claim 2, wherein: The traffic flow samples of the multiple groups of road nodes are constructed in step 3, specifically as follows: , p ∈[1, S ] =( X t,1 , X t,2 , ..., X t,N ), t ∈[1, T ] wherein, denotes the p group of road node traffic flow samples, S denotes the number of road node traffic flow samples, denotes the p group of road node traffic flow samples, k denotes the traffic flow data of the k th road node at the th historical time step, denotes the length of each group of road node traffic flow samples, denotes the traffic flow data of the t th road node at the T th historical time step, X t,i denotes the traffic flow data of the t th road node at the i th historical time step, i ∈[1, N ], N denotes the number of nodes of the node set of the geographical traffic graph; The real traffic flow data of each group of road node traffic flow samples is constructed in step 3, specifically as follows: No. p The actual traffic flow data for the group of road node traffic flow samples are as follows: ; wherein, denotes the predicted time step of each group of road node traffic flow samples, denotes the true traffic flow data of the p group of road node traffic flow samples.
5. The traffic prediction method based on the spatio-temporal gated hypergraph convolution network according to claim 2, wherein: The spatio-temporal gated hypergraph convolution network traffic prediction model is constructed in step 4, and the specific process is as follows: The spatio-temporal gated hypergraph convolution network traffic prediction model Comprises a convolutional neural network, an encoder time block, an encoder space block, a decoder time block, a decoder space block, and a spatio-temporal perception channel attention mechanism; The convolutional neural network, the encoder time block, the encoder space block, the decoder time block, the decoder space block, and the spatio-temporal perception channel attention mechanism are sequentially cascaded; The convolutional neural network is configured to obtain high-dimensional features of each group of road node traffic flow samples through the convolutional neural network, and output the high-dimensional features to the encoder time block; The encoder time block is configured to obtain encoded time features of each group of road node traffic flow samples by modeling time correlation, and output the encoded time features to the encoder space block; The encoder space block is configured to obtain encoded space features of each group of road node traffic flow samples by modeling space correlation, and output the encoded space features to the decoder time block; The decoder time block is configured to obtain decoded time features of each group of road node traffic flow samples by modeling time correlation, and output the decoded time features to the decoder space block; The decoder space block is configured to obtain decoded space features of each group of road node traffic flow samples by modeling space correlation, and output the decoded space features to the spatio-temporal perception channel attention mechanism; The spatio-temporal perception channel attention mechanism is configured to mine spatio-temporal correlation and channel feature correlation through the spatio-temporal perception channel attention mechanism, and map the decoded space features to an output to obtain predicted traffic flow data of each group of road node traffic flow samples; The structure and function of the encoder time block and the decoder time block are the same; The structure and function of the encoder space block and the decoder space block are the same.
6. The traffic prediction method based on the spatio-temporal gated hypergraph convolution network according to claim 5, wherein: The encoder time block comprises a time gating convolution module, a time attention mechanism module, and a time attention fusion module; The time-gated convolution module and the time attention mechanism module are connected in parallel and further cascaded with the time attention fusion module; The time-gated convolution module selects a time-gated convolution neural network model, which is used to model local time correlation of high-dimensional features of each group of road node traffic flow samples and output to the time attention fusion module; The time attention mechanism module selects a time attention mechanism, which is used to model global time correlation of high-dimensional features of each group of road node traffic flow samples and output to the time attention fusion module; The time attention fusion module selects an attention mechanism, which is used to fuse local time correlation of each group of road node traffic flow samples and global time correlation of each group of road node traffic flow samples to obtain encoded time features of each group of road node traffic flow samples and output to the encoder spatial block; The encoder spatial block is composed of a spatial-gated convolution module, a hypergraph convolution module and a spatial attention fusion module; The spatial-gated convolution module and the hypergraph convolution module are connected in parallel and further cascaded with the spatial attention fusion module; The spatial-gated convolution module selects a spatial-gated convolution neural network model, which is used to model pairwise spatial correlation of encoded time features of each group of road node traffic flow samples and output to the spatial attention fusion module; The spatial attention fusion module selects an attention mechanism, which is used to fuse pairwise spatial correlation of each group of road node traffic flow samples and high-order spatial correlation of each group of road node traffic flow samples to obtain encoded spatial features of each group of road node traffic flow samples and output to the decoder time block.
7. The traffic prediction method based on the spatio-temporal gated hypergraph convolution network according to claim 6, wherein: The hypergraph convolution module selects a hypergraph convolution neural network model, which is used to model high-order spatial correlation of encoded time features of each group of road node traffic flow samples and output to the spatial attention fusion module; The hypergraph convolution neural network model is composed of a vertex convolution module and a hyperedge convolution module in cascade; The vertex convolution module selects a multi-head attention mechanism to aggregate information of each node connected to each hyperedge in a hyperedge set of a traffic hypergraph to the hyperedge, specifically as follows: A node set contained in each hyperedge in the hyperedge set of the traffic hypergraph is constructed: If the set of superedges of the traffic hypergraph contains the first... m The superedge contains the set of nodes in the geographic transportation graph. k m 1 node m ∈[1, M ], M Let represent the number of hyperedges in the hyperedge set of the traffic hypergraph. Then, the th hyperedge in the hyperedge set of the traffic hypergraph... m The set of nodes contained in each superedge is: in, The set of superedges in the traffic hypergraph represents the first... m The set of nodes contained in the superedge k The nth node, that is, the nth node in the set of nodes of the geographic transportation map. One node; The transformation matrix of the vertex convolution of the first h attention head is calculated by the multi-head attention mechanism, specifically as follows: ; wherein represents row a two-dimensional matrix of columns h ∈[1, H ], i ∈[1, k m ], j ∈[1, k m ]; wherein, h denotes the head index, H denotes the number of attention heads, D is the number of output channels of each layer of neural network, denotes the h row and the i column of the transformation matrix of the j th attention head, which represents the similarity between the m th node in the node set contained in the i th superedge in the superedge set of the traffic supergraph and the m th node in the node set contained in the j th superedge in the superedge set of the traffic supergraph, denotes the training parameter used to obtain the query in the h th attention head, denotes the training parameter used to obtain the key in the h th attention head, denotes the feature of the m th node in the node set contained in the i th superedge in the superedge set of the traffic supergraph, the feature of the m th node in the node set contained in the j th superedge in the superedge set of the traffic supergraph; normalizing with a softmax function , the normalized In particular, as follows: , h ∈[1, H ], i ∈[1, k m ], j ∈[1, k m ]; wherein, represents the similarity between the j-th node in the node set contained in the i-th hyperedge of the traffic hypergraph and the k-th node in the node set contained in the i-th hyperedge of the traffic hypergraph, m i m k k m represents the similarity between the j-th node in the node set contained in the i-th hyperedge of the traffic hypergraph and the k-th node in the node set contained in the i-th hyperedge of the traffic hypergraph, m k m the i-th hyperedge of the traffic hypergraph contains The first h Note that the normalized transformation matrix of the attention head's top convolution is as follows: ; wherein, denotes row a two-dimensional matrix, the first i row the first j column as , the as a weight matrix to calculate the weighted sum of all node features contained in the first m edge of the superedge set of the traffic supergraph, so as to obtain the feature of the first m edge of the superedge set of the traffic supergraph, specifically: , m ∈[1, k m ], ; wherein, (·) represents a reshaping shape, (·) represents a convolution operation, is the input of vertex convolution, that is, the encoded time feature of each group of road node traffic flow samples obtained through the time attention fusion module, represents the feature of the m th superedge in the superedge set of the traffic supergraph, k m represents a three-dimensional vector, the dimensions are , represents the length of each group of road node traffic flow samples, is the number of output channels of each layer of neural network, and a two-dimensional vector is obtained by reshaping , the dimensions are , is the feature of the m th superedge in the superedge set of the traffic supergraph, || represents splicing H attention heads, represents the training parameter used to obtain the value in the h th attention head; The hyperedge convolution module selects a multi-head attention mechanism to aggregate features of hyperedges in the hyperedge set of the traffic hypergraph to a centroid, specifically as follows: A hyperedge set of each node in the node set of the connected geographical traffic graph is constructed: For each node in the set of nodes of the geographical traffic graph, a set of hyper-edges connecting the node is constructed: if the set of hyper-edges of the traffic hypergraph contains a hyper-edge k i The set of hyper-edges connecting the i-th node in the set of nodes of the geographical traffic graph i v i , i ∈ [1, N ], N denoting the number of nodes in the set of nodes of the geographical traffic graph, the set of hyper-edges connecting the i-th node in the set of nodes of the geographical traffic graph i v i is ξ i ={ , ,…, }; Among them, nodes v i Called 8. The traffic prediction method based on the spatio-temporal gated hypergraph convolution network according to claim 5, wherein: i The center of mass, This represents the set of nodes connecting the geographic transportation map. i The set of hyperedges of the nth node k The first superedge, i.e., the first superedge in the set of superedges of the traffic hypergraph. Strip of edge; The transformation matrix of the hyper-edge convolution of the first attention head is calculated by the multi-head attention mechanism, specifically as follows: h ; wherein represents row a two-dimensional matrix of rows and columns; h ∈[1, H ], i ∈[1, k i ], j ∈[1, k i ]; wherein, h denotes the head index, H denotes the number of attention heads, D is the number of output channels of each layer of the neural network, denotes the h th row of the i th column of the transformation matrix of the j th attention head, represents the similarity between the i th hyperedge in the hyperedge set of the i th node in the node set of the connected geographical traffic graph and the i th hyperedge in the hyperedge set of the j th node in the node set of the connected geographical traffic graph, denotes the training parameter used to obtain the query in the h th attention head, denotes the training parameter used to obtain the key in the h th attention head, denotes the feature of the i th hyperedge in the hyperedge set of the i th node in the node set of the connected geographical traffic graph, denotes the feature of the i th hyperedge in the hyperedge set of the j th node in the node set of the connected geographical traffic graph; normalizing with a softmax function , the normalized In particular, as follows: , h ∈[1, H ], i ∈[1, k i ], j ∈[1, k i ]; wherein, represents a similarity between the i-th hyperedge of the hyperedge set connecting the i-th node of the set of nodes of the geographic traffic graph and the j-th hyperedge of the hyperedge set connecting the j-th node of the set of nodes of the geographic traffic graph; i i i k represents the i-th hyperedge of the hyperedge set of the traffic hypergraph connecting the i-th node of the set of nodes of the geographic traffic graph; k i i the i-th node of the set of nodes of the geographic traffic graph; The first h Note that the normalized transformation matrix of the attention head's hyper-edge convolution is as follows: ; wherein, denotes a row of a two-dimensional matrix, a first i row of a first j column of a two-dimensional matrix, , and as a weight matrix to calculate a weighted sum of the i th hyperedge in the hyperedge set of the traffic hypergraph connected to the th node in the node set of the geographic traffic graph, thereby obtaining a feature representation of the i th node in the node set of the geographic traffic graph, in particular: , i ∈[1, k i ], ; wherein, (·) denotes a reshaping operation, (·) denotes a convolution operation, denotes the feature of the i th edge in the superedge set of the supergraph connecting the k th node in the node set of the geographical traffic graph, i denotes a three-dimensional vector with dimensions , denotes the length of each group of road node traffic flow samples, is the number of output channels of each layer of neural network, and a two-dimensional vector is obtained by reshaping with dimensions is the feature representation of the i th node in the node set of the geographical traffic graph v i is obtained by concatenating H attention heads, and denotes the training parameter used to obtain the value in the h th attention head. The spatio-temporal perception channel attention mechanism is composed of a spatio-temporal convolutional neural network, global average pooling, a convolutional neural network with a Relu activation function, and a convolutional neural network with a Sigmoid activation function; The spatio-temporal convolutional neural network, the global average pooling, the convolutional neural network with the Relu activation function, and the convolutional neural network with the Sigmoid activation function are cascaded in sequence; The spatio-temporal convolutional neural network adopts a spatio-temporal convolutional neural network with a spatio-temporal kernel to obtain the spatio-temporal features of each group of road node traffic flow by simultaneously modeling the time correlation and the space correlation and output to the global average pooling, wherein represents a three-dimensional vector, and the dimensions are , N is the number of nodes of the node set of the geographic traffic graph, represents a prediction time step of each group of road node traffic flow samples, is the number of output channels of each layer of neural network, and the transformed spatio-temporal features of each group of road node traffic flow are obtained by reorganizing the spatio-temporal features of each group of road node traffic flow , wherein represents a two-dimensional vector, and the dimensions are ; The global average pooling selects the global average pooling, and the time-space features of the traffic flow of each group of road nodes The channel features of the traffic flow of each group of road nodes are obtained by global average pooling X p ∈ R 1×1×D And output to the convolutional neural network with Relu activation function, wherein Represents a three-dimensional vector, and the dimensions are , The number of output channels of each layer of neural network The convolutional neural network with a Relu activation function selects a convolutional neural network and a Relu activation function by changing the channel characteristics of each set of road node traffic flow X p ∈ R 1×1×D The channel dimension of is obtained , and output to a convolutional neural network with a Sigmoid activation function, wherein represents a three-dimensional vector, and the dimensions are , is the number of output channels of each layer of neural network; The convolutional neural network with a sigmoid activation function selects a convolutional neural network and a sigmoid activation function by changing the channel dimension to obtain wherein represents a three-dimensional vector, and the dimensions are , is the number of output channels of each layer of the neural network, and the channel attention matrix is obtained by reorganizing , , represents a two-dimensional vector, and the dimensions are D ; Transforming the spatio-temporal features of each group of road node traffic flow and channel attention matrix are multiplied to obtain the result wherein denotes a two-dimensional vector, the dimensions of which are , N is the number of nodes of the node set of the geographic traffic graph, denotes the prediction time step of each group of road node traffic flow samples, is the number of output channels of each layer of the neural network, which is obtained by reorganizing is the prediction traffic flow data of each group of road node traffic flow samples .
9. The traffic prediction method based on the spatio-temporal gated hypergraph convolutional network according to claim 5, characterized in that: The loss function model of the spatio-temporal gated hypergraph convolutional network in step 4 is defined as follows: in, S This indicates the number of traffic flow samples at road nodes. This represents the prediction time step for each group of traffic flow samples at each road node. N This represents the number of nodes in the node set of the geographic transportation map. Indicates the first p Group 1 i In the traffic flow sample of the nth road node k The first real traffic flow data, i.e., the first Real traffic flow data for each road node at each predicted time step. Indicates the first p Group 1 i In the traffic flow sample of the nth road node k A predicted traffic flow data.
Citation Information
Patent Citations
Traffic flow prediction method based on space-time hypergraph neural network
CN114944053A