A Federated Learning Optimization Method for Graph Data
By introducing personalized model parameters and representation vectors into federated learning, generating personalized supplementary models and performing local training, the problem of poor training effect of graph data federated learning models in the existing technology is solved, and higher accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202210499734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-05-09
AI Technical Summary
When processing graph data, existing federated learning algorithms do not match the basic assumptions of the data, resulting in poor training effect, low training accuracy, slow convergence speed, and even non-convergence of the model, making it difficult to produce meaningful results.
A federated learning method based on graph data is proposed. By transmitting personalized model parameters and representation vectors between servers and clients, a personalized supplementary model is generated, and locally trained to update the global graph neural network model parameters.
It improves the training accuracy and efficiency of the federated learning model on graph data, reduces communication bandwidth, enhances the personalized representation ability of the model, and ensures that the model can converge effectively.
Smart Images

Figure CN114925849B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a federated learning method based on graph data. Technical Background
[0002] Federated learning is a distributed machine learning algorithm, and it considers privacy protection issues on the basis of general distributed machine learning. In the application of machine learning algorithms, graph-structured data occupies a very important position. For example, in the field of natural language processing, the relationship between concepts can be represented as a graph structure, that is, a knowledge graph. In the field of short video recommendation, the sharing and comments between users can be represented as a graph, and the browsing and liking of users and videos can also be represented as a graph. The data types considered by existing federated learning algorithms are mainly images, natural language texts, and structured table data, all of which are limited to Euclidean space. However, graph data does not have a regular Euclidean space structure. Directly applying the federated learning algorithm designed for image and natural language text data to graph data may result in poor model training effect, low training accuracy, slow convergence speed, and even non-convergence of the model, due to the mismatch of the basic assumptions of the data, making it difficult to produce meaningful results. Summary of the invention
[0003] The purpose of the present invention is to provide a federated learning method based on graph data to improve the training accuracy and efficiency of the federated learning model.
[0004] The specific technical solution for achieving the purpose of the present invention is:
[0005] A method for optimizing federated learning on graph data, wherein the implementation environment of the method includes a server, K clients, a processor, and a memory storing calculations and programs, wherein K is an integer at least equal to 2; a configuration file for describing a global graph neural network model structure and a personalized model structure is stored on the server; the method is characterized in that the method includes the following specific steps:
[0006] Step S1, the server randomly initializes the global graph neural network model parameters and the personalized model parameters according to the pre-configuration file, and initializes the number of training rounds T to 1;
[0007] Step S2: In the Tth round of training, select M participating clients, send training instructions to each participating client, and the kth participating client obtains the corresponding global graph neural network model parameters and personalized model parameters from the server. If the client is selected for the first time, the personalized model representation vector is randomly initialized, k = 1, 2, ... M;
[0008] Step S3: Each client generates a local personalized supplement model based on the acquired server personalized model parameters and the locally stored personalized model representation vector, and then performs local training based on the corresponding model parameters, personalized supplement model and local data, and sends the corresponding model parameters to the server;
[0009] Step S4: The server updates the corresponding global graph neural network model parameters and personalized model parameters of this round based on the local update parameters sent by the M participating clients of this round;
[0010] Step S5, determine whether the model has converged, if converged, end the model training, otherwise, set T = T + 1, and return to execute steps S2-S5.
[0011] The node status update method of the global graph neural network model described in step S1 is expressed in the form of the following formula:
[0012]
[0013]
[0014] Among them, N(v) is the set of neighbor nodes of node v, is the message received by the node, function M t It is a message generation function, which uses the state of node v at the last moment and the state of neighbor node w at the last moment And the corresponding edge information e vw Generate messages; function Agg is an aggregation function that aggregates messages from all neighbors of node v into is the state of node v at the last moment, is the current state of node v, function U is the node state update function, through the state and the received message, updating the node to
[0015] The step S3 specifically includes:
[0016] Step S31: The personalized model generation network P reconstructed based on the server personalized model parameter Wp obtained by the kth participating client and the personalized model representation vector stored locally by the kth participating client Generate a local personalized supplementary model corresponding to each layer of the global graph neural network model
[0017]
[0018] The personalized model generation network P is an n p The neural network of the layer is expressed as:
[0019] f(x)=σ(Wx+b)
[0020]
[0021] Where f(x) represents a single-layer neural network function, x is the input of the function P, and W and b are the parameters of each layer of the neural network. is an operator, which means that the function on the left is applied to the result of the function on the right;
[0022] Personalized supplement model For an n f A neural network of layers, where t represents a personalized supplementary model for the t-th layer global graph neural network model;
[0023] Step S32: Based on the global graph neural network model G corresponding to all servers and the local personalized supplementary model obtained by the kth participating client Get the local personalized graph neural network model G l , expressed as:
[0024]
[0025]
[0026] Among them, N(v) is the set of neighbor nodes of node v, is the message received by the node, function M t It is a message generation function, which uses the state of node v at the last moment and the state of neighbor node w at the last moment And the corresponding edge information e vw Generate messages; function Agg is an aggregation function that aggregates messages from all neighbors of node v into Supplementing models for personalization; is the state of node v at the last moment, is the current state of node v, function U is the node state update function, through the state and the received message, updating the node to
[0027] Step S33: local personalized graph neural network model G corresponding to all servers obtained by the kth participating client l Parameters of parameters W gl and local data D k Perform several rounds of stochastic gradient descent training to obtain local model parameters;
[0028]
[0029] Among them, W gl As the kth participating client local model training is updated, W gl The initial value is ← means updating the value on the right side of the arrow to the parameter on the left side of the arrow, W gl is the sum of the local model parameters obtained by the kth participating client in the current round, η is the preset learning rate, D k represents the local data of the kth participating client, L(W gl ;D k ) indicates W gl In D k The loss function value on ;
[0030] Step S34: Send corresponding local model parameters to the server based on the local model parameters obtained after the local model training of the kth participating client is completed.
[0031] The step S4 specifically includes:
[0032] Step S41: The server updates the corresponding global graph neural network model parameters and personalized model parameters of this round based on the local update parameters sent by the M participating clients of this round;
[0033]
[0034]
[0035] Among them, W g is the global graph neural network model parameter of this round, is the graph neural network model parameter uploaded by the kth client in this round, W p is the global personalized model parameter of this round, It is the personalized model parameters uploaded by the kth client in this round.
[0036] Compared with the prior art, the present invention has obvious advantages and beneficial effects.
[0037] The federated learning method based on graph data provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following advantages:
[0038] The method of the present invention is based on graph data, and adds a personalized model representation vector to each client, adding the ability of personalized representation to the algorithm model in a manner suitable for graph data, which can improve the accuracy of the algorithm model. The algorithm model refers to a conventional graph neural network model. At the same time, the personalized model parameters and the personalized model representation vector are used to generate a personalized supplementary model on each client, which improves the model accuracy while reducing the communication bandwidth and improving the model training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A structural diagram for implementing the present invention;
[0040] Figure 2 A schematic diagram of a local personalized model generation process in an embodiment of the present invention;
[0041] Figure 3 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the present invention is described in detail below in conjunction with the accompanying drawings and embodiments.
[0043] Example
[0044] See also Figure 1 This embodiment provides a federated learning method based on graph data, the implementation environment of which includes a server, K clients, a processor, and a memory storing calculations and programs, wherein K is an integer greater than or equal to 2. The server stores various configuration files configured as needed, which are used to describe the global graph neural network model structure and the personalized model structure.
[0045] See also Figure 3 , this embodiment specifically includes the following steps:
[0046] Step S1, the server randomly initializes the global graph neural network model parameters and the personalized model parameters according to the pre-configuration file, and initializes T to 1;
[0047] As an example, the parameter can be expressed as W g , the personalized model parameters can be expressed as W p ;
[0048] As an embodiment, the node state update of the specific global graph neural network model G in this embodiment needs to be expressed in the form of the following formula:
[0049]
[0050]
[0051] The graph data consists of several nodes and edges connecting them. N(v) is the set of neighbor nodes of node v. is the message received by the node, function M t It is a message generation function, which uses the state of node v at the last moment and the state of neighbor node w at the last moment And the corresponding edge information e vw Generate messages; function Agg is an aggregation function that aggregates messages from all neighbors of node v into is the state of node v at the last moment, is the current state of node v, function U is the node state update function, through the state and the received message, updating the node to
[0052] It should be noted that the function Agg and the function M in step S1 t The sum function U can be specifically executed by using existing corresponding methods, such as the GraphSAGE method and the PinSAGE method.
[0053] Step S2: In the Tth round of training, M participating clients are selected, and training instructions are sent to each participating client. The kth participating client obtains the corresponding global graph neural network model parameters and personalized model parameters from the server. If the client is selected for the first time, the personalized model representation vector is randomly initialized, k = 1, 2, ...M;
[0054] Step S3: Each client generates a local personalized supplement model based on the acquired server personalized model parameters and the locally stored personalized model representation vector, then performs local training based on the corresponding model parameters, personalized supplement model, and local data, and sends the corresponding model parameters to the server;
[0055] Step S4: The server updates the corresponding global graph neural network model parameters and personalized model parameters of this round based on the local update parameters sent by the M participating clients of this round;
[0056] Step S5, determine whether the model has converged, if converged, end model training, otherwise, set T = T + 1, and return to step S2. It should be noted that step S5 can be specifically executed using existing methods for determining model convergence, such as setting a maximum number of iterations and setting a threshold for changes between two iterations.
[0057] The method of the present invention is based on graph data and adds a personalized model representation vector to each client, adding the ability of personalized representation to the algorithm model in a manner suitable for graph data, which can improve the accuracy of the algorithm model. At the same time, the personalized model parameters and personalized model representation vectors are used to generate a personalized supplementary model on each client, which improves the model accuracy while reducing the communication bandwidth and improving the model training efficiency.
[0058] As an embodiment, this embodiment can be specifically carried out in a personalized model training manner, which not only improves the model training efficiency, but also improves the model training accuracy. Specifically, the step S3 may include:
[0059] Step S3: Each client generates a local personalized supplement model based on the acquired server personalized model parameters and the locally stored personalized model representation vector, then performs local training based on the corresponding model parameters, personalized supplement model, and local data, and sends the corresponding model parameters to the server;
[0060] Step S31: Refer to Figure 2 , based on the personalized model generation network P reconstructed by the server personalized model parameters Wp obtained by the k-th participating client and the personalized model representation vector stored locally by the k-th participating client Generate a local personalized supplementary model corresponding to each layer of the global graph neural network model
[0061]
[0062] Preferably, the personalized model generation network P is an n p The neural network of the layer can be expressed as
[0063] f(x)=σ(Wx+b)
[0064]
[0065] Where f(x) represents a single-layer neural network function, x is the input of the function P, and W and b are the parameters of each layer of the neural network. is an operator, which means that the function on the left is applied to the result of the function on the right.
[0066] Preferred, personalized supplement model For an n f A neural network of layers, where t represents a personalized supplementary model for the t-th layer global graph neural network model.
[0067] Step S32: Based on the global graph neural network model G corresponding to all servers and the local personalized supplementary model obtained by the kth participating client Get the local personalized graph neural network model G l , which can be expressed as:
[0068]
[0069]
[0070] Step S33: local personalized graph neural network model G corresponding to all servers obtained by the kth participating client l Parameters of parameters W gl and local data D k Perform several rounds of stochastic gradient descent training to obtain local model parameters;
[0071]
[0072] Among them, W gl As the kth participating client local model training is updated, W gl The initial value is ← means updating the value on the right side of the arrow to the parameter on the left side of the arrow, W gl is the sum of the local model parameters obtained by the kth participating client in the current round, η is the preset learning rate, D k represents the local data of the kth participating client, L(W gl ;D k ) indicates W gl In D k It should be noted that the evaluation function is specifically an existing evaluation function, which will not be described in detail here.
[0073] Step S34: sending corresponding local model parameters to each server based on the local model parameters obtained after the local model training of the kth participating client is completed;
[0074] It is understandable that through steps S31 to S34, a corresponding personalized model can be generated based on the personalized parameters in each client, fully considering the data heterogeneity caused by the data being scattered across various clients. Furthermore, the integration of the personalized supplementary model with the global graph neural network also fully considers the characteristics of the graph data, thereby further improving the accuracy of model training.
[0075] As an embodiment, step S4 may include:
[0076] Step S41: The server updates the corresponding global graph neural network model parameters and personalized model parameters of this round based on the local update parameters sent by the M participating clients of this round;
[0077]
[0078]
[0079] Among them, W g is the global graph neural network model parameter of this round, is the graph neural network model parameter uploaded by the kth client in this round, W p is the global personalized model parameter of this round, It is the personalized model parameters uploaded by the kth client in this round.
[0080] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for optimizing federated learning on graph data, wherein the implementation environment of the method includes a server, K clients, a processor, and a memory storing calculations and programs, wherein: K is an integer at least equal to 2; a configuration file for describing a global graph neural network model structure and a personalized model structure is stored on the server; the method comprises the following specific steps: Step S1, the server randomly initializes the global graph neural network model parameters and the personalized model parameters according to the pre-configuration file, and initializes the number of training rounds T to 1; Step S2: In the Tth round of training, select M participating clients, send training instructions to each participating client, and the kth participating client obtains the corresponding global graph neural network model parameters and personalized model parameters from the server. If the client is selected for the first time, the personalized model representation vector is randomly initialized, k = 1, 2, ... M; Step S3: Each client generates a local personalized supplement model based on the acquired server personalized model parameters and the locally stored personalized model representation vector, and then performs local training based on the corresponding model parameters, personalized supplement model and local data, and sends the corresponding model parameters to the server; Step S4: The server updates the corresponding global graph neural network model parameters and personalized model parameters of this round based on the local update parameters sent by the M participating clients of this round; Step S5, determine whether the model has converged, if converged, end the model training, otherwise, set T = T + 1, and return to execute steps S2-S5.
2. The federated learning optimization method according to claim 1, characterized in that: The node status update method of the global graph neural network model described in step S1 is expressed in the form of the following formula: Among them, N(v) is the set of neighbor nodes of node v, is the message received by the node, function M t It is a message generation function, which uses the state of node v at the last moment and the state of neighbor node w at the last moment And the corresponding edge information e vw Generate messages; function Agg is an aggregation function that aggregates messages from all neighbors of node v into is the state of node v at the last moment, is the current state of node v, function U is the node state update function, through the state and the received message, updating the node to 3. The federated learning optimization method according to claim 1, characterized in that: The step S3 specifically includes: Step S31: The personalized model generation network P reconstructed based on the server personalized model parameter Wp obtained by the kth participating client and the personalized model representation vector stored locally by the kth participating client Generate a local personalized supplementary model corresponding to each layer of the global graph neural network model The personalized model generation network P is an n p The neural network of the layer is expressed as: f(x)=σ(Wx+b) Where f(x) represents a single-layer neural network function, x is the input of the function P, and W and b are the parameters of each layer of the neural network. is an operator, which means that the function on the left is applied to the result of the function on the right; Personalized supplement model For an n f A neural network of layers, where t represents a personalized supplementary model for the t-th layer global graph neural network model; Step S32: Based on the global graph neural network model G corresponding to all servers and the local personalized supplementary model obtained by the kth participating client Get the local personalized graph neural network model G l , expressed as: Among them, N(v) is the set of neighbor nodes of node v, is the message received by the node, function M t It is a message generation function, which uses the state of node v at the last moment and the state of neighbor node w at the last moment And the corresponding edge information e vw Generate messages; function Agg is an aggregation function that aggregates messages from all neighbors of node v into Supplementing models for personalization; is the state of node v at the last moment, is the current state of node v, function U is the node state update function, through the state and the received message, updating the node to Step S33: local personalized graph neural network model G corresponding to all servers obtained by the kth participating client l Parameters of parameters W gl and local data D k Perform several rounds of stochastic gradient descent training to obtain local model parameters; Among them, W gl As the kth participating client local model training is updated, W gl The initial value is ← means updating the value on the right side of the arrow to the parameter on the left side of the arrow, W gl is the sum of the local model parameters obtained by the kth participating client in the current round, η is the preset learning rate, D k represents the local data of the kth participating client, L(W gl ;D k ) indicates W gl In D k The loss function value on ; Step S34: Send corresponding local model parameters to the server based on the local model parameters obtained after the local model training of the kth participating client is completed.
4. The federated learning optimization method according to claim 1, characterized in that: The step S4 specifically includes: Step S41: The server updates the corresponding global graph neural network model parameters and personalized model parameters of this round based on the local update parameters sent by the M participating clients of this round; Among them, W g is the global graph neural network model parameter of this round, W g k is the graph neural network model parameter uploaded by the kth client in this round, W p is the global personalized model parameter of this round, It is the personalized model parameters uploaded by the kth client in this round.
Citation Information
Patent Citations
Method for eliminating peak noise in magnetic resonance image
CN103150707A
Transverse federated learning optimization method and device based on semi-supervision and storage medium
CN111275207A
Cited By
Heterogeneous task-oriented big language model enhanced federal map learning method and system
CN121835845A