A method for assigning user weights in federated learning based on explainable machine learning

By using Intergrated Gradients method that can interpret machine learning in federated learning for model interpretation and screening, the problem of malicious users or low-computer users uploading low-quality models is solved, and the convergence speed and accuracy of the global model are improved.

CN115062775BActive Publication Date: 2025-02-18NANJING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210736425.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-02-18
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

In federated learning, malicious users or low-computer power users may upload fake or poor quality models, making it difficult for global models to converge and have low accuracy. The existing average aggregation algorithm cannot effectively filter and reduce the weight of these models.

Method used

Using an interpretable machine learning method, local interpretation is performed through Intergrated Gradients, the similarity between the user uploaded model and the global model is calculated, models that do not meet the requirements are selected, weights are allocated according to the similarity during aggregation, and the global model is updated.

Benefits of technology

Effectively filter out malicious users or low-performance models, reduce their aggregation weight, and improve the convergence speed and testing accuracy of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115062775B_ABST
    Figure CN115062775B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for allocating user weights in federated learning based on interpretable machine learning, specifically: each user end first accepts a model randomly initialized by a server end, uses a local data set and trains using a random gradient descent method, and uploads the model to the server end after completing local training; after the server end receives the local model uploaded by the user end, each model is locally interpreted, and the result of each model interpretation is compared with the result of the interpretation of the global model in the previous round for similarity, and the weight of each user end model participating in aggregation is allocated according to the similarity, and the aggregated model is sent to each user end as a global model, and each user end continues to perform local training; the server end continues to accept the local model of the next round, and the aggregation is sent to the user end for training until the global model converges. The present invention can accelerate the convergence speed of the global model and improve the test accuracy of the global model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning, and in particular to a method for allocating user weights in federated learning based on explainable machine learning. Background Art

[0002] In the era of big data, machine learning can play a big role in improving product sales and assisting human decision-making. When we use machine learning models, the commonly used model performance evaluation indicators include accuracy, precision, recall, ROC curve, cost curve, etc. The high performance of the model means that the model is intelligent and "smart", but this is not enough for us to understand its operating principle. Therefore, we need to give the model "expressive ability" so that we can better understand and trust the model. In addition to a single performance evaluation, the evaluation of the model should also add a dimension to indicate the "expressive ability" of the model, and interpretability is one of them. Interpretation refers to the analysis, explanation or presentation in plain language. For a model, interpretability means that the model can be expressed in plain language, which is an ability that can be understood by humans. Specifically, it is the ability to convert the model's prediction process into rules with logical relationships. Interpretability is usually subjective. The degree of explanation varies from person to person, and it is difficult to measure it with a unified indicator. Our goal is to hope that machine learning models can "express like humans and think like humans". If the explanation of the model is consistent with our cognition and thinking mode, and can clearly express the prediction process of the model from input to output, then we will consider the model's interpretability to be good.

[0003] Federated learning is an emerging basic technology of artificial intelligence. Its design goal is to carry out efficient machine learning among multiple participants or multiple computing nodes under the premise of ensuring information security during big data exchange, protecting terminal data and personal data privacy, and ensuring legal compliance. Since federated learning requires the aggregation of local models of each participant, each participant may upload a false model for their own benefit, or upload a poor quality model due to their own computing power and data factors. For such users, the currently popular average aggregation algorithm cannot filter out poor models and reduce the weight of participating in aggregation, resulting in a significant increase in the number of communications, difficulty in model convergence, and low model accuracy. Summary of the invention

[0004] The purpose of the present invention is to provide a method for allocating federated learning user weights based on interpretable machine learning, thereby accelerating the convergence speed of the global model and improving the test accuracy of the global model.

[0005] The technical solution to achieve the purpose of the present invention is: a method for allocating user weights in federated learning based on explainable machine learning, comprising:

[0006] Step 1: The server randomly initializes the global model parameters and sends them to each user. The number of initial training times n=1 is set, and federated learning begins.

