Equivalent hypergraph construction method for traffic flow prediction

By training the model locally on the client and building an equivalent hypergraph, the problems of data privacy leakage and communication overhead in the existing traffic flow prediction methods are solved, and more efficient model training and more accurate traffic flow prediction are achieved.

CN119416819APending Publication Date: 2025-02-11CHANGZHOU UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411537352.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods have problems such as risk of data privacy leakage, large communication overhead, low model training efficiency, limited feature extraction capability and single optimization strategy.

Method used

The equivalent hypergraph construction method is adopted, by training the model locally on the client, only sharing model parameters and edge weight information, using attention mechanism for feature fusion, and optimizing the model structure through dynamic edge optimization strategies.

Benefits of technology

It significantly improves data privacy protection and security, reduces communication overhead, improves model training efficiency and prediction accuracy, and enhances model robustness and overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416819A_ABST
    Figure CN119416819A_ABST
Patent Text Reader

Abstract

The invention provides an equivalent hypergraph construction method for traffic flow prediction. The equivalent hypergraph construction method comprises the following steps: S1, data collection: collecting traffic flow data of each region through a sensor of an intelligent traffic system; s2, data processing: carrying out preprocessing and normalization processing on the collected traffic flow data, and constructing a graph structure of a traffic system and a training graph neural network model; s3, constructing a graph neural network: selecting a GCN as a framework of the graph neural network; s4, client node construction: performing feature fusion on the graph constructed for the local jurisdiction by each client through an attention mechanism; and S5, constructing an equivalent hypergraph: for n clients formed by traffic flow information of n regions, repeating the step S4 to obtain n client nodes, adding edges and weights according to a region adjacency principle to obtain an initial equivalent hypergraph, and continuously training and comparing based on the initial equivalent hypergraph to finally obtain the equivalent hypergraph. The risk of privacy disclosure is reduced, the efficiency of model training is improved, and the prediction precision of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method for constructing an equivalent hypergraph for traffic flow prediction. Background Art

[0002] Traffic flow prediction is crucial for the efficient operation of intelligent transportation systems. Accurately predicting traffic conditions on the road can help traffic managers formulate optimized control strategies, alleviate traffic congestion, improve traffic efficiency, and reduce carbon emissions.

[0003] Existing traffic flow prediction methods generally include a variety of methods based on statistics, machine learning, and deep learning:

[0004] 1. Statistical methods: Early traffic flow prediction usually uses statistical model-based methods, such as the autoregressive moving average model (ARMA) and the Kalman filter. These methods need to assume that the data meets certain statistical properties and perform well for linear data, but their performance is relatively limited when dealing with complex, nonlinear and dynamically changing traffic flow data.

[0005] 2. Machine learning-based methods: Machine learning methods are gradually being introduced into the field of traffic flow prediction, such as support vector machines (SVMs) and random forests. These methods can capture the complex patterns of data to a certain extent and significantly improve the prediction accuracy. However, these methods often require a large amount of historical data and have limitations in dealing with spatial correlation and temporal dependence.

[0006] 3. Methods based on deep learning: With the rise of deep learning, technologies such as convolutional neural networks (CNN) and recurrent neural networks (RNN) have been widely used in traffic flow prediction. In particular, graph neural networks (GNN) can effectively process graph structure data in traffic systems, pushing the accuracy of traffic flow prediction to a new level. However, in the application of deep learning models, centralized storage and training of data is an important issue. Centralized data training has the risk of privacy leakage and high communication overhead.

[0007] Current existing technical solutions include centralized graph neural networks and federated learning, among which graph neural networks (GNNs) are widely used in traffic flow prediction tasks, especially models based on graph convolutional networks (GCNs) and graph attention networks (GATs). These models capture the spatiotemporal dependencies between different traffic nodes through graph structures and generate embedded representations for each node. Federated Learning (FL) is a distributed learning technology that aims to address data privacy issues. By training the model locally on each client, only model parameters are shared instead of raw data, thereby ensuring data privacy. In traffic flow prediction, federated learning has been used to build models based on graph neural networks, such as the Federated Graph Convolutional Network (FedGCN), to address the privacy issues of centralized training.

[0008] In summary, the prior art has at least the following disadvantages:

[0009] (1) High data privacy risk: Existing centralized traffic flow prediction methods require data from different regions to be centralized on a central server for training and reasoning, which may lead to data privacy leakage, especially since the user travel information involved in traffic flow data is highly sensitive.

[0010] (2) High communication overhead and low efficiency: In a centralized system, traffic flow data in each region needs to be frequently transmitted to the central server, which brings a large amount of communication overhead, resulting in an increased burden on network transmission and reduced overall efficiency. Especially in intelligent transportation systems, data needs to be transmitted in real time. Excessive communication overhead will directly affect the real-time performance and response speed of the model.

