Federal learning-based machine learning model training method and device
By evaluating the client reputation value and designing personalized contracts in federated learning, the problems of privacy leakage and high resource costs in traditional machine learning are solved, the security and efficiency of data privacy protection and model aggregation are achieved, and the federated learning system is improved. overall reliability and adaptability.
Patent Information
- Application Number
- CN202410880422.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-20
AI Technical Summary
The traditional machine learning paradigm has inefficiencies and risks of privacy leakage in data collection and use. Although federated learning improves privacy protection and alleviates network congestion, it still lacks effective protection against external attacks and has limited resources. Clients are costly and malicious. Security risk of clients providing fake model updates.
By evaluating the reputation value based on the client's historical interaction trust records in federated learning, selecting trusted clients, designing personalized privacy levels and type contracts, performing privacy perturbation and model update parameter aggregation, and combining reputation values and privacy levels. Quality assessment and reward distribution ensure the safety and efficiency of model training.
Effectively protect data privacy, resist external attacks, reduce network traffic congestion, improve client participation enthusiasm and model aggregation robustness, enhance system adaptability and flexibility, and ensure the accuracy and stability of the global model.
Smart Images

Figure CN118674070A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Internet of Things security technology, and specifically relates to a machine learning model training method and device based on federated learning. Background Art
[0002] With the rapid popularization of distributed computing devices such as mobile smart devices and drones, the amount of data generated at the edge of the network has shown an unprecedented surge. These data are extremely valuable and provide rich resources for the construction of machine learning models, promoting the rapid development of smart applications such as smart cities and smart healthcare. However, the traditional machine learning paradigm faces major challenges in data collection and use, especially the problem of privacy leakage. In the traditional machine learning paradigm, in order to train the model, data from data owners needs to be collected and stored centrally. This data centralization method is not only inefficient, but also has serious risks of privacy leakage. Once the data center is attacked or the data is leaked by internal personnel, it may lead to the leakage of personal privacy information, causing immeasurable losses to individuals and society.
[0003] To solve this problem, federated learning has emerged as a new distributed AI paradigm. Federated learning allows data owners to collaboratively train AI models under the scheduling of a federated server while keeping the data local. In federated learning, clients only need to transmit model updates containing relatively small amounts of data to the federated server, which reduces the amount of data transmission and the risk of network congestion, while also enhancing the privacy protection of participating clients.
[0004] However, despite the significant advantages of federated learning in protecting privacy and alleviating network congestion, there are still some challenges and problems. First, since the model updates uploaded by the client may contain sensitive information, it is still possible for attackers to infer this data through reasoning attacks. Therefore, the current federated learning framework lacks an effective privacy protection scheme to defend against external attackers. Second, resource-limited clients need to frequently train local models when participating in the federated learning process, which will bring significant costs to the client, including energy consumption, computing resource consumption, and potential privacy leakage risks. These costs may reduce the willingness of clients to participate in federated learning, thereby affecting the efficiency and effectiveness of the entire federated learning system. Finally, due to the untrustworthiness of the client, there may be malicious clients that provide false local model updates to disrupt the federated learning process. These false model updates may cause the performance of the global model to degrade or even fail, posing serious security risks to the entire federated learning system. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a machine learning model training method and device based on federated learning, which aims to solve the above problems.
[0006] In order to solve the above technical problems, the present invention is implemented by the following technical solutions:
[0007] A method for training a machine learning model based on federated learning is applied to a federated server in a training system composed of a federated server and a plurality of clients communicating with the federated server;
[0008] The training method comprises:
[0009] During each round of global iterative training, at least the following steps are performed:
[0010] Evaluate the reputation value of each client based on the trusted record of historical interactions with each client, and select clients that meet the requirements based on the reputation value;
[0011] Receiving the privacy level and type sent by the client that meets the requirements, and designing a contract set including the training sample size and the reward according to the privacy level and type of the client that meets the requirements; wherein the privacy level and type are inherent attributes of each client that meets the requirements;
[0012] Send the global model and contract set to the clients that meet the requirements;
[0013] Receive the privacy-perturbed local model update parameters sent by the clients that meet the requirements, and combine the training sample size, privacy level and reputation value in the current round corresponding to the clients that meet the requirements to aggregate the privacy-perturbed local model update parameters to obtain the global model update parameters; wherein the privacy-perturbed local model update parameters refer to the local model update parameters obtained after each client that meets the requirements selects a matching contract item from the contract set according to the inherent attributes, selects samples for local model training according to the training sample size specified in the contract item, and performs privacy perturbation on the trained local model update parameters according to the privacy level;
[0014] A reward is sent to clients that meet the requirements, a quality assessment is performed on the local model update parameters after privacy perturbation, and the corresponding historical interaction trusted records are updated according to the quality assessment results; wherein the reward is the reward specified in the matching contract item selected by each client that meets the requirements from the contract set according to inherent attributes.
[0015] Furthermore, the reputation value of each client is evaluated based on the trusted record of historical interactions with each client, specifically:
[0016] Defined as follows: In the tth round of global iteration, the trusted record of historical interactions between the federated server and each client m is expressed as:
[0017]
[0018] in, Indicates that client m is credible in the tth round of global iteration, otherwise
[0019] The reputation value of each client is evaluated based on the historical interaction trust records of each client, expressed as:
[0020]
[0021] In the formula, is the reputation value of client m in the tth round of global iteration; It is the trusted record of the interaction of client m in the kth round of global iteration; is the attenuation factor; t k is the current global iteration round.
[0022] Further, selecting a client meeting the requirement according to the reputation value includes:
[0023] Arrange the reputation values of all clients in descending order;
[0024] The clients that are located before the set ranking threshold are selected as the clients that meet the requirements.
[0025] Furthermore, the contract set including the training sample size and reward is designed according to the privacy level and type of the client that meets the requirements, including:
[0026] Establish contract models based on the privacy levels and types of clients that meet the requirements;
[0027] Based on the contract model, the subjective utility function of the federated server and the utility function of the client that meets the requirements are formulated using prospect theory;
[0028] According to the subjective utility function of the federated server and the utility function of the clients that meet the requirements, the contract theory driven by prospect theory is used to design the optimal contract that includes the training sample size and reward of each client that meets the requirements to form a contract set.
[0029] Furthermore, the contract model is:
[0030] Λ(Θ,Ψ)={φ j,l , 1≤j≤J, 1≤l≤L}
[0031] In the formula, φ j,l =(d j,l , rj,l ) is a contract item for a client of type (j, l), d j,l is the training sample size, r j,l is the reward; Θ=(θ j : 1≤j≤J} is a set of J training cost types; is a set of L privacy leakage cost types;
[0032] The utility function of the client that meets the requirements is:
[0033]
[0034] In the formula, u j,l is the utility function of a client of type (j, l); θ j is the training cost type of a client of type (j, l); is the privacy leakage cost type of the client of type (j, l);
[0035] The subjective utility function of the federated server is:
[0036]
[0037] Where γ and ζ are risk parameters; δ is the risk aversion of the federated server; U ref is the reference point of the federated server settings; β is the number of clients of type (j, l); U S,j,l =ω s ln(1+d j,l )-r j,l is the objective utility function of the federated server for clients of type (j, l), where the first term is the user satisfaction that is a logarithmic function of the training sample size, and the second term is the reward paid to the client that participates in model training; ω s is the satisfaction parameter of the federated server.
[0038] Furthermore, according to the subjective utility function of the federated server and the utility function of the client that meets the requirements, the contract theory driven by prospect theory is used to design the optimal contract including the training sample size and reward of each client that meets the requirements, specifically:
[0039] The optimization problem of the optimal contract is to maximize the subjective utility function of the federated server while satisfying individual rationality constraints and incentive compatibility constraints for different types of clients that meet the requirements;
[0040] The marginal cost is introduced to convert the training sample size and privacy level of the client that meets the requirements into a one-dimensional marginal cost type, and the optimal contract design problem is rewritten as an optimal contract optimization problem of the one-dimensional marginal cost type;
[0041] By simplifying the individual rationality constraints and incentive compatibility constraints of the clients that meet the requirements, the optimal contract optimization problem of the one-dimensional marginal cost type is transformed into a relaxed one-dimensional marginal cost type optimal contract design problem, and the relaxed one-dimensional marginal cost type optimal contract design problem is solved to obtain the optimal relaxed solution of the training sample size-reward contract under a completely rational situation;
[0042] The optimal relaxation solution of the training sample size-reward contract under the completely rational situation is further analyzed to obtain the optimal relaxation solution of the optimal contract design problem driven by prospect theory. At the same time, the optimal relaxation solution that does not meet the monotonicity constraint is dynamically assigned to complete the dynamic allocation of the optimal contract.
[0043] Furthermore, the optimal relaxation solution of the training sample size-reward contract under the completely rational situation is further analyzed to obtain the optimal relaxation solution of the optimal contract design problem driven by prospect theory, which is specifically:
[0044] To U S,i ≥U ref , 1≤i≤JL, the optimal contract training sample size of the relaxed one-dimensional marginal cost type optimal contract design problem is: in, is the marginal cost of a client of type (j, l); using the marginal cost, a client of type (j, l) is converted to a client of type i; the optimal contract reward of the relaxed one-dimensional marginal cost type optimal contract design problem is: Among them, α(Φ JL ) is the marginal cost of type JL client; d JL,PT is the optimal contract training sample size for type JL clients; α(Φ k ) is the marginal cost of type k client;
[0045] To U S,i <U ref , 1≤i≤JL, the optimal contract training sample size and optimal contract reward of the relaxed one-dimensional marginal cost type optimal contract design problem are related to U S,i ≥U ref , the optimal contract training sample size and the optimal contract reward are consistent when 1≤i≤JL;
[0046] To U S,JL ≤…≤U S,y ≤…≤U S,n+1 ≤U ref ≤U S,n ≤…≤U S,x ≤…≤U S,1,,The optimal contract training sample size of the relaxed one-dimensional marginal cost type optimal contract design problem is: The optimal contract reward for the relaxed one-dimensional marginal cost type optimal contract design problem is:
[0047] Furthermore, the optimal relaxed solution that does not satisfy the monotonicity constraint is dynamically assigned, specifically:
[0048] The federated server sorts the optimal contract training sample sizes of all clients that meet the requirements according to the marginal cost type. When there is an optimal contract training sample size that violates the monotonicity constraint, the clustering and ironing algorithm is used to adjust the client's optimal contract training sample size sequence to satisfy the monotonicity constraint, thereby obtaining the adjusted optimal contract training sample size. At the same time, the optimal contract reward is calculated based on the adjusted optimal contract training sample size.
[0049] Furthermore, combined with the training sample size, privacy level, and reputation value of the client that meets the requirements in the current round, the local model update parameters after privacy perturbation are aggregated to obtain the global model update parameters, which are:
[0050]
[0051] In the formula, Update the parameters of the local model of the client of type i; μ t+1 is the global model parameter of the (t+1)th iteration; ε i is the privacy level of client of type i; β i is the number of clients of type i.
[0052] A machine learning model training device based on federated learning is applied to a federated server in a training system composed of a federated server and a plurality of clients communicating with the federated server;
[0053] The training device comprises:
[0054] A selection module is used to evaluate the reputation value of each client based on the historical interaction trust records with each client, and select the client that meets the requirements according to the reputation value;
[0055] A contract design module, used to receive the privacy level and type sent by the client that meets the requirements, and design a contract set including the training sample size and the reward according to the privacy level and type of the client that meets the requirements; wherein the privacy level and type are inherent attributes of each client that meets the requirements;
[0056] The task delivery module is used to send the global model and contract set to the clients that meet the requirements;
[0057] An aggregation module is used to receive the local model update parameters after privacy perturbation sent by the clients that meet the requirements, and to aggregate the local model update parameters after privacy perturbation in combination with the training sample size, privacy level and reputation value in the current round corresponding to the clients that meet the requirements to obtain the global model update parameters; wherein the local model update parameters after privacy perturbation refer to the local model update parameters obtained after each client that meets the requirements selects a matching contract item from the contract set according to the inherent attributes, selects a sample according to the training sample size specified in the contract item for local model training, and performs privacy perturbation on the trained local model update parameters according to the privacy level;
[0058] The reward distribution and interactive trusted record update module is used to send rewards to clients that meet the requirements, perform quality assessment on the local model update parameters after privacy perturbation, and update the corresponding historical interactive trusted records according to the quality assessment results; wherein, the reward is the reward specified in the matching contract item selected by each client that meets the requirements from the contract set according to inherent attributes.
[0059] Compared with the prior art, the present invention has at least the following beneficial effects:
[0060] The present invention provides a method for training a machine learning model based on federated learning. Through the federated learning framework, the client does not need to upload the original data, but only transmits the local model update parameters, thereby effectively protecting the privacy and security of the data. Personalized privacy budgets are allocated to different clients, and privacy disturbances are performed in the local model update, which effectively resists the inference attack of external attackers and further enhances the security of the data. Compared with the traditional cloud server-centric machine learning model training method, the client in the present invention only periodically transmits local model updates consisting of a relatively small amount of data to the server, thereby significantly reducing the amount of data transmission and effectively alleviating the problem of network traffic congestion. By designing a contract including the training sample size and reward according to the privacy level and type of the client that meets the requirements, the optimal participation incentive is provided for the differentiated training cost and privacy emphasis of the client, which not only meets the constraints of personal rationality and incentive compatibility, but also stimulates the enthusiasm of the client to participate in high-quality model training. Considering the heterogeneity and privacy requirements of the client, a personalized privacy budget and contract set are designed for each client, showing high adaptability and flexibility, and being able to cope with the federated learning needs in different scenarios. By using reputation evaluation based on the client's historical interaction trusted records, the quality of the local model update parameters provided by the client is evaluated, and the historical interaction trusted records are updated based on the evaluation results, and then the client's reputation value is updated, so that trustworthy clients are selected to participate in model training, which improves the overall reliability of federated learning. When aggregating the local model updates provided by the client, the federated server not only considers the client's reputation value, but also combines the training sample size and privacy level factors, making the model aggregation process more robust and improving the accuracy and stability of the final global model.
[0061] In summary, the machine learning model training method based on federated learning of the present invention shows significant advantages in improving data security, alleviating network traffic congestion, enhancing the enthusiasm of participants, enhancing the reliability of federated learning, improving the robustness of model aggregation, and enhancing the adaptability and flexibility of the system.
[0062] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions in the specific implementation modes of the present invention, the drawings required for use in the description of the specific implementation modes will be briefly introduced below. Obviously, the drawings described below are some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0064] Figure 1This is a flow chart of a method for training a machine learning model based on federated learning according to an embodiment of the present invention;
[0065] Figure 2 This is a flowchart of a machine learning model training method based on federated learning according to another embodiment of the present invention;
[0066] Figure 3 Dynamic reputation management flow chart for clients;
[0067] Figure 4 Design graphs for differentially private local model perturbations;
[0068] Figure 5 Design a graph for the optimal training sample size-reward contract;
[0069] Figure 6 Flowchart for differentially private federated learning with robust aggregation. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0071] like Figure 1 As shown, an embodiment of the present application provides a machine learning model training method based on federated learning, which is particularly suitable for a training system composed of a federated server and multiple clients communicating with it. That is, the training system consists of a federated server and multiple clients, wherein the federated server is responsible for the iterative update of the global model and the coordinated management of the clients, while the clients hold their own local data sets and perform local model training.
[0072] The training method of this embodiment is applied to a federated server in a training system, and the training method includes:
[0073] During each round of global iterative training, at least the following steps are performed:
[0074] S101. Evaluate the reputation value of each client based on the historical interaction trust records with each client, and select a client that meets the requirements according to the reputation value.
[0075] Specifically, before each round of global iterative training begins, the federated server will evaluate the reputation value of each client based on the trusted records of historical interactions with each client. The reputation value reflects the reliability, data quality, and behavioral compliance of the client during past training. The federated server will select clients that meet the requirements to participate in this round of global model training based on the reputation value.
[0076] S102, receiving the privacy level and type sent by the client that meets the requirements, and designing a contract set including training sample size and reward according to the privacy level and type of the client that meets the requirements, wherein the privacy level and type are inherent attributes of each client that meets the requirements.
[0077] Specifically, the federated server receives privacy level and type information sent by clients that meet the requirements. This information is the inherent attribute of the client and reflects the privacy sensitivity and protection requirements of its data. Based on this information, the federated server will design a contract set containing different training sample sizes and rewards. The contract items in the contract set will serve as incentives and constraints for the corresponding clients to participate in this round of training.
[0078] S103: Send the global model and contract set to clients that meet the requirements.
[0079] Specifically, the federated server sends the global model and contract set to the clients that meet the requirements. The clients that meet the requirements will select matching contract items from the contract set according to their own privacy level and type. Then, the client will select samples for local model training according to the training sample size specified in the contract item, and perform privacy perturbation processing on the updated parameters of the trained local model according to the privacy level to protect data privacy.
[0080] S104. Receive the local model update parameters after privacy disturbance sent by the client that meets the requirements, and combine the training sample size, privacy level and reputation value in the current round corresponding to the client that meets the requirements to aggregate the local model update parameters after privacy disturbance to obtain the global model update parameters.
[0081] It should be understood that the local model update parameters after privacy perturbation refer to the local model update parameters obtained after each client that meets the requirements selects a matching contract item from the contract set according to the inherent attributes, selects samples for local model training according to the training sample size specified in the contract item, and performs privacy perturbation on the trained local model update parameters according to the privacy level.
[0082] That is, the client sends the local model update parameters after privacy perturbation to the federated server. The federated server will aggregate the received local model update parameters based on the training sample size, privacy level, and reputation value of each client in the current round to obtain the global model update parameters. This aggregation process will comprehensively consider the contributions and credibility of different clients to ensure the accuracy and reliability of the global model.
[0083] S105: Send rewards to clients that meet the requirements, perform quality assessment on the local model update parameters after privacy disturbance, and update the corresponding historical interaction trusted records according to the quality assessment results. The reward is the reward specified in the matching contract item selected by each client that meets the requirements from the contract set according to the inherent attributes.
[0084] Specifically, the federated server will issue corresponding rewards to clients that meet the requirements based on their performance in this round of training. These rewards are stipulated in the contract set and are intended to encourage clients to actively participate in training and provide high-quality data and model update parameters. At the same time, the federated server will also conduct a quality assessment of the local model update parameters after privacy perturbation, and update the corresponding historical interaction trusted records based on the assessment results to update the client's reputation value.
[0085] In a possible implementation, the reputation value of each client is evaluated based on the historical interaction trustworthy record with each client, which may be:
[0086] In each round of global iterative training, the federated server records the interaction with each client, including the quality of the data, the accuracy of the transmission, and whether the training protocol is followed. Based on these interactions, a historical interaction trusted record is defined to represent the client's behavior in past iterations.
[0087] Specifically, it is defined that in the tth round of global iteration, the historical interaction trust record between the federation server and each client m is expressed as:
[0088]
[0089] in, Indicates that client m is credible in the tth round of global iteration, otherwise
[0090] Reputation is a cumulative indicator that takes into account not only the behavior of the current round, but also the behavior of previous rounds.
[0091] Therefore, the reputation value of each client is evaluated based on its historical interaction trustworthy records. The calculation formula is:
[0092]
[0093] In the formula, is the reputation value of client m in the tth round of global iteration; is the interactive trusted record of client m in the kth round of global iteration; τ is the decay factor; t k The current global iteration number.
[0094] The reputation value calculation formula takes into account the client's behavior during the entire training process and gives more weight to more recent behaviors. In this way, even if a client performs poorly in the early stage, as long as the subsequent behavior is good, its reputation value still has a chance to be improved.
[0095] In a possible implementation, a client meeting the requirements is selected according to the reputation value, which may be:
[0096] First, the reputation values of all clients are sorted in descending order. This operation clarifies the relative credibility of each client in the current round.
[0097] Finally, the clients that are ranked before the set ranking threshold are selected as clients that meet the requirements. These clients will serve as participants in this round of global model training, interact with the federated server, and provide local model update parameters.
[0098] It should be noted that the ranking threshold can be set according to actual needs, for example, the top 50% of clients, or the top 10 clients, etc. This threshold determines which clients will be considered to meet the requirements and participate in the global model training of this round.
[0099] In this implementation, since clients with higher reputation values are selected to participate in the training, the local model update parameters provided by these clients are of higher quality, which is conducive to improving the performance of the global model. By screening the reputation value, clients that may have malicious behavior or low data quality can be excluded, thereby reducing the risk of system attacks or data pollution and enhancing the security and robustness of the system. Since the reputation value is calculated based on the trusted records of historical interactions, each client has the opportunity to improve its reputation value through good behavior, thereby obtaining more participation opportunities and rewards, and promoting fair competition among clients.
[0100] In a possible implementation, a contract set including training sample size and reward is designed according to the privacy level and type of the client that meets the requirements, including the following steps:
[0101] a. Establish a contract model based on the privacy level and type of clients that meet the requirements.
[0102] In one embodiment, the contract model is:
[0103] Λ(Θ,Ψ)={φ j,l , 1≤j≤J, 1≤l≤L}
[0104] In the formula, φ j,l =(d j,l , r j,l ) is a contract item for a client of type (j, l), d j,l is the training sample size, r j,l is the reward; Θ={θ j : 1≤j≤J} is a set of J training cost types; is a set of L privacy leakage cost types;
[0105] b. Based on the contract model, the prospect theory is used to formulate the subjective utility function of the federated server and the utility function of the client that meets the requirements.
[0106] It should be noted that prospect theory is a theory that describes people's decision-making behavior when facing uncertainty. It can help more accurately predict and evaluate the behavioral preferences and decision results of all parties. The subjective utility function of the federated server mainly focuses on the efficiency of global model training, data security, and cost-effectiveness; while the utility function of the client that meets the requirements focuses more on factors such as its degree of privacy protection, reward size, and the cost of participating in training.
[0107] In one embodiment, the utility function of the client that meets the requirements is:
[0108]
[0109] In the formula, θ j is the training cost type of a client of type (j, l); is the privacy leakage cost type of the client of type (j, l); u j,l is the utility function of a client of type (j, l).
[0110] In one embodiment, the subjective utility function of the federated server is:
[0111]
[0112] Where γ and ζ are risk parameters; δ is the risk aversion of the federated server; U ref is the reference point of the federated server settings; β is the number of clients of type (j, l); U S,j,l =ω s ln(1+d j,l )-r j,lis the objective utility function of the federated server for clients of type (j, l), where the first term is the user satisfaction that is a logarithmic function of the training sample size, and the second term is the reward paid to the client that participates in model training; ω s is the satisfaction parameter of the federated server.
[0113] c. Based on the subjective utility function of the federated server and the utility function of the clients that meet the requirements, the contract theory driven by prospect theory is used to design the optimal contract that includes the training sample size and reward of each client that meets the requirements to form a contract set.
[0114] Specifically, in order to model the decision-making process of the federated server in a risky and uncertain environment, prospect theory is applied to capture the subjective decision-making bias of the federated server, thereby formulating a utility function, and using the contract theory driven by prospect theory to design an optimal contract that includes the training sample size and reward for each client that meets the requirements. The contract design process is an optimization problem that aims to find the contract parameters that maximize the equilibrium point of the utility function of the federated server and the client. By solving this optimization problem, a set of optimal contract parameters can be obtained, including the training sample size and corresponding reward for each client. These contract parameters will constitute a contract set to guide the behavior of the client in local model training.
[0115] In this implementation, a contract set including training sample size and reward is designed based on the privacy level and type of the client that meets the requirements. This approach has the following advantages:
[0116] (1) Meeting personalized needs: Different clients have different privacy levels and types. By designing a personalized contract set, their needs can be better met, which can improve their enthusiasm for participating in global model training and data quality.
[0117] (2) Promote data security and privacy protection: Through the design of the contract set, it can ensure that the client follows certain privacy protection specifications when providing local model update parameters, reducing the risk of data leakage and abuse.
[0118] (3) Improving training efficiency and accuracy: Through reasonable contract design, clients can be incentivized to provide higher quality data and model update parameters, thereby improving the training efficiency and accuracy of the global model.
[0119] In a possible implementation, based on the subjective utility function of the federated server and the utility function of the client that meets the requirements, the contract theory driven by prospect theory is used to design an optimal contract including the training sample size and reward of each client that meets the requirements, specifically including:
[0120] c1. The optimization problem of the optimal contract is to maximize the subjective utility function of the federated server while satisfying the individual rationality constraints and incentive compatibility constraints for different types of clients that meet the requirements.
[0121] c2. Introducing marginal cost converts the training sample size and privacy level of the client that meets the requirements into a one-dimensional marginal cost type, and rewrites the optimal contract design problem into an optimal contract optimization problem of the one-dimensional marginal cost type.
[0122] c3. By simplifying the personal rationality constraints and incentive compatibility constraints of the clients that meet the requirements, the one-dimensional marginal cost type optimal contract optimization problem is transformed into a relaxed one-dimensional marginal cost type optimal contract design problem, and the relaxed one-dimensional marginal cost type optimal contract design problem is solved to obtain the optimal relaxed solution of the training sample size-reward contract under completely rational conditions.
[0123] c4. Further analyze the optimal relaxation solution of the training sample size-reward contract under the completely rational situation, and obtain the optimal relaxation solution of the optimal contract design problem driven by prospect theory. At the same time, dynamically assign the optimal relaxation solution that does not meet the monotonicity constraint to complete the dynamic allocation of the optimal contract. Through dynamic allocation, the fairness and effectiveness of the contract can be ensured, and the participants can be encouraged to train according to the behavior specified in the contract.
[0124] In one embodiment, the optimal relaxation solution of the training sample size-reward contract under the completely rational situation is further analyzed to obtain the optimal relaxation solution of the optimal contract design problem driven by prospect theory, which specifically includes:
[0125] ① For U S,i ≥U ref , 1≤i≤JL, the optimal contract training sample size of the relaxed one-dimensional marginal cost type optimal contract design problem is: in, is the marginal cost of a client of type (j, l); using the marginal cost, a client of type (j, l) is converted to a client of type i; the optimal contract reward of the relaxed one-dimensional marginal cost type optimal contract design problem is: Among them, α(Φ JL ) is the marginal cost of type JL client; d JL,PT is the optimal contract training sample size for type JL clients; α(Φ k ) is the marginal cost of type k client.
[0126] ② For U S,i <U ref , 1≤i≤JL, the optimal contract training sample size and optimal contract reward of the relaxed one-dimensional marginal cost type optimal contract design problem are related to US,i ≥U ref , the optimal contract training sample size and the optimal contract reward are consistent when 1≤i≤JL.
[0127] ③To U S,JL ≤…≤U S,y ≤…≤U S,n+1 ≤U ref ≤U S,n ≤…≤U S,x ≤…≤U S,1 , the optimal contract training sample size for the relaxed one-dimensional marginal cost type optimal contract design problem is: The optimal contract reward for the relaxed one-dimensional marginal cost type optimal contract design problem is:
[0128] In one embodiment, the optimal relaxed solution that does not satisfy the monotonicity constraint is dynamically assigned, specifically:
[0129] The federated server sorts the optimal contract training sample sizes of all clients that meet the requirements according to the marginal cost type. When there is an optimal contract training sample size that violates the monotonicity constraint, the clustering and ironing algorithm is used to adjust the client's optimal contract training sample size sequence to satisfy the monotonicity constraint, thereby obtaining the adjusted optimal contract training sample size. At the same time, the optimal contract reward is calculated based on the adjusted optimal contract training sample size.
[0130] In a possible implementation, the local model update parameters after privacy disturbance are aggregated to obtain the global model update parameters in combination with the training sample size, privacy level and reputation value in the current round corresponding to the client that meets the requirements, specifically:
[0131]
[0132] In the formula, Update the parameters of the local model of the client of type i; μ t+1 is the global model parameter of the (t+1)th iteration; ε i is the privacy level of client of type i; β i is the number of clients of type i.
[0133] In a possible implementation, a quality assessment is performed on the local model update parameters after the privacy disturbance, and the corresponding historical interaction trusted records are updated according to the quality assessment results, specifically:
[0134] The federated server uses a quality assessment algorithm, such as a variance-based detection algorithm, to detect the local model update parameters uploaded by the client after privacy perturbation, and sets the score of each client in the current training round based on the detection results. Use the score of each client in the current training round to update the client's historical interaction trust record In the formula It is a credible record of the historical interactions of client m in the previous t-1 rounds.
[0135] In a possible implementation, each client meeting the requirements selects a matching contract item from the contract set according to inherent attributes, selects samples for local model training according to the training sample size specified in the contract item, and performs privacy perturbation on the trained local model update parameters according to the privacy level to obtain local model update parameters, which can be specifically:
[0136] After selecting the corresponding contract item, the client uses the gradient descent algorithm to train the local model according to the training sample size specified in the contract item, and then uses differential privacy based on the Laplace mechanism to perturb the trained local model update parameters based on the selected privacy level. The perturbed local model update parameters are then uploaded to the federal server for model aggregation.
[0137] It should be noted that in the machine learning model training method based on federated learning provided in the present application, the machine learning model involved can be used to train an image recognition model. For example, in the context of smart medical care, convolutional neural networks are trained using patient image data sets from multiple medical units, thereby achieving efficient medical image recognition while complying with relevant data protection regulations and ethical standards.
[0138] In another optional embodiment, if Figure 2 As shown, a machine learning model training method based on federated learning is applied to a training system, specifically comprising the following steps:
[0139] Step 1: The federated server evaluates the reputation value of each client based on a dynamic reputation evaluation scheme based on historical interaction trusted records, and selects clients that meet the requirements based on the reputation value, thereby selecting honest clients to participate in federated learning.
[0140] like Figure 3 As shown in Figure 1, the federated server evaluates the reputation value of each client by analyzing the client's historical interaction trust records. Then, the clients are ranked in descending order according to their reputation values, and the top-ranked client B is selected to participate in federated learning based on the ranking. In the tth global iteration, the historical interaction trust records of client m are Given that the reputation value of a client changes over time, intuitively, the current interaction trust record contains more information than the past interaction trust record. Therefore, the federated server uses the exponential forgetting function to assign a larger weight to the most recent historical interaction trust record and a smaller weight to the past historical interaction trust record. Therefore, based on the historical interaction trust record, the reputation value of client m in the tth global iteration is:
[0141]
[0142] Step 2: Design a privacy-preserving federated learning framework based on differential privacy to resist the attacker's inference attack while quantifying the privacy leakage cost of the client.
[0143] like Figure 4 As shown in Figure 1, each client m incorporates noise into its local model update parameters before uploading them to the federated server to protect its privacy. By using differential privacy, an attacker cannot accurately infer the client's true local model update parameters. More specifically, the Laplace mechanism is used to achieve differential privacy.
[0144] Differential privacy is defined as:
[0145] Definition 1: A random scheme is considered to be m -Differential privacy, if for any pair of adjacent local model parameters and And the observed value have:
[0146]
[0147] In the formula, is the perturbed model gradient shared by client m in the tth round of global iteration; by using differential privacy, client m adds noise that conforms to the Laplace distribution to the model gradient, and will get it with a certain probability Therefore, when the attacker observes , they cannot accurately infer the true model gradient of client m; ε m Budget for privacy, indicating the risk of leaks The tolerance of privacy leakage caused by m Indicates stronger privacy protection because the attacker is observing When, distinguish and The difficulty of m To quantify the privacy level of client m.
[0148] The privacy leakage of client m has a cost, which is the economic loss caused by the privacy leakage; given that ε m The smaller the value, the stronger the privacy protection; therefore, the privacy leakage cost is defined as: In the formula, is the privacy preference of client m, indicating how much it values privacy; d m is the local sample size used by client m for model training, which shows that the privacy leakage cost is positively correlated with the sample size.
[0149] Step 3: Design optimal contracts for different types of clients based on the multi-dimensional contract theory driven by prospect theory to encourage clients to participate in differential privacy federated learning.
[0150] As a preferred implementation, the optimal contracts for different types of clients are designed based on the multi-dimensional contract theory driven by prospect theory, specifically including:
[0151] Step 3.1, establish a contract model based on the multi-dimensional heterogeneous types (privacy levels and types) of clients that meet the requirements;
[0152] Specifically, the contract model is:
[0153] Λ(Θ,Ψ)={φ j,l , 1≤j≤J, 1≤l≤L}
[0154] In the formula, φ j,l =(d j,l , r j,l ) is a client contract item of type -(j, l), d j,l is the data size used for model training by the client of type (j, l), r j,l The price reward paid by the federated server to clients of type -(j,l).
[0155] More specifically, in order to describe the heterogeneity of clients, the clients are divided into two groups, namely: θ = {θ j : J training cost types with 1≤j≤J}, and The client types are sorted in ascending order in each dimension, i.e., 0<θ 1 <…<θ j <…θ J and A client with training cost type j and privacy leakage cost type l is represented as type-(j, l).
[0156] Step 3.2: Based on the contract model, the utility function of the participants (i.e., the federated server and the client) is formulated using prospect theory, which is as follows:
[0157] Clients of type (j, l) choose contract terms φ j,l The utility function of is the difference between the reward paid by the federated server and its cost:
[0158]
[0159] In the formula, is the effective capacitance factor; is the privacy preference of the client of type -(j,l); is the number of local training rounds of the client of type-(j, l) in the tth global iteration; is the number of CPU cycles required to process one data sample during model training; The CPU cycle frequency of the client of type (j, l).
[0160] Driven by prospect theory, the subjective utility of a federated server depends on its satisfaction and the reward paid to each client, defined as follows:
[0161]
[0162] Where γ and ζ are risk parameters; δ is the risk aversion of the federated server; U ref is the reference point of the federated server setup; β is the number of type-(j, l) clients; ω s is the satisfaction parameter of the federated server.
[0163] Step 3.3: Based on the utility functions of the participants, use the contract theory driven by prospect theory to design the optimal contract.
[0164] Specifically, if Figure 5 As shown, in the present invention, based on the formulated participant utility function, the optimal contract is designed using the contract theory driven by prospect theory, specifically:
[0165] Step 3.3.1, the optimal contract design problem is to maximize the subjective utility function of the federated server while satisfying individual rationality constraints and incentive compatibility constraints for different types of clients;
[0166] Individual rationality constraints and incentive compatibility constraints are defined as:
[0167] Definition 2: Individual rationality constraint: When each client of type (j, l) participating in federated learning passes the corresponding contract item φ j,l =(d j,l , r j,l ) obtains non-negative utility, a set of contracts is considered to satisfy individual rationality constraints, namely:
[0168]
[0169] Definition 3: Incentive compatibility constraint: When a client of type -(j, l) has a corresponding contract item φ j,l =(d j,l , r j,l ) when the maximum utility is obtained under the condition of , a set of contracts is considered to satisfy the incentive compatibility constraint, that is:
[0170]
[0171] The optimal subjective contract design problem under the guidance of expected utility theory is as follows:
[0172]
[0173] Among them, JL (JL-1) incentive compatibility constraints and JL individual rationality constraints pose challenges to directly solving the optimization problem.
[0174] Step 3.3.2: Introduce marginal cost to convert the multi-dimensional privacy type (i.e., training sample size and privacy level) of the client that meets the requirements into a one-dimensional privacy type (i.e., one-dimensional marginal cost type), and rewrite the optimal contract design problem into an optimal contract optimization problem of one-dimensional marginal cost type;
[0175] By compressing the client's training cost type and privacy leakage cost type, the marginal training cost type is introduced and defined as: Based on the marginal cost type, the multi-dimensional optimal contract is simplified to the one-dimensional optimal contract Λ={φ i , 1≤i≤JL}, and type-(j, l) is converted to a one-dimensional marginal cost type i-client; where φ i =(d i ,r i ).
[0176] By simplifying the multi-dimensional optimal contract to the one-dimensional optimal contract, Problem 1 can be transformed into the following Problem 2:
[0177]
[0178] In the formula, for α(Φ i ) is the marginal cost of type i-client. Further, by simplifying the individual rationality constraints and incentive compatibility constraints, Problem 2 can be transformed into the following relaxed optimal contract design problem:
[0179]
[0180] Solving problem 3, we can get the optimal solution of the contract reward, which is expressed as:
[0181]
[0182] Bringing the optimal solution of the contract reward into question 3, we can get the contract local training sample size, expressed as:
[0183] To U S,i ≥U ref , 1≤i, JL, the optimal contract data size for the relaxed one-dimensional marginal cost type optimal contract design problem is:
[0184] To U S,i <U ref , 1≤i≤JL, the optimal contract data size of the relaxed one-dimensional marginal cost type optimal contract design problem is related to U S,i ≥U ref , the optimal contract data under the condition of 1≤i≤JL is consistent;
[0185] To U S,JL ≤…≤U S,y ≤…≤U S,n+1 ≤U ref ≤U S,n ≤…≤U S,x ≤…≤U S,1 , the optimal contract data for the relaxed one-dimensional marginal cost type optimal contract design problem is:
[0186] Step 3.3.3: Dynamically assign the optimal training sample size-reward contract solution that does not satisfy the monotonicity constraint to complete the dynamic allocation of the optimal contract, as follows:
[0187] First, the federated server sorts the optimal contract training sample sizes of all clients according to the marginal cost type;
[0188] Secondly, when there is an optimal contract training sample size that violates the monotonicity constraint, the “clustering and ironing” algorithm is used to adjust the client’s optimal contract data sequence to satisfy the monotonicity constraint, thereby obtaining the adjusted optimal contract training sample size;
[0189] Finally, the optimal contract reward is calculated based on the adjusted optimal contract training sample size.
[0190] Step 4: The client that meets the requirements selects the optimal contract according to its own attributes to perform local model training to obtain local model update parameters, then perturbs the model update parameters according to the selected privacy level and then transmits them to the federal server.
[0191] like Figure 6 As shown in the figure, in each global iterative training round t, each selected client m uses the training sample size specified in the contract to train the global model μ tPerform model training. Specifically, using the gradient descent algorithm, the local model parameters of client m are updated as follows:
[0192]
[0193] In the formula, λ is the learning rate; is the local model gradient of client m;
[0194] Then, in order to protect privacy, each selected client m is assigned a personalized privacy protection level ε m Perturb the model gradient, that is:
[0195]
[0196] In the formula, σ m is a random noise that follows a Laplace distribution;
[0197] Afterwards, each client returns the perturbed model gradients (model update parameters) to the federated server;
[0198] Finally, the federated server summarizes the model update parameters shared by the selected clients and updates the historical interaction trusted records for calculating the client's reputation value in the next round.
[0199] Repeat the above steps until the maximum number of global iterations is reached.
[0200] Step 5: The federated server performs a model quality assessment on the privacy-perturbed local model update parameters provided by the client, thereby updating the client's historical interaction trusted record.
[0201] like Figure 6 As shown in Figure 1, after receiving the updated local model shared by the client, the federated server detects whether the model deviates from the normal model by comparing the variance of the perturbed model and the variance of the added noise. In addition, the federated server can also use a fault-tolerant anomaly detection algorithm to identify dishonest clients by comparing the similarity of the perturbed local models. When the local model provided by the client in the tth round of global iteration is detected as reliable, the federated server considers the client to be honest, that is, otherwise, In the tth round of global iteration, the historical interaction credible record of client m is Therefore, based on the detection results in the round t of global iteration, the client's historical interaction trusted record is updated to
[0202] Step 6: The federated server aggregates the local model update parameters provided by each client based on its reputation value.
[0203] like Figure 6As shown in Figure 1, the federated server aggregates the received local model update parameters based on the client's reputation value, the corresponding training sample size, and the privacy level, expressed as:
[0204]
[0205] In the formula, Update parameters for the local model of type i clients.
[0206] In one embodiment of the present invention, a machine learning model training device based on federated learning is provided, which is applied to a federated server in a training system composed of a federated server and a plurality of clients communicating with the federated server. The training device comprises:
[0207] The selection module is used to evaluate the reputation value of each client based on the historical interaction trust records with each client, and select the client that meets the requirements according to the reputation value.
[0208] The contract design module is used to receive the privacy level and type sent by the client that meets the requirements, and design a contract set including the training sample size and reward according to the privacy level and type of the client that meets the requirements; wherein the privacy level and type are inherent attributes of each client that meets the requirements.
[0209] The task delivery module is used to send the global model and contract set to clients that meet the requirements.
[0210] An aggregation module is used to receive local model update parameters after privacy perturbation sent by clients that meet the requirements, and to aggregate the local model update parameters after privacy perturbation in combination with the training sample size, privacy level and reputation value in the current round corresponding to the clients that meet the requirements to obtain global model update parameters; wherein the local model update parameters after privacy perturbation refer to the local model update parameters obtained after each client that meets the requirements selects matching contract items from the contract set according to inherent attributes, selects samples for local model training according to the training sample size specified in the contract items, and performs privacy perturbation on the trained local model update parameters according to the privacy level.
[0211] The reward distribution and interactive trusted record update module is used to send rewards to clients that meet the requirements, perform quality assessment on the local model update parameters after privacy perturbation, and update the corresponding historical interactive trusted records according to the quality assessment results; wherein, the reward is the reward specified in the matching contract item selected by each client that meets the requirements from the contract set according to inherent attributes.
[0212] Regarding the specific implementation methods of the above modules, please refer to the corresponding contents disclosed in the above embodiments, which will not be repeated here.
[0213] In one embodiment of the present invention, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used to implement the operation of a machine learning model training method based on federated learning.
[0214] In one embodiment of the present invention, a method for training a machine learning model based on federated learning can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data.
[0215] The computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0216] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0217] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0218] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0219] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0220] In the present invention, unless otherwise clearly specified and limited, the terms "connected", "connection" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or communication with each other; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0221] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0222] In the present invention, the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0223] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A machine learning model training method based on federated learning, It is characterized in that A federated server in a training system composed of a federated server and a plurality of clients communicating with the federated server; The training method comprises: During each round of global iterative training, at least the following steps are performed: Evaluate the reputation value of each client based on the trusted record of historical interactions with each client, and select clients that meet the requirements based on the reputation value; Receiving the privacy level and type sent by the client that meets the requirements, and designing a contract set including the training sample size and the reward according to the privacy level and type of the client that meets the requirements; wherein the privacy level and type are inherent attributes of each client that meets the requirements; Send the global model and contract set to the clients that meet the requirements; Receive the privacy-perturbed local model update parameters sent by the clients that meet the requirements, and combine the training sample size, privacy level and reputation value in the current round corresponding to the clients that meet the requirements to aggregate the privacy-perturbed local model update parameters to obtain the global model update parameters; wherein the privacy-perturbed local model update parameters refer to the local model update parameters obtained after each client that meets the requirements selects a matching contract item from the contract set according to the inherent attributes, selects samples for local model training according to the training sample size specified in the contract item, and performs privacy perturbation on the trained local model update parameters according to the privacy level; A reward is sent to clients that meet the requirements, a quality assessment is performed on the local model update parameters after privacy perturbation, and the corresponding historical interaction trusted records are updated according to the quality assessment results; wherein the reward is the reward specified in the matching contract item selected by each client that meets the requirements from the contract set according to inherent attributes.
2. According to the method for training a machine learning model based on federated learning according to claim 1, It is characterized in that The reputation value of each client is evaluated based on the historical interaction trustworthy record with each client, specifically: Defined as follows: In the tth round of global iteration, the trusted record of historical interactions between the federated server and each client m is expressed as: in, Indicates that client m is credible in the tth round of global iteration, otherwise The reputation value of each client is evaluated based on the historical interaction trust records of each client, expressed as: In the formula, is the reputation value of client m in the tth round of global iteration; is the interactive trusted record of client m in the kth round of global iteration; τ is the decay factor; t k is the current global iteration round.
3. According to the method for training a machine learning model based on federated learning according to claim 1, It is characterized in that The selecting a client meeting the requirements according to the reputation value includes: Arrange the reputation values of all clients in descending order; The clients that are located before the set ranking threshold are selected as the clients that meet the requirements.
4. According to the method for training a machine learning model based on federated learning according to claim 1, It is characterized in that The contract set including the training sample size and reward is designed according to the privacy level and type of the client that meets the requirements, including: Establish contract models based on the privacy levels and types of clients that meet the requirements; Based on the contract model, the subjective utility function of the federated server and the utility function of the client that meets the requirements are formulated using prospect theory; According to the subjective utility function of the federated server and the utility function of the clients that meet the requirements, the contract theory driven by prospect theory is used to design the optimal contract that includes the training sample size and reward of each client that meets the requirements to form a contract set.
5. A method for training a machine learning model based on federated learning according to claim 4, It is characterized in that The contract model is: A(Θ,Ψ)={φ j,l ,1≤j≤J,1≤l≤L} In the formula, φ j,l =(d j,l , r j,l ) is a contract item for a client of type (j, l), d j,l is the training sample size, r j,l is the reward; Θ={θ j : 1≤j≤J} is a set of J training cost types; is a set of L privacy leakage cost types; The utility function of the client that meets the requirements is: In the formula, u j,l is the utility function of a client of type (j, l); θ j is the training cost type of a client of type (j, l); is the privacy leakage cost type of the client of type (j, l); The subjective utility function of the federated server is: Where γ and ζ are risk parameters; δ is the risk aversion of the federated server; U ref is the reference point of the federated server settings; β is the number of clients of type (j, l); U S,j,l =ω s ln(1+d j,l )-r j,l is the objective utility function of the federated server for clients of type (j, l), where the first term is the user satisfaction that is a logarithmic function of the training sample size, and the second term is the reward paid to the client that participates in model training; ω s is the satisfaction parameter of the federated server.
6. A method for training a machine learning model based on federated learning according to claim 5, It is characterized in that According to the subjective utility function of the federated server and the utility function of the client that meets the requirements, the optimal contract including the training sample size and reward of each client that meets the requirements is designed using the contract theory driven by prospect theory, specifically: The optimization problem of the optimal contract is to maximize the subjective utility function of the federated server while satisfying individual rationality constraints and incentive compatibility constraints for different types of clients that meet the requirements; The marginal cost is introduced to convert the training sample size and privacy level of the client that meets the requirements into a one-dimensional marginal cost type, and the optimal contract design problem is rewritten as an optimal contract optimization problem of the one-dimensional marginal cost type; By simplifying the individual rationality constraints and incentive compatibility constraints of the clients that meet the requirements, the optimal contract optimization problem of the one-dimensional marginal cost type is transformed into a relaxed one-dimensional marginal cost type optimal contract design problem, and the relaxed one-dimensional marginal cost type optimal contract design problem is solved to obtain the optimal relaxed solution of the training sample size-reward contract under a completely rational situation; The optimal relaxation solution of the training sample size-reward contract under the completely rational situation is further analyzed to obtain the optimal relaxation solution of the optimal contract design problem driven by prospect theory. At the same time, the optimal relaxation solution that does not meet the monotonicity constraint is dynamically assigned to complete the dynamic allocation of the optimal contract.
7. A method for training a machine learning model based on federated learning according to claim 6, It is characterized in that The optimal relaxation solution of the training sample size-reward contract under the completely rational situation is further analyzed to obtain the optimal relaxation solution of the optimal contract design problem driven by prospect theory, which is specifically: To U S,i ≥U ref , 1≤i≤JL, the optimal contract training sample size of the relaxed one-dimensional marginal cost type optimal contract design problem is: in, is the marginal cost of a client of type (j, l); using the marginal cost, a client of type (j, l) is converted to a client of type i; the optimal contract reward of the relaxed one-dimensional marginal cost type optimal contract design problem is: Among them, α(Φ JL ) is the marginal cost of type JL client; d JL,PT is the optimal contract training sample size for type JL clients; α(Φ k ) is the marginal cost of type k client; To U S,i <U ref , 1≤i≤JL, the optimal contract training sample size and optimal contract reward of the relaxed one-dimensional marginal cost type optimal contract design problem are related to U S,i ≥U ref , the optimal contract training sample size and the optimal contract reward are consistent when 1≤i≤JL; To U S,JL ≤…≤U S,y ≤…≤U S,n+1 ≤U ref ≤U S,n ≤…≤U S,x ≤…≤U S,1 , the optimal contract training sample size for the relaxed one-dimensional marginal cost type optimal contract design problem is: The optimal contract reward for the relaxed one-dimensional marginal cost type optimal contract design problem is:
8. A method for training a machine learning model based on federated learning according to claim 6, It is characterized in that The optimal relaxed solution that does not satisfy the monotonicity constraint is dynamically assigned, specifically: The federated server sorts the optimal contract training sample sizes of all clients that meet the requirements according to the marginal cost type. When there is an optimal contract training sample size that violates the monotonicity constraint, the clustering and ironing algorithm is used to adjust the client's optimal contract training sample size sequence to satisfy the monotonicity constraint, thereby obtaining the adjusted optimal contract training sample size. At the same time, the optimal contract reward is calculated based on the adjusted optimal contract training sample size.
9. A method for training a machine learning model based on federated learning according to claim 6, It is characterized in that Combined with the training sample size, privacy level and reputation value of the client that meets the requirements in the current round, the local model update parameters after privacy perturbation are aggregated to obtain the global model update parameters, which are: In the formula, Update the parameters of the local model of the client of type i; μ t+1 is the global model parameter of the (t+1)th iteration; ε i is the privacy level of the client of type i; β i is the number of clients of type i.
10. A machine learning model training device based on federated learning, It is characterized in that A federated server in a training system composed of a federated server and a plurality of clients communicating with the federated server; The training device comprises: A selection module is used to evaluate the reputation value of each client based on the historical interaction trust records with each client, and select the client that meets the requirements according to the reputation value; A contract design module, used to receive the privacy level and type sent by the client that meets the requirements, and design a contract set including the training sample size and the reward according to the privacy level and type of the client that meets the requirements; wherein the privacy level and type are inherent attributes of each client that meets the requirements; The task delivery module is used to send the global model and contract set to the clients that meet the requirements; An aggregation module is used to receive the local model update parameters after privacy perturbation sent by the clients that meet the requirements, and to aggregate the local model update parameters after privacy perturbation in combination with the training sample size, privacy level and reputation value in the current round corresponding to the clients that meet the requirements to obtain the global model update parameters; wherein the local model update parameters after privacy perturbation refer to the local model update parameters obtained after each client that meets the requirements selects a matching contract item from the contract set according to the inherent attributes, selects a sample according to the training sample size specified in the contract item for local model training, and performs privacy perturbation on the trained local model update parameters according to the privacy level; The reward distribution and interactive trusted record update module is used to send rewards to clients that meet the requirements, perform quality assessment on the local model update parameters after privacy perturbation, and update the corresponding historical interactive trusted records according to the quality assessment results; wherein, the reward is the reward specified in the matching contract item selected by each client that meets the requirements from the contract set according to inherent attributes.