[0007] Step 2: Each user uses the local stochastic gradient descent method based on the local data set to continuously update the parameters of the global model received from the server to determine whether the number of training times reaches the threshold:

[0008] When the number of training times n reaches the predetermined number of local training times, the global model parameters after local training are uploaded to the server, and the process goes to step 3;

[0009] When the number of training times n does not reach the predetermined number of local training times, the prediction accuracy of the global model on the server side is lower than the requirement, the server side communicates with the user, accepts the global model uploaded by the user and aggregates the global model parameters, and the server side weights and averages the aggregated global model parameters to update the global model parameters on the server side, and then proceeds to step 5;

[0010] Step 3: When the prediction accuracy of the global model on the server side reaches the requirement, the local global model uploaded by each user and the global model trained last time are partially explained using the IntergratedGradients method in interpretable machine learning using the data on the server side: guided by the input sample, the contribution of each dimensional feature of the input sample to the final decision result of the global model is analyzed;

[0011] Step 4: According to the global model interpretation results corresponding to each user in step 3 and the results of the previous round of global model interpretation, two tensor matrices are obtained, and the cosine similarity of the two tensor matrices is calculated. According to the local interpretation visualization results in step 3 and the size of the similarity, the global model uploaded by each user in step 3 that does not meet the requirements is screened out. During aggregation, the weight of the global model aggregation corresponding to each user is assigned according to the size of the similarity, and the global model is updated;

[0012] Step 5: The server sends the global model obtained in step 2 or step 4 to each user;

[0013] Step 6: After each user receives the global model issued in step 5, it determines whether the number of training times reaches the threshold:

[0014] If the number of training times n does not reach the predetermined number of local training times, the number of training times is increased by 1 and the process returns to step 2, where the local data set is continued to be used to continuously update the accuracy of the global model through the local stochastic gradient descent method;

[0015] If the number of training times n reaches the predetermined number of local training times, it is determined whether the global model has converged. If not, it returns to step 1 until the global model has converged.

[0016] Furthermore, the server side mentioned in step 1 refers to a coordinator that can perform basic operations, can establish an initialized global model, and can accept global model parameters uploaded by various user sides.

[0017] Furthermore, the number of local trainings predetermined in step 2 is 10 times.

[0018] Furthermore, the local explanation in step 3 refers to the method of calculating and visualizing the neural network attribution Intergrated Gradients, which is specifically: starting from the current position, calculate the gradient every time it decreases until it decreases to the minimum value called the baseline, and finally add up all the gradients to solve the problem of gradient saturation;

[0019] Intergrated Gradients is used to calculate the gradient of the features of all dimensions of the input to the output to reflect the contribution value to the prediction result. The local global model uploaded by each user is given the same input and the contribution value of each dimension of the feature is calculated using Intergrated Gradients and compared with the calculation result of the server-side global model. The global model with a large difference in results is regarded as a model with poor performance. During aggregation, the aggregation weight of such a model with poor performance is reduced according to the calculated value.

[0020] Furthermore, the cosine similarity in step 4 refers to using the cosine value of the angle between two vectors in the vector space as a measure of the size of the difference between two individuals.

[0021] A mobile terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for allocating user weights in federated learning based on explainable machine learning is implemented.

[0022] A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps in the method for allocating user weights in federated learning based on interpretable machine learning are implemented.

[0023] Compared with the prior art, the present invention has the following significant advantages: (1) It uses an interpretable machine learning method to visualize the models uploaded by users, which can clearly screen out the models of malicious users and models with poor performance, reduce the weight of such models in the aggregation or even remove them, and improve the quality of the global model; (2) It significantly accelerates the convergence speed of the global model and improves the test accuracy of the global model. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flowchart of allocating user weights in federated learning based on explainable machine learning in the present invention.

[0025] Figure 2 It is a schematic diagram of the system during the model training process of the present invention.