[0011] (3) Inefficiency and poor consistency of model training: In the existing federated learning environment, there is a lack of sufficient information exchange between different clients, resulting in large differences in the model performance of each client, which in turn affects the performance of the global model. The heterogeneity of the federated learning model increases the difficulty of consistency of the global model on each client, making the overall prediction effect unsatisfactory.

[0012] (4) Limited feature extraction capabilities: Existing graph neural networks have difficulty effectively identifying the importance of key nodes and edges in traffic networks when capturing graph structural information, resulting in insufficient feature extraction. The model cannot fully utilize the topological structure information of the graph, affecting the prediction accuracy of complex traffic flow patterns.

[0013] (5) Single optimization strategy: In traditional federated learning or hypergraph methods, the structural optimization strategy of the model is relatively simple, usually using a static method to define the structure of the graph, and lacking a dynamic edge optimization mechanism. This makes the model perform poorly when dealing with dynamic changes in data or clients with strong heterogeneity, and cannot achieve the best prediction effect. Summary of the invention

[0014] In view of this, the present invention provides an equivalent hypergraph construction method for traffic flow prediction to at least solve the above-mentioned problem.

[0015] The present invention provides an equivalent hypergraph construction method for traffic flow prediction, comprising: S1, data collection: collecting traffic flow data of various regions through sensors of an intelligent transportation system, wherein the traffic flow data includes vehicle flow data of various roads, connection relationship data between roads, population density, climate characteristics and the number of vehicles in various regions; S2, data processing: preprocessing and normalizing the collected traffic flow data, and constructing a graph structure of the traffic system according to the connection relationship data between various sensors and roads, wherein nodes represent traffic sensors in various regions, edges represent road section information connecting two sensors, and the population density, climate characteristics and number of vehicles collected in various regions are used as node attributes to train a graph neural network model, and the traffic flow data set after preprocessing and normalization is divided into a training set, a validation set and a test set; S3, Constructing a graph neural network: Select GCN as the architecture of the graph neural network to extract node features to generate an embedded representation of each node; S4, client node construction: Perform feature fusion on the graph constructed by each client for the local jurisdiction through the attention mechanism, including: calculating the attention score of each node and other nodes, weighted summing the node features by the attention score, obtaining the fused node feature representation, and using the fused feature representation as the client node, where the client node is used to construct an equivalent hypergraph; S5, constructing an equivalent hypergraph: For n clients formed by traffic flow information in n regions, repeat step S4 to obtain n client nodes, add edges and weights according to the regional adjacency principle to obtain an initial equivalent hypergraph, train the initial equivalent hypergraph and compare it with each local client, and divide the local clients into G according to the set threshold δ. good and G poor , randomly connect the two groups of corresponding client nodes and retrain the model to update the weights and compare them with the performance of the model in the previous round of training. According to the set threshold δ′, retain the edges added by meeting the conditions. Then delete the edges in order from low to high according to the weights, retrain and update the weights and compare them with the performance of the model in the previous round of training. Keep the edges deleted by meeting the conditions, and finally obtain an equivalent hypergraph.

[0016] In one implementation, the data processing in step S2 uses the z-score normalization method to normalize the collected traffic flow data, and the formula is:

[0017]

[0018] Among them, x represents the original data, μ represents the mean of the data, and σ represents the standard deviation of the data.

[0019] In another implementation, the method for constructing the graph structure of the traffic system in step S2 includes: creating an adjacency matrix to represent the graph structure, wherein the rows and columns of the matrix represent traffic sensors in various regions; if a node v i and node v j There is an edge between them, then the adjacency matrix element A ij =1, otherwise A ij =0.

[0020] In another implementation, the specific steps of selecting GCN as the architecture of the graph neural network in step S3 include: S31, using the GCN architecture to define the model to obtain a GCN model, the GCN model consists of multiple GCN layers and a fully connected layer, wherein the GCN layer is used to process the features and structural information of the node, and the fully connected layer is used to generate traffic flow prediction results; S32, using the mean square error as the loss function to evaluate the model performance, and selecting the Adam optimizer for model training to minimize the loss function; S33, importing the training data into the GCN model, in each layer, for each node, by aggregating the features of neighboring nodes, update the representation of the node, in each layer of GCN, perform feature aggregation operations, and transform the updated node representation through a nonlinear activation function, the update rule of GCN is as follows:

[0021]

[0022] in, represents the feature of node i in layer l, W (l) is the learnable weight matrix of layer l, represents the set of neighbor nodes of node i, σ is a nonlinear activation function, c ij is the normalization coefficient.

[0023] In another implementation, the client node construction in step S4 specifically includes the following steps:

