Federal learning aggregation method based on reputation evaluation and knowledge fusion
By employing a reputation assessment and third-party knowledge fusion mechanism, Byzantine attacks and statistical heterogeneity issues in federated learning systems are addressed, improving system security and accuracy. This effectively decouples malicious attacks from heterogeneous data, enhancing system robustness and data utilization efficiency.
Patent Information
- Application Number
- CN202511736312.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-03-03
AI Technical Summary
In existing federated learning systems, Byzantine attacks and statistical heterogeneity problems are intertwined, resulting in low system security and accuracy. Existing defense mechanisms are not reliable enough, making it difficult to effectively defend against sign-flipping attacks and failing to fully utilize heterogeneous data knowledge.
By constructing a reputation assessment mechanism and a third-party knowledge fusion mechanism, the complex security algorithms related to model aggregation are centralized on the server. The client is selected using dynamic reputation scores, and local training and performance evaluation are performed. The updated global model is generated by combining third-party knowledge fusion training. The robustness of the system is improved by using reputation assessment and knowledge distillation techniques.
It effectively defends against symbol-flipping attacks, maintains high accuracy and stability, and improves system security and data utilization efficiency.
Smart Images

Figure CN121599159A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the fields of distributed machine learning and cybersecurity technology, specifically involving a federated learning aggregation method based on reputation assessment and knowledge fusion. Background Technology
[0002] As data becomes the core driving force of modern artificial intelligence, how to utilize data scattered across various locations while protecting privacy has become a key challenge. Federated learning, as a privacy-preserving distributed machine learning paradigm, is based on the core idea of "data doesn't move, model moves," meaning that the client trains the model locally and only uploads updates to the server for aggregation. This effectively solves the data silo problem caused by data privacy and security barriers.
[0003] However, due to the open and decentralized nature of federated learning, it faces two intertwined and severe challenges in real-world deployment. First, Byzantine attacks: in an open system, some clients may be malicious, uploading carefully crafted, toxic model updates to disrupt the system. These attacks include both non-targeted and targeted attacks, posing a serious threat to the system's security and reliability. Second, the problem of statistical heterogeneity: in the real world, the data distribution of different clients often varies significantly, leading to natural divergences in the parameter space of models trained locally by honest clients. These two challenges intertwine to form a deep dilemma: an honest client, exhibiting beneficial biases due to possessing unique data, may have model updates that appear dissimilar to those of other clients in the parameter space, making them geometrically indistinguishable from the model updates of a malicious attacker.
[0004] Existing defense mechanisms based on parametric space geometry rely on geometric assumptions, such as geometric clustering or orientation alignment, for core trust assessment. While these mechanisms mitigate statistical heterogeneity by introducing more complex training mechanisms on the client side, the following technical problems remain:
[0005] (1) The reliability of geometric assumptions is low.
[0006] (2) Failed to effectively defend against attacks such as symbol flipping.
[0007] (3) Low accuracy and stability.
[0008] Therefore, there is an urgent need for a new aggregation method that can overcome the limitations of parameter space-based geometric metrics and effectively decouple malicious attacks from benign data heterogeneity in the knowledge space, thereby ensuring system robustness while making full use of heterogeneous data knowledge. Summary of the Invention
[0009] To address the aforementioned technical problems in the existing technology, the purpose of this invention is to centralize all the security-related complex algorithms for model aggregation on a server by constructing a reputation assessment mechanism and a third-party knowledge fusion mechanism. The technical solution is as follows:
[0010] A federated learning aggregation method based on reputation assessment and knowledge fusion includes the following steps:
[0011] Step 1: Select Client and Distribution Model
[0012] The current global model is distributed to the client selected for training based on dynamic reputation scores.
[0013] Step 2: Local Training and Model Upload
[0014] Train the model on a local dataset and then upload the updated local model to the server.
[0015] Step 3: Conduct performance evaluation
[0016] Independent performance evaluation of the model is performed on a private validation dataset to obtain a quantitative indicator of its effective contribution, which is then converted into a dynamic reputation score.
[0017] Step 4: Conduct tripartite knowledge integration training
[0018] The three-party knowledge fusion training is performed to generate an updated global model.
[0019] Furthermore, in step 1, the specific steps for selecting clients and distributing models based on dynamic reputation are as follows:
[0020] Step 1.1: Read the reputation score currently stored on the client;
[0021] Step 1.2: Calculate the probability of a client being selected in this round, normalize the reputation scores of all clients to obtain the probability distribution, expressed as:
[0022]
[0023] in, This represents the reputation score currently stored by the client, where N represents the number of clients.
[0024] Step 1.3: Based on the preset number of participating clients m, perform weighted random sampling on the probability distribution to select m clients to participate in this round of training;
[0025] Step 1.4: Distribute the current global model to the selected m clients.
[0026] Furthermore, the specific steps for local training and model uploading in step 2 are as follows:
[0027] Step 2.1: Use the global model received by the selected client as the initial state of its local model;
[0028] Step 2.2: Train the learner on its respective local dataset;
[0029] Step 2.3: Upload the updated local model to the server.
[0030] Furthermore, in step 2.2, the learner employs a stochastic gradient descent (SGD) optimizer, based on a preset local learning rate. Given the number of training epochs E, iterate on the local dataset in mini-batch mode to minimize the local loss function.
[0031] Furthermore, in step 3, the independent performance evaluation of the model is carried out on a preset, server-private, class-balanced validation dataset. Each local model is independently evaluated to obtain a quantitative indicator of its effective contribution, and the indicator is converted into a dynamic reputation score.
[0032] Furthermore, the dynamic credit score is implemented using an EMA formula with a penalty term, the specific steps of which are as follows:
[0033] 3.1: Calculate the accuracy of each of the m participating clients in this round;
[0034] 3.2: Calculate the average accuracy of all m participating clients in this round;
[0035] 3.3: Calculate the effective contribution of each client, the calculation expression is as follows:
[0036]
[0037] in, This represents the accuracy obtained by the local model of client i after performance evaluation on the private validation dataset. This represents the average accuracy achieved by the local models of all participating clients in the current round on this private validation dataset.
[0038] 3.4: Update the client's reputation score to obtain... Its calculation expression is:
[0039]
[0040] in, This represents the reputation score of client i in round t. This represents the reputation smoothing factor.
[0041] Furthermore, in step 4, the three-party knowledge fusion training to generate the updated global model refers to using the new global model as the student model and conducting multi-objective optimization fusion training so that it learns from three knowledge sources simultaneously. The specific steps are as follows:
[0042] Step 4.1: Initialize the student model and use it as the global model to be updated;
[0043] Step 4.2: Calculate the weight of each teacher model in the knowledge fusion process;
[0044] Step 4.3: Perform cyclic training on the private validation dataset, and update the student model parameters by minimizing the total loss function of the three-party knowledge fusion;
[0045] Step 4.4: Use the student model as the global model after this round of updates.
[0046] Furthermore, the learning from the three knowledge sources includes:
[0047] (1) Learning from a teacher model composed of a high-reputation client model through knowledge distillation;
[0048] (2) Learn from the real labels of the private validation dataset through supervised learning;
[0049] (3) Learn from the historical global model through self-distillation.
[0050] Furthermore, in step 4.2, the weights of the teacher model in the knowledge fusion process are calculated through... The sharpening function is implemented, and its calculation expression is:
[0051]
[0052] in, It is a reputation sharpening factor.
[0053] Furthermore, in step 4.3, the specific steps for updating the student model parameters by minimizing the total loss function of the three-party knowledge fusion are as follows:
[0054] 4.3.1: Retrieve a batch of data (x, y) from the private validation dataset, calculate the logits output of the student model, the previous round's global model, and all m teacher models for this batch, and denote them as follows: , and ;
[0055] 4.3.2: Calculate the cross-entropy loss Its calculation expression is:
[0056]
[0057] in, Represents the cross-entropy loss function. This represents the logits output of the student model on the private validation dataset. This represents the actual label corresponding to the private verification dataset;
[0058] 4.3.3: Calculating Knowledge Distillation Losses Its calculation expression is:
[0059]
[0060] Where m represents the number of clients participating in this round, Indicates the first The logits output of each teacher model on the private validation dataset. express function, This indicates that the knowledge distillation temperature exceeds the parameter. Indicates the Kullback-Leibler divergence. Indicates the first The weighted weights of each teacher model;
[0061] 4.3.4: Calculate self-distillation loss Its calculation expression is:
[0062]
[0063] in, This represents the logits output of the previous round's global model on the private validation dataset;
[0064] 4.3.5: Calculate the total loss based on cross-entropy loss, knowledge distillation loss, and self-distillation loss. The expression for the total loss is as follows:
[0065]
[0066] in, This represents the preset loss weight hyperparameter used to adjust the knowledge distillation loss. This represents the preset loss weight hyperparameter used to adjust the intensity of self-distillation loss;
[0067] 4.3.6: Update the parameters of the student model using the Adam optimizer based on the gradient of the total loss.
[0068] Beneficial effects: (1) Effectively defends against attacks such as symbol flipping. (2) Maintains high accuracy and stability in statistically heterogeneous scenarios. Attached Figure Description
[0069] Figure 1 This is an overall flowchart of the federated learning aggregation method based on reputation assessment and knowledge fusion of the present invention.
[0070] Figure 2 This is a flowchart of the client selection and model distribution based on dynamic reputation of the present invention;
[0071] Figure 3 This is a flowchart of the client-side local training and model upload process of the present invention;
[0072] Figure 4 A flowchart illustrating the performance-based reputation assessment mechanism implemented on the server in this invention;
[0073] Figure 5 The flowchart illustrates the server-side execution of the third-party knowledge fusion mechanism of this invention. Detailed Implementation
[0074] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0075] like Figure 1 As shown, the federated learning aggregation method based on reputation assessment and knowledge fusion of the present invention includes the following steps:
[0076] S1: The server selects clients based on their dynamic reputation scores and distributes the global model to the selected clients, specifically as follows: Figure 2 As shown, the detailed steps are as follows:
[0077] S11: At the start of each round (round t), the server first reads the reputation scores currently stored by all N clients. In the initial round of the system, all clients' reputation scores are initialized to the same positive value;
[0078] S12: Based on the dynamic reputation score read, the server calculates the probability of each client i being selected in this round. This probability is related to the client's reputation score in this round. Proportional to the credit scores of all clients, the probability distribution is obtained by normalizing the scores. The calculation expression is as follows:
[0079]
[0080] in, This represents the reputation score currently stored by the client, where N represents the number of clients.
[0081] S13: The server, based on the preset number of participating clients m, calculates the probability distribution... We will perform weighted random sampling to select m clients to participate in this round of training.
[0082] S14: The server will update the current global model. Distribute the model parameters to the selected m clients, which means that all model parameters that constitute the global model are transmitted to the clients over the network.
[0083] S2: The selected client trains the model locally and then uploads it, the process is as follows. Figure 3 As shown, the specific steps are as follows:
[0084] S21: The selected client receives the global model. Then, its parameters are used as the initial state of its local model;
[0085] S22: Each client uses a local learner on its own local dataset. The learner is trained on a local learning rate using a stochastic gradient descent (SGD) optimizer. Given the number of local training rounds E, iterate on the local dataset in mini-batch mode to minimize a local loss function;
[0086] S23: After training is complete, the client will update the local model. Uploading to the server involves uploading all updated model parameters that constitute the local model. However, some malicious clients might tamper with the trained model parameters before uploading.
[0087] S3: The server performs a performance-based reputation assessment mechanism. The server uses a private verification dataset. The process involves evaluating model performance and updating client reputation scores, as follows: Figure 4 As shown, the specific steps are as follows:
[0088] S31: After receiving all m participating local model parameters, the server does not immediately perform aggregation. Instead, it first creates a temporary model with the same network architecture on the server side, and then aggregates the model parameters W received from client i. i t+1 The model is loaded into the server, thus completely reconstructing the local model of client i on the server side. Then, it is used on a pre-set, server-private, class-balanced validation dataset. Above, for each local model Perform independent performance evaluations. The results of the performance evaluations are used to evaluate the model on this private validation dataset. accuracy ;
[0089] S32: Based on the accuracy of each of the m participating clients obtained in step S31 The server first calculates the average accuracy for this round. .
[0090] S33: For each client i, the server sets its respective accuracy... Compared with the average accuracy calculated in step S32 Compare these figures to calculate the effective contribution of each client in this round. Its calculation expression is:
[0091]
[0092] S34: The server combines the client i's historical reputation score. and the current effective contribution calculated in step S33 The client's dynamic reputation score is updated using an EMA formula with a penalty term, resulting in a new reputation score for use in the next round. Its calculation expression is:
[0093]
[0094] in, Let i be the reputation score of client i in round t. This is a reputation smoothing factor.
[0095] S4: The server executes a three-party knowledge fusion mechanism. The server employs a three-party knowledge fusion mechanism, using a new global model as the student model. Through a multi-objective optimization fusion training process, it learns simultaneously from three knowledge sources: knowledge distillation from a teacher model composed of high-reputation client models, supervised learning from the real labels of the private validation dataset, and self-distillation from the historical global model. Through this mechanism, the server generates a global model updated for this round, as follows: Figure 5 As shown, the specific steps are as follows:
[0096] S41: The server initializes a student model. As the global model to be updated, its parameters are compared with those of the previous global model. same;
[0097] S42: The server updates the reputation score based on the information provided in step S32. ,pass The sharpening function is for each teacher model Calculate its weight in the knowledge fusion process. Its calculation expression is:
[0098]
[0099] in, It is a reputation sharpening factor;
[0100] S43: The server is using a private verification dataset. Up, proceed The cyclic training process involves minimizing the total loss function of the three-party knowledge fusion. To update the student model The specific steps are as follows:
[0101] (1) In each training iteration, from Take a data batch (x, y) from the dataset and calculate the student model. The previous round of global model and all m teacher models The logits output for this batch are denoted as follows: , and .
[0102] (2) Calculate the cross-entropy loss Its calculation expression is:
[0103]
[0104] in, Let cross-entropy be the loss function. For the student model In the private verification dataset The logits output on the screen, For the private validation dataset The corresponding real tags.
[0105] (3) Calculate knowledge distillation loss Its calculation expression is:
[0106]
[0107] Where m is the number of clients participating in this round. for In the private verification dataset The logits output on the screen, The function is Softmax, where T is the knowledge distillation temperature hyperparameter, used to smooth the output probability distribution to extract richer inter-class relationship knowledge; Kullback-Leibler divergence is used to measure the difference between probability distributions; For teacher model The weighted weights.
[0108] (4) Calculate the self-distillation loss Its calculation expression is:
[0109]
[0110] in, For the previous round of global model In the private verification dataset The logits output, where T is the knowledge distillation temperature hyperparameter, is used to encourage the student model. To prevent catastrophic amnesia, we must remain consistent with our historical state.
[0111] (5) Based on cross-entropy loss Knowledge distillation loss and self-distillation loss The total loss is calculated using the following expression:
[0112]
[0113] in, This represents the preset loss weight hyperparameter used to adjust the knowledge distillation loss. This represents the preset loss weight hyperparameter used to adjust the intensity of self-distillation loss; cross-entropy loss. Used to convert student models Knowledge anchored in private validation datasets In objective reality; knowledge distillation loss Used to extract collective wisdom from high-reputation teacher models; self-distillation loss This is used to ensure the intergenerational stability of global model knowledge.
[0114] (6) Update the student model using the Adam optimizer based on the gradient of the total loss. The parameters.
[0115] S44: Global Model Update: The student model obtained after fusion training. This will become the safe global model in this update. .
[0116] At the end of a global model iteration round, the updated global model generated in step S4 will be designated by the server as the current global model for the next round. Subsequently, the system will start a new global model iteration round, repeating the aforementioned steps S1 to S4. This global model iteration process will continue until the total number of rounds reaches a preset value.
[0117] It should be understood that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although this specification has described the present invention in detail with reference to the above embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A federated learning aggregation method based on reputation assessment and knowledge fusion, characterized in that, Includes the following steps: Step 1: Select Client and Distribution Model The current global model is distributed to the client selected for training based on dynamic reputation scores. Step 2: Local Training and Model Upload Train the model on a local dataset and then upload the updated local model to the server. Step 3: Conduct performance evaluation Independent performance evaluation of the model is performed on a private validation dataset to obtain a quantitative indicator of its effective contribution, which is then converted into a dynamic reputation score. Step 4: Conduct tripartite knowledge integration training The three-party knowledge fusion training is performed to generate an updated global model.
2. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 1, characterized in that, In step 1, the specific steps for selecting clients and distributing models based on dynamic reputation are as follows: Step 1.1: Read the reputation score currently stored on the client; Step 1.2: Calculate the probability of a client being selected in this round, normalize the reputation scores of all clients to obtain the probability distribution, the expression of which is: Among them, among them, This represents the reputation score currently stored by the client, where N represents the number of clients. Step 1.3: Based on the preset number of participating clients m, perform weighted random sampling on the probability distribution to select m clients to participate in this round of training; Step 1.4: Distribute the current global model to the selected m clients.
3. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 1, characterized in that, In step 2, the specific steps for local training and model uploading are as follows: Step 2.1: Use the global model received by the selected client as the initial state of the local model; Step 2.2: Train the learner on its respective local dataset; Step 2.3: Upload the updated local model to the server.
4. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 3, characterized in that, In step 2.2, the learner uses a stochastic gradient descent (SGD) optimizer, based on a preset local learning rate. Given the number of training epochs E, iterate on the local dataset in mini-batch mode to minimize the local loss function.
5. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 1, characterized in that, In step 3, the independent performance evaluation of the model is carried out on a preset, server-private, class-balanced validation dataset. Each local model is evaluated independently to obtain a quantitative indicator of its effective contribution, and the indicator is converted into a dynamic reputation score.
6. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 5, characterized in that, The dynamic credit score is implemented using an EMA formula with a penalty term, and the specific steps are as follows: Step 3.1: Calculate the accuracy of each of the m participating clients in this round; Step 3.2: Calculate the average accuracy of all m participating clients in this round; Step 3.3: Calculate the effective contribution of each client, the calculation expression is as follows: in, This represents the accuracy obtained by the local model of client i after performance evaluation on the private validation dataset. This represents the average accuracy achieved by the local models of all participating clients in the current round on this private validation dataset. Step 3.4: Update the client's reputation score to obtain... Its calculation expression is: in, This represents the reputation score of client i in round t. This represents the reputation smoothing factor.
7. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 1, characterized in that, In step 4, the three-party knowledge fusion training to generate the updated global model involves using the new global model as a student model and conducting multi-objective optimization fusion training, enabling it to learn from three knowledge sources simultaneously. The specific steps are as follows: Step 4.1: Initialize the student model and use it as the global model to be updated; Step 4.2: Calculate the weight of each teacher model in the knowledge fusion process; Step 4.3: Perform cyclic training on the private validation dataset, and update the student model parameters by minimizing the total loss function of the three-party knowledge fusion; Step 4.4: Use the student model as the global model after this round of updates.
8. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 7, characterized in that, The learning from the three knowledge sources includes: (1) Learning from a teacher model composed of a high-reputation client model through knowledge distillation; (2) Learn from the real labels of the private validation dataset through supervised learning; (3) Learn from the historical global model through self-distillation.
9. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 7, characterized in that, In step 4.2, the weights of the teacher model in the knowledge fusion process are calculated through... The sharpening function is implemented, and its calculation expression is: in, It is a reputation sharpening factor.
10. The federated learning aggregation method based on reputation assessment and knowledge fusion according to claim 7, characterized in that, In step 4.3, the specific steps for updating the student model parameters by minimizing the total loss function of the three-party knowledge fusion are as follows: Step 4.3.1: Retrieve a batch of data (x, y) from the private validation dataset, calculate the logits output of the student model, the previous round global model, and all m teacher models for this batch, and denot them as follows: , and ; Step 4.3.2: Calculate the cross-entropy loss Its calculation expression is: in, Represents the cross-entropy loss function. This represents the logits output of the student model on the private validation dataset. This represents the actual label corresponding to the private verification dataset; Step 4.3.3: Calculate knowledge distillation loss Its calculation expression is: Where m represents the number of clients participating in this round, This represents the logits output of the i-th teacher model on the private validation dataset. express function, This indicates that the knowledge distillation temperature exceeds the parameter. Indicates the Kullback-Leibler divergence. This represents the weighted weight of the i-th teacher model; Step 4.3.4: Calculate self-distillation loss Its calculation expression is: in, This represents the logits output of the previous round's global model on the private validation dataset; Step 4.3.5: Calculate the total loss based on the cross-entropy loss, knowledge distillation loss, and self-distillation loss. The expression for the total loss is as follows: in, This represents the preset loss weight hyperparameter used to adjust the knowledge distillation loss. This represents the preset loss weight hyperparameter used to adjust the intensity of self-distillation loss; Step 4.3.6: Update the parameters of the student model using the Adam optimizer based on the gradient of the total loss.
Citation Information
Cited By
Multi-index federal optimization method and system for human body activity recognition and medium
CN122090514A
Multi-index federated optimization methods, systems, and media for human activity recognition
CN122090514B