[0026] Figure 3 It is a performance effect diagram of the aggregation algorithm involved in the present invention. DETAILED DESCRIPTION

[0027] The traditional average aggregation algorithm cannot distinguish between models with poor performance uploaded by malicious users or low computing power users and models uploaded by normal users, which makes it difficult for the global model to converge and has low precision. The present invention designs a method for allocating federated learning user weights based on interpretable machine learning. The method uses the local interpretation method of Intergrated Gradients to pre-test the model uploaded by the user with a small amount of data on the server side, and compares the similarity between the interpretation result and the interpretation result of the global model in the previous round. The size of the similarity reflects the real prediction ability of the model; the aggregation weight of the model with low similarity is reduced to obtain a high-precision global model.

[0028] Combination Figure 1-2 The present invention provides a method for allocating federated learning user weights based on explainable machine learning, comprising:

[0029] Step 1: The server randomly initializes the global model parameters and sends them to each user. The number of initial training times n=1 is set, and federated learning begins.

[0030] Step 2: Each user uses the local stochastic gradient descent method based on the local data set to continuously update the parameters of the global model received from the server to determine whether the number of training times reaches the threshold:

[0031] When the number of training times n reaches the predetermined number of local training times, the global model parameters after local training are uploaded to the server, and the process goes to step 3;

[0032] When the number of training times n does not reach the predetermined number of local training times, the prediction accuracy of the global model on the server side is lower than the requirement, the server side communicates with the user, accepts the global model uploaded by the user and aggregates the global model parameters, and the server side weights and averages the aggregated global model parameters to update the global model parameters on the server side, and then proceeds to step 5;

[0033] Step 3: When the prediction accuracy of the global model on the server side reaches the requirement, the global model uploaded by each user and the global model trained last time are partially explained using the IntergratedGradients method in interpretable machine learning using the data on the server side: guided by the input sample, the contribution of each dimensional feature of the input sample to the final decision result of the model is analyzed;

[0034] Step 4: According to the global model interpretation results corresponding to each user in step 3 and the results of the previous round of global model interpretation, two tensor matrices are obtained, and the cosine similarity of the two tensor matrices is calculated. According to the local interpretation visualization results in step 3 and the size of the similarity, the global model uploaded by each user in step 3 that does not meet the requirements is screened out. During aggregation, the weight of the global model aggregation corresponding to each user is assigned according to the size of the similarity, and the global model is updated;

[0035] Step 5: The server sends the global model obtained in step 2 or step 4 to each user;

[0036] Step 6: After each user receives the global model issued in step 5, it determines whether the number of training times reaches the threshold:

[0037] If the number of training times n does not reach the predetermined number of local training times, the number of training times is increased by 1 and the process returns to step 2, where the local dataset is continued to be used to continuously update the accuracy of the model through the local stochastic gradient descent method;

[0038] If the number of training times n reaches the predetermined number of local training times, it is determined whether the global model has converged. If not, it returns to step 1 until the global model has converged.

[0039] As a specific example, the server side described in step 1 refers to a coordinator that can perform basic operations, can establish an initialized global model, and can accept model parameters uploaded by various user sides.

[0040] As a specific example, the number of local training times predetermined in step 2 is 10 times.

[0041] As a specific example, the local explanation in step 3 refers to the method of calculating and visualizing neural network attribution Intergrated Gradients; in the most primitive gradient explanation Saliency map method, it is assumed that the classification result of the neural network depends linearly on each input feature, and the gradient of the output to the input can be directly used to quantify the importance of each feature to the classification decision. However, the real neural network is highly nonlinear. After a certain feature is enhanced to a certain extent, its contribution to the network decision may reach saturation. At this time, further increase will not increase the decision score, resulting in the output gradient of the input feature being 0. Intergrated Gradients is specifically: starting from the current position, the gradient is calculated every time it is reduced until it is reduced to the minimum value called the baseline, and finally all the gradients are added up to solve the problem of gradient saturation. Intergrated Gradients is used to calculate the gradient of the features of all dimensions of the input to the output to reflect the contribution value to the prediction result. The local model uploaded by each user is calculated using Intergrated Gradients with the same input for each dimension of the feature and compared with the calculation results of the global model on the server. The model with a large difference in results is regarded as a model with poor performance. When aggregating, the aggregation weight of this type of model is reduced according to the calculated value.