[0024] S41, for each local client, construct a local graph based on traffic sensor data within the local jurisdiction, wherein nodes represent traffic sensors and edges represent road section information connecting two sensors;

[0025] S42. Use the attention mechanism to perform feature fusion and calculate the attention score of each node and other nodes. The specific process is as follows:

[0026] e ij =LeakvReLU(a T [Wh i ||Wh j ])

[0027] Among them, e ij represents the attention score between node i and node j, a is the learnable parameter in the attention mechanism, w is the learnable weight matrix, and h i and h j Respectively represent the feature representation of node i and node j, || represents the concatenation operation of vectors;

[0028] S43. Use the softmax function to normalize the attention score and obtain the attention weight:

[0029]

[0030] Among them, α ij represents the attention weight of node i to node j, Represents the set of neighbor nodes of node i;

[0031] S44. Perform weighted summation on the node features to obtain the fused node feature representation:

[0032]

[0033] Among them, h′ i Represents the fused feature representation of node i. The fused node feature representation is used as the client node, where the client node is used to construct an equivalent hypergraph.

[0034] In another implementation, constructing the equivalent hypergraph in step S5 specifically includes the following steps:

[0035] S51, repeating step S4 for n clients formed by traffic flow information of n regions to obtain n client nodes;

[0036] S52. Based on the neighborhood adjacency principle, the obtained n client nodes are used to construct edges between the client nodes in two adjacent regions and add an initial weight of 0.5 to form an initial equivalent hypergraph. The mean absolute percentage error (MAPE) is used as the performance evaluation indicator:

[0037]

[0038] Among them, M is the time step of prediction, y t is the true value at time t, is the predicted value at time t;

[0039] S53, train the constructed initial equivalent hypergraph on GCN, record the performance differences of all clients relative to the local client model, and define the objective function To quantify the difference:

[0040]

[0041] Where n is the total number of clients, P(LG i ) is the performance of the local client i, For the performance of the initial equivalent hypergraph, we set an expected threshold δ, if The performance score P(LG i ) are sorted in descending order, and the arrangement is used to further distinguish between poorly performing and well performing clients, where the client nodes marked as poorly performing will be classified as G poor , the remaining client nodes will be classified as G good ;

[0042] S54、For clients with poor performance, G poor The client nodes in G are randomly connected to good A client node with good performance that is not yet connected in the network, after adding an edge, retrain the current new global model And evaluate the performance of the updated model pass and The performance difference is calculated as follows:

[0043]

[0044] According to the performance difference, adjust the weight of the edge and decide whether to keep the edge. If ΔP add >δ′, it indicates that the edge significantly improves the performance of the model. The weight of the edge is enhanced as follows and the edge is retained:

[0045] w(e)=w(e)+α·ΔP add Among them, α is the learning rate that controls the magnitude of weight adjustment;

[0046] If ΔP add <δ′, the surface edge does not achieve the expected performance improvement, and the edge is weakened as follows:

[0047] w(e)=w(e)-β·(|ΔP add |+γ)

[0048] Among them, β is a parameter that controls the attenuation amplitude, γ is a small constant that ensures that the weight does not decrease infinitely. If the weight w(e) of an edge is greater than the predefined threshold ∈, then the edge is retained, otherwise, the edge is removed;

[0049] S55. If the edge addition phase converges, the edge removal phase begins. In this phase, edges are iteratively removed starting from the minimum weight, and the model performance is re-evaluated and adjusted accordingly. For each edge removal, the performance change ΔP is calculated as described in S54.del , defined as:

[0050]

[0051] When ΔP del When >0 is a positive value, it means that the performance is improved after removing the edge, and the weights of the remaining edges are adjusted, similar to the process of adding edges. If ΔP del <0, indicating that the deletion leads to a decrease in performance, then the edge is retained and its weight is enhanced:

[0052] w(e)=w(e)+α·|ΔP del |

[0053] After each edge is removed, the global model is retrained and re-evaluated until the model converges or reaches the predetermined target performance, and the final equivalent hypergraph model is obtained. The final equivalent hypergraph model is distributed to each local client for traffic flow prediction.

[0054] In another implementation, 70% of the data in the preprocessed and normalized traffic flow dataset is used as a training set, 15% of the data is used as a validation set, and the remaining 15% of the data is used as a test set.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] (1) Data privacy protection and security are significantly improved: The present invention adopts a distributed model training method of federated learning. The data is always retained locally, and only model parameters and edge weight information are shared, which greatly reduces the risk of data privacy leakage. Compared with the traditional centralized traffic flow prediction method, it avoids the privacy issues that may arise from uploading sensitive data to the central server, and significantly improves the security of user data.

