A Robust Federated Learning Method Based on Dynamic Aggregation Weights and Prototype Guidance
By detecting drifting clients in federated learning and performing dynamic weight allocation and prototype-guided distillation training, the performance degradation caused by concept drift and malicious clients in federated learning is solved, achieving higher robustness and adaptability, and reducing information loss and resource overhead.
Patent Information
- Application Number
- CN202510826650.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Existing federated learning methods struggle to achieve satisfactory results in complex environments where concept drift and malicious clients coexist, failing to effectively mitigate model performance degradation and security risks. Furthermore, existing robust aggregation methods may overlook cross-client semantic differences or lead to information loss.
By combining drift client detection, dynamic weight aggregation, and knowledge distillation, positive and negative prototype sets are constructed to dynamically evaluate client similarity and complementarity, perform dynamic weight allocation, and improve the robustness and adaptability of the global model through distillation training.
While protecting data privacy, this approach effectively mitigates model degradation caused by concept drift and malicious clients, improves the robustness and adaptability of the global model, and reduces information loss and computational resource consumption.
Smart Images

Figure CN120764626B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a robust federated learning method based on dynamic aggregation weights and prototype guidance, belonging to the field of federated learning technology. Background Technology
[0002] Google first proposed federated learning, a novel distributed machine learning framework, in 2016 to address the data silo problem in traditional deep learning architectures that require data privacy. Federated learning enables multiple clients to collaboratively learn a highly adaptive global model without transmitting local private data to the server, offering a new learning framework that combines efficient communication with privacy protection. However, with the widespread adoption of federated learning in mobile devices, the Internet of Things (IoT), and edge computing, the non-independent and identically distributed nature of data and concept drift are becoming increasingly common in real-world scenarios. Furthermore, malicious clients may exist in open federated learning environments, disrupting global model training by uploading abnormal model updates. These factors all contribute to a decline in global model performance, severely limiting the reliability and adaptability of federated learning systems in practice.
[0003] In federated learning scenarios, changes in the statistical distribution of local client data can lead to concept drift. For example, multiple medical institutions may assign different pathological grades to the same pathological image due to differences in annotation standards, or voice assistants from different regions may have ambiguities regarding the same accented commands. Such cross-client concept inconsistencies significantly reduce the generalization ability of the global model to unseen clients or public test sets. (References include...) <Proceedings of the Twenty-fifthInternational Symposium on Theory, Algorithmic Foundations, and ProtocolDesign for Mobile Networks and Mobile Computing> (2024, 151-160) proposed introducing prototype representations into federated learning to capture changing concepts. For example, the FedStream method in streaming federated learning uses client prototype vectors to dynamically represent evolving concepts in the data stream, thereby improving the model's adaptability to concept drift. However, these methods primarily focus on detecting and adapting to concept drift, lacking countermeasures against potentially malicious clients. When concept drift and malicious attacks coexist, simply adjusting the clients involved in training or updating the model may be insufficient to ensure the robustness of the global model.
[0004] Furthermore, in federated learning, malicious clients may intentionally use erroneous data to train or tamper with local model updates, injecting distortions, noise, or malicious gradients with triggering conditions into the global model, leading to a sharp drop in model accuracy or erroneous outputs in critical scenarios. To combat such attacks, researchers have proposed various robust aggregation strategies, such as selecting only the closest updates for aggregation by measuring the similarity or Euclidean distance between client updates; methods to remove extreme values on each coordinate axis to resist anomalous gradients; and methods based on constructing undirected graphs to identify potential malicious nodes, excluding them before weighted averaging. However, these methods often rely on static distance or statistical rules, making it difficult to distinguish update differences caused by real data drift, easily misjudging normal clients as attackers, thus losing the model's adaptability to new distributions; using fixed aggregation weights after removing or weakening some updates fails to fully utilize the complementary advantages of heterogeneous data from different clients; and overly aggressive filtering strategies may weaken the model's learning performance on rare samples and a few classes. Furthermore, these algorithms often present challenges in practical deployment, such as high computational overhead, increased system latency, and complex parameter tuning. There is an urgent need to design a more flexible, dynamic aggregation mechanism that balances robustness and learning performance.
[0005] In summary, existing federated learning methods struggle to achieve satisfactory results in complex environments where concept drift and malicious clients coexist. Methods addressing concept drift often lack mechanisms to defend against malicious attacks, while robust aggregation methods may overlook useful knowledge inherent in cross-client semantic differences, or even misclassify clients whose distribution has deviated due to concept drift as anomalous nodes, thus diminishing their legitimate contributions. Therefore, a novel federated learning method is urgently needed that can simultaneously mitigate model degradation caused by concept drift and security risks posed by malicious clients while protecting data privacy, achieving superior global model performance in complex and heterogeneous environments. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a robust federated learning method based on dynamic aggregation weights and prototype guidance, aiming to solve the problem of global model performance degradation caused by dynamic changes in client data distribution and malicious client interference in federated learning.
[0007] The technical solution of this invention is: a robust federated learning method based on dynamic aggregated weights and prototype guidance. This method organically combines drift client detection, dynamic weight aggregation, and knowledge distillation, minimizing the adverse effects of anomalous information on the model while retaining useful information, thereby improving the robustness and adaptability of federated learning. Specifically, it includes the following steps:
[0008] Step 1: After each client undergoes local preheating training, a local model is obtained. The classification accuracy of the local models is evaluated among the clients. Based on the evaluation results, the clients are classified into trusted clients and drifting clients according to the voting rules.
[0009] Step 2: Extract trainable vectors from the trusted client and the drifting client respectively, and construct a positive prototype set and a negative prototype set based on the trainable vectors;
[0010] Step 3: Calculate the similarity and complementarity of each client, obtain the dynamic weight of each client in the global model aggregation based on the preset rules, the similarity and complementarity, and combine the dynamic weights of all clients to obtain the dynamic aggregation weight matrix.
[0011] Step 4: Merge the models in the trusted client based on a preset merging threshold;
[0012] Specifically, based on the trusted client and the corresponding dynamic aggregation weight matrix, model pairs whose similarity and complementarity satisfy the preset merging threshold are merged to generate a new model, and the corresponding dynamic aggregation weight matrix is updated. The merging operation is repeated until the trusted client has only one model left, and the last model is used as the trusted client aggregated model.
[0013] Specifically, when performing a merging operation, if there is no model pair that meets the preset merging threshold, the preset merging threshold is increased. If, after increasing the threshold a preset number of times, there is still no model pair that meets the preset merging threshold, the model pair with the highest similarity is forcibly aggregated.
[0014] Step 5: Distillation training is performed based on the trusted client aggregation model, the positive prototype set, and the negative prototype set. The trained model is then distributed to each client for the next round of iteration. Robust federated learning is achieved through multiple rounds of iteration.
[0015] Optionally, the classification accuracy is calculated for each client on its own validation set. The evaluated model The accuracy for each category, wherein the evaluated model is the local model of all other clients distributed by the server, excluding the client itself, and the formula for calculating the classification accuracy is:
[0016]
[0017] In the formula, For the client For the client The Class accuracy, where Acc is a function used to calculate classification accuracy.
[0018] Optionally, after obtaining the peer review results of classification accuracy for all clients, a voting rule is constructed to divide all clients, including:
[0019] Preset a threshold Using the client Self-first Class accuracy minus threshold This yields a discriminant value;
[0020] When the client For the client The Class accuracy When the value is less than the discrimination value, the voting result is recorded as "". right "Cast a vote";
[0021] The server aggregates all client voting results; if a client... If the number of votes received in any category exceeds a preset threshold, the client will be... Clients are categorized as drifting clients, while the remaining clients are categorized as trusted clients. Drifting clients include conceptual drifting clients and malicious clients.
[0022] Optionally, Step 2 includes:
[0023] Step 2.1: Extract trainable vectors representing the global normal data distribution from the trusted client. The server then converts it into a global prototype with the same shape, resulting in a prototype set. ;
[0024] Step 2.2: Extract trainable vectors representing the concept skew data distribution from the drift client. The server then converts it into a global prototype with the same shape, resulting in a negative prototype set. ;
[0025] Step 2.3: Store the positive prototype set and the negative prototype set on the server as the data source for distillation training.
[0026] Optionally, Step 3 includes:
[0027] Step 3.1: Server Update the set of model update parameters uploaded by each client. Principal component analysis is performed to update the parameter vector set of the high-dimensional model. Mapping to low-dimensional principal component space Extract one or more principal component vectors that characterize the client's change features, where, These are the parameter weights of the model;
[0028] Step 3.2: Calculate the similarity between the parameter vectors of any two client models to obtain the similarity score, which reflects the degree of similarity between the client models. ;
[0029] Step 3.3: Calculate the complementarity of any two clients based on the principal component vectors. To quantify the complementarity of information provided by the two clients, wherein the complementarity is measured by the difference in the angle between the principal component vectors of the two clients;
[0030] Step 3.4: Overall Similarity and complementarity The dynamic weights of each client in the global model aggregation are assigned according to preset rules, and the dynamic weights of all clients are combined into a dynamic aggregate weight matrix. ,in, Indicates the first in the global aggregation Client relative to the first The weighting of client contributions, and Normalize by row or column to satisfy the constraint that the sum of the weights is 1.
[0031] Optionally, the preset rules include:
[0032] When the similarity between trusted clients is higher than a preset threshold but their complementarity is lower than a preset threshold, the weights are distributed equally, and the higher the complementarity, the higher the weight distribution.
[0033] The lower the similarity between the drifting client and the trusted client, the lower the weight allocation.
[0034] Optionally, the updated dynamic aggregation weight matrix includes:
[0035] When the trusted client model set The similarity and complementarity among them satisfy the preset merging threshold. A pair of models At that time, exist Weights in , The weighted average merging is expressed as follows:
[0036]
[0037] The model after weighted average merging replace And update the corresponding rows and columns in the dynamic aggregate weight matrix.
[0038] Optionally, the distillation training based on the trusted client aggregation model, the positive prototype set, and the negative prototype set includes:
[0039] The trusted client aggregation model As the teacher and student models in distillation training, where training has not yet begun, It serves as both a teacher model and a student model; once training begins... Just a student model, the prototype set and negative prototype set As unlabeled training samples;
[0040] Prototype set Input the student model to obtain the predicted probability distribution. The gradient of the gradient is locked as the softmax probability of the teacher model, and the softmax probability is transformed into a confidence label data structure. ;
[0041] The student model is trained on the prototype set to obtain the log probability of the student model. Thus, the loss function is constructed. :
[0042]
[0043] in, For the prototype set The total number of categories included. Let cross-entropy be the loss function. In the log probability of the student model, the th The log probability of the class For the confidence label Class tags;
[0044] The student model is trained on the negative prototype set, and a loss function is constructed. :
[0045]
[0046] in, negative prototype set The total number of categories included. For the prototype set The Middle The prototype vector of a class. negative prototype set The Middle The prototype vector of a class. To find the maximum value function, The preset threshold;
[0047] Construct the total loss function :
[0048]
[0049] in, As a preset ratio, when the total loss function converges, a robust global model that retains the knowledge of trusted clients while suppressing the influence of drifting clients is obtained and used for the next iteration.
[0050] Compared with existing methods, the significant advantages of the technical solution of the present invention are as follows:
[0051] (1) Traditional robust aggregation often performs hard filtering on clients deemed abnormal, resulting in a significant loss of cross-client difference knowledge. This invention does not simply remove clients that have drifted, but instead assigns them certain weights through complementarity evaluation and incorporates their useful knowledge into the global model in the subsequent distillation stage. This preserves the new information contained in the cross-client difference data while avoiding the information loss caused by over-filtering in existing robust methods, thus improving the adaptability and generalization ability of the global model to heterogeneous data.
[0052] (2) Traditional robust aggregation often relies solely on the similarity between clients, resulting in the loss of cross-client differential knowledge. Multi-model federated learning methods, on the other hand, require storing multiple models, incurring significant overhead in communication and computational resources. This invention uses a joint similarity-complementarity measure to comprehensively consider the similarity and complementarity between client models during the aggregation process. This allows the global model to maintain mainstream semantic consistency while explicitly learning different insights into differential knowledge, maximizing the utilization of limited data. Furthermore, this invention uses hierarchical aggregation to aggregate multiple models into a single model, significantly reducing communication and computational overhead.
[0053] (3) The dual-prototype guided distillation mechanism proposed in this invention enables the distillation target to simultaneously cover the normal mode prototype and the biased mode prototype. Under the joint constraint of the total loss function, the student model not only inherits the discriminative ability of the trusted client, but also quickly corrects the response to normal and biased concepts through contrast and negative distillation, thereby achieving higher generalization in data distributions with concept bias. Compared with traditional methods that rely solely on parameter averaging, this invention enables the global model to explicitly learn "what to learn" and "what to forget" in concept bias scenarios. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating the present invention;
[0055] Figure 2 This is a schematic diagram of the structure of the present invention. Detailed Implementation
[0056] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0057] Example 1: As Figure 1 As shown, a robust federated learning method based on dynamic aggregated weights and prototype guidance includes the following steps:
[0058] Step 1: After each client undergoes local preheating training, a local model is obtained. The classification accuracy of the local models is evaluated among the clients. Based on the evaluation results, the clients are classified into trusted clients and drifting clients according to the voting rules.
[0059] Specifically, the classification accuracy is for each client on its own validation set. The evaluated model The accuracy for each category, wherein the evaluated model is the local model of all other clients distributed by the server, excluding the client itself, and the formula for calculating the classification accuracy is:
[0060]
[0061] In the formula, For the client For the client The Class accuracy, where Acc is a function used to calculate classification accuracy.
[0062] Furthermore, after obtaining the peer review results of classification accuracy across all clients, a voting rule is constructed to divide all clients, including:
[0063] Preset a threshold Using the client Self-first Class accuracy minus threshold This yields a discriminant value;
[0064] When the client For the client The Class accuracy When the value is less than the discrimination value, the voting result is recorded as "". right "Cast a vote";
[0065] The server aggregates all client voting results; if a client... If the number of votes received in any category exceeds a preset threshold, the client will be... Clients are categorized as drifting clients, while the remaining clients are categorized as trusted clients. Drifting clients include conceptual drifting clients and malicious clients.
[0066] It is important to understand that the client has independent local data, communicates only with the server, and does not directly exchange data with other clients. The client is responsible for receiving the model parameters sent by the server, performing a few rounds of warm-up training locally, and sending the updated trained model to the server.
[0067] Before training begins, the server randomly initializes global model parameters and distributes them to each client. After each round of training, the server is responsible for collecting client model updates and sequentially performing: drift client identification, dynamic weight calculation, hierarchical fusion, dual prototype extraction, and prototype-guided distillation update. Finally, the updated global model is sent back to the client.
[0068] Furthermore, combined Figure 2 The present invention will be described in further detail below. In this embodiment, there are 10 clients (numbered 0–9), and all 10 clients are selected to participate in each round of training. The drifting clients identified through voting rules are 0, 2, 4, and 6, while the rest are trusted clients (1, 3, 5, 7, 8, and 9). The specific steps are as follows:
[0069] Step 1.1: Each client The local model is obtained through a short warm-up training process. and the local model Send to the server;
[0070] Step 1.2: The server distributes each client model to the other 9 clients as the models to be evaluated. The classification accuracy is evaluated among the various clients;
[0071] Step 1.3: When the client For the client The Class accuracy When the accuracy rate is more than 0.3 lower than its own accuracy rate in this category, that is... ,Record" right "Cast a vote";
[0072] Step 1.4: The server summarizes the votes. If client u receives a certain number of votes in any category... ticket( If the number is 10, it is marked as a drift client. According to this rule, in this embodiment, the numbers that are determined to be drift clients are 0, 2, 4, and 6; the rest are trusted clients.
[0073] Step 2: Extract trainable vectors from the trusted client and the drifting client respectively, and construct a positive prototype set and a negative prototype set based on the trainable vectors;
[0074] Step 2.1: Extract trainable vectors representing the global normal data distribution from the trusted clients (1,3,5,7,8,9). The server then converts it into a global prototype with the same shape, resulting in a prototype set. ;
[0075] Step 2.2: Extract trainable vectors representing the concept skew data distribution from the drift client (0,2,4,6). The server then converts it into a global prototype with the same shape, resulting in a negative prototype set. ;
[0076] Step 2.3: Store the positive prototype set and the negative prototype set on the server as the data source for distillation training, which will guide the global model learning.
[0077] Step 3: Calculate the similarity and complementarity of each client, obtain the dynamic weight of each client in the global model aggregation based on the preset rules, the similarity and complementarity, and combine the dynamic weights of all clients to obtain the dynamic aggregation weight matrix.
[0078] Step 3.1: Server Update the set of model update parameters uploaded by each client. Principal component analysis is performed to update the parameter vector set of the high-dimensional model. Mapping to low-dimensional principal component space Extract one or more principal component vectors that characterize the client's change features, where, These are the parameter weights of the model;
[0079] Step 3.2: Calculate the similarity between the parameter vectors of any two client models to obtain the similarity score, which reflects the degree of similarity between the client models. ;
[0080] Specifically, similarity can be represented by cosine similarity or the reciprocal of Euclidean distance. In this embodiment, cosine similarity is used as an example to obtain the similarity. ;
[0081] Step 3.3: Calculate the complementarity of any two clients based on the principal component vectors. To quantify the complementarity of information provided by the two clients, wherein the complementarity is measured by the difference in the angle between the principal component vectors of the two clients;
[0082] Step 3.4: Overall Similarity and complementarity The dynamic weights of each client in the global model aggregation are assigned according to preset rules, and the dynamic weights of all clients are combined into a dynamic aggregate weight matrix. ,in, Indicates the first in the global aggregation Client relative to the first The weighting of client contributions, and Normalization is performed by row or column to satisfy the constraint that the sum of weights is 1, where the weight of the drift client is set to 0.
[0083] Specifically, the preset rules include:
[0084] When the similarity between trusted clients is higher than a preset threshold but their complementarity is lower than a preset threshold, the weights are distributed equally, and the higher the complementarity, the higher the weight distribution.
[0085] The lower the similarity between the drifting client and the trusted client, the lower the weight allocation.
[0086] Step 4: Merge the models in the trusted client based on a preset merging threshold;
[0087] Specifically, based on the trusted client and the corresponding dynamic aggregation weight matrix, model pairs whose similarity and complementarity satisfy the preset merging threshold are merged to generate a new model, and the corresponding dynamic aggregation weight matrix is updated. The merging operation is repeated until the trusted client has only one model left, and the last model is used as the trusted client aggregated model.
[0088] Specifically, when performing a merging operation, if there is no model pair that meets the preset merging threshold, the preset merging threshold is increased. If, after increasing the threshold a preset number of times, there is still no model pair that meets the preset merging threshold, the model pair with the highest similarity is forcibly aggregated.
[0089] Specifically, in this embodiment, when the trusted client model set The similarity and complementarity among them satisfy the preset merging threshold. A pair of models At that time, exist Weights in , The weighted average merging is expressed as follows:
[0090]
[0091] The model after weighted average merging replace And update the corresponding rows and columns in the dynamic aggregate weight matrix.
[0092] Step 5: Distillation training is performed based on the trusted client aggregation model, the positive prototype set, and the negative prototype set. The trained model is then distributed to each client for the next round of iteration. Robust federated learning is achieved through multiple rounds of iteration.
[0093] The trusted client aggregation model As the teacher and student models in distillation training, where training has not yet begun, It serves as both a teacher model and a student model; once training begins... Just a student model, the prototype set and negative prototype set As unlabeled training samples;
[0094] Prototype set Input the student model to obtain the predicted probability distribution. The gradient of the gradient is locked as the softmax probability of the teacher model, and the softmax probability is transformed into a confidence label data structure. ;
[0095] The student model is trained on the prototype set to obtain the log probability of the student model. Thus, the loss function is constructed. This ensures that shared semantics are faithfully inherited.
[0096]
[0097] in, For the prototype set The total number of categories included. Let cross-entropy be the loss function. In the log probability of the student model, the th The log probability of the class For the confidence label Class tags;
[0098] The student model is trained on the negative prototype set, and a loss function is constructed. :
[0099]
[0100] in, negative prototype set The total number of categories included. For the prototype set The Middle The prototype vector of a class. negative prototype set The Middle The prototype vector of a class. To find the maximum value function, The preset threshold;
[0101] Specifically, the negative prototype is used to increase the distributional distance between the student model and the teacher model, thereby forcing the student model to maintain a difference from the teacher model in terms of conflict concepts, thus achieving the purpose of inhibition;
[0102] Construct the total loss function :
[0103]
[0104] in, As a preset ratio, when the total loss function converges, a robust global model that retains the knowledge of trusted clients while suppressing the influence of drifting clients is obtained and used for the next iteration.
[0105] In summary, this invention proposes a robust federated learning method based on dynamic aggregation weights and prototype guidance. First, drifting clients are detected and labeled. Client complementarity and similarity are dynamically evaluated and assigned different aggregation weights. Then, model parameters are fused to ensure that data from the primary source dominates the global model update. Subsequently, by refining trusted client prototypes and drifting client prototypes, the global model is guided to undergo distillation training, making it account for both existing and newly emerging data patterns. This improves the model's generalization performance in heterogeneous and non-stationary environments and reduces the impact of malicious updates. Each step of this invention can be implemented within existing federated learning frameworks, with controllable computational and communication overhead, resulting in significant overall benefits.
[0106] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A robust federated learning method based on dynamic aggregation weights and prototype guidance, characterized in that, Includes the following steps: Step 1: After each client undergoes local preheating training, a local model is obtained. The classification accuracy of the local models is evaluated among the clients. Based on the evaluation results, the clients are classified into trusted clients and drifting clients according to the voting rules. Step 2: Extract trainable vectors from the trusted client and the drifting client respectively, and construct a positive prototype set and a negative prototype set based on the trainable vectors; Step 3: Calculate the similarity and complementarity of each client, obtain the dynamic weight of each client in the global model aggregation based on the preset rules, the similarity and complementarity, and combine the dynamic weights of all clients to obtain the dynamic aggregation weight matrix. Step 4: Merge the models in the trusted client based on a preset merging threshold; Specifically, based on the trusted client and the corresponding dynamic aggregation weight matrix, model pairs whose similarity and complementarity satisfy the preset merging threshold are merged to generate a new model, and the corresponding dynamic aggregation weight matrix is updated. The merging operation is repeated until the trusted client has only one model left, and the last model is used as the trusted client aggregated model. Specifically, when performing a merging operation, if there is no model pair that meets the preset merging threshold, the preset merging threshold is increased. If, after increasing the threshold a preset number of times, there is still no model pair that meets the preset merging threshold, the model pair with the highest similarity is forcibly aggregated. Step 5: Distillation training is performed based on the trusted client aggregation model, the positive prototype set, and the negative prototype set. The trained model is then distributed to each client for the next round of iteration. Robust federated learning is achieved through multiple rounds of iteration. The classification accuracy is for each client on its own validation set. The evaluated model The accuracy for each category, wherein the evaluated model is the local model of all other clients distributed by the server, excluding the client itself, and the formula for calculating the classification accuracy is: ; In the formula, For the client For the client The Class accuracy, where Acc is a function for calculating classification accuracy; After obtaining the peer review results of classification accuracy from all clients, a voting rule is constructed to divide all clients, including: Preset a threshold Using the client Self-first Class accuracy minus threshold This yields a discriminant value; When the client For the client The Class accuracy When the value is less than the discrimination value, the voting result is recorded as " right "Cast a vote"; The server aggregates all client voting results; if a client... If the number of votes received in any category exceeds a preset threshold, the client will be... Clients are classified as drifting clients, while the remaining clients are classified as trusted clients. Drifting clients include conceptual drifting clients and malicious clients. Step 3 includes: Step 3.1: Server Update the set of model update parameters uploaded by each client. Principal component analysis is performed to update the parameter vector set of the high-dimensional model. Mapping to low-dimensional principal component space Extract one or more principal component vectors that characterize the client's change features, where, These are the parameter weights of the model; Step 3.2: Calculate the similarity between the parameter vectors of any two client models to obtain the similarity score, which reflects the degree of similarity between the client models. ; Step 3.3: Calculate the complementarity of any two clients based on the principal component vectors. To quantify the complementarity of information provided by two clients, wherein the complementarity is measured by the difference in the angle between the principal component vectors of the two clients; Step 3.4: Overall Similarity and complementarity The dynamic weights of each client in the global model aggregation are assigned according to preset rules, and the dynamic weights of all clients are combined into a dynamic aggregate weight matrix. ,in, Indicates the first in the global aggregation Client relative to the first The weighting of client contributions, and Normalize by row or column to satisfy the constraint that the sum of weights is 1.
2. The robust federated learning method based on dynamic aggregation weights and prototype guidance according to claim 1, characterized in that, Step 2 includes: Step 2.1: Extract trainable vectors representing the global normal data distribution from the trusted client. The server then converts it into a global prototype with the same shape, resulting in a prototype set. ; Step 2.2: Extract trainable vectors representing the concept skew data distribution from the drift client. The server then converts it into a global prototype with the same shape, resulting in a negative prototype set. ; Step 2.3: Store the positive prototype set and the negative prototype set on the server as the data source for distillation training.
3. The robust federated learning method based on dynamic aggregation weights and prototype guidance according to claim 1, characterized in that, The preset rules include: When the similarity between trusted clients is higher than a preset threshold but their complementarity is lower than a preset threshold, the weights are distributed equally, and the higher the complementarity, the higher the weight distribution. The lower the similarity between the drifting client and the trusted client, the lower the weight allocation.
4. The robust federated learning method based on dynamic aggregation weights and prototype guidance according to claim 1, characterized in that, The updated dynamic aggregated weight matrix includes: When the trusted client model set The similarity and complementarity among them satisfy the preset merging threshold. A pair of models At that time, exist Weights in , The weighted average merging is expressed as follows: ; The model after weighted average merging replace And update the corresponding rows and columns in the dynamic aggregate weight matrix.
5. The robust federated learning method based on dynamic aggregation weights and prototype guidance according to claim 1, characterized in that, The distillation training based on the trusted client aggregation model, the positive prototype set, and the negative prototype set includes: The trusted client aggregation model As the teacher and student models in distillation training, where training has not yet begun, It serves as both a teacher model and a student model; once training begins... Just a student model, the prototype set and negative prototype set As unlabeled training samples; Prototype set Input the student model to obtain the predicted probability distribution. The gradient of the gradient is locked as the softmax probability of the teacher model, and the softmax probability is transformed into a confidence label data structure. ; The student model is trained on the prototype set to obtain the log probability of the student model. Thus, the loss function is constructed. : ; in, For the prototype set The total number of categories included. Let cross-entropy be the loss function. In the log probability of the student model, the th The log probability of the class For the confidence label Class tags; Train the student model on the negative prototype set and construct the loss function. : ; in, negative prototype set The total number of categories included. For the prototype set The Middle The prototype vector of a class. negative prototype set The Middle The prototype vector of a class. To find the maximum value function, The preset threshold; Construct the total loss function : ; in, As a preset ratio, when the total loss function converges, a robust global model that retains the knowledge of trusted clients while suppressing the influence of drifting clients is obtained and used for the next iteration.
