Traffic prediction method based on sub-hypergraph and self-distillation
By using sub-hypergraph and self-distillation methods in traffic data prediction, combined with local and global features, the problem of existing methods ignoring the differentiated characteristics of roads is solved and the prediction accuracy is significantly improved.
Patent Information
- Application Number
- CN202410763286.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-08
AI Technical Summary
Existing traffic data prediction methods based on graphs/hypergraphs ignore the differentiated characteristics between roads, resulting in insufficient prediction accuracy and inability to effectively utilize the information in complex traffic data.
Using a method based on sub-hypergraph and self-distillation, the traffic data is divided into different sub-categories through unsupervised clustering, a sub-hypergraph network model is constructed to extract local features, and combined with the global hypergraph network model, the self-distillation method is used to fuse local and global features for prediction.
The accuracy of traffic data prediction is improved. By considering the differentiated characteristics of road data and road network topology, better training parameters and prediction results are obtained. The experimental results outperform existing methods on multiple public data sets.
Smart Images

Figure CN118747552A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a traffic data prediction method for a traffic system, and proposes a traffic prediction method and device based on a sub-hypergraph and self-distillation, which supports traffic data prediction tasks in urban road networks and achieves good prediction results. Background Art
[0002] With the continuous advancement of my country's urbanization process, the Intelligent Traffic System (ITS) has been developing continuously. The Intelligent Traffic System is a complex and comprehensive system, which is mainly composed of a traffic data information collection system, a data processing and analysis system, and an information release system. Traffic data information is collected through sensors or GPS positioning systems, and then collected and transmitted to the traffic information processing and analysis center system. The data is uniformly processed and mined through relevant algorithms or models to analyze and grasp the road traffic operation status, and can realize the prediction and evaluation of future traffic conditions, and then judge the congestion status and whether there are emergencies. The Intelligent Traffic System has played an important role in improving traffic safety, alleviating traffic congestion, and improving traffic efficiency. Traffic prediction is an important part of the Intelligent Traffic System. Accurate road network traffic prediction provides important information for the Intelligent Traffic System to implement active and efficient traffic management decisions. Traffic prediction is to analyze and utilize the inherent correlation of traffic data through a large amount of historical data, and then predict the development trend of road traffic conditions, realize the evaluation of future traffic prediction conditions, provide favorable support for travel route planning, congestion risk assessment, vehicle scheduling and diversion, etc., improve the efficiency of urban traffic operation, and make residents' travel more convenient.
[0003] At present, with the vigorous development of IPv6, wireless communication technology and sensor technology, intelligent transportation systems are integrated into the transportation field through short-range microelectronic sensor technology, wireless communication technology, embedded sensor network and other technologies, making it possible to obtain a large amount of road traffic data information required for urban traffic prediction such as flow, speed, lane occupancy rate, etc. through a large amount of road traffic data collection. The large amount of accumulated rich traffic data accompanied by geographic information has laid a good foundation for traffic prediction. Traffic prediction is actually to mine the spatiotemporal correlation from rich and complex traffic data. In order to explore the temporal correlation of traffic data, recurrent neural network (RNN) and long short-term memory network (LSTM) are often used to formulate prediction methods. Since traffic data are generated from a road network covering a large area, they often have a high spatial correlation. Therefore, researchers use convolutional neural networks (CNNs) and propose traffic prediction methods based on spatial feature extraction. However, these methods all require the traffic network to be converted into a regular grid, which will disrupt the original irregular traffic network structure. In recent years, the theory of Graph Neural Networks (GNNs) has become a research hotspot and focus in the field of ITS. This is because graph representation methods can effectively represent irregular road networks. Therefore, researchers use graph neural networks to extract the spatial relationship of road networks and propose a series of graph-based traffic prediction methods. Representative methods include Spatio-temporal Graph Convolutional Networks (STGCN), Attention based Spatial-temporal Graph Convolutional Networks (ASTGCN), Optimized Graph Convolution Recurrent Neural Network (OGCRNN), Hierarchical Graph Convolution Network (HGCN), etc. Since graph convolution is a local operation, traditional graph representation methods can only represent simple pairwise relationships. However, there are always high-order relationships between complex road networks.Therefore, researchers adopted hypergraph theory to develop traffic prediction methods, such as SpatioTemporalHypergraph Convolution Networks (STHGCN), MultitaskHypergraph Convolutional Networks (MHCN), and DirectedHypergraph Attention Network (DHAT).
[0004] However, in the above existing graph / hypergraph-based methods, all road and traffic data are used to construct a single graph or hypergraph. In addition, the graph or hypergraph is often constructed directly based on a fixed road structure. This approach ignores the differentiated characteristics of traffic data from different roads, such as congestion and smoothness. In actual traffic scenarios, traffic data from adjacent roads may reflect different traffic characteristics, while locations farther away may reflect similar traffic characteristics. Figure 1 It shows a true reflection of traffic data with different characteristics from different roads. Figure 1 In (a), although locations A and B are connected, they contain different traffic states. In contrast, locations A and D are not connected but are in similar states. Figure 1 (b) and Figure 1 (c) shows the real speed data of A, B and D. Based on this, the present invention believes that considering different data features in the traffic network for modeling can better utilize the information in a large amount of complex traffic data, thereby improving the accuracy of prediction. Summary of the invention
[0005] A new traffic data prediction method and device based on sub-hypergraph and self-distillation is proposed. During the training process, the traffic data is first divided into different sub-classes by unsupervised clustering according to different characteristics, and the sub-hypergraph is constructed with the data of each sub-class. Subsequently, the corresponding sub-hypergraph network models are established using these sub-hypergraphs, that is, the teacher network of the corresponding local traffic features is constructed to extract different local features of the traffic data. At the same time, a global hypergraph network is established based on the complete traffic data and the topological structure of the traffic road network, that is, the student network is constructed. Finally, the local data features learned by each teacher network are transferred to the student network by the self-distillation method, so that the student network can extract global traffic information while integrating the local traffic features of each teacher network, and obtain better training parameters and prediction results. The method is evaluated on several real open-world datasets for traffic data prediction, and the experimental results prove the effectiveness of the proposed method.
[0006] The main steps of the present invention include the following:
[0007] Step 1: Introduce the definition of hypergraph:
[0008] The topological structure of a traffic network can be represented by a graph G = (V, E), where V is the set of nodes representing intersections in the network, and E is the set of edges between nodes. h =(V,E h ) is defined as a special graph, where edges are abstracted into hyperedges, where h is used to represent the hypergraph, E h represents the set of hyperedges, which refers to the set of partial nodes. In addition, at each time step t, the hypergraph G h There is a signal matrix That is a set of real numbers, N represents the number of nodes, d represents the characteristic dimension of traffic data, and t represents the observation time of the data. Therefore, the traffic prediction problem is defined as a time series prediction problem on a hypergraph. Given a hypergraph G h and its historical signal of S time steps The goal is to learn a function f that can predict the signal of the next T time steps. The mapping relationship can be expressed as:
[0009]
[0010] Hypergraph G h The historical data from the past observation time t-S+1 to t is used through function f to predict the data of the next T moments.
[0011] Unlike in traditional graphs, where an edge can only connect two points, in the hypergraph G h =(V,E h ) can connect multiple nodes. The connection relationship between nodes and hyperedges is represented by an association matrix It can be represented by N, where N represents the number of nodes and I represents the number of hyperedges.
[0012]
[0013] Among them, v i is the i-th node in V, e j YesE h The jth hyperedge in h ij is the value of the i-th row and j-th column of the association matrix H, representing the node v i With super edge e j If connected, the value is 1, otherwise it is 0.
[0014] For a node v, its degree d(v) is defined as the sum of all hyperedge weights w attached to the node v:
[0015]
[0016] Among them, e i YesE h The i-th hyperedge in w(e i ) represents the hyperedge e i The weight of h(v,e i ) represents the relationship between node v and hyperedge e in the association matrix i The value of the connection condition.
[0017] For a hyperedge e, its degree δ(e) is defined as the number of nodes connected to e:
[0018] δ(e)=∑ v∈V h(v,e i ),i∈I.
[0019] Step 2: Introduce the construction of the main hypergraph:
[0020] In the main hypergraph construction method, it is necessary to use the complete road structure mining to extract the global structural features of the traffic road network. First, the specific location of each road in the road network is obtained, and the distance between each road is calculated to form a distance matrix. Each value in the matrix represents the distance between two road nodes. In the main hypergraph, the nodes on the hyperedge are composed of a series of spatially adjacent nodes. To do this, it is first necessary to find several nodes that are closest to each node. Therefore, the K-Nearest Neighbors (KNN) algorithm is used to calculate the distance between each node and all other nodes, and the K nearest neighbor nodes are selected to construct the hyperedge E. h By constructing multiple hyperedges, we can finally get the main hypergraph G h =(V,E h ).
[0021] Step 3: Introduce the construction of sub-hypergraph:
[0022] A feature-based method is used to construct sub-hyperedges in the student network to represent the data features of the road network. First, the K-means clustering algorithm is used to divide the entire data set, and the traffic flow data with similar traffic attributes are divided to form subsets of traffic flow data with different attributes. That is, the traffic flow data with different flow attributes can be divided into different clusters, and each cluster forms a sub-data set. For each sub-data set, the KNN method is also used to construct hyperedges to form the corresponding sub-hypergraph Where s refers to "sub", which means a sub-hypergraph. Represents a hyperedge in a sub-hypergraph. Different from the construction method of hyperedges in the main hypergraph, the hyperedge construction process of the sub-hypergraph uses traffic flow data features and is independent of the distance between the roads where the traffic flow is located.
[0023] Step 4: Introduce the prediction model:
[0024] In hypergraph theory, the Laplacian matrix is first used to learn the constructed hypergraph. The Laplacian matrix is defined as:
[0025]
[0026] Where: L h Denotes the Laplacian matrix of the hypergraph, D v Denotes the degree matrix of the node, D e represents the degree matrix of the hyperedge, W e represents the weight matrix of the hypergraph, H represents the association matrix of the hypergraph, and H T represents the transposed matrix of H, and I is the identity matrix. Then the 1stChebNet using hypergraph convolution can be defined as:
[0027]
[0028] Where X represents the signal matrix of the input hypergraph, θ represents the weight parameter during the convolution operation, and Z h Represents the output of the hypergraph convolution.
[0029] After obtaining the calculation formula of hypergraph convolution, the graph wavelet neural network (GWN) was selected as the prediction model. The graph wavelet neural network effectively captures the spatiotemporal dependency by combining graph convolution with causal convolution. Since hypergraphs cannot be directly used in models with graph convolution, improvements were made on the basis of the original GWN, and the graph convolution network module was expanded to a hypergraph convolution network module. Specifically, the historical data is first passed through a fully connected layer, and the result is input into the network. The dimension of the fully connected layer is set according to the dimension of the input historical data. The network has five layers in total. The input data will first pass through the gated temporal convolution module in the network to extract the features of the temporal dimension. The temporal convolution module is divided into two channels, each of which performs one-dimensional temporal convolution on the input. One channel uses tanh as the activation function, and the other channel uses sigmiod as the activation function. The merged result is then input into the hypergraph convolution HGCN module to extract the features of the spatial dimension. In addition, in order to prevent overfitting, residual connections are also used in the network. After extracting the spatiotemporal features, a fully connected layer and a Relu activation function are used to obtain the final prediction result.
[0030] Step 5: After obtaining local traffic data features through the main hypergraph and global road network topology features through the sub-hypergraph, the self-distillation method is used to combine the features of the two parts. The specific process is as follows:
[0031] First, the teacher network is trained. Figure 3 The upper part of the figure shows the learning process of the teacher network. In the teacher network, the entire data set X is first clustered by KMeans to obtain M sub-data sets. Then, M sub-hypergraphs are constructed from hyperedges. Subsequently, the M sub-hypergraphs are input into the teacher model to learn the data features and obtain the prediction results. in, represents the prediction result of the first sub-hypergraph in the teacher network, is the prediction result of the Mth sub-hypergraph in the teacher network, and M is set to 2. The parameters of the teacher network are updated by comparing the prediction result with the true value Y. In general, the teacher network optimizes the subsequent loss function:
[0032]
[0033] Among them, X and Y are the input value and true value of the entire teacher network respectively. and Y i are the input value and true value of the i-th teacher model, L t is the loss of the teacher network, using the L1 loss function.
[0034] After the teacher network training is completed, the parameters of the teacher network are fixed, and the knowledge learned by the teacher network is used to guide the training of the student network, so as to transfer the data features to the student network training process. The loss function is:
[0035] L(X,Y)=L(P s ,Y)+λL SD ,
[0036] Where L is the loss of the student network, P s and Y are the input value and true value of the student network respectively. λ is a hyperparameter used to control the size of the distillation loss transferred from the teacher network to the student network. After experimental verification, it is best to set it to 0.6. SD is the distillation loss, which is calculated as follows:
[0037]
[0038] Since the output of the teacher network is unbounded and may have large errors, thus giving harmful guidance to the student network, a bounded distillation loss is adopted, which is formulated as:
[0039]
[0040] Among them, L SD-b is the bounded distillation loss, m is the hyperparameter that controls the boundary, which is used to set the size of the distillation boundary. After experimental verification, it is best to set it to 1, that is, when the prediction result P of the student network is s If the L2 loss with the true value Y plus this boundary value is greater than the prediction result P of the teacher network t The L2 loss with the true value Y proves that the prediction error of the teacher network is small at this time, which can provide useful guidance to the student network. Otherwise, when the prediction error of the teacher network is large, this part of the distillation loss is set to 0, that is, no distillation loss is added.
[0041] A traffic prediction method and device based on sub-hypergraph and self-distillation are proposed. Compared with the existing method, the global road network topology structure characteristics are obtained by constructing a main hypergraph, and the data characteristics are obtained by constructing a sub-hypergraph. Finally, the two parts of features are combined through the self-distillation method. Experimental results on multiple public datasets show that the proposed method is superior to the existing traffic prediction method. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a schematic diagram of the differentiated characteristics of the road network targeted by the present invention.
[0043] Figure 2 This is a structural diagram of the training model in the present invention.
[0044] Figure 3 It is a framework diagram of the overall model in the present invention. DETAILED DESCRIPTION
[0045] A traffic data prediction method based on sub-hypergraph and self-distillation, comprising the following steps:
[0046] Step 1: Download XiAn, METR-LA, PeMS04, PeMS08 datasets in the following format:
[0047] Each data set contains a road network matrix and a signal matrix. The road network matrix is used to represent the topological structure of the traffic network, represented by a graph G = (V, E), where V is the set of nodes representing intersections in the road network, and E is the set of edges between nodes. The road network matrix is an N × N square matrix, where N represents the number of nodes, and the edge weight is used to represent the distance between two nodes. In addition, at each time step t, the graph G has a signal matrix Where N represents the number of nodes and d represents the characteristic dimension of traffic data. Therefore, the traffic prediction problem can be defined as a time series prediction problem on a graph.
[0048] Step 2: The present invention first constructs the main hypergraph G based on historical data h=(V,E h ), E h is a collection of hyperedges. The main hypergraph is used to represent the global topological structure characteristics of the road network. In the main hypergraph, a hyperedge can connect multiple nodes. The connection relationship between nodes and hyperedges is represented by an association matrix It can be represented by N, where N represents the number of nodes and I represents the number of hyperedges.
[0049]
[0050] where v i is the i-th node in V, e j YesE h The jth hyperedge in . That is to say, if a group of nodes all belong to a hyperedge, then their connection relationship is established, otherwise they are not considered connected. In the construction of the main hypergraph, the present invention first obtains the road network matrix in the data set. From the previous definition, it can be seen that the road network matrix is a square matrix composed of N nodes in the data set, and each value in the matrix represents the distance between two nodes. In the main hypergraph, the nodes on a hyperedge are selected according to the correlation of the spatial topological structure of the road network, that is, a series of nodes on a hyperedge of the main hypergraph are spatially adjacent nodes, because it is generally believed that in a traffic road network, spatially adjacent nodes mostly have similar characteristics. Therefore, in order to find the K nodes closest to each node, the K nearest neighbor algorithm (K-NearestNeighbors, KNN) is used to calculate the Euclidean distance between each node and all other nodes, and find the K nodes closest to each node in space. This process can obtain a set of certain nodes closest to the node, and then use these nodes to construct the hyperedge E h , by constructing multiple hyperedges, we can finally get the main hypergraph G h =(V,E h ).
[0051] In addition, for a hypergraph, its degree is divided into the degree of the node and the degree of the hyperedge. For a node v, the degree d(v) is defined as the sum of all hyperedge weights w attached to the node v:
[0052]
[0053] Among them, e i YesE h The i-th hyperedge in w(e i ) represents the hyperedge e i The weight of h(v,e i ) represents the relationship between node v and hyperedge e in the association matrix i The value of the connection condition.
[0054] For a hyperedge e, the degree δ(e) is defined as the number of nodes connected to e:
[0055] δ(e)=∑ v∈V h(v,e i ),i∈I.
[0056] Step 3: After obtaining the main hypergraph used to represent the spatial topological structure of the road network, the present invention uses a feature-based method to construct a sub-hypergraph to represent the characteristics of the traffic data. As mentioned earlier, since traffic data is very complex, even nodes that are adjacent in space may show different traffic characteristics, while non-adjacent nodes may show similar traffic characteristics. In order to obtain these features, it is necessary to construct a sub-hypergraph based on the characteristics of the data. For the original data set, the present invention first uses the KMeans clustering algorithm to cluster the entire data set. At this time, the signal matrix in the input original image Then, according to different d values, nodes with different traffic characteristics are divided into different clusters, while nodes with similar traffic characteristics are divided into one cluster. Each cluster represents a sub-dataset. In order to build the association between nodes in the sub-dataset, it is necessary to build hyperedges for those nodes in each sub-dataset, which are called sub-hyperedges, and the hypergraph composed of sub-hyperedges is called a sub-hypergraph. The construction of a sub-hypergraph is different from that of the main hypergraph. The sub-hypergraph is a hyperedge constructed based on the association between the data features of the signal matrix of each node. When constructing a sub-hyperedge in a sub-hypergraph, the K nearest neighbor algorithm is also used, but the series of nodes that are most similar to each node in terms of data features are calculated, and then these nodes with more similar data features are used as a sub-hyperedge, thereby constructing multiple sub-hypergraphs.
[0057] Step 4: After obtaining the main hypergraph and multiple sub-hypergraphs, they need to be predicted using a suitable model. The model used in the present invention is shown in the attached figure. Figure 2As shown. The present invention stacks a total of 5 layers of spatiotemporal prediction modules, and uses residual connections to reduce the impact of network overfitting. For a layer of network, the input historical traffic data is first passed through a linear layer, and a linear transformation is performed on the input spatiotemporal data. Then the result is divided into two branches, which are first convolved in the time dimension, namely the temporal convolution network (TCN), which uses dilated causal convolution. The dilated convolution neural network can reduce the loss of information and does not reduce the number of nodes after each layer of operation; compared with the superimposed CNN network, the dilated convolution neural network can expand the field of view at an exponential growth rate. Then, a gating operation is performed on it, that is, TCN-a is processed through a tanh activation function, and TCN-b is processed through a sigmoid activation function. Finally, the results of the two are dot-producted to form a Gated-TCN. After extracting the temporal features, we need to extract the spatial features. Since the input is a hypergraph, and the traditional graph convolution method cannot be directly applied to the hypergraph, the hypergraph convolution network (HGCN) is used to extract the spatial features. The Laplacian matrix of the hypergraph is defined as:
[0058]
[0059] Where: D v is the degree matrix of the node, D e is the degree matrix of the hypergraph, W e is the weight matrix of the hypergraph, H is the association matrix, and H T is the transpose of the correlation matrix, and I is the identity matrix. Then, we use the 1stChebNet approximation to get:
[0060]
[0061] Where X is the input hypergraph signal, θ represents the weight parameter during the convolution operation, and Z h is the output of the hypergraph convolution.
[0062] Step 5: Propose a prediction framework based on the self-distillation method, which can combine the topological structure features of the main hypergraph with the data features of the sub-hypergraph to achieve more accurate prediction. First, in the teacher network, KMeans clustering is performed on the entire data set X to obtain M sub-datasets. Then, M sub-hypergraphs are constructed from hyperedges. Subsequently, the M sub-hypergraphs are input into the teacher model to learn the data features and obtain the prediction results. in, represents the prediction result of the first sub-hypergraph in the teacher network, is the prediction result of the Mth sub-hypergraph in the teacher network, and M is set to 2. The parameters of the teacher network are updated by comparing the prediction result with the true value Y. In general, the teacher network optimizes the subsequent loss function:
[0063]
[0064] Among them, X and Y are the input value and true value of the entire teacher network respectively. and Y i are the input value and true value of the i-th teacher model, and L is the L1 loss function.
[0065] After training the teacher network, the parameters in the teacher network will remain unchanged. Since it is self-distillation, the student network has the same training process as the teacher network. During the training process of the student network, the prediction result P is obtained. s , given the teacher network P t The output of the two networks can be created through the distillation loss. An intuitive way is to minimize P s and P t Distance between:
[0066] L SD = dist(P s ,P t ),
[0067] Where L SD is the self-distillation loss, dist(·,·) is a function that measures the distance between two points, and L2 loss is used. When calculating the self-distillation loss, the present invention matches the nodes in the student network with the nodes in the teacher network according to the index obtained during clustering, thereby obtaining the loss of each node. Thus, the overall loss of the student network can be obtained:
[0068] L s (X,Y)=L(P s ,Y)+λL SD ,
[0069] Where L is the loss of the student network, P s and Y are the input value and true value of the student network respectively. λ is a hyperparameter used to control the size of the distillation loss transferred from the teacher network to the student network. After experimental verification, it is best to set it to 0.6. SD is the distillation loss, which is calculated as follows, where P is the input value of the student network s and the L2 loss of the true value Y.
[0070]
[0071] In the prediction problem, since the output of the teacher network is unbounded, there may be large errors, which may give harmful guidance to the student network. To this end, the present invention limits the upper bound of the teacher output and uses the following loss function to eliminate the influence of the predicted values exceeding the upper bound. Then, the self-distillation loss is no longer the result of the above formula, but is given by the following equation:
[0072]
[0073] Among them, L SD-b is the bounded distillation loss, m is the hyperparameter that controls the boundary, which is used to set the size of the distillation boundary. After experimental verification, it is best to set it to 1, that is, when the prediction result P of the student network is s If the L2 loss with the true value Y plus this boundary value is greater than the prediction result P of the teacher network t The L2 loss with the true value Y proves that the prediction error of the teacher network is small at this time, which can provide useful guidance to the student network. Otherwise, when the prediction error of the teacher network is large, this part of the distillation loss is set to 0, that is, no distillation loss is added.
[0074] Finally, after the student network training is completed, the student network can be directly used to predict traffic data.
[0075] In the data of the experiment of the present invention, the mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) evaluation criteria are used to evaluate and analyze the prediction error:
[0076]
Claims
1. A traffic data prediction method based on sub-hypergraph and self-distillation, characterized in that Here are the steps: Step 1: Define the hypergraph: The topological structure of the traffic network is represented by a graph G = (V, E), where V is the set of nodes representing intersections in the network, and E is the set of edges between nodes. h =(V,E h ) abstracts the edge into a hyperedge, where h is used to represent the hypergraph, E h represents the set of hyperedges, which refers to the set of partial nodes; in addition, at each time step t, the hypergraph G h There is a signal matrix That is a real number set, N represents the number of nodes, d represents the characteristic dimension of traffic data, and t represents the observation time of data; therefore, the traffic prediction problem is defined as a time series prediction problem on a hypergraph; given a hypergraph G h and its historical signal of S time steps The goal is to learn a function f that can predict the signal of the next T time steps; the mapping relationship is expressed as: Hypergraph G h From the historical data from the past observation time t-S+1 to t, through the function f, the data of the next T moments are predicted; In the hypergraph G h =(V,E h ) connects multiple nodes; the connection relationship between nodes and hyperedges is represented by an association matrix It is represented by , where N represents the number of nodes and I represents the number of hyperedges; it is defined as: Among them, v i is the i-th node in V, e j YesE h The jth hyperedge in h ij is the value of the i-th row and j-th column of the association matrix H, representing the node v i With super edge e j If connected, the value is 1, otherwise it is 0; For a node v, its degree d(v) is defined as the sum of all hyperedge weights w attached to the node v: Among them, e i YesE h The i-th hyperedge in w(e i ) represents the hyperedge e i The weight of h(v,e i ) represents the relationship between node v and hyperedge e in the association matrix i The value of the connection condition; For a hyperedge e, its degree δ(e) is defined as the number of nodes connected to e: δ(e)=Σ v∩V h(v,e i ),i∈I. Step 2: Construction of the main hypergraph: The K nearest neighbor algorithm is used to calculate the distance between each node and all other nodes, and the K nearest neighbor nodes are selected to construct the hyperedge E. h ; By constructing multiple hyperedges, we get the main hypergraph G h =(V,E h ); Step 3: Construction of sub-hypergraph: A feature-based method is used to construct sub-hyperedges in the student network to represent the data features of the road network; first, the K-means clustering algorithm is used to divide the entire data set, and the traffic flow data with similar traffic attributes are divided to form subsets of traffic flow data with different attributes, that is, the traffic flow data with different flow attributes are divided into different clusters, and each cluster forms a sub-data set; for each sub-data set, the KNN method is also used to construct hyperedges to form the corresponding sub-hypergraph Where s refers to "sub", which means a sub-hypergraph. Represents a hyperedge in a sub-hypergraph; in the process of constructing the hyperedge of a sub-hypergraph, traffic flow data features are used, which is independent of the distance between the roads where the traffic flow is located; Step 4: Build a prediction model: In hypergraph theory, the Laplacian matrix is first used to learn the constructed hypergraph; the Laplacian matrix is defined as: Where: L h Denotes the Laplacian matrix of the hypergraph, D v Denotes the degree matrix of the node, D e represents the degree matrix of the hyperedge, W e represents the weight matrix of the hypergraph, H represents the association matrix of the hypergraph, and H T represents the transposed matrix of H, and I is the identity matrix; then the 1stChebNet defined as hypergraph convolution is used: Where X represents the signal matrix of the input hypergraph, θ represents the weight parameter during the convolution operation, and Z h represents the output of hypergraph convolution; After obtaining the calculation formula of hypergraph convolution, the graph wavelet neural network is selected as the prediction model; first, the historical data passes through a fully connected layer and the result is input into the network. The dimension of the fully connected layer is set according to the dimension of the input historical data; the network has a total of five layers. The input data will first pass through the gated time convolution module in the network to extract the features of the time dimension. The time convolution module is divided into two channels, which perform one-dimensional time convolution on the input respectively. One channel uses tanh as the activation function, and the other channel uses sigmiod as the activation function. Then the combined result is input into the hypergraph convolution HGCN module to extract the features of the spatial dimension; Residual residual connection is also used in the network; after extracting the spatiotemporal features, it passes through a fully connected layer and Relu activation function to obtain the final prediction result; Step 5: After obtaining local traffic data features through the main hypergraph and global road network topology features through the sub-hypergraph, the self-distillation method is used to combine the features of the two parts. The specific process is as follows: First, the teacher network is trained. In the teacher network, the entire data set X is first clustered by KMeans to obtain M sub-data sets. Then, M sub-hypergraphs are constructed by hyperedges. Subsequently, the M sub-hypergraphs are input into the teacher model to learn the data features and obtain the prediction results. in, represents the prediction result of the first sub-hypergraph in the teacher network, is the prediction result of the Mth sub-hypergraph in the teacher network, and M is set to 2; the parameters of the teacher network are updated by comparing the prediction result with the true value Y; in general, the teacher network optimizes the subsequent loss function: Among them, X and Y are the input value and true value of the entire teacher network respectively. and Y i are the input value and true value of the i-th teacher model, L t is the loss of the teacher network, using the L1 loss function; After the teacher network training is completed, the parameters of the teacher network are fixed, and the knowledge learned by the teacher network is used to guide the training of the student network, so as to transfer the data features to the student network training process. The loss function is: L(X,Y)=L(P s ,Y)+λL SD , Where L is the loss of the student network, P s and Y are the input value and true value of the student network, respectively. λ is a hyperparameter set to 0.
6. SD is the distillation loss, which is calculated as follows: Using bounded distillation loss, the formula is: Among them, L SD-b is the bounded distillation loss, m is the hyperparameter controlling the boundary, which is set to 1, that is, when the prediction result P of the student network s If the L2 loss with the true value Y plus this boundary value is greater than the prediction result P of the teacher network t The L2 loss with the true value Y proves that the prediction error of the teacher network is small at this time, which provides useful guidance to the student network. Otherwise, this part of the distillation loss is set to 0, that is, no distillation loss is added.