[0057] (2) Significantly reduce communication overhead and improve efficiency: By training the model locally on the client, the present invention reduces the need for centralized data transmission, reduces communication overhead, and improves the training efficiency of the model. Especially in intelligent transportation systems, communication resources are precious. Reducing communication overhead means reducing time and cost consumption, allowing the model to quickly respond to real-time traffic flow changes.

[0058] (3) Enhanced information interaction between clients and improved model consistency: The equivalent hypergraph model proposed in the present invention, by constructing a hypergraph connecting multiple clients, enables information between clients to be fully shared and interacted, greatly improving the training effect and consistency of the global model. Compared with the problem of relatively independent clients and insufficient information interaction in traditional federated learning methods, the present invention effectively overcomes the disadvantage of inconsistent performance of each client during model training through the equivalent hypergraph, and improves the prediction effect of the model.

[0059] (4) Enhanced feature extraction capability and improved model prediction accuracy: By using the attention mechanism to fuse the node features of the client, the present invention can capture the information of key nodes and edges in the graph structure, make full use of the topological structure characteristics of the graph, and improve the ability to learn complex traffic flow patterns. This feature extraction method enables the present invention to have higher prediction accuracy when processing complex traffic flow data than existing graph neural network prediction methods.

[0060] (5) Dynamic edge optimization strategy to improve model robustness and stability: This paper proposes a dynamic edge addition and deletion strategy. By iteratively optimizing the edges in the equivalent hypergraph, only the edges that contribute positively to the model performance are retained, thereby continuously optimizing the model structure. This dynamic adjustment strategy ensures that the model can adapt to changes in different client data, improves the robustness and overall performance of the model, and performs better than the static hypergraph defects in traditional methods when dealing with complex and heterogeneous data.

[0061] (6) Effectively reduce computing and storage overhead: This invention combines the local model with the global model by constructing an equivalent hypergraph and performs unified optimization. Compared with the centralized graph neural network method, this invention greatly reduces computing and storage overhead. This distributed joint optimization method reduces the burden on the server, making the entire system more efficient and cost-saving.

[0062] (7) Improved real-time performance and response speed of the overall system: Due to the reduction of communication overhead and the efficient training of local models, the present invention has significantly improved the real-time performance and response speed compared with the existing technology. In particular, in intelligent transportation systems, the present invention can capture and predict changes in traffic flow in real time, which helps to quickly adjust traffic management strategies, alleviate congestion, and improve travel efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 The present invention is a flowchart of the steps of a method for constructing an equivalent hypergraph for traffic flow prediction according to an embodiment of the present invention.

[0064] Figure 2 For Figure 1 The corresponding overall flow chart of the equivalent hypergraph construction method for traffic flow prediction.

[0065] Figure 3 An optimization graph is formed for an equivalent hypergraph of an equivalent hypergraph construction method for traffic flow prediction according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] See also Figure 1 , 2 3. The equivalent hypergraph construction method for traffic flow prediction according to an embodiment of the present invention comprises the following steps:

[0068] S1. Data collection: Traffic flow data of various regions are collected through sensors of the intelligent transportation system, where traffic flow data includes vehicle flow data of various roads, connection relationship data between roads, population density, climate characteristics and number of vehicles in various regions;

[0069] S2. Data processing: Preprocess and normalize the collected traffic flow data, and build a graph structure of the traffic system based on the connection relationship data between each sensor and the road. The nodes represent the traffic sensors in each region, and the edges represent the road section information connecting two sensors. The population density, climate characteristics and number of vehicles collected in each region are used as node attributes to train the graph neural network model, and the traffic flow data set after preprocessing and normalization is divided into training set, validation set and test set.

[0070] S3. Build a graph neural network: Select GCN as the architecture of the graph neural network to extract node features to generate an embedded representation of each node;

[0071] S4, client node construction: feature fusion is performed on the graph constructed by each client for the local area through the attention mechanism, including: calculating the attention score of each node and other nodes, weighted summing the node features by the attention score, obtaining the fused node feature representation, and using the fused feature representation as the client node, wherein the client node is used to construct the equivalent hypergraph;

[0072] S5, construct an equivalent hypergraph: for n clients formed by traffic flow information in n regions, repeat step S4 to obtain n client nodes, add edges and weights according to the regional adjacency principle to obtain an initial equivalent hypergraph, train the initial equivalent hypergraph and compare it with each local client, and divide the local clients into G according to the set threshold δ good and G poor, randomly connect the two groups of corresponding client nodes and retrain the model to update the weights and compare them with the performance of the model in the previous round of training. According to the set threshold δ′, retain the edges added by meeting the conditions. Then delete the edges in order from low to high according to the weights, retrain and update the weights and compare them with the performance of the model in the previous round of training. Keep the edges deleted by meeting the conditions, and finally obtain an equivalent hypergraph.

