Federated Meta-Learning Method for Graph-Structured Data
By introducing federated meta-learning methods in federated graph machine learning, using codec mean aggregation technology, meta-learning models adapted to data of different graph topology structures are trained, which solves the convergence speed and accuracy problems caused by data heterogeneity, and achieves faster and higher-precision model training.
Patent Information
- Application Number
- CN202310465725.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Federated graph machine learning faces the challenge of data heterogeneity, resulting in a decrease in convergence speed and model accuracy. It is difficult for the existing technology to effectively utilize the common characteristics of data of different graph topology structures.
A federated meta-learning method for graph structure data is proposed. By using the codec mean aggregation method under the federated learning framework, a meta-learning model containing feature extraction network and codec mean is trained. The client downloads the meta-learning model for local training to achieve fast convergence and high-precision prediction.
It effectively improves the convergence speed and model accuracy of training, and can use graph structure data scattered across each client without transmitting data to improve the prediction accuracy of each client model.
Smart Images

Figure CN116484945B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a federated meta - learning method for graph - structured data. Background Art
[0002] Graph - structured data is data samples with graph - topological connections between data nodes, which is a common data type. For example, network traffic, traffic flow, etc. can be represented as graph - structured data. Using graph - structured data to train a machine - learning model can extract the spatial correlation between nodes, thereby improving the accuracy. A neural network trained using graph - structured data is called a graph neural network. Training a graph neural network requires a large amount of data. With the development of intelligent devices, this data is often scattered and stored on various edge intelligent devices. Due to communication bandwidth and privacy restrictions, it is difficult to collect this data to train the neural network.
[0003] For this reason, as a training method that can complete the training of a machine - learning model without transmitting data, federated learning is introduced into the training of graph neural networks, which is called Federated Graph Machine Learning (FGML). However, federated graph machine learning may face more severe data heterogeneity challenges. The data of different clients participating in federated graph machine learning may have different topological structures. For example, in traffic flow prediction, an agency in charge of an area deploys road sensors on the roads in this area, collects traffic flow information, and uses this data to participate in federated learning. While other clients participating in federated learning collect traffic flow data from other areas. Different road conditions in different areas will make the data graph structures held by each client heterogeneous, which will have a negative impact on the convergence speed and the accuracy of the final model of federated learning. Although some research focuses on the heterogeneity of the spatial topological structure in graph federated learning, these works often regard the spatial topological structure as the private feature of the client, and the client cannot benefit from the spatial correlation learned from different graph topological structures.
[0004] Therefore, there is a need for a federated learning method that can learn a meta - learning model adapted to different graph - structured data during the training of different graph - structured data on different clients. Summary of the Invention
[0005] The object of the present invention is to provide a federated meta - learning method for graph - structured data, which learns the commonality of different graph - structured data based on federated meta - learning. First, under the framework of federated learning, a meta - learning model including a feature extraction network and the mean of an encoder - decoder is trained through an encoder - decoder mean aggregation method. Secondly, the client downloads the meta - learning model to initialize the local model, and uses the local data to train the local data until convergence, quickly obtaining a more accurate prediction model. Thereby effectively improving the convergence speed of training and the model accuracy.
[0006] To achieve the above object, the technical solution of the present invention is: a federated meta-learning method for graph-structured data, including the following steps:
[0007] Step S1: Each client constructs local graph-structured data, confirms to participate in subsequent federated meta-training, and proceeds to step S2;
[0008] Step S2: The server designs the feature extraction network part of the meta-learning model and randomly initializes it, randomly initializes the mean of the encoder-decoder, designs the hyperparameters for training, and the server sends the feature extraction network, mean, and hyperparameters to the client, and proceeds to step S3;
[0009] Step S3: The client constructs a local encoder-decoder, initializes it with the downloaded encoder-decoder mean, adds it to the downloaded meta-learning model feature extraction network to construct a local model, and proceeds to step S4;
[0010] Step S4: The client trains the local model according to the hyperparameters in step S2 using local data, and proceeds to step S5;
[0011] Step S5: The client averages the weights and biases of the encoder and decoder respectively, uploads the mean and the local model feature extraction network part, and proceeds to step S6;
[0012] Step S6: The server averages and aggregates the uploaded mean and other model parameters, sends them to each client. If the model has not converged, proceed to step S3. If the model has converged, proceed to step S7;
[0013] Step S7: The client constructs a local encoder-decoder, initializes it with the downloaded encoder-decoder mean, adds it to the downloaded meta-learning model feature extraction network to construct a local model, and then trains the local model using local data, and stops training after convergence.
[0014] In an embodiment of the present invention, in the step S1, the local graph-structured data constructed by the client has a spatio-temporal structure. The topological structure of the data graph held by one client is the same, but the node values change over time.
[0015] In an embodiment of the present invention, the graph-structured data is historical traffic flow data collected by sensors deployed by the client in its responsible area.
[0016] In an embodiment of the present invention, in the step S2, the meta-learning model feature extraction network needs to be able to extract the spatio-temporal correlation of the data, be able to learn the common features of data with different graph topologies, and the input and output data dimensions are the same.
[0017] In an embodiment of the present invention, the meta-learning model feature extraction network adopts a Transformer network.
[0018] In an embodiment of the present invention, in the step S2, the hyperparameters include the number of local training rounds E, which represents the total number of rounds for the client to train the model using local data, the batch size B for training, which represents the batch size for dividing the local dataset during local training by the client, the learning rate η for local training, which represents the update learning rate used during local training, and the loss function used for training.
[0019] In an embodiment of the present invention, in the step S3, the local model is constructed as follows:
[0020] Step S31: Construct an encoder-decoder according to the number of nodes in the local graph structure data. The encoder maps the data to the size of the input of the feature extraction network, and the decoder decodes the output of the feature extraction network into the size of the input data.
[0021] Step S32: Initialize the weights and biases of the encoder and decoder respectively with the downloaded means.
[0022] Step S33: Input the output of the encoder into the feature extraction network, and input the output of the feature extraction network into the decoder to form the local model.
[0023] In an embodiment of the present invention, the encoder and decoder are each composed of a single fully connected layer.
[0024] In an embodiment of the present invention, in the step S4, the local training process is to divide the local data into multiple batches according to the batch size B in the hyperparameters. For each batch of data, input the data into the local model, output the predicted value, calculate the loss between the predicted value and the true value according to the loss function, then use backpropagation to calculate the parameter gradient, and update the parameters using the learning rate. This loop continues until the local training round E is reached.
[0025] In an embodiment of the present invention, in the step S5, the mean calculation formula of the encoder-decoder parameters is as follows:
[0026]
[0027] Where are the model encoder parameters and decoder parameters after the (t + 1)-th round of local training of client k, represents the mean of the encoder-decoder after local training, both are vectors of size 2, respectively including the weight mean and the bias mean, M k,E is the number of nodes of the encoder of client k, M k,D is the number of nodes of the decoder of client k.
[0028] In an embodiment of the present invention, in the step S6, the average aggregation method is as follows:
[0029] For the uploaded codec mean value:
[0030]
[0031] where K is the number of clients participating in training; is the mean value of the aggregated model;
[0032] For the uploaded feature extraction network parameters Average each parameter:
[0033]
[0034] where is the model parameter of the feature extractor uploaded by client k in the (t + 1)-th round, is the aggregated model parameter.
[0035] Compared with the prior art, the present invention has the following beneficial effects: A federated meta-learning method for graph-structured data proposed by the present invention can learn a meta-learning model that can adapt to different graph-topology data from different graph-topology data of each client based on federated learning without transmitting data, so as to improve the prediction accuracy of each client model by using the graph-structured data scattered in each client without transmitting data. Applying the present invention to traffic flow prediction can improve the prediction accuracy by using the traffic flow data of other clients without the need to transmit historical traffic flow data. Description of the Drawings
[0036] Figure 1 is the overall model framework in the embodiment of the present invention.
[0037] Figure 2 is the overall model structure in the embodiment of the present invention.
[0038] Figure 3 is the meta-training process in the embodiment of the present invention.
[0039] Figure 4 is the comparison of the average training loss (MSE) of each algorithm model on each client with the change of training rounds during the federated meta-training on the clients in Table 1 by using the method proposed by the present invention in the embodiment of the present invention.
[0040] Figure 5 is the comparison of the average training loss (MSE) of each algorithm model on each client with the change of training rounds during the meta-test by using the method proposed by the present invention in the embodiment of the present invention.
[0041] Figure 6This is a comparison of the test MAE of each algorithm model with the change of the training round during the meta-test on the clients of Table 1 and Table 2 using the method proposed in the embodiments of the present invention. Detailed implementation manner
[0042] The technical solution of the present invention will be specifically described below with reference to the accompanying drawings.
[0043] To address the problem of graph topology heterogeneity in graph federated machine learning and achieve accurate and personalized federated learning, the present invention proposes graph federated meta-learning based on federated meta-learning, which can quickly learn data with different topological structures. As Figure 1 , the training process of the present invention is divided into two stages: meta-learning and meta-test. In the meta-learning stage, within the framework of federated learning, the model is made to adapt to graph structure data with different numbers of nodes through an encoder-decoder, and the training method of encoder-decoder mean transmission is used to accelerate the training convergence speed. In the meta-test stage, the client uses the meta-learning model to quickly learn local data and obtain a more accurate model.
[0044] The graph federated machine learning system consists of a server and K clients. The graph structure data is retained on different clients. The graph topology data held by different clients has different graph topologies. The node values of these data change over time, that is, they have spatio-temporal structures, such as social networks, transportation networks, logistics networks, financial networks, etc. The clients have certain computing capabilities to support the training and operation of machine learning models and also have communication capabilities to download and upload training models. The clients have the need to train prediction models using these data to predict future values based on node historical values. However, due to high communication costs or privacy information, they are reluctant to move the data for centralized training, and the amount of data held by each client is small, so it is impossible to train a model with high accuracy and good generalization performance. The central server acts as a coordinator for federated learning and does not hold training data. The present invention proposes to train a meta-learning model based on federated meta-learning that can quickly learn data with different graph topologies on different clients. The meta-learning model includes the optimal mean of the encoder-decoder and the recently initialized parameters of the feature extraction network.
[0045] Due to the graph topology heterogeneity of client data, the objective of the present invention is to train a meta-learning model that can adapt to data with different graph topologies.
[0046] A federated meta-learning method for graph structure data according to the present invention is specifically implemented according to the following steps.
[0047] Step S1: Each client constructs local graph structure data, confirms participation in training, and proceeds to step S2;
[0048] In this embodiment, each client constructs the traffic flow historical data collected by sensors installed on roads in different regions into graph topology structure data as local data. The number of nodes of data held by each client is shown in Table 1.
[0049] Table 1
[0050]
[0051] Step S2: The server designs the feature extraction network part of the meta-learning model and initializes it. Randomly initialize the mean of the encoder-decoder, design the hyperparameters for training, and the server sends the feature extraction network, mean, and hyperparameters to the client to proceed to Step S3;
[0052] In this example, in the hyperparameters, the local training rounds E = 10, the batch size B = 256, the learning rate is 0.001, the loss function used is the mean squared error (MSE), the feature extraction network uses the graph Transformer model, and the encoder-decoder is respectively composed of a single fully connected layer. The structure is as Figure 2 .
[0053]
[0054] Among them, is the predicted value, n is the number of samples, and y is the true value.
[0055] Step S3: The client downloads the model and hyperparameters, constructs a local encoder-decoder, initializes it with the downloaded mean of the encoder-decoder, and adds it to the downloaded model feature extraction network to construct a local model, specifically as follows:
[0056] Step S31: Construct an encoder-decoder according to the number of nodes of the local graph data. The encoder maps the data to the size of the input of the feature extraction network, and the decoder decodes the output of the feature extraction network into the size of the input data. The encoder and decoder are respectively composed of a single fully connected layer;
[0057] Step S32: Initialize the weights and biases of the encoder-decoder with the downloaded mean respectively;
[0058] Step S33: Input the output of the encoder into the feature extraction network, and input the output of the feature extraction network into the decoder to form a local model, and proceed to Step S4;
[0059] Step S4: The client uses the local data to train the local model according to the hyperparameters in Step S1, specifically as follows:
[0060] Divide the local data into multiple batches according to the batch size B in the hyperparameters. For each batch of data, input the data into the local model, output the predicted values, calculate the loss between the predicted values and the true values according to the loss function, then use backpropagation to calculate the parameter gradients, and update the parameters using the learning rate. Repeat this process until the local training round E is reached; proceed to step S5;
[0061] Step S5: The client calculates the average of the encoder and decoder weights and biases respectively, as
[0062]
[0063] where are the encoder parameters and decoder parameters of the model after the (t + 1)-th round of local training for client k, represents the mean of the encoder and decoder after local training, both are vectors of size 2, including the weight mean and bias mean respectively, M k,E is the number of nodes in the encoder of client k, M k,D is the number of nodes in the decoder of client k.
[0064] Upload the mean and the feature extraction network part of the local model, and proceed to step S6;
[0065] Step S6: The server averages and aggregates the uploaded means and other model parameters, as
[0066] For the uploaded encoder and decoder means:
[0067]
[0068] where K is the number of clients participating in the training; is the aggregated model mean.
[0069] For the uploaded feature extraction network parameters, average each parameter:
[0070]
[0071] where are the feature extractor model parameters uploaded by client k in the (t + 1)-th round, is the aggregated model parameter.
[0072] Send the feature extraction network parameters and the encoder and decoder means to the client. If the model has not converged, proceed to step S3. If the model has converged, proceed to step S7;
[0073] Step S7: The client downloads the model and hyperparameters of Table 1 and Table 2, constructs a local codec, initializes it with the mean of the downloaded codec, adds it to the downloaded model feature extraction network to construct a local model, and then trains the local model using local data. Stop training after convergence.
[0074] Table 2
[0075]
[0076] Step S8: The client deploys the trained local model on the server in its own area. The model predicts the vehicle flow in the next hour based on the vehicle flow data collected by the currently uploaded sensors, achieving a more accurate prediction effect.
[0077] The quantization metrics for prediction accuracy are MAE (Mean Absolute Error) and RMSE (Root Mean Square Error);
[0078]
[0079]
[0080] The method of the present invention realizes the learning of different graph topology data of different clients through federated learning on the premise that the data does not leave the local area, improving the convergence speed and prediction accuracy of the client to train the local model. By introducing meta-learning into graph federated learning to solve the heterogeneity of graph topology structures, and overcoming the heterogeneity of the number of data nodes of each client through the codec, and accelerating the convergence speed of the meta-training process through the codec mean aggregation method, each client can achieve a faster convergence speed and higher prediction accuracy using the meta-learning model obtained from meta-training.
[0081] To enable those skilled in the art to further understand a federated meta-learning method for graph-structured data proposed by the present invention, the following will be described in detail with specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and gives the detailed implementation manner and specific operation process.
[0082] As Figure 1 shown, the implementation method of the entire framework is shown.
[0083] This embodiment includes the following specific steps:
[0084] Step 1: Each client completes the federated meta-training process using local graph-structured data under the coordination of the server to obtain a meta-learning model.
[0085] Step 2: The server shares the meta-learning model. After the client downloads it, it uses the meta-learning model to initialize the local model, and then uses the local graph topology structure data to train the local model to obtain a prediction model that can be used for prediction.
[0086] As Figure 2 shown, this is the model structure using the graph Transformer model as the feature extraction network in this example.
[0087] As Figure 3 shown, this is the federated meta-training process in the present invention.
[0088] Figure 4 This is a comparison of the average training losses (MSE) of each algorithm model on each client during federated meta-training using the method proposed in the present invention in Table 1 of the embodiments of the present invention.
[0089] This embodiment includes the following specific steps:
[0090] Step 1: As shown in the experimental results, FedGM-RI is an ablation algorithm of FedGM that does not use encoder-decoder mean aggregation. It can be seen that the loss of FedGM during training has always been lower than that of FedGM-RI. For example, at the 10th round, the loss of FedGM is only 53.23% of that of FedGM-RI. At the 30th round, the loss of FedGM-RI has tended to be stable and there is no downward trend, while FedGM can still decrease to a lower loss, indicating that FedGM-RI is vulnerable to the negative impact of data heterogeneity and it is difficult for the aggregated model to update towards the global optimal point. With the encoder-decoder mean aggregation strategy, FedGM achieves a faster convergence speed and lower convergence loss. The experiment fully demonstrates the effectiveness of encoder-decoder mean aggregation. The loss of FedRecon statistics is the result after the encoder-decoder of the model is pre-trained, so it can maintain a lower loss at the beginning of training. However, there is no downward trend in the loss, indicating that it cannot learn the common knowledge between different topology structure data across communication rounds. It should be noted that FedGM-PL achieves the fastest convergence speed and the lowest convergence loss because under this method, the parameters learned by the encoder-decoder can be completely retained across communication rounds.
[0091] Figure 5 This is a comparison of the average training losses (MSE) of each algorithm model on each client during meta-testing using the method proposed in the present invention in the embodiments of the present invention.
[0092] This embodiment includes the following specific steps:
[0093] Step 1. Since the local model (LM) is a randomly initialized model, the initial loss is relatively high. FedGM, FedGM-PL, and FedGM-RI have been trained by federated meta-learning, and their initial loss and convergence speed are better than those of the randomly initialized model. The final converged loss is lower than that of the randomly initialized model, indicating that in the training of federated meta-learning on data with different topological structures, common features and knowledge that adapt to different graph topological data can be learned, and training can be started at a better initial position to obtain a more generalized model. FedGM achieved the best results in both convergence speed and final convergence loss. Although FedRecon can achieve lower losses at the beginning by relying on pre-training of the codec, it cannot achieve good convergence speed in subsequent training rounds.
[0094] Figure 6 It is the MAE comparison of each algorithm model test when the meta-test is performed on the client in Table 1 and Table 2 using the method proposed in the present invention in the embodiment of the present invention.
[0095] This embodiment includes the following specific steps:
[0096] Step 1. This experiment tests the change of prediction accuracy of the meta-test process model as the number of training rounds increases. FedGM can achieve the highest accuracy in the second round of training, indicating that after the meta-training process, the meta-learning model can quickly adapt to data with different topological structures. After training to the final accuracy, FedGM can still maintain the highest accuracy. Other algorithms are lower than the present invention in terms of convergence speed and final accuracy. This experiment can verify the effectiveness and advancement of FedGM.
[0097] Table 3
[0098]
[0099] As shown in Table 3, after the training of federated meta-learning, the accuracies of FedGM, FedGM-RI, and FedGM-PL are all higher than those of the local model (LM) trained only with local data. As an ablation algorithm of FedGM, FedGM-RI cannot retain the knowledge obtained from the training of the encoder-decoder during the federated meta-training process, and the final accuracy of the meta-test is lower than that of FedGM. By retaining the private layer, FedGM-PL can achieve better accuracy on the clients participating in federated learning. However, if the purpose is to train the best initial parameters that can adapt to data with unknown graph topologies and the trained private layer is discarded, the performance of FedGM-PL on each client is inferior to that of FedGM. The final accuracy of FedRecon is lower than that of the locally randomly initialized model, indicating that although pre-trained, the encoder-decoder cannot obtain a model that matches GTAN, making the model more likely to fall into local optima. The results show that FedRecon is not suitable for learning the common knowledge of different graph topologies. Except for client 6, FedGM achieves the best prediction effect on each client. Compared with FedRecon, FedGM-RI, FedGM-PL, and LM, the average MAE is respectively 19.73, 2.95, 3.56, and 5.29 lower, and the average RMSE is respectively 25.04, 4.25, 5.27, and 7.43 lower. The experiment fully shows that the meta-learning model trained by FedGM can achieve higher accuracy after being trained with local data.
[0100] The above analysis shows that the proposed federated meta-learning method for graph-structured data can accelerate the convergence speed through encoder-decoder mean aggregation during the meta-training stage when applied to traffic flow prediction. During the meta-test stage, whether on the clients participating in federated learning or on the clients with unknown graph topology data that do not participate in federated learning, the meta-learning model can quickly adapt and achieve higher prediction accuracy, which has certain reference value and practical economic benefits.
[0101] The above are the preferred embodiments of the present invention. All changes made according to the technical solutions of the present invention that do not exceed the scope of the technical solutions of the present invention in terms of the functions and effects produced belong to the protection scope of the present invention.
Claims
1. A federated meta - learning method for graph - structured data, characterized in that, it includes the following steps: Step S1: Each client constructs local graph - structured data, confirms to participate in subsequent federated meta - training, and proceeds to Step S2; Step S2: The server designs the feature extraction network part of the meta - learning model and randomly initializes it, randomly initializes the mean of the encoder - decoder, designs the hyperparameters for training. The server sends the feature extraction network, the mean, and the hyperparameters to the clients, and proceeds to Step S3; Step S3: The client constructs a local encoder - decoder, initializes it with the downloaded mean of the encoder - decoder, adds it to the downloaded feature extraction network of the meta - learning model to construct a local model, and proceeds to Step S4; Step S4: The client uses the local data to train the local model according to the hyperparameters in Step S2, and proceeds to Step S5; Step S5: The client calculates the average of the weights and biases of the encoder and decoder respectively, uploads the mean and the local model's feature extraction network part, and proceeds to Step S6; Step S6: The server averages and aggregates the uploaded means and other model parameters, and sends them to each client. If the model has not converged, proceed to Step S3; if the model has converged, proceed to Step S7; Step S7: The client constructs a local encoder - decoder, initializes it with the downloaded mean of the encoder - decoder, adds it to the downloaded feature extraction network of the meta - learning model to construct a local model, and then uses the local data to train the local model. Stop training after convergence.
2. The federated meta - learning method for graph - structured data according to claim 1, characterized in that, in the Step S1, the local graph - structured data constructed by the client has a spatio - temporal structure. The topological structure of the data graph held by one client is the same, but the node values change over time.
3. The federated meta - learning method for graph - structured data according to claim 1, characterized in that, in the Step S2, the feature extraction network of the meta - learning model needs to be able to extract the spatio - temporal correlation of the data, be able to learn the common features of data with different graph topologies, and the input and output data dimensions are of the same size.
4. The federated meta - learning method for graph - structured data according to claim 1, characterized in that, the feature extraction network of the meta - learning model adopts a Transformer network.
5. The federated meta - learning method for graph - structured data according to claim 1, characterized in that, in the Step S2, the hyperparameters include the local training rounds E, which represents the total number of rounds for the client to train the model using local data, the training batch size B, which represents the batch size for dividing the local dataset during the client's local training, the local training learning rate η, which represents the update learning rate used during local training, and the loss function used for training.
6. The federated meta - learning method for graph - structured data according to claim 1, characterized in that, in the Step S3, the local model is constructed in the following way: Step S31: Construct an encoder - decoder according to the number of nodes of the local graph - structured data. The encoder maps the data to the size of the input of the feature extraction network, and the decoder decodes the output of the feature extraction network into the size of the input data; Step S32: Initialize the weights and biases of the encoder and the weights and biases of the decoder with the downloaded means respectively; Step S33: Input the output of the encoder into the feature extraction network, and input the output of the feature extraction network into the decoder to form a local model.
7. The federated meta - learning method for graph - structured data according to claim 5, wherein, the encoder and the decoder are respectively composed of a single fully - connected layer.
8. The federated meta - learning method for graph - structured data according to claim 1 or 4, wherein, In step S4, the local training process is to divide the local data into multiple batches of data according to the batch size B in the hyperparameters. For each batch of data, input the data into the local model, output the predicted value, calculate the loss between the predicted value and the true value according to the loss function, then use backpropagation to calculate the parameter gradient, and update the parameters using the learning rate, and loop like this until the local training round number E is reached.
9. The federated meta - learning method for graph - structured data according to claim 1, wherein, In step S5, the formula for calculating the mean of the encoder - decoder parameters is as follows: Among them are the model encoder parameters and decoder parameters after the (t + 1)-th round of local training of client k, denote the mean values of the encoder and decoder after local training, both are vectors of size 2, including the weight mean and bias mean respectively, M k,E is the number of nodes of the encoder of client k, M k,D is the number of nodes of the decoder of client k.
10. The federated meta - learning method for graph - structured data according to claim 8, wherein, In step S6, the calculation formula of the average aggregation method is as follows: For the uploaded encoder - decoder means: where K is the number of clients participating in the training; is the mean of the aggregated models; For the uploaded feature extraction network parameters Average each parameter: Among them are the feature extractor model parameters uploaded by client k in the (t + 1)-th round, is the aggregated model parameter.