[0042] As a specific example, the cosine similarity in step 4 refers to using the cosine value of the angle between two vectors in the vector space as a measure of the size of the difference between two individuals.

[0043] The present invention provides a mobile terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for allocating user weights in federated learning based on explainable machine learning is implemented.

[0044] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method for allocating user weights in federated learning based on interpretable machine learning.

[0045] The present invention is further described in detail below with reference to specific embodiments.

[0046] Example

[0047] This embodiment uses a method for assigning federated learning user weights based on interpretable machine learning. The method uses the local interpretation method of Intergrated Gradients to pre-test the model uploaded by the user with a small amount of data on the server side, and compares the similarity between the interpretation result and the interpretation result of the global model in the previous round. The size of the similarity reflects the real prediction ability of the model; selects local models with lower similarity than the global model in the previous round and reduces the aggregation weight of such models to obtain a high-precision global model, which solves the problem that low-performance models uploaded by low-computing power users and malicious users damage the global model. Figure 3 It is a performance effect diagram based on the explainable AI aggregation algorithm, average aggregation algorithm, and prox algorithm.

[0048] The data island problem in the medical field is a very thorny but extremely valuable problem. Federated learning requires that the feature inputs of each hospital are consistent, and a disease label set and feature set formed by the same set of data standards are constructed, and the same set of models are constructed based on this feature standard. This technology can integrate data from multiple hospitals for joint training without leaking data, and can be applied to the prediction of the incidence of major chronic diseases. The specific process is as follows:

[0049] (1) Each participating hospital uses artificial intelligence technologies such as natural language processing and image feature extraction to clean the patient data collected from the hospital and normalize them into structured medical data;

[0050] (2) The server randomly initializes the global model parameters and sends them to each participating hospital;

[0051] (3) Each hospital's client uses the local data set to continuously update the model's accuracy through the local stochastic gradient descent method. When the predetermined number of local training times is reached, the locally trained model parameters are uploaded to the server. In the first 10 rounds, the server receives the model parameter gradients uploaded by each hospital and aggregates them. The server updates the global model parameters by weighted average of the sampled model parameters.

[0052] (4) After the 10th round, a small amount of data from the server is used to provide local explanations for the model uploaded by each hospital and the global model from the previous round;

[0053] (5) Calculate the interpretation results of each hospital client model in (4) and the interpretation results of the previous round of global model and calculate the cosine similarity between the two. According to the results of local interpretation visualization and the size of similarity, some poor models can be screened out. When aggregating, the weight of each hospital client model aggregation is assigned according to the size of similarity, and the global model is updated;

[0054] (6) Send the global model obtained in (3) or (5) to each hospital client;

[0055] (7) After receiving the global model issued by (6), each hospital client continues to use the local data set to continuously update the model accuracy through the local stochastic gradient descent method until the predetermined number of local training times is reached;

[0056] (8) Repeat operations (3) to (7) until the global model converges, and obtain a disease prediction model trained based on the data of each participating hospital.

[0057] The present invention is applicable to a federated learning framework including a server with computing functions and multiple participants. Through the technology of interpretable machine learning, a very small amount of data visualization model is used to intuitively see the defects of low-performance models in prediction tasks. It solves the problem that the traditional average aggregation algorithm cannot distinguish between low-computing power users, dishonest users and malicious users who upload low-quality models and reduce the weight of such models.

[0058] In summary, the present invention uses a better aggregation method to improve the convergence speed of the global model, reduce the number of communications, and ultimately improve the prediction accuracy of the model.