[0073] Optionally, the data processing in step S2 uses a z-score normalization method to normalize the collected traffic flow data, and the formula is:

[0074]

[0075] Among them, x represents the original data, μ represents the mean of the data, and σ represents the standard deviation of the data.

[0076] Optionally, the method for constructing the graph structure of the traffic system in step S2 includes: creating an adjacency matrix to represent the graph structure, wherein the rows and columns of the matrix represent traffic sensors in various regions; if the node v i and node v j There is an edge between them, then the adjacency matrix element A ij =1, otherwise A ij =0.

[0077] Optionally, the specific steps of selecting GCN as the architecture of the graph neural network in step S3 include:

[0078] S31. Define the model using the GCN architecture to obtain a GCN model. The GCN model consists of multiple GCN layers and a fully connected layer. The GCN layer is used to process the features and structural information of the nodes, and the fully connected layer is used to generate traffic flow prediction results.

[0079] S32. Use mean square error (MSE) as the loss function to evaluate model performance, and select Adam optimizer for model training to minimize the loss function.

[0080] S33, import the training data into the GCN model. In each layer, for each node, the representation of the node is updated by aggregating the features of neighboring nodes. In each layer of GCN, feature aggregation operation is performed, and the updated node representation is transformed by a nonlinear activation function. The update rules of GCN are as follows:

[0081]

[0082] in, represents the feature of node i in layer l, W (l) is the learnable weight matrix of layer l, represents the set of neighbor nodes of node i, σ is a nonlinear activation function, c ij is the normalization coefficient.

[0083] Optionally, the client node construction in step S4 specifically includes the following steps:

[0084] S41, for each local client, construct a local graph based on traffic sensor data within the local jurisdiction, wherein nodes represent traffic sensors and edges represent road section information connecting two sensors;

[0085] S42. Use the attention mechanism to perform feature fusion and calculate the attention score of each node and other nodes. The specific process is as follows:

[0086] e ij =LeakyReLU(a T [Wh i ||Wh j ])

[0087] Among them, e ij represents the attention score between node i and node j, a is the learnable parameter in the attention mechanism, w is the learnable weight matrix, and h i and h j Respectively represent the feature representation of node i and node j, || represents the concatenation operation of vectors;

[0088] S43. Use the softmax function to normalize the attention score and obtain the attention weight:

[0089]

[0090] Among them, α ij represents the attention weight of node i to node j, Represents the set of neighbor nodes of node i;

[0091] S44. Perform weighted summation on the node features to obtain the fused node feature representation:

[0092]

[0093] Among them, h′ i Represents the fused feature representation of node i. The fused node feature representation is used as the client node, where the client node is used to construct an equivalent hypergraph.

[0094] Optionally, constructing the equivalent hypergraph in step S5 specifically includes the following steps:

[0095] S51, repeating step S4 for n clients formed by traffic flow information of n regions to obtain n client nodes;

[0096] S52. Based on the neighborhood adjacency principle, the obtained n client nodes are used to construct edges between the client nodes in two adjacent regions and add an initial weight of 0.5 to form an initial equivalent hypergraph. The mean absolute percentage error (MAPE) is used as the performance evaluation indicator:

[0097]

[0098] Among them, M is the time step of prediction, y t is the true value at time t, is the predicted value at time t;

[0099] S53, train the constructed initial equivalent hypergraph on GCN, record the performance differences of all clients relative to the local client model, and define the objective function To quantify the difference:

[0100]

[0101] Where n is the total number of clients, P(LG i ) is the performance of the local client i, For the performance of the initial equivalent hypergraph, we set an expected threshold δ, if The performance score P(LG i ) are sorted in descending order, and the arrangement is used to further distinguish between poorly performing and well performing clients, where the client nodes marked as poorly performing will be classified as G poor , the remaining client nodes will be classified as G good ;

[0102] S54、For clients with poor performance, G poor The client nodes in G are randomly connected to good A client node with good performance that is not yet connected in the network, after adding an edge, retrain the current new global model And evaluate the performance of the updated model pass and The performance difference is calculated as follows:

[0103]

[0104] According to the performance difference, adjust the weight of the edge and decide whether to keep the edge. If ΔP add >δ′, it indicates that the edge significantly improves the performance of the model. The weight of the edge is enhanced as follows and the edge is retained:

[0105] w(e)=w(e)+α·ΔPadd

[0106] Among them, α is the learning rate that controls the magnitude of weight adjustment;

[0107] If ΔP add <δ′, the surface edge does not achieve the expected performance improvement, and the edge is weakened as follows:

[0108] w(e)=w(e)-β·(|ΔP add |+γ) where β is a parameter that controls the attenuation amplitude, and γ is a small constant that ensures that the weight does not decrease infinitely. If the weight w(e) of an edge is greater than a predefined threshold ∈, then the edge is retained, otherwise, the edge is removed;

