Federal dynamic graph learning optimization method based on knowledge distillation and prototype learning
Through knowledge distillation and prototype learning optimization method, the problems of time evolution and data heterogeneity in dynamic graph learning are solved, the generalization ability and adaptability of the model are improved, and the security of data privacy is ensured.
Patent Information
- Application Number
- CN202411529942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-30
AI Technical Summary
The existing federated graph learning methods cannot effectively capture the temporal evolution characteristics in dynamic graph data, and the model performance decreases when facing diversified dynamic graph data, especially in federated learning environments with high data heterogeneity.
Using the federal dynamic graph learning optimization method based on knowledge distillation and prototype learning, the time evolution characteristics of graph snapshots are captured through global knowledge distillation technology, and the regular term constraints of global prototypes are used to reduce the impact of data differences, and the comparison learning is introduced to generate global prototypes to improve Intra-class compactness and inter-class separation of models.
On the premise of ensuring data privacy, the generalization ability and personalized aggregation mechanism of the global model are improved, so that each client's model can adapt to different data distributions and improve the model's inference ability.
Smart Images

Figure CN119293294A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning, and belongs to the technical field of federated learning. Background Art
[0002] With the increasing demand for data privacy protection, Federated Learning (FL) has been widely used as a machine learning method that can protect data privacy in a distributed environment. Especially in graph data scenarios, Federated Graph Learning (FGL) effectively improves the performance of the model by aggregating the structural information of local graph data between different clients. However, most of the existing federated graph learning methods are designed for static graph data, ignoring the dynamic characteristics of graph data in real applications. Static graph learning methods cannot accurately capture the time evolution characteristics when processing dynamic nodes and edges, resulting in poor performance of the model in processing dynamic scenarios. Therefore, how to deal with the time evolution problem in dynamic graph data without leaking data privacy has become a key technical challenge in federated learning.
[0003] On the other hand, Dynamic Graph Learning (DGL), as a technology to solve the problem of graph data changing over time, has shown great application potential in social network analysis, recommendation systems and other fields in recent years. The DGL method introduces time information so that the model can adapt to the dynamic changes of nodes and edges. However, most of the existing dynamic graph learning methods are based on a centralized learning architecture and cannot cope with the data heterogeneity problem in federated learning scenarios, that is, the distribution of graph data between different clients varies greatly. Due to the uneven data distribution of each client, the generalization ability of existing methods in a federated learning environment is limited, and the model is prone to performance degradation when faced with diverse dynamic graph data. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning, which can effectively capture the time evolution characteristics in the dynamic graph and reduce the impact of data heterogeneity between clients on model performance. On the premise of ensuring data privacy, it not only improves the generalization ability of the global model, but also through a personalized aggregation mechanism, enables the model of each client to adapt to different data distributions, thereby improving the reasoning ability of the model.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions: the present invention designs a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning, wherein the server combines the local data node graph of each client that changes with time steps, initializes the time step t=0, and performs the following steps A to F, performs federated learning training for the feature extraction model initialized by the server and sent to each client, and obtains the trained feature extraction model, wherein the local data node graph includes each node, each node's real category under a preset classification, and the edges between the nodes that are connected;
[0006] Step A. Each client applies its local data node graph corresponding to time step t to train the feature extraction model, obtains the trained parameter group of the client corresponding to time step t, and uploads it to the server; the server aggregates the trained parameter group of each client corresponding to time step t, obtains the global parameter group corresponding to time step t and sends it to each client, each client uses the global parameter group corresponding to time step t to form the parameter group of the first iteration corresponding to time step t+1, adds 1 to the t value and updates, and enters step B;
[0007] Step B. Each client selects and obtains the local analysis node set corresponding to the time step t of the client for its local data node graph corresponding to the time step t, then initializes the number of iterations l=1, and proceeds to step C;
[0008] Step C. Each client applies the feature extraction model under the l-th iteration parameter group under the corresponding time step t based on its local data node graph at the corresponding time step t, combines the processing and return of the server, obtains the global prototype of each category under the l-th iteration under the corresponding time step t, and then enters step D;
[0009] Step D. Each client applies the feature extraction model under the parameter group of the lth iteration at the corresponding time step t and the feature extraction model under the global parameter group at the corresponding time step t-1, and calculates the distillation loss of the client at the lth iteration at the corresponding time step t for the local analysis node set at the corresponding time step t;
[0010] Each client applies the feature extraction model under the parameter group of the lth iteration at the corresponding time step t, and calculates the classification loss of the lth iteration of the client at the corresponding time step t for the node set of the local data node graph at the corresponding time step t;
[0011] Each client calculates the regularization loss of the lth iteration at the corresponding time step t, and then enters step E;
[0012] Step E. Each client respectively integrates the sum of the distillation loss, classification loss, and regularization term loss of the lth iteration at the corresponding time step t to form the comprehensive loss of the client at the lth iteration at the corresponding time step t, and judges whether the difference in comprehensive loss between each group of adjacent iterations in the preset b iteration steps from the lth iteration to the historical iteration direction is less than the preset loss threshold. If so, the client completes the training of the feature extraction model at the time step t, and the parameter group of the lth iteration of the client at the corresponding time step t is the trained parameter group of the client at the corresponding time step t, and obtains the accuracy of the feature extraction model under the trained parameter group, uploads it to the server, and then enters step F; otherwise, according to the comprehensive loss of the lth iteration of the client at the corresponding time step t, the parameter group of the lth iteration of the client at the corresponding time step t is updated to form the parameter group of the l+1th iteration of the client at the corresponding time step t, and the l value is updated by adding 1, and then returns to step C;
[0013] Step F. The server obtains the average accuracy of the feature extraction model accuracy of the parameter group after training corresponding to time step t of each client, and determines whether the average accuracy is greater than the preset model accuracy threshold or whether the global training times reach the preset global maximum training times. If so, the federated learning training for the feature extraction model is completed, and each client applies the feature extraction model under the parameter group after training corresponding to time step t; otherwise, the server updates the parameter group after training corresponding to time step t of each client respectively, and aggregates the global parameter group corresponding to time step t and sends it to each client. Each client constructs the parameter group of the first iteration of its corresponding time step t+1 with the global parameter group received corresponding to time step t, updates the t value by adding 1, and returns to step B.
[0014] As a preferred technical solution of the present invention: in step B, the following steps are performed for each client:
[0015] Step B1. Traverse the node set of the local data node graph of the client corresponding to time step t For each node in the local data node graph, determine whether the node belongs to any historical time step before time step t. If so, mark the activity of the node as 0, otherwise mark the activity of the node as 1, and update the node set K represents the number of clients, The node set representing the local data node graph of the k-th client corresponding to time step t;
[0016] Step B2. Filter and obtain the node set The set of nodes that do not belong to the L-hop neighboring node set of any node with activity 1 represents the set of nodes in the local data node graph of the k-th client corresponding to time step t that do not belong to the L-hop neighboring node set of any node with activity 1, where L represents the number of network layers of the feature extraction model;
[0017] Step B3. According to the following formula:
[0018]
[0019] Get a collection of nodes The loss value of the local data node graph at the kth client corresponding to time step t-1 And the node collection Each node The loss value of the local data node graph at the kth client corresponding to time step t-1 Among them, it means, represents the edge adjacency matrix of the local data node graph of the kth client corresponding to time step t-1, I represents the identity matrix, express The normalized adjacency matrix of represents the trained parameter group of the kth client corresponding to time step t-1, Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains The set of predicted classifications for each node in; express The set of true classifications corresponding to each node in , represents the loss function, Represents a node collection The i-th node in Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains The predicted classification of the i-th node in, Represents a node collection The true classification corresponding to the i-th node in;
[0020] Step B4. Filter and obtain the node set In line with Each node constitutes a candidate node set And further according to the following formula:
[0021]
[0022] Get the candidate node set Each node The loss value of the local data node graph at the kth client corresponding to time step t in, Represents a set of candidate nodes The jth node in represents the adjacency matrix of the edges in the local data node graph of the kth client corresponding to time step t, express The normalized adjacency matrix of Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains the candidate node set The predicted classification of the jth node in , Represents a set of candidate nodes The true classification corresponding to the jth node in;
[0023] Step B5. Calculate the candidate node set Each node in Corresponding to The difference between the two is used as the influence value of each node, and the candidate node set is sorted from large to small according to the influence value. Sort the nodes in the list to form a set of candidate nodes The corresponding nodes are sorted;
[0024] Step B6. Select candidate node set The corresponding node is ranked first nodes, forming the local analysis node set of the kth client corresponding to time step t in, Represents a set of candidate nodes The number of nodes in the middle, a represents the preset ratio, 0 <a<1, Indicates rounding up.
[0025] As a preferred technical solution of the present invention: the step C comprises the following steps:
[0026] Step C1. Each client applies the lth iteration parameter set at its corresponding time step t The feature extraction model under the client performs forward propagation on each node in the local data node graph corresponding to time step t, obtains the feature vector of each node, and divides each node according to each real category to obtain the average feature vector of each node feature vector in each real category as the local prototype of each category at the lth iteration under the client corresponding to time step t Upload to the server; represents the parameter group of the kth client at the lth iteration at time step t, represents the local prototype of category c at the lth iteration of the kth client corresponding to time step t;
[0027] Step C2: The server applies the local prototypes of each category uploaded by each client at the corresponding time step t at the lth iteration Taking the category of the local prototype as input and the local prototype as output, continue training the neural network model H in the server to obtain the trained model H at the lth iteration at time step t. (t,l) ;
[0028] Step C3. The server applies the trained model H at the lth iteration at time step t to each category. (t,l) Processing is performed to obtain the global prototype of each category at the lth iteration at the corresponding time step t And send it to each client separately; represents the global prototype of category c at the lth iteration at time step t.
[0029] As a preferred technical solution of the present invention: in step D, the following steps are performed for each client:
[0030] Step D1. The client applies the lth iteration parameter set corresponding to time step t The feature extraction model under the above condition is respectively for the local analysis node set corresponding to the time step t Each node m is processed to obtain the local feature vector of each node corresponding to the lth iteration at time step t And apply the global parameter set corresponding to time step t-1 The feature extraction model under the above condition is respectively for the local analysis node set corresponding to time step t Each node m is processed to obtain the global feature vector of each node corresponding to time step t-1
[0031] Step D2. The client uses the following formula:
[0032]
[0033] Get the distillation loss of the client at the lth iteration corresponding to time step t in, represents the distillation loss of the kth client at the lth iteration at time step t, m c Represents a local analysis node set Nodes belonging to category c in Indicates that the kth client applies the lth iteration parameter set at its corresponding time step t The feature extraction model under the local analysis node set corresponding to the time step t The nodes belonging to category c are processed to obtain the local feature vectors of the nodes corresponding to the lth iteration at time step t; express The predicted classification, C represents the set of preset categories, Indicates m c The true category of the node, γ represents the preset distillation coefficient;
[0034] Step D3. The client applies the lth iteration parameter set corresponding to time step t The feature extraction model under the t time step processes each node in the node set of the local data node graph corresponding to the time step t, and calculates the classification loss of the lth iteration at the client corresponding to the time step t.
[0035] Step D4. The client uses the following formula:
[0036]
[0037] Calculate the regularization loss of the client at the lth iteration corresponding to time step t in, represents the regularization loss of the k-th client at the l-th iteration at time step t, represents the different categories to which each node in the local data node graph of the kth client corresponds to time step t. Representing a collection The number of categories in express and The cosine similarity between .
[0038] As a preferred technical solution of the present invention: in step E, each client is respectively based on the following formula:
[0039]
[0040] Get the distillation loss of the lth iteration at the corresponding time step t Classification Loss Regularization loss sum
[0041] According to the comprehensive loss of the client at the lth iteration at the corresponding time step t, the following formula is used:
[0042]
[0043] The parameter set for the lth iteration at the client corresponding to time step t Update to form the parameter group of the l+1th iteration of the client corresponding to time step t η represents the model hyperparameter, Indicates derivation.
[0044] As a preferred technical solution of the present invention: in the step F, the server updates the trained parameter group of each client corresponding to the time step t according to the following steps;
[0045] Step F1. The server calculates the following formula for each client:
[0046]
[0047] Get the cosine similarity between the local prototype and the global prototype at each client corresponding to time step t
[0048] Step F2. The server calculates the following formula for each client: Perform cosine similarity normalization
[0049]
[0050] Obtain the normalized cosine similarity results of each client at time step t, and construct the personalized weights of each client at time step t
[0051] Step F3. The server calculates the following formula for each client:
[0052]
[0053] Upload the trained parameter set corresponding to time step t to the client to update.
[0054] The federated dynamic graph learning optimization method based on knowledge distillation and prototype learning described in the present invention adopts the above technical solution and has the following technical effects compared with the prior art:
[0055] (1) The present invention designs a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning, aiming to solve the problems of capturing time evolution and data heterogeneity in dynamic graph learning. Through global knowledge distillation technology, the previously learned knowledge is retained to effectively capture the time evolution feature relationship of graph snapshots; and a regularization term constraint method based on global prototype is used to reduce the impact of data differences between clients on model performance, and contrastive learning is introduced to generate global class prototypes to improve the intra-class compactness and inter-class separation of the model. Under the premise of ensuring data privacy, not only the generalization ability of the global model is improved, but also through a personalized aggregation mechanism, the model of each client can adapt to different data distributions, thereby improving the reasoning ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flow chart of the federated dynamic graph learning optimization method designed by the present invention based on knowledge distillation and prototype learning;
[0057] Figure 2 It is a schematic diagram of a federated training algorithm of a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning designed by the present invention. DETAILED DESCRIPTION
[0058] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0059] The present invention designs a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning. The server combines the local data node graph of each client that changes with time steps, such as Brain, initializes the time step t=0, and Figure 1 and Figure 2 As shown, the following steps A to F are executed, and for the feature extraction model initialized by the server and sent to each client, federated learning training is performed to obtain a trained feature extraction model, and the local data node graph includes each node, each node's real category under a preset classification, and edges between two connected nodes.
[0060] Step A. Each client applies its local data node graph corresponding to time step t to train the feature extraction model, obtains the trained parameter group of the client corresponding to time step t, and uploads it to the server; the server aggregates the trained parameter group of each client corresponding to time step t, obtains the global parameter group corresponding to time step t and sends it to each client, and each client uses the global parameter group corresponding to time step t to form the parameter group of the first iteration corresponding to time step t+1, updates the t value by adding 1, and enters step B.
[0061] Step B. Each client screens and obtains the local analysis node set corresponding to time step t for its local data node graph corresponding to time step t, then initializes the number of iterations l=1, and proceeds to step C.
[0062] In actual application, the above step B is specifically designed to execute the following steps for each client.
[0063] Step B1. Traverse the node set of the local data node graph of the client corresponding to time step t For each node in the local data node graph, determine whether the node belongs to any historical time step before time step t. If so, mark the activity of the node as 0, otherwise mark the activity of the node as 1, and update the node set K represents the number of clients, The node set representing the local data node graph of the k-th client corresponding to time step t.
[0064] Step B2. Filter and obtain the node set The set of nodes that do not belong to the L-hop neighboring node set of any node with activity 1 It represents the set of nodes in the local data node graph of the k-th client corresponding to time step t that do not belong to the L-hop neighborhood node set of any node with activity 1, and L represents the number of network layers of the feature extraction model.
[0065] Step B3. According to the following formula:
[0066]
[0067] Get a collection of nodes The loss value of the local data node graph at the kth client corresponding to time step t-1 And the node collection Each node The loss value of the local data node graph at the kth client corresponding to time step t-1 Among them, it means, represents the edge adjacency matrix of the local data node graph of the kth client corresponding to time step t-1, I represents the identity matrix, express The normalized adjacency matrix of represents the trained parameter group of the kth client corresponding to time step t-1, Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains The set of predicted classifications for each node in; express The set of true classifications corresponding to each node in , represents the loss function, Represents a node collection The i-th node in Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains The predicted classification of the i-th node in, Represents a node collection The true classification corresponding to the i-th node in .
[0068] Step B4. Filter and obtain the node set In line with Each node constitutes a candidate node set And further according to the following formula:
[0069]
[0070] Get the candidate node set Each node The loss value of the local data node graph at the kth client corresponding to time step t in, Represents a set of candidate nodes The jth node in represents the adjacency matrix of the edges in the local data node graph of the kth client corresponding to time step t, express The normalized adjacency matrix of Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains the candidate node set The predicted classification of the jth node in , Represents a set of candidate nodes The true classification corresponding to the jth node in .
[0071] Step B5. Calculate the candidate node set Each node in Corresponding to The difference between the two is used as the influence value of each node, and the candidate node set is sorted from large to small according to the influence value. Sort the nodes in the list to form a set of candidate nodes The corresponding nodes are sorted.
[0072] Step B6. Select candidate node set The corresponding node is ranked first nodes, forming the local analysis node set of the kth client corresponding to time step t in, Represents a set of candidate nodes The number of nodes in the middle, a represents the preset ratio, 0 <a<1, Indicates rounding up.
[0073] Step C. Each client applies the feature extraction model under the l-th iteration parameter group at the corresponding time step t based on its local data node graph at the corresponding time step t, combines the processing and return of the server, obtains the global prototype of each category at the l-th iteration at the corresponding time step t, and then enters step D.
[0074] In practical application, the above step C is specifically designed to execute the following steps C1 to C3.
[0075] Step C1. Each client applies the lth iteration parameter set at its corresponding time step t The feature extraction model under the client performs forward propagation on each node in the local data node graph corresponding to time step t, obtains the feature vector of each node, and divides each node according to each real category to obtain the average feature vector of each node feature vector in each real category as the local prototype of each category at the lth iteration under the client corresponding to time step t Upload to the server; represents the parameter group of the kth client at the lth iteration at time step t, represents the local prototype of category c at the lth iteration of the kth client corresponding to time step t.
[0076] Step C2: The server applies the local prototypes of each category uploaded by each client at the corresponding time step t at the lth iteration Taking the category of the local prototype as input and the local prototype as output, continue training the neural network model H in the server to obtain the trained model H at the lth iteration at time step t. (t,l) .
[0077] Step C3. The server applies the trained model H at the lth iteration at time step t to each category. (t,l) Processing is performed to obtain the global prototype of each category at the lth iteration at the corresponding time step t And send it to each client separately; represents the global prototype of category c at the lth iteration at time step t.
[0078] Step D. Each client applies the feature extraction model under the parameter group of the lth iteration at the corresponding time step t and the feature extraction model under the global parameter group at the corresponding time step t-1, and calculates the distillation loss of the client at the lth iteration at the corresponding time step t for the local analysis node set at the corresponding time step t;
[0079] Each client applies the feature extraction model under the parameter group of the lth iteration at the corresponding time step t, and calculates the classification loss of the lth iteration of the client at the corresponding time step t for the node set of the local data node graph at the corresponding time step t;
[0080] Each client calculates the regularization loss of the lth iteration at its corresponding time step t, and then enters step E.
[0081] In the above step D, the following steps D1 to D4 are specifically designed and executed for each client.
[0082] Step D1. The client applies the lth iteration parameter set corresponding to time step t The feature extraction model under the above condition is respectively for the local analysis node set corresponding to the time step t Each node m is processed to obtain the local feature vector of each node corresponding to the lth iteration at time step t And apply the global parameter set corresponding to time step t-1 The feature extraction model under the above condition is respectively for the local analysis node set corresponding to time step t Each node m is processed to obtain the global feature vector of each node corresponding to time step t-1
[0083] Step D2. The client uses the following formula:
[0084]
[0085] Get the distillation loss of the client at the lth iteration corresponding to time step t in, represents the distillation loss of the kth client at the lth iteration at time step t, m c Represents a local analysis node set Nodes belonging to category c in Indicates that the kth client applies the lth iteration parameter set at its corresponding time step t The feature extraction model under the local analysis node set corresponding to the time step t The nodes belonging to category c are processed to obtain the local feature vectors of the nodes corresponding to the lth iteration at time step t; express The predicted classification, C represents the set of preset categories, Indicates m c The true category of the node, γ represents the preset distillation coefficient.
[0086] Step D3. The client applies the lth iteration parameter set corresponding to time step t The feature extraction model under the t time step processes each node in the node set of the local data node graph corresponding to the time step t, and calculates the classification loss of the lth iteration at the client corresponding to the time step t.
[0087] Step D4. The client uses the following formula:
[0088]
[0089] Calculate the regularization loss of the client at the lth iteration corresponding to time step t in, represents the regularization loss of the k-th client at the l-th iteration at time step t, represents the different categories to which each node in the local data node graph of the kth client corresponds to time step t. Representing a collection The number of categories in , express and The cosine similarity between .
[0090] Step E. Each client uses the following formula:
[0091]
[0092] Get the distillation loss of the lth iteration at the corresponding time step t Classification Loss Regularization loss sum It constitutes the comprehensive loss of the client at the lth iteration at the corresponding time step t.
[0093] Determine whether the difference in comprehensive loss between adjacent iterations in the preset b iterations from the lth iteration to the historical iteration direction is less than the preset loss threshold. If so, the client completes the training of the feature extraction model at time step t, and the parameter group of the lth iteration of the client corresponding to time step t is the trained parameter group of the client corresponding to time step t, and obtains the accuracy of the feature extraction model under the trained parameter group, uploads it to the server, and then enters step F; otherwise, according to the comprehensive loss of the lth iteration of the client corresponding to time step t, according to the following formula:
[0094]
[0095] The parameter set for the lth iteration at the client corresponding to time step t Update to form the parameter group of the l+1th iteration of the client corresponding to time step t η represents the model hyperparameter, It indicates to take the derivative, and to update the value of l by adding 1, and then return to step C.
[0096] Step F. The server obtains the average accuracy of the feature extraction model accuracy of the parameter group after training corresponding to time step t of each client, and determines whether the average accuracy is greater than the preset model accuracy threshold or whether the global training times reaches the preset global maximum training times. If so, the federated learning training for the feature extraction model is completed, and each client applies the feature extraction model under the parameter group after training corresponding to time step t; otherwise, the server updates the parameter group after training corresponding to time step t of each client according to the following steps F1 to F3, and aggregates the global parameter group corresponding to time step t and sends it to each client. Each client constructs the parameter group of the first iteration of its corresponding time step t+1 with the global parameter group received corresponding to time step t, updates the t value by adding 1, and returns to step B.
[0097] Step F1. The server calculates the following formula for each client:
[0098]
[0099] Get the cosine similarity between the local prototype and the global prototype at each client corresponding to time step t
[0100] Step F2. The server calculates the following formula for each client: Perform cosine similarity normalization
[0101]
[0102] Obtain the normalized cosine similarity results of each client at time step t, and construct the personalized weights of each client at time step t
[0103] Step F3. The server calculates the following formula for each client:
[0104]
[0105] Upload the trained parameter set corresponding to time step t to the client to update.
[0106] In the actual application of the above design scheme, each client applies its local data node graph corresponding to time step t. Before training the feature extraction model, the data set corresponding to the local data node graph is preprocessed. The preprocessing operations of the data set include normalization Normalize to make the model converge faster; tensorization ToTensor, so that the data can be calculated on a general GPU for acceleration. The node feature matrix and the edge feature matrix are normalized to ensure that they have similar scales and distributions. Among them, the data enhancement methods for the training set include random node drop RandomNodeDrop, random edge drop RandomEdgeDrop, node feature perturbation FeaturePerturbation, and subgraph sampling SubgraphSampling, etc. These methods can enhance the complexity of the data and prevent overfitting of the neural network model during the convergence process.
[0107] The above design scheme aims to solve the problems of capturing time evolution and data heterogeneity in dynamic graph learning. 1) The global knowledge distillation technology is used to effectively retain the time evolution knowledge, accelerate the model convergence and improve its generalization ability; 2) The regularization term constraint method based on the global prototype solves the data heterogeneity problem between clients and greatly improves the consistency and stability of the global model; 3) The global class prototype generated by contrastive learning enhances the intra-class compactness and inter-class separation of features, significantly improving the classification accuracy; 4) The personalized aggregation method enables the model to adapt to the data distribution of different clients and has stronger adaptability.
[0108] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A federated dynamic graph learning optimization method based on knowledge distillation and prototype learning, characterized by: The server combines the local data node graph of each client that changes with time steps, initializes the time step t=0, and executes the following steps A to F, performs federated learning training on the feature extraction model initialized by the server and sent to each client, and obtains the trained feature extraction model. The local data node graph includes each node, each node's real category under the preset classification, and the edges between the two nodes that are connected; Step A. Each client applies its local data node graph corresponding to time step t to train the feature extraction model, obtains the trained parameter group of the client corresponding to time step t, and uploads it to the server; The server aggregates the trained parameter groups of each client corresponding to time step t, obtains the global parameter group corresponding to time step t and sends it to each client. Each client respectively uses the global parameter group corresponding to time step t to form the parameter group of the first iteration corresponding to time step t+1, adds 1 to the t value and enters step B. Step B. Each client selects and obtains the local analysis node set corresponding to the time step t of the client for its local data node graph corresponding to the time step t, then initializes the number of iterations l=1, and proceeds to step C; Step C. Each client applies the feature extraction model under the l-th iteration parameter group under the corresponding time step t based on its local data node graph at the corresponding time step t, combines the processing and return of the server, obtains the global prototype of each category under the l-th iteration under the corresponding time step t, and then enters step D; Step D. Each client applies the feature extraction model under the parameter group of the lth iteration at the corresponding time step t and the feature extraction model under the global parameter group at the corresponding time step t-1, and calculates the distillation loss of the client at the lth iteration at the corresponding time step t for the local analysis node set at the corresponding time step t; Each client applies the feature extraction model under the parameter group of the lth iteration at the corresponding time step t, and calculates the classification loss of the lth iteration of the client at the corresponding time step t for the node set of the local data node graph at the corresponding time step t; Each client calculates the regularization loss of the lth iteration at the corresponding time step t, and then enters step E; Step E. Each client respectively integrates the sum of the distillation loss, classification loss, and regularization term loss of the lth iteration at the corresponding time step t to form the comprehensive loss of the client at the lth iteration at the corresponding time step t, and judges whether the difference in comprehensive loss between each group of adjacent iterations in the preset b iteration steps from the lth iteration to the historical iteration direction is less than the preset loss threshold. If so, the client completes the training of the feature extraction model at the time step t, and the parameter group of the lth iteration of the client at the corresponding time step t is the trained parameter group of the client at the corresponding time step t, and obtains the accuracy of the feature extraction model under the trained parameter group, uploads it to the server, and then enters step F; otherwise, according to the comprehensive loss of the lth iteration of the client at the corresponding time step t, the parameter group of the lth iteration of the client at the corresponding time step t is updated to form the parameter group of the l+1th iteration of the client at the corresponding time step t, and the l value is updated by adding 1, and then returns to step C; Step F. The server obtains the average accuracy of the feature extraction model accuracy of the parameter group after training corresponding to time step t of each client, and determines whether the average accuracy is greater than the preset model accuracy threshold or whether the global training times reach the preset global maximum training times. If so, the federated learning training for the feature extraction model is completed, and each client applies the feature extraction model under the parameter group after training corresponding to time step t; otherwise, the server updates the parameter group after training corresponding to time step t of each client respectively, and aggregates the global parameter group corresponding to time step t and sends it to each client. Each client constructs the parameter group of the first iteration of its corresponding time step t+1 with the global parameter group received corresponding to time step t, updates the t value by adding 1, and returns to step B.
2. According to claim 1, a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning is characterized by: In step B, the following steps are performed for each client: Step B1. Traverse the node set of the local data node graph of the client corresponding to time step t For each node in the local data node graph, determine whether the node belongs to any historical time step before time step t. If so, mark the activity of the node as 0, otherwise mark the activity of the node as 1, and update the node set K represents the number of clients, The node set representing the local data node graph of the k-th client corresponding to time step t; Step B2. Filter and obtain the node set The set of nodes that do not belong to the L-hop neighboring node set of any node with activity 1 represents the set of nodes in the local data node graph of the k-th client corresponding to time step t that do not belong to the L-hop neighboring node set of any node with activity 1, where L represents the number of network layers of the feature extraction model; Step B3. According to the following formula: Get a collection of nodes The loss value of the local data node graph at the kth client corresponding to time step t-1 And the node collection Each node The loss values of the local data node graph at the kth client corresponding to time step t-1 Among them, it means, represents the edge adjacency matrix of the local data node graph of the kth client corresponding to time step t-1, I represents the identity matrix, express The normalized adjacency matrix of represents the trained parameter group of the kth client corresponding to time step t-1, Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains The set of predicted classifications for each node in; express The set of true classifications corresponding to each node in , l() represents the loss function, Represents a node collection The i-th node in Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains The predicted classification of the i-th node in, Represents a node collection The true classification corresponding to the i-th node in; Step B4. Filter and obtain the node set In line with Each node of constitutes a candidate node set And further according to the following formula: Get the candidate node set Each node The loss value of the local data node graph at the kth client corresponding to time step t in, Represents a set of candidate nodes The jth node in represents the adjacency matrix of the edges in the local data node graph of the kth client corresponding to time step t, express The normalized adjacency matrix of Indicates For input, based on the parameter group The feature extraction model extracts the feature vector and obtains the candidate node set The predicted classification of the jth node in , Represents a set of candidate nodes The true classification corresponding to the jth node in; Step B5. Calculate the candidate node set Each node in Corresponding to The difference between the two is used as the influence value of each node, and the candidate node set is sorted from large to small according to the influence value. Sort the nodes in the list to form a set of candidate nodes The corresponding nodes are sorted; Step B6. Select candidate node set The corresponding node is ranked first nodes, forming the local analysis node set of the kth client corresponding to time step t in, Represents a set of candidate nodes The number of nodes in the middle, a represents the preset ratio, 0<a<1, Indicates rounding up.
3. According to claim 1, a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning is characterized by: The step C comprises the following steps: Step C1. Each client applies the lth iteration parameter set at its corresponding time step t The feature extraction model under the client performs forward propagation on each node in the local data node graph corresponding to time step t, obtains the feature vector of each node, and divides each node according to each real category, obtains the average feature vector of each node feature vector in each real category, and uses it as the local prototype of each category at the client corresponding to time step t at the lth iteration Upload to the server; represents the parameter group of the kth client at the lth iteration at time step t, represents the local prototype of category c at the lth iteration of the kth client corresponding to time step t; Step C2: The server applies the local prototypes of each category uploaded by each client at the corresponding time step t at the lth iteration Taking the category of the local prototype as input and the local prototype as output, continue training the neural network model H in the server to obtain the trained model H at the lth iteration at time step t. (t,l) ; Step C3. The server applies the trained model H at the lth iteration at time step t to each category. (t,l) Processing is performed to obtain the global prototype of each category at the lth iteration at the corresponding time step t And send it to each client separately; represents the global prototype of category c at the lth iteration at time step t.
4. According to claim 3, a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning is characterized by: In step D, the following steps are performed for each client: Step D1. The client applies the lth iteration parameter set corresponding to time step t The feature extraction model under the above condition is respectively for the local analysis node set corresponding to the time step t Each node m is processed to obtain the local feature vector of each node corresponding to the lth iteration at time step t And apply the global parameter set corresponding to time step t-1 The feature extraction model under the above condition is respectively for the local analysis node set corresponding to time step t Each node m is processed to obtain the global feature vector of each node corresponding to time step t-1 Step D2. The client uses the following formula: Get the distillation loss of the client at the lth iteration corresponding to time step t in, represents the distillation loss of the kth client at the lth iteration at time step t, m c Represents a local analysis node set Nodes belonging to category c in Indicates that the kth client applies the lth iteration parameter set at its corresponding time step t The feature extraction model under the local analysis node set corresponding to the time step t The nodes belonging to category c are processed to obtain the local feature vectors of the nodes corresponding to the lth iteration at time step t; express The predicted classification, C represents the set of preset categories, Indicates m c The true category of the node, γ represents the preset distillation coefficient; Step D3. The client applies the lth iteration parameter set corresponding to time step t The feature extraction model under the t time step processes each node in the node set of the local data node graph corresponding to the time step t, and calculates the classification loss of the lth iteration at the client corresponding to the time step t. Step D4. The client uses the following formula: Calculate the regularization loss of the client at the lth iteration corresponding to time step t in, represents the regularization loss of the k-th client at the l-th iteration at time step t, represents the different categories to which each node in the local data node graph of the kth client corresponds to time step t. Representing a collection The number of categories in express and The cosine similarity between .
5. According to claim 1, a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning is characterized by: In step E, each client uses the following formula: Get the distillation loss of the lth iteration at the corresponding time step t Classification Loss Regularization loss sum According to the comprehensive loss of the client at the lth iteration at the corresponding time step t, the following formula is used: The parameter set for the lth iteration at the client corresponding to time step t Update to form the parameter group of the l+1th iteration of the client corresponding to time step t η represents the model hyperparameter, Indicates derivative.
6. According to claim 1, a federated dynamic graph learning optimization method based on knowledge distillation and prototype learning is characterized by: In step F, the server updates the trained parameter group of each client corresponding to time step t according to the following steps; Step F1. The server calculates the following formula for each client: Get the cosine similarity between the local prototype and the global prototype at each client corresponding to time step t Step F2. The server calculates the following formula for each client: Perform cosine similarity normalization Obtain the normalized cosine similarity results of each client at time step t, and construct the personalized weights of each client at time step t Step F3. The server calculates the following formula for each client: Upload the trained parameter set corresponding to time step t to the client to update.
Citation Information
Patent Citations
Efficient encrypted voice traffic recognition method
CN116186512A
Power grid abnormal mode data identification method and system based on genetic LM algorithm
CN117807542A
Federal learning performance optimization method based on knowledge distillation
CN117952189A
Federal learning optimization method based on mutual knowledge transfer
CN118364898A
Knowledge distillation-based joint learning training method and apparatus, device and medium
WO2023124296A1