Claims

1. A method for assigning user weights in federated learning based on explainable machine learning, characterized in that: include: Step 1: The server randomly initializes the global model parameters and sends them to each user. The number of training times n=1 is initialized, and federated learning begins. Step 2: Each user uses the local stochastic gradient descent method based on the local data set to continuously update the parameters of the global model received from the server to determine whether the number of training times reaches the threshold: When the number of training times n reaches the predetermined number of local training times, the global model parameters after local training are uploaded to the server, and the process goes to step 3; When the number of training times n does not reach the predetermined number of local training times, the prediction accuracy of the global model on the server side is lower than the requirement, the server side communicates with the user, accepts the global model uploaded by the user and aggregates the global model parameters, and the server side weights and averages the aggregated global model parameters to update the global model parameters on the server side, and then proceeds to step 5; Step 3: When the prediction accuracy of the global model on the server side reaches the requirement, the local global model uploaded by each user and the global model trained last time are partially explained using the IntergratedGradients method in interpretable machine learning using the data on the server side: guided by the input sample, the contribution of each dimensional feature of the input sample to the final decision result of the global model is analyzed; Step 4: According to the global model interpretation results corresponding to each user in step 3 and the results of the previous round of global model interpretation, two tensor matrices are obtained, and the cosine similarity of the two tensor matrices is calculated. According to the local interpretation visualization results in step 3 and the size of the similarity, the global model uploaded by each user in step 3 that does not meet the requirements is screened out. During aggregation, the weight of the global model aggregation corresponding to each user is assigned according to the size of the similarity, and the global model is updated; Step 5: The server sends the global model obtained in step 2 or step 4 to each user; Step 6: After each user receives the global model issued in step 5, it determines whether the number of training times reaches the threshold: If the number of training times n does not reach the predetermined number of local training times, the number of training times is increased by 1 and the process returns to step 2, where the local data set is continued to be used to continuously update the accuracy of the global model through the local stochastic gradient descent method; If the number of training times n reaches the predetermined number of local training times, it is determined whether the global model has converged. If not, it returns to step 1 until the global model has converged.

2. The method for assigning user weights in federated learning based on explainable machine learning according to claim 1, characterized in that: The server mentioned in step 1 refers to a coordinator that can perform basic operations, build an initial global model, and accept global model parameters uploaded by various user terminals.

3. The method for assigning user weights in federated learning based on explainable machine learning according to claim 1, characterized in that: The number of local training times scheduled in step 2 is 10.

4. The method for assigning user weights in federated learning based on explainable machine learning according to claim 1, characterized in that: The local explanation in step 3 refers to the method of calculating and visualizing the neural network attribution IntergratedGradients, which is to reduce from the current position, calculate the gradient every time it is reduced until it is reduced to the minimum value called baseline, and finally add up all the gradients to solve the problem of gradient saturation; Intergrated Gradients is used to calculate the gradient of the features of all dimensions of the input to the output to reflect the contribution value to the prediction result. The local global model uploaded by each user is given the same input and the contribution value of each dimension of the feature is calculated using Intergrated Gradients and compared with the calculation result of the server-side global model. The global model with a large difference in results is regarded as a model with poor performance. During aggregation, the aggregation weight of such a model with poor performance is reduced according to the calculated value.

5. The method for assigning user weights in federated learning based on explainable machine learning according to claim 1, characterized in that: The cosine similarity in step 4 refers to using the cosine value of the angle between two vectors in the vector space as a measure of the size of the difference between two individuals.

6. A mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for allocating user weights in federated learning based on explainable machine learning as claimed in any one of claims 1 to 5 is implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method for assigning user weights in federated learning based on explainable machine learning as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Federal learning method based on dynamic adjustment model aggregation weight

    CN113112027A

  • Federal learning defecation vehicle defense method and device based on model weight change

    CN114266361A