[0109] S55. If the edge addition phase converges, the edge removal phase begins. In this phase, edges are iteratively removed starting from the minimum weight, and the model performance is re-evaluated and adjusted accordingly. For each edge removal, the performance change ΔP is calculated as described in S54. del , defined as:

[0110]

[0111] When ΔP del When >0 is a positive value, it means that the performance is improved after removing the edge, and the weights of the remaining edges are adjusted, similar to the process of adding edges. If ΔP del <0, indicating that the deletion leads to a decrease in performance, then the edge is retained and its weight is enhanced:

[0112] w(e)=w(e)+α·|ΔP del |

[0113] After each edge is removed, the global model is retrained and re-evaluated to ensure that the changes have a positive performance impact. This process is iterated until there is no significant performance improvement, that is, the model converges or reaches the predetermined target performance, and the final equivalent hypergraph model is obtained and distributed to each local client for traffic flow prediction.

[0114] Optionally, 70% of the data in the preprocessed and normalized traffic flow dataset is used as a training set, 15% of the data is used as a validation set, and the remaining 15% of the data is used as a test set.

[0115] First, the present invention proposes a solution for constructing an equivalent hypergraph. Based on the graph model trained locally on each client, the nodes of each client are connected by the regional adjacency principle, and initial edge weights are added to form an equivalent hypergraph, thereby realizing cross-client information sharing and fusion. This hypergraph construction method is the core of the present invention to improve the information interaction capability of federated learning;

[0116] Secondly, the present invention proposes a dynamic optimization strategy based on performance evaluation for the edges of equivalent hypergraphs, including the addition and deletion of edges. Through iterative training, the contribution of each edge to the global model is evaluated, useful edges are retained, and invalid edges are deleted, thereby continuously optimizing the hypergraph structure and improving the robustness and prediction performance of the model. This dynamic optimization strategy is the innovation of the present invention in solving model consistency and improving overall performance;

[0117] Next, the present invention also uses the attention mechanism to fuse the node features of each client, calculates the attention scores between nodes, and uses weighted summation to generate new node feature representations, thereby improving the ability to capture key information of the graph structure. This feature fusion method based on the attention mechanism is the key point of the present invention to improve model performance and information extraction effectiveness;

[0118] The present invention also proposes a distributed training method for a federated graph neural network, in which each client performs model training locally and uses an equivalent hypergraph to jointly optimize with the global model, thereby ensuring data privacy while improving the prediction accuracy of the overall model. The design of this distributed training method is an important innovation of the present invention in terms of data privacy protection and improving training efficiency; the present invention also introduces a performance evaluation indicator (mean absolute percentage error MAPE) to quantify the performance difference between the global model and the local model by defining an objective function. Dynamically adjusting edge weights according to performance changes, including a mechanism to increase weights when edges are added and decrease weights when edges are deleted, is an innovation of the present invention in the edge optimization strategy, which can ensure the positive contribution of each edge to the global model;

[0119] In addition, the present invention groups the client nodes according to the set threshold value and divides them into nodes with good performance (G good ) and poorly performing nodes (G poor ). For G poor Nodes in G are randomly connected to good The unconnected node in the model is retrained and the global model performance is optimized. This grouping optimization method effectively solves the problem of large performance differences between different clients in the model and is a key measure to improve the consistency of the overall model.

[0120] Compared with the prior art, the present invention has the following beneficial effects:

[0121] (1) Data privacy protection and security are significantly improved: The present invention adopts a distributed model training method of federated learning. The data is always retained locally, and only model parameters and edge weight information are shared, which greatly reduces the risk of data privacy leakage. Compared with the traditional centralized traffic flow prediction method, it avoids the privacy issues that may arise from uploading sensitive data to the central server, and significantly improves the security of user data.

[0122] (2) Significantly reduce communication overhead and improve efficiency: By training the model locally on the client, the present invention reduces the need for centralized data transmission, reduces communication overhead, and improves the training efficiency of the model. Especially in intelligent transportation systems, communication resources are precious. Reducing communication overhead means reducing time and cost consumption, allowing the model to quickly respond to real-time traffic flow changes.

[0123] (3) Enhanced information interaction between clients and improved model consistency: The equivalent hypergraph model proposed in the present invention, by constructing a hypergraph connecting multiple clients, enables information between clients to be fully shared and interacted, greatly improving the training effect and consistency of the global model. Compared with the problem of relatively independent clients and insufficient information interaction in traditional federated learning methods, the present invention effectively overcomes the disadvantage of inconsistent performance of each client during model training through the equivalent hypergraph, and improves the prediction effect of the model.

[0124] (4) Enhanced feature extraction capability and improved model prediction accuracy: By using the attention mechanism to fuse the node features of the client, the present invention can capture the information of key nodes and edges in the graph structure, make full use of the topological structure characteristics of the graph, and improve the ability to learn complex traffic flow patterns. This feature extraction method enables the present invention to have higher prediction accuracy when processing complex traffic flow data than existing graph neural network prediction methods.

[0125] (5) Dynamic edge optimization strategy to improve model robustness and stability: This paper proposes a dynamic edge addition and deletion strategy. By iteratively optimizing the edges in the equivalent hypergraph, only the edges that contribute positively to the model performance are retained, thereby continuously optimizing the model structure. This dynamic adjustment strategy ensures that the model can adapt to changes in different client data, improves the robustness and overall performance of the model, and performs better than the static hypergraph defects in traditional methods when dealing with complex and heterogeneous data.

[0126] (6) Effectively reduce computing and storage overhead: This invention combines the local model with the global model by constructing an equivalent hypergraph and performs unified optimization. Compared with the centralized graph neural network method, this invention greatly reduces computing and storage overhead. This distributed joint optimization method reduces the burden on the server, making the entire system more efficient and cost-saving.

[0127] (7) Improved real-time performance and response speed of the overall system: Due to the reduction of communication overhead and the efficient training of local models, the present invention has significantly improved the real-time performance and response speed compared with the existing technology. In particular, in intelligent transportation systems, the present invention can capture and predict changes in traffic flow in real time, which helps to quickly adjust traffic management strategies, alleviate congestion, and improve travel efficiency.

[0128] It should be noted that the present invention may be a method, a system, an apparatus and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0129] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0130] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0131] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, Python, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0132] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0133] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0134] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0135] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement by hardware, implement by software, and implement by a combination of software and hardware.

[0136] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A method for constructing an equivalent hypergraph for traffic flow prediction, characterized in that: include: S1. Data collection: Traffic flow data of various regions are collected through sensors of the intelligent transportation system, where traffic flow data includes vehicle flow data of various roads, connection relationship data between roads, population density, climate characteristics and number of vehicles in various regions; S2. Data processing: Preprocess and normalize the collected traffic flow data, and build a graph structure of the traffic system based on the connection relationship data between each sensor and the road. The nodes represent the traffic sensors in each region, and the edges represent the road section information connecting two sensors. The population density, climate characteristics and number of vehicles collected in each region are used as node attributes to train the graph neural network model, and the traffic flow data set after preprocessing and normalization is divided into training set, validation set and test set. S3. Build a graph neural network: Select GCN as the architecture of the graph neural network to extract node features to generate an embedded representation of each node; S4, client node construction: feature fusion is performed on the graph constructed by each client for the local area through the attention mechanism, including: calculating the attention score of each node and other nodes, weighted summing the node features by the attention score, obtaining the fused node feature representation, and using the fused feature representation as the client node, wherein the client node is used to construct the equivalent hypergraph; S5, construct an equivalent hypergraph: for n clients formed by traffic flow information in n regions, repeat step S4 to obtain n client nodes, add edges and weights according to the regional adjacency principle to obtain an initial equivalent hypergraph, train the initial equivalent hypergraph and compare it with each local client, and divide the local clients into G according to the set threshold δ good and G poor , randomly connect the two groups of corresponding client nodes and retrain the model to update the weights and compare them with the performance of the model in the previous round of training. According to the set threshold δ′, retain the edges added by meeting the conditions. Then delete the edges in order from low to high according to the weights, retrain and update the weights and compare them with the performance of the model in the previous round of training. Keep the edges deleted by meeting the conditions, and finally obtain an equivalent hypergraph.

2. The method according to claim 1, characterized in that The data processing in step S2 uses the z-score normalization method to standardize the collected traffic flow data. The formula is: Among them, x represents the original data, μ represents the mean of the data, and σ represents the standard deviation of the data.

3. The method according to claim 2, characterized in that The method for constructing the graph structure of the traffic system in step S2 includes: Create an adjacency matrix to represent the graph structure, where the rows and columns of the matrix represent traffic sensors in each region; If the node v i and node v j There is an edge between them, then the adjacency matrix element A ij =1, otherwise A ij =0.

4. The method according to claim 1, characterized in that The specific steps of selecting GCN as the architecture of the graph neural network in step S3 include: S31. Define the model using the GCN architecture to obtain a GCN model. The GCN model consists of multiple GCN layers and a fully connected layer. The GCN layer is used to process the features and structural information of the nodes, and the fully connected layer is used to generate traffic flow prediction results. S32. Use mean square error as the loss function to evaluate model performance and select Adam optimizer for model training to minimize the loss function. S33, import the training data into the GCN model. In each layer, for each node, the representation of the node is updated by aggregating the features of neighboring nodes. In each layer of GCN, feature aggregation operation is performed, and the updated node representation is transformed by a nonlinear activation function. The update rules of GCN are as follows: in, represents the feature of node i in layer l, W (l) is the learnable weight matrix of layer l, represents the set of neighbor nodes of node i, σ is a nonlinear activation function, c ij is the normalization coefficient.

5. The method according to claim 1, characterized in that The client node construction in step S4 specifically includes the following steps: S41, for each local client, construct a local graph based on traffic sensor data within the local jurisdiction, wherein nodes represent traffic sensors and edges represent road section information connecting two sensors; S42. Use the attention mechanism to perform feature fusion and calculate the attention score of each node and other nodes. The specific process is as follows: e ij =LeakyReLU(a T [Wh i |||Wh j ]) Among them, e ij represents the attention score between node i and node j, a is the learnable parameter in the attention mechanism, w is the learnable weight matrix, and h i and h j Respectively represent the feature representation of node i and node j, || represents the concatenation operation of vectors; S43. Use the softmax function to normalize the attention score and obtain the attention weight: Among them, α ij represents the attention weight of node i to node j, Represents the set of neighbor nodes of node i; S44. Perform weighted summation on the node features to obtain the fused node feature representation: Among them, h′ i Represents the fused feature representation of node i. The fused node feature representation is used as the client node, where the client node is used to construct an equivalent hypergraph.

6. The method according to claim 1, characterized in that The step S5 of constructing an equivalent hypergraph specifically includes the following steps: S51, repeating step S4 for n clients formed by traffic flow information of n regions to obtain n client nodes; S52. Based on the neighborhood adjacency principle, the obtained n client nodes are used to construct edges between the client nodes in two adjacent regions and add an initial weight of 0.5 to form an initial equivalent hypergraph. The mean absolute percentage error (MAPE) is used as the performance evaluation indicator: Among them, M is the time step of prediction, y t is the true value at time t, is the predicted value at time t; S53, train the constructed initial equivalent hypergraph on GCN, record the performance differences of all clients relative to the local client model, and define the objective function To quantify the difference: Where n is the total number of clients, P(LG i ) is the performance of the local client i, For the performance of the initial equivalent hypergraph, we set an expected threshold δ, if The performance score P(LG i ) are sorted in descending order, and the arrangement is used to further distinguish between poorly performing and well performing clients, where the client nodes marked as poorly performing will be classified as G poor , the remaining client nodes will be classified as G good ; S54、For clients with poor performance, G poor The client nodes in G are randomly connected to good A client node with good performance that is not yet connected in the network, after adding an edge, retrain the current new global model And evaluate the performance of the updated model pass and The performance difference is calculated as follows: According to the performance difference, adjust the weight of the edge and decide whether to keep the edge. If ΔP add >δ′, it indicates that the edge significantly improves the performance of the model. The weight of the edge is enhanced as follows and the edge is retained: w(e)w(e)+α·ΔP add Among them, α is the learning rate that controls the magnitude of weight adjustment; If ΔP add <δ′, the surface edge does not achieve the expected performance improvement, and the edge is weakened as follows: w(e)=w(e)-β·(|ΔP add |+c) Among them, β is a parameter that controls the attenuation amplitude, γ is a small constant that ensures that the weight does not decrease infinitely. If the weight w(e) of an edge is greater than the predefined threshold ∈, then the edge is retained, otherwise, the edge is removed; S55. If the edge addition phase converges, the edge removal phase begins. In this phase, edges are iteratively removed starting from the minimum weight, and the model performance is re-evaluated and adjusted accordingly. For each edge removal, the performance change ΔP is calculated as described in S54. del , defined as: When ΔP del When >0 is a positive value, it means that the performance is improved after removing the edge, and the weights of the remaining edges are adjusted, similar to the process of adding edges. If ΔP del <0, indicating that the deletion leads to a decrease in performance, then the edge is retained and its weight is enhanced: w(e)w(e)+α·|ΔP del | After each edge is removed, the global model is retrained and re-evaluated until the model converges or reaches the predetermined target performance, and the final equivalent hypergraph model is obtained. The final equivalent hypergraph model is distributed to each local client for traffic flow prediction.

7. The method according to claim 1, characterized in that 70% of the data in the preprocessed and normalized traffic flow dataset is used as a training set, 15% of the data is used as a validation set, and the remaining 15% of the data is used as a test set.

Citation Information

Cited By

  • Federal learning-based dynamic space-time diagram traffic flow prediction method and related device

    CN121904994A

  • Dynamic spatio-temporal graph traffic flow prediction method based on federated learning and related device

    CN121904994B