Model optimization method and system for federated learning with fairness assurance

By building an optimization model that comprehensively considers client accuracy, opportunity fairness and result fairness, the problem that existing federated learning methods cannot enable all clients to obtain good performance model parameters, and the long-term stability and fairness of the system are achieved balanced.

CN114358308BActive Publication Date: 2025-02-18INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111467731.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-02-18
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The existing federated learning method only considers fair opportunities or fair results, and cannot enable all clients to obtain well-performance model parameters, making it difficult for the system to continue for a long time and stably.

Method used

By receiving the first optimization parameters and images to be tested for the classification model to be optimized by multiple clients, the accuracy of each client is calculated to form a contribution matrix, and the optimization model is constructed based on the total accuracy, the first quantity, the second quantity and the variance, and obtain the The second optimization parameter pre-assigned to each client achieves accurate optimization of all client model parameters.

Benefits of technology

Accurate optimization of all client model parameters is achieved to ensure that the system can continue for a long time and stably, while taking into account both the fairness of opportunity and the fairness of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114358308B_ABST
    Figure CN114358308B_ABST
Patent Text Reader

Abstract

The present invention provides a model optimization method and system for federated learning with fairness guarantee, the method comprising: receiving first optimization parameters and images to be tested of a classification model to be optimized sent by multiple clients; calculating the accuracy of the classification model to be optimized of each client on different images to be tested, and obtaining a contribution matrix formed by the accuracy corresponding to all clients; according to the contribution matrix, obtaining the total accuracy corresponding to each client, and constructing an optimization model according to the total accuracy corresponding to each client, the first number and the second number, and the variance between the total accuracy corresponding to all clients; according to the optimal solution of the optimization model, allocating a second optimization parameter to each client, so that each client optimizes the classification model to be optimized according to the second optimization parameter. The present invention realizes comprehensive improvement of the performance of the classification model to be optimized after all clients are optimized, and ensures that the distributed system composed of servers and clients can be sustained for a long time and stably.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a model optimization method and system for federated learning with fairness assurance. Background Art

[0002] Federated learning is a distributed learning framework that can effectively help multiple institutions use data and conduct machine learning modeling while meeting the requirements of user privacy protection, data security, and government regulations, and has therefore received widespread attention.

[0003] Federated learning is a multi-party collaborative system. The motivation for each participant to participate is to get a better model than the local training. In order to ensure that the system can continue for a long time and stably, it is necessary to further ensure the fairness of the system. Therefore, in the federated learning scenario, how to achieve fairness is an urgent problem to be solved.

[0004] In order to solve the above problems, there are many federated learning methods for fairness. The definitions of fairness in these methods can be divided into two categories: one belongs to opportunity fairness; the other belongs to outcome fairness. For example, the fairness mentioned by relevant scholars belongs to opportunity fairness, which is achieved by designing a credit evaluation mechanism. Under this mechanism, clients exchange parameter information in the form of "earning and paying". Each client will store a local trust value, which is used to represent the credit level of other clients on the client and the points used to download parameters of other clients. Clients can earn points by uploading their own parameter information and use the earned points to exchange parameters with other clients. In addition, some scholars have considered outcome fairness and proposed the objective function of q-FFL (q-Fair Federated Learning), which is used to dynamically allocate the weights of clients in the objective function. Clients with poor performance will be assigned higher weights, thereby ensuring that the accuracy of all clients is relatively small, thereby achieving outcome fairness.

[0005] The above opportunity fairness means that the effort is proportional to the reward, that is, the client that provides better parameters should have a better model accuracy. The above result fairness means that the final accuracy of all clients participating in federated learning should be basically the same and cannot differ too much.

[0006] The existing federated learning methods that consider fairness either only consider opportunity fairness or only consider outcome fairness. Opportunity fairness is beneficial to clients with strong capabilities, while outcome fairness is beneficial to clients with weak capabilities. However, in a federated learning system, the capabilities of clients are often uneven. Considering only one type of fairness will not allow all clients to obtain model parameters with good performance, and it is difficult to ensure that the system can continue for a long time and stably. Summary of the invention

[0007] The present invention provides a model optimization method and system for federated learning with fairness assurance, which is used to solve the defects in the prior art that federated learning only considers opportunity fairness or result fairness, fails to enable all clients to obtain model parameters with good performance, and thus fails to ensure that the system can continue for a long time and stably, and realizes accurate optimization of model parameters for all clients.

[0008] The present invention provides a model optimization method for federated learning for fairness assurance, comprising:

[0009] Receiving first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested;

[0010] Calculate the accuracy of the classification model to be optimized corresponding to the first optimization parameter sent by each client on different images to be tested, and use the matrix formed by the accuracy rates corresponding to all clients as the contribution matrix;

[0011] According to the contribution matrix, the total accuracy rate corresponding to each client is obtained, and according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients, an optimization model for parameter allocation to each client is constructed; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients;

[0012] According to the optimal solution of the optimization model, a second optimization parameter pre-assigned to each client is obtained, and the corresponding second optimization parameter is assigned to each client, so that each client optimizes the classification model to be optimized according to the second optimization parameter.

[0013] According to a model optimization method for federated learning for fairness assurance provided by the present invention, the optimization model for parameter allocation to each client is constructed according to the total accuracy rate corresponding to each client, the first quantity and the second quantity, and the variance between the total accuracy rates corresponding to all clients, including:

[0014] Taking the maximum sum of the total accuracy rates corresponding to all clients as the goal, constructing the objective function of the optimization model;

[0015] A constraint condition of the optimization model is determined according to a difference between the first quantity and the second quantity, and the variance.

[0016] According to a model optimization method for federated learning for fairness assurance provided by the present invention, obtaining a second optimization parameter pre-allocated to each client according to the optimal solution of the optimization model includes:

[0017] For each client, according to the optimal solution of the optimization model, obtain the pre-allocated parameters of each client; wherein the pre-allocated parameters include one or more groups of parameters in all groups of first optimization parameters;

[0018] In the case that there are multiple groups of pre-allocated parameters for any client, aggregating all groups of pre-allocated parameters for the any client to obtain a second optimization parameter pre-allocated to the any client;

[0019] In the case that the pre-allocated parameters of any one of the clients are a group, the pre-allocated parameters are directly used as the second optimization parameters pre-allocated to any one of the clients.

[0020] According to a model optimization method for federated learning for fairness assurance provided by the present invention, aggregating all group pre-allocated parameters of any client to obtain a second optimization parameter pre-allocated to any client includes:

[0021] The average values ​​of all the group pre-allocated parameters of any one of the clients are calculated to obtain the second optimization parameter pre-allocated to any one of the clients.

[0022] According to a model optimization method for federated learning for fairness assurance provided by the present invention, aggregating all group pre-allocated parameters of any client to obtain a second optimization parameter pre-allocated to any client includes:

[0023] A weighted average of all group pre-allocated parameters of the any client is calculated to obtain a second optimization parameter pre-allocated to the any client.

[0024] According to a model optimization method for federated learning for fairness assurance provided by the present invention, before receiving first optimization parameters of a classification model to be optimized and an image to be tested sent by multiple clients, the method further includes:

[0025] The classification model to be optimized is sent to each client, so that each client can train the classification model to be optimized based on the sample image and the category corresponding to the sample image to obtain the first optimization parameter of the classification model to be optimized.

[0026] According to a model optimization method for federated learning with fairness assurance provided by the present invention, the image to be tested is generated by each client based on a generative adversarial network with differential privacy.

[0027] The present invention also provides a model optimization system for federated learning with fairness assurance, including:

[0028] A receiving module, used for receiving first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested;

[0029] A calculation module, used to calculate the accuracy of the classification model to be optimized corresponding to the first optimization parameter sent by each client on different images to be tested, and use the matrix formed by the accuracy corresponding to all clients as a contribution matrix;

[0030] A construction module is used to obtain the total accuracy rate corresponding to each client according to the contribution matrix, and to construct an optimization model for parameter allocation to each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients; wherein the first number is the number of first optimization parameters pre-allocated to each client; and the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients;

[0031] The optimization module is used to obtain the second optimization parameters pre-allocated to each client according to the optimal solution of the optimization model, and allocate the corresponding second optimization parameters to each client, so that each client can optimize the classification model to be optimized according to the second optimization parameters.

[0032] The present invention also provides an electronic device, 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, the steps of the model optimization method for federated learning for fairness assurance as described in any one of the above are implemented.

[0033] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the model optimization method for federated learning for fairness assurance as described in any of the above.

[0034] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the model optimization method for federated learning for fairness assurance as described in any of the above.

[0035] The model optimization method and system of federated learning for fairness assurance provided by the present invention receive first optimization parameters and images to be tested of the classification model to be optimized sent by multiple clients in real time, calculate the accuracy of the classification model to be optimized corresponding to the first optimization parameters sent by each client on different images to be tested, and comprehensively consider the total accuracy corresponding to each client, the first number and the second number, and the variance between the total accuracy corresponding to all clients to construct an optimization model that comprehensively considers the accuracy, opportunity fairness and result fairness of the classification model to be optimized on each client. On the one hand, it can achieve a balance between accuracy and fairness, thereby making the optimization model more reasonable and reliable; on the other hand, according to the optimal solution of the optimization model, a second optimization parameter with the best overall accuracy and fairness is allocated to each client, so that each client can optimize the classification model to be optimized according to the second optimization parameter, so as to comprehensively improve the performance of the classification model to be optimized after optimization of all clients, and ensure that the distributed system composed of servers and clients can continue for a long time and stably. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 This is one of the flow charts of the model optimization method for federated learning with fairness assurance provided by the present invention;

[0038] Figure 2 It is a structural diagram of the interaction between the server and the client in the model optimization method of federated learning for fairness assurance provided by the present invention;

[0039] Figure 3 This is the second flow chart of the model optimization method for federated learning for fairness assurance provided by the present invention;

[0040] Figure 4 This is the third flow chart of the model optimization method for federated learning for fairness assurance provided by the present invention;

[0041] Figure 5 This is the fourth flow chart of the model optimization method for federated learning for fairness assurance provided by the present invention;

[0042] Figure 6 This is the fifth flow chart of the model optimization method for federated learning for fairness assurance provided by the present invention;

[0043] Figure 7 It is a structural schematic diagram of a model optimization system for federated learning for fairness assurance provided by the present invention;

[0044] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. 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.

[0046] The main process of federated learning includes: the server randomly assigns values ​​to the parameters of the global optimization model to initialize the global optimization model, and distributes the initialized global optimization model to each client; each client trains the global optimization model locally using local sample data, and then returns the updated parameters of the global optimization model to the server; the server updates the global model using the received parameters and distributes it to the user again, and then performs a new round of iterative updates. In this process, since the server only collects the parameters of the global optimization model sent by the client, rather than the original data, it is more conducive to data privacy protection. Therefore, federated learning is widely used in model optimization.

[0047] In the existing federated learning process, either only opportunity fairness or only result fairness is considered. The former is beneficial to clients with strong capabilities, while the latter is beneficial to clients with weak capabilities. However, in a federated learning system, the capabilities of clients are often uneven. Therefore, if only one kind of fairness is considered and only the interests of one party are guaranteed, it is difficult to ensure that the system can continue for a long time and stably. In addition, the existing federated learning methods based on opportunity fairness often ignore the accuracy of the classification models to be optimized on each client. Without considering fairness, the only goal of model training is to maximize accuracy, but once fairness is considered, a certain degree of accuracy is often lost.

[0048] In summary, the existing federated learning cannot make the optimized model have the best comprehensive accuracy, opportunity fairness and result fairness, and cannot enable all clients to obtain model parameters with good performance, and thus it is difficult to ensure that the system can continue for a long time and stably.

[0049] In this embodiment, the classification model to be optimized is optimized through federated learning, and in the optimization process, an optimization model that can balance fairness and accuracy is constructed according to the contribution matrix, the first number and the second number corresponding to each client, and the variance between the total accuracy rates corresponding to all clients. This not only considers opportunity fairness and result fairness at the same time, but also achieves a balance between fairness and accuracy, so that all clients can obtain model parameters with good performance, thereby ensuring that the system can continue for a long time and stably, and can effectively guarantee data privacy.

[0050] Combine the following Figure 1 The present invention describes a model optimization method for federated learning for fairness assurance, the method comprising:

[0051] Step 101, receiving first optimization parameters of a classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested;

[0052] like Figure 2 As shown, the execution subject in this embodiment is a server, which can be applied to a distributed federated learning architecture including one server and multiple clients.

[0053] The client may be a tablet computer, a desktop computer, a smart phone, or other intelligent client capable of performing data processing, which is not specifically limited in this embodiment.

[0054] The number of clients can be set according to actual needs, and this embodiment does not specifically limit this.

[0055] The image to be tested may be an image acquired locally in real time by the client, or may be an image pre-stored locally, which is not specifically limited in this embodiment.

[0056] The image to be tested may be a pathological section image, a vehicle driving image, or a pollen image, etc. This embodiment is not limited to the type of the image to be tested.

[0057] The classification model to be optimized is a classification model that needs to be optimized in parameters, which can be used to classify image samples. For example, by taking a pollen image as the input of the classification model to be optimized, the category of pollen in the pollen image output by the classification model to be optimized can be obtained.

[0058] The structure of the classification model to be optimized can be set according to actual needs, such as various deep learning models, including but not limited to convolutional neural networks, VGG models (Visual Geometry Group Network), ResNet (Residual Network) series, and DenseNet (Densely Connected Convolutional Networks) series, etc. This embodiment does not specifically limit the type of the classification model to be optimized.

[0059] The first optimization parameter is the optimization parameter of the classification model to be optimized obtained by each client after training the classification model to be optimized locally;

[0060] Optionally, when it is necessary to perform federated learning optimization on the classification model to be optimized, each client sends a first optimization parameter of the local classification model to be optimized and an image to be tested;

[0061] After receiving the first optimization parameters of the classification model to be optimized and the images to be tested sent by multiple clients, the server can obtain multiple sets of different first optimization parameters and images to be tested;

[0062] Step 102, calculating the accuracy of the classification model to be optimized corresponding to the first optimization parameter sent by each client on different images to be tested, and using the matrix formed by the accuracy corresponding to all clients as the contribution matrix;

[0063] Optionally, a plurality of different groups of images to be tested are respectively input into the classification model to be optimized corresponding to the first optimization parameter sent by each client, to obtain a plurality of groups of accuracy rates corresponding to each client;

[0064] Optionally, based on the classification model f to be optimized corresponding to the first optimization parameter sent by the client i i , learn the test images sent by client j in multiple groups of different test images, and obtain the predicted category of the test images sent by client j; where 1≤i,j≤n; n is the total number of clients; the clients are numbered from 1 to n;

[0065] Then, according to the predicted category and the real category of the image to be tested, the classification model f to be optimized corresponding to the first optimization parameter sent by the client i is calculated. i The image D to be tested sent by client j j The accuracy on i (D j )];

[0066] Then, the matrix formed by the accuracy rates of all clients is used as the contribution matrix;

[0067] Optionally, the client i sends the classification model f to be optimized corresponding to the first optimization parameter i The accuracy acc[f i (D j )], written into the i-th row and j-th column of the contribution matrix C, that is, C(i,j)=acc[f i (D j )], used to represent the contribution of client i to client j;

[0068] According to the above method, all i and j are traversed, and the accuracy rates corresponding to all clients are written into the contribution matrix, thereby forming an n×n contribution matrix C.

[0069] Step 103, according to the contribution matrix, the total accuracy corresponding to each client is obtained, and according to the total accuracy corresponding to each client, the first number and the second number, and the variance between the total accuracy corresponding to all clients, an optimization model for parameter allocation to each client is constructed; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients;

[0070] Optionally, for client i, the accuracy of the first optimization parameter pre-assigned to client i in the contribution matrix on the image to be tested of client i is obtained, and the sum of the accuracy corresponding to all the first optimization parameters pre-assigned to client i is calculated to obtain the total accuracy acc[global] corresponding to client i. modeli (D i )].

[0071] Obtaining a first number of first optimization parameters pre-assigned to client i from among a plurality of different sets of first optimization parameters; if 6 sets of the 10 sets of first optimization parameters are pre-assigned to client i, the first number is 6; wherein the first number is used to characterize the return of client i;

[0072] Obtain a second number of the first optimization parameter of client i pre-allocated to other clients; if the first optimization parameter of client i is pre-allocated to other 4 clients, the second number is 4; wherein the second number is used to represent the contribution of client i;

[0073] Calculate the variance of the total accuracy rates corresponding to all clients, and the calculation formula is δ = var(ACC); where δ is the variance of the total accuracy rates corresponding to all clients, ACC = {acc[global modeli (D i)]|1≤i≤n} is the set of total accuracy rates corresponding to all clients, and var(·) is the variance calculation formula.

[0074] Finally, the total accuracy rate, the first number, and the second number corresponding to each client, as well as the variance between the total accuracy rates corresponding to all clients, are comprehensively considered to construct an optimization model for parameter allocation to each client;

[0075] Among them, the total accuracy rate corresponding to each client can represent the accuracy rate of the classification model to be optimized obtained on each client;

[0076] The first quantity and the second quantity corresponding to each client are used to represent the input and return of each client respectively, and the opportunity fairness needs to ensure that the difference between the input and return of each client needs to be as small as possible; therefore, combining these two parameters can ensure the opportunity fairness of each client;

[0077] Fair results require that the accuracy of the classification model to be optimized obtained on each client should not differ too much, that is, the variance between the total accuracy rates corresponding to all clients should be as small as possible; therefore, the fairness of the results of each client can be determined by the variance between the total accuracy rates corresponding to each client;

[0078] In summary, by combining the total accuracy, the first number and the second number corresponding to each client, and the variance between the total accuracy corresponding to all clients, an optimization model can be constructed that comprehensively considers the accuracy, opportunity fairness and result fairness of the classification model to be optimized on each client, thereby making the optimization parameters allocated to each client according to the optimization model more reasonable and reliable.

[0079] Step 104, according to the optimal solution of the optimization model, obtain the second optimization parameters pre-assigned to each client, and assign the corresponding second optimization parameters to each client, so that each client can optimize the classification model to be optimized according to the second optimization parameters.

[0080] Optionally, the optimization model is optimized and solved to obtain the optimal solution of the optimization model; wherein the solution method includes optimizing and solving using optimization algorithms such as genetic algorithms, which is not specifically limited in this embodiment.

[0081] Obtaining a second optimization parameter pre-allocated to each client according to the optimal solution;

[0082] Then, the corresponding second optimization parameter is allocated to each client;

[0083] When receiving the second optimization parameter, each client optimizes the local classification model to be optimized according to the second optimization parameter to obtain an optimized classification model to be optimized;

[0084] In addition, each client can further optimize the optimized classification model to be optimized to obtain a new first optimization parameter, send the new first optimization parameter and the new image to be tested to the server, and continue the next round of iterative optimization until the termination condition is met.

[0085] Then, each client can locally classify the real-time collected images using the final optimized model to be classified to accurately obtain the classification results of the images.

[0086] This embodiment receives first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients in real time, calculates the accuracy of the classification model to be optimized on different images to be tested corresponding to the first optimization parameters sent by each client, and comprehensively considers the total accuracy corresponding to each client, the first number and the second number, and the variance between the total accuracy corresponding to all clients to construct an optimization model that comprehensively considers the accuracy, opportunity fairness and result fairness of the classification model to be optimized on each client. On the one hand, it can achieve a balance between accuracy and fairness, thereby making the optimization model more reasonable and reliable; on the other hand, according to the optimal solution of the optimization model, allocates the second optimization parameter with the best comprehensive accuracy and fairness to each client, so that each client can optimize the classification model to be optimized according to the second optimization parameter, so as to comprehensively improve the performance of the classification model to be optimized after optimization of all clients, and ensure that the distributed system composed of servers and clients can continue for a long time and stably.

[0087] On the basis of the above embodiments, the present embodiment constructs an optimization model for parameter allocation to each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients, including: constructing an objective function of the optimization model with the goal of maximizing the sum of the total accuracy rates corresponding to all clients; determining the constraints of the optimization model according to the difference between the first number and the second number, and the variance.

[0088] Optionally, in the process of constructing the optimization model, the objective function of the optimization model is constructed with the maximum sum of the total accuracy rates corresponding to all clients as the goal;

[0089] The difference between the first number and the second number is less than or equal to a first threshold as a first constraint condition of the optimization model, so as to ensure the fairness of the opportunity of allocating parameters;

[0090] The second constraint condition of the optimization model is that the variance between the total accuracy rates corresponding to all clients is less than or equal to the second threshold, so as to ensure the fairness of the result of allocating parameters.

[0091] Among them, the specific formula of the optimization model is:

[0092]

[0093]

[0094] stVar(ACC)≤b

[0095] in, is the total accuracy corresponding to client i; n is the total number of clients; P is the set of allocation states of all first optimization parameters pre-allocated to all clients, which is called the parameter allocation matrix; P(i,j) is the allocation state of the first optimization parameter of client i to client j in the allocation matrix; P(j,i) is the allocation state of the first optimization parameter of client j to client i; a and b are thresholds; is the set of total accuracy corresponding to all clients, and var(·) is the variance calculation formula.

[0096] Wherein, P(i,j)∈{0,1}, when P(i,j)=1, it indicates that the first optimization parameter of client i is allocated to client j; when P(i,j)=0, it indicates that the first optimization parameter of client i is not allocated to client j.

[0097] Among them, opportunity fairness needs to ensure that the gap between the input and the reward of each client needs to be as small as possible. This embodiment introduces a threshold a to limit the maximum gap between the input and the reward, so as to achieve opportunity fairness.

[0098] Result fairness requires ensuring that the model accuracy obtained on each client does not differ too much, that is, the variance should be as small as possible. This embodiment introduces a threshold b to limit the size of the variance, thereby achieving result fairness.

[0099] The above parameters a and b are dynamically adjustable parameters, and the specific values ​​can be set according to actual needs; the smaller the a value, the more emphasis is placed on equal opportunity; similarly, the smaller the b value, the more emphasis is placed on equal results.

[0100] This embodiment records the accuracy that can be achieved by the first optimization parameter of each client on the test image on other clients through the contribution matrix; and obtains the parameter allocation matrix through the optimization model solution to record the exchange of the first optimization parameters between clients. Based on the above two matrices, fair opportunities and fair results can be achieved. In addition, the multi-objective optimization method is used to take the two types of fairness issues as the constraints of the optimization model and the model accuracy as the optimization goal, which can effectively achieve a balance between the two types of fairness issues and the model accuracy; thus making the constructed optimization model more reasonable and reliable.

[0101] On the basis of the above embodiments, the second optimization parameters pre-allocated to each client are obtained according to the optimal solution of the optimization model in this embodiment, including: for each client, according to the optimal solution of the optimization model, the pre-allocated parameters of each client are obtained; wherein the pre-allocated parameters include one or more groups of parameters in all groups of first optimization parameters; in the case where the pre-allocated parameters of any client are multiple groups, all groups of pre-allocated parameters of any client are aggregated to obtain the second optimization parameters pre-allocated to any client; in the case where the pre-allocated parameters of any client are one group, the pre-allocated parameters are directly used as the second optimization parameters pre-allocated to any client.

[0102] Optionally, the step of obtaining the second optimization parameter pre-allocated to each client includes:

[0103] First, the optimal model is solved to obtain the optimal solution of the optimization model; the allocation state {P(j,i)|1≤j≤n} of all first optimization parameters corresponding to each client i is determined according to the optimal solution; the first optimization parameter of the allocation state P(j,i)=1 of the first optimization parameter corresponding to each client i is used as the pre-allocation parameter of each client.

[0104] The set formed by all allocation states is called a parameter allocation matrix, which is used to record the parameter allocation status.

[0105] Then, the number of pre-allocated parameters of each client is counted; if any client has multiple pre-allocated parameters, all pre-allocated parameters of the client are aggregated, and the aggregated result is used as the second optimization parameter of the client;

[0106] The aggregation method may be to input all pre-allocated parameters into an aggregation model to obtain an aggregation result output by the aggregation model; or to aggregate all pre-allocated parameters using statistics, which is not specifically limited in this embodiment.

[0107] When the client has only one pre-allocated parameter, the pre-allocated parameter is directly used as the second optimization parameter of the client.

[0108] In the parameter aggregation stage of existing federated learning methods, the server performs weighted average of the optimization parameters uploaded by all clients. The weights used are determined by the amount of data of the client that generates the optimization parameters. Aggregating the parameters in this way causes the optimized classification model to favor clients with larger data volumes, thereby making the optimized classification model more accurate on clients with larger data volumes. However, this method violates the fairness of the results and prevents all clients from obtaining model parameters with good performance.

[0109] The present embodiment solves a balanced optimization model that can achieve accuracy, opportunity fairness, and result fairness to obtain an optimal solution that comprehensively optimizes accuracy, opportunity fairness, and result fairness, and obtains pre-allocated parameters for each client based on the optimal solution of the optimization model, and obtains second optimization parameters pre-allocated to each client based on the pre-allocated parameters, so that the second optimization parameters of the classification model to be optimized obtained by each client are more accurate and reasonable.

[0110] Based on the above embodiment, the present embodiment aggregates all group pre-allocated parameters of any one of the clients to obtain a second optimization parameter pre-allocated to any one of the clients, including: calculating the average value of all group pre-allocated parameters of any one of the clients to obtain the second optimization parameter pre-allocated to any one of the clients.

[0111] Optionally, in the case that there are multiple groups of pre-allocated parameters for any client, an average value of the pre-allocated parameters of all groups may be calculated, and the average value may be used as the second optimization parameter of the client.

[0112] This embodiment can quickly and accurately obtain the second optimization parameters pre-assigned to any client by combining multiple groups of pre-assigned parameters of any client to calculate the average value, so that the second optimization parameters of the classification model to be optimized obtained by the client are more accurate and more reasonable.

[0113] Based on the above embodiments, the present embodiment aggregates all group pre-allocated parameters of any one of the clients to obtain a second optimization parameter pre-allocated to any one of the clients, including: calculating a weighted average of all group pre-allocated parameters of any one of the clients to obtain a second optimization parameter pre-allocated to any one of the clients.

[0114] Optionally, in the case that there are multiple groups of pre-allocated parameters for any client, a weighted average value of the pre-allocated parameters of all groups may be calculated, and the weighted average value may be used as the second optimization parameter of the client.

[0115] Optionally, the weight of each group of pre-allocated parameters may be determined according to the accuracy, data volume, number of categories, etc. corresponding to the pre-allocated parameters, which is not specifically limited in this embodiment.

[0116] For example, the higher the accuracy of any pre-assigned parameter on the image to be tested of the client, the greater the weight assigned to the pre-assigned parameter.

[0117] For another example, for any client, the pre-allocated parameters include the first optimization parameter w sent by client i i and the first optimization parameter w sent by client j j ; Among them, the amount of training sample data of client i is m i, the amount of training sample data of client j is m j , the calculation formula for aggregating these two sets of pre-allocated parameters is:

[0118]

[0119] Wherein, F is the second optimization parameter after the parameters of the client are aggregated.

[0120] For another example, for any client, the pre-allocated parameters include the first optimization parameter w sent by client i i and the first optimization parameter w sent by client j j ; Among them, the number of categories of training samples of client i is l i , the number of categories of training samples of client j is l j , the calculation formula for aggregating these two sets of pre-allocated parameters is:

[0121]

[0122] Wherein, F is the second optimization parameter after the parameters of the client are aggregated.

[0123] This embodiment combines multiple groups of pre-allocated parameters of any client for weighted average, and can quickly and accurately obtain the second optimization parameters pre-allocated to the client, so that the second optimization parameters of the classification model to be optimized obtained by the client are more accurate and reasonable.

[0124] On the basis of the above embodiments, this embodiment further includes, before receiving the first optimization parameters of the classification model to be optimized and the image to be tested sent by multiple clients: sending the classification model to be optimized to each client, so that each client can train the classification model to be optimized based on the sample image and the category corresponding to the sample image, and obtain the first optimization parameters of the classification model to be optimized.

[0125] Optionally, before receiving the first optimization parameters of the classification model to be optimized and the test image sent by each client, the classification model to be optimized needs to be sent to each client so that each client can train the classification model to be optimized and obtain the first optimization parameters of the classification model to be optimized.

[0126] Optionally, the classification model to be optimized is initialized on the server, and the initialized classification model to be optimized is sent to each client; when the client receives the classification model to be optimized, iteratively trains the classification model to be optimized according to the locally stored sample images and the categories corresponding to the sample images until the termination condition of the classification model to be optimized is met, and the first optimization parameter of the classification model to be optimized is obtained; wherein the termination condition is that the number of iterations is greater than a preset threshold and / or the classification model to be optimized converges.

[0127] Then, each client sends the first optimization parameter obtained through local training and the image to be tested obtained locally to the server.

[0128] On the basis of the above embodiments, the image to be tested in this embodiment is generated by each client based on a differentially private generative adversarial network.

[0129] Among them, the differentially private generative adversarial network can achieve a balance between data availability and privacy protection.

[0130] Since each client needs to transmit local test data during the federated learning process, in order to protect the client's privacy information, this embodiment produces test images through a generative adversarial network technology based on differential privacy, effectively solving the problem of privacy leakage of test images generated by each client during the federated learning process.

[0131] like Figure 3 The above is a complete flow chart of the model optimization method for federated learning for fairness assurance in this embodiment, which mainly includes initializing on the server and the client at the same time, training the classification model to be optimized on the client, calculating the contribution matrix on the server, calculating the optimal solution of the optimization model on the server, obtaining the allocation matrix, aggregating parameters on the server and distributing them to each client; the specific steps include:

[0132] Step 301, initialization is performed simultaneously on the server and the client, and the client sends a locally generated test image to the server; it should be noted that this step only needs to be performed once during multiple rounds of iterations;

[0133] Step 302, training the classification model to be optimized on the client;

[0134] Optionally, each client updates the classification model to be optimized using a training set consisting of local sample images and categories corresponding to the sample images, obtains a first optimization parameter of the classification model to be optimized, and sends the first optimization parameter to the server;

[0135] Step 303: Calculate the contribution matrix on the server.

[0136] Optionally, based on the test images sent by each client in step 301 and the first optimization parameters of the classification model to be optimized uploaded by each client in step 302, the contribution matrix is ​​calculated by calculating the accuracy of the classification model to be optimized corresponding to each first optimization parameter on different test images.

[0137] Step 304: Calculate and obtain a parameter allocation matrix on the server.

[0138] Optionally, a parameter allocation matrix that can balance fairness and accuracy is calculated based on the contribution matrix. The parameter allocation matrix is ​​obtained by solving the optimization model.

[0139] The parameter allocation matrix is ​​denoted as P, where P(i,j)∈{0,1}. When P(i,j)=1, it means that the first optimization parameter of client i can be pre-allocated to client j, otherwise it means that the first optimization parameter of client i is not pre-allocated to client j. The number of 1s in the i-th row of the matrix P represents the contribution of client i, and the number of 1s in the i-th column represents the return of the i-th user.

[0140] Step 305 , parameters are aggregated on the server according to the parameter allocation matrix to obtain the second optimization parameters pre-allocated to each client, and the second optimization parameters are sent to each client, and then jump to step 302 for the next round of iteration until the iteration stops.

[0141] Optionally, a second optimization parameter pre-allocated to each client is calculated according to the parameter allocation matrix; and the second optimization parameter is sent to each client.

[0142] like Figure 4 As shown, the specific steps for initializing on both the server and the client include:

[0143] Step 401, initialize a global classification model to be optimized on the server and send it to each client;

[0144] Step 402: Generate a local test image on the client using a generative adversarial network based on differential privacy, and send it to the server; wherein the generative adversarial network based on differential privacy is a data generation technology that can protect user privacy.

[0145] like Figure 5 As shown, the specific steps of calculating the contribution matrix on the server include:

[0146] Step 501: According to the first optimization parameter uploaded by the client i, the classification model f to be optimized corresponds to i , perform D on the image to be tested uploaded by client j j Tagging, where 1≤i,j≤n;

[0147] Step 502: Calculate the accuracy rate based on the labeling result in step 501 and the actual label value corresponding to the image to be tested, denoted as acc[f i (D j )].

[0148] Step 503: convert the acc[f i (Dj )] is filled into the i-th row and j-th column of the contribution matrix, that is, C(i,j)=acc[f i (D j )], which is used to represent the contribution of client i to client j, and traverses all i and j to form an n×n contribution matrix C; where n represents the number of clients, and the clients are numbered from 1 to n.

[0149] like Figure 6 As shown in FIG. 1 , the specific steps of aggregating parameters on the server and distributing them to each client include:

[0150] Step 601, obtaining the pre-allocated parameters of each client according to the parameter allocation matrix P, performing parameter aggregation on multiple groups of pre-allocated parameters to obtain second optimized parameters; wherein the parameter aggregation method includes but is not limited to averaging or weighted averaging.

[0151] Step 602: Distribute the second optimization parameters obtained in step 601 to each client.

[0152] In summary, this embodiment can achieve equal opportunities and equal results by introducing a contribution matrix and obtaining a parameter allocation matrix according to an optimization model; and uses a multi-objective optimization method to take the two types of fairness issues as constraints of the optimization model, and the model accuracy as the optimization goal of the optimization model, thereby achieving a balance between the two types of fairness issues and model accuracy; in addition, by using a generative adversarial network technology based on differential privacy to produce images to be tested, the privacy leakage problem generated during the learning process is effectively solved.

[0153] The model optimization system for federated learning for fairness assurance provided by the present invention is described below. The model optimization system for federated learning for fairness assurance described below and the model optimization method for federated learning for fairness assurance described above can be referenced to each other.

[0154] like Figure 7 As shown, a model optimization system for federated learning with fairness assurance provided in this embodiment includes a receiving module 701, a computing module 702, a building module 703 and an optimization module 704, wherein:

[0155] The receiving module 701 is used to receive first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients, and obtain multiple groups of different first optimization parameters and images to be tested;

[0156] Optionally, when it is necessary to perform federated learning optimization on the classification model to be optimized, each client sends a first optimization parameter of the local classification model to be optimized and an image to be tested;

[0157] After receiving the first optimization parameters of the classification model to be optimized and the images to be tested sent by multiple clients, the server can obtain multiple sets of different first optimization parameters and images to be tested;

[0158] The calculation module 702 is used to calculate the accuracy of the classification model to be optimized corresponding to the first optimization parameter sent by each client on different images to be tested, and use the matrix formed by the accuracy corresponding to all clients as the contribution matrix;

[0159] Optionally, a plurality of different groups of images to be tested are respectively input into the classification model to be optimized corresponding to the first optimization parameter sent by each client, to obtain a plurality of groups of accuracy rates corresponding to each client;

[0160] Optionally, based on the classification model f to be optimized corresponding to the first optimization parameter sent by the client i i , learn the test images sent by client j in multiple groups of different test images, and obtain the predicted category of the test images sent by client j; where 1≤i,j≤n; n is the total number of clients; the clients are numbered from 1 to n;

[0161] Then, according to the predicted category and the real category of the image to be tested, the classification model f to be optimized corresponding to the first optimization parameter sent by the client i is calculated. i The image D to be tested sent by client j j The accuracy on i (D j )];

[0162] Then, the matrix formed by the accuracy rates of all clients is used as the contribution matrix;

[0163] Optionally, the client i sends the classification model f to be optimized corresponding to the first optimization parameter i The accuracy acc[f i (D j )], written into the i-th row and j-th column of the contribution matrix C, that is, C(i,j)=acc[f i (D j )], used to represent the contribution of client i to client j;

[0164] According to the above method, all i and j are traversed, and the accuracy rates corresponding to all clients are written into the contribution matrix, thereby forming an n×n contribution matrix C.

[0165] The construction module 703 is used to obtain the total accuracy corresponding to each client according to the contribution matrix, and construct an optimization model for parameter allocation to each client according to the total accuracy corresponding to each client, the first number and the second number, and the variance between the total accuracy corresponding to all clients; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of the first optimization parameters uploaded by each client pre-allocated to other clients;

[0166] Optionally, for client i, the accuracy of the first optimization parameter pre-assigned to client i in the contribution matrix on the tested image of client i is obtained, and the sum of the accuracy corresponding to all the first optimization parameters pre-assigned to client i is calculated to obtain the total accuracy corresponding to client i

[0167] Obtaining a first number of first optimization parameters pre-assigned to client i from among a plurality of different sets of first optimization parameters; if 6 sets of the 10 sets of first optimization parameters are pre-assigned to client i, the first number is 6; wherein the first number is used to characterize the return of client i;

[0168] Obtain a second number of the first optimization parameter of client i pre-allocated to other clients; if the first optimization parameter of client i is pre-allocated to other 4 clients, the second number is 4; wherein the second number is used to represent the contribution of client i;

[0169] Calculate the variance of the total accuracy rates corresponding to all clients. The calculation formula is δ = var(ACC); where δ is the variance of the total accuracy rates corresponding to all clients. is the set of total accuracy corresponding to all clients, and var(·) is the variance calculation formula.

[0170] Finally, the total accuracy rate, the first number, and the second number corresponding to each client, as well as the variance between the total accuracy rates corresponding to all clients, are comprehensively considered to construct an optimization model for parameter allocation to each client;

[0171] Among them, the total accuracy rate corresponding to each client can represent the accuracy rate of the classification model to be optimized obtained on each client;

[0172] The first quantity and the second quantity corresponding to each client are used to represent the input and return of each client respectively, and the opportunity fairness needs to ensure that the difference between the input and return of each client needs to be as small as possible; therefore, combining these two parameters can ensure the opportunity fairness of each client;

[0173] Fair results require that the accuracy of the classification model to be optimized obtained on each client should not differ too much, that is, the variance between the total accuracy rates corresponding to all clients should be as small as possible; therefore, the fairness of the results of each client can be determined by the variance between the total accuracy rates corresponding to each client;

[0174] In summary, by combining the total accuracy, the first number and the second number corresponding to each client, and the variance between the total accuracy corresponding to all clients, an optimization model can be constructed that comprehensively considers the accuracy, opportunity fairness and result fairness of the classification model to be optimized on each client, thereby making the optimization parameters allocated to each client according to the optimization model more reasonable and reliable.

[0175] The optimization module 704 is used to obtain the second optimization parameters pre-allocated to each client according to the optimal solution of the optimization model, and allocate the corresponding second optimization parameters to each client so that each client can optimize the classification model to be optimized according to the second optimization parameters.

[0176] Optionally, the optimization model is optimized and solved to obtain the optimal solution of the optimization model; wherein the solution method includes optimizing and solving using optimization algorithms such as genetic algorithms, which is not specifically limited in this embodiment.

[0177] Obtaining a second optimization parameter pre-allocated to each client according to the optimal solution;

[0178] Then, the corresponding second optimization parameter is allocated to each client;

[0179] When receiving the second optimization parameter, each client optimizes the local classification model to be optimized according to the second optimization parameter to obtain an optimized classification model to be optimized;

[0180] In addition, each client can further optimize the optimized classification model to be optimized to obtain a new first optimization parameter, send the new first optimization parameter and the new image to be tested to the server, and continue the next round of iterative optimization until the termination condition is met.

[0181] This embodiment receives first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients in real time, calculates the accuracy of the classification model to be optimized on different images to be tested corresponding to the first optimization parameters sent by each client, and comprehensively considers the total accuracy corresponding to each client, the first number and the second number, and the variance between the total accuracy corresponding to all clients to construct an optimization model that comprehensively considers the accuracy, opportunity fairness and result fairness of the classification model to be optimized on each client. On the one hand, it can achieve a balance between accuracy and fairness, thereby making the optimization model more reasonable and reliable; on the other hand, according to the optimal solution of the optimization model, allocates the second optimization parameter with the best comprehensive accuracy and fairness to each client, so that each client can optimize the classification model to be optimized according to the second optimization parameter, so as to comprehensively improve the performance of the classification model to be optimized after optimization of all clients, and ensure that the distributed system composed of servers and clients can continue for a long time and stably.

[0182] On the basis of the above-mentioned embodiments, the construction module in this embodiment is specifically used to: construct the objective function of the optimization model with the goal of maximizing the sum of the total accuracy rates corresponding to all clients; determine the constraints of the optimization model according to the difference between the first number and the second number, and the variance.

[0183] On the basis of the above embodiments, the optimization module in this embodiment is specifically used to: for each client, according to the optimal solution of the optimization model, obtain the pre-allocated parameters of each client; wherein the pre-allocated parameters include one or more groups of parameters in all groups of first optimization parameters; in the case that the pre-allocated parameters of any client are multiple groups, all groups of pre-allocated parameters of any client are aggregated to obtain the second optimization parameters pre-allocated to any client; in the case that the pre-allocated parameters of any client are one group, the pre-allocated parameters are directly used as the second optimization parameters pre-allocated to any client.

[0184] On the basis of the above embodiment, the optimization module in this embodiment is further used to: calculate the average value of all group pre-allocated parameters of any client to obtain the second optimization parameter pre-allocated to any client.

[0185] On the basis of the above embodiments, the optimization module in this embodiment is further used to: calculate the weighted average of all groups of pre-allocated parameters of any client to obtain a second optimization parameter pre-allocated to any client.

[0186] On the basis of the above embodiments, this embodiment also includes a training module, which is used to: send the classification model to be optimized to each client, so that each client can train the classification model to be optimized based on the sample image and the category corresponding to the sample image to obtain the first optimization parameter of the classification model to be optimized.

[0187] On the basis of the above embodiments, the image to be tested in this embodiment is generated by each client based on a differentially private generative adversarial network.

[0188] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute a model optimization method for federated learning with fairness assurance, the method comprising: receiving first optimization parameters of a classification model to be optimized and images to be tested sent by multiple clients to obtain multiple groups of different first optimization parameters and images to be tested; calculating the accuracy of the classification model to be optimized corresponding to the first optimization parameters sent by each client on different images to be tested, and using the matrix formed by the accuracy rates corresponding to all clients as a contribution matrix; according to the contribution matrix, obtaining the total accuracy rate corresponding to each client, and constructing an optimization model for parameter allocation to each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients; according to the optimal solution of the optimization model, obtaining the second optimization parameters pre-allocated to each client, and allocating the corresponding second optimization parameters to each client, so that each client optimizes the classification model to be optimized according to the second optimization parameters.

[0189] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0190] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the model optimization method of federated learning for fairness protection provided by the above methods, which includes: receiving first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested; calculating the accuracy of the classification model to be optimized corresponding to the first optimization parameters sent by each client on different images to be tested, and using the matrix formed by the accuracy rates corresponding to all clients as a contribution matrix; according to the contribution matrix, obtaining the total accuracy rate corresponding to each client, and constructing an optimization model for parameter allocation to each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients; according to the optimal solution of the optimization model, obtaining the second optimization parameters pre-allocated to each client, and allocating the corresponding second optimization parameters to each client, so that each client optimizes the classification model to be optimized according to the second optimization parameters.

[0191] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the model optimization method for federated learning with fairness assurance provided by the above-mentioned methods, the method comprising: receiving first optimization parameters of a classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested; calculating the accuracy of the classification model to be optimized corresponding to the first optimization parameters sent by each client on different images to be tested, and using the matrix formed by the accuracy rates corresponding to all clients as a contribution matrix; according to the contribution matrix, obtaining the total accuracy rate corresponding to each client, and constructing an optimization model for parameter allocation to each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients; according to the optimal solution of the optimization model, obtaining the second optimization parameters pre-allocated to each client, and allocating the corresponding second optimization parameters to each client, so that each client optimizes the classification model to be optimized according to the second optimization parameters.

[0192] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0193] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A model optimization method for federated learning with fairness assurance, characterized in that: include: Receiving first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested; Calculate the accuracy of the classification model to be optimized corresponding to the first optimization parameter sent by each client on different images to be tested, and use the matrix formed by the accuracy rates corresponding to all clients as the contribution matrix; According to the contribution matrix, the total accuracy rate corresponding to each client is obtained, and according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients, an optimization model for parameter allocation to each client is constructed; wherein the first number is the number of first optimization parameters pre-allocated to each client; the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients; According to the optimal solution of the optimization model, a second optimization parameter pre-assigned to each client is obtained, and the corresponding second optimization parameter is assigned to each client, so that each client optimizes the classification model to be optimized according to the second optimization parameter.

2. The model optimization method for federated learning with fairness assurance according to claim 1, characterized in that: The step of constructing an optimization model for parameter allocation for each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients includes: Taking the maximum sum of the total accuracy rates corresponding to all clients as the goal, constructing the objective function of the optimization model; A constraint condition of the optimization model is determined according to a difference between the first quantity and the second quantity, and the variance.

3. The model optimization method for federated learning with fairness assurance according to claim 1, characterized in that: The step of obtaining, according to the optimal solution of the optimization model, a second optimization parameter pre-allocated to each client includes: For each client, according to the optimal solution of the optimization model, obtain the pre-allocated parameters of each client; wherein the pre-allocated parameters include one or more groups of parameters in all groups of first optimization parameters; In the case that there are multiple groups of pre-allocated parameters for any client, aggregating all groups of pre-allocated parameters for the any client to obtain a second optimization parameter pre-allocated to the any client; In the case that the pre-allocated parameters of any one of the clients are a group, the pre-allocated parameters are directly used as the second optimization parameters pre-allocated to any one of the clients.

4. The model optimization method for federated learning with fairness assurance according to claim 3, characterized in that: The aggregating all group pre-allocated parameters of any client to obtain a second optimization parameter pre-allocated to any client includes: The average values ​​of all the group pre-allocated parameters of any one of the clients are calculated to obtain the second optimization parameter pre-allocated to any one of the clients.

5. The model optimization method for federated learning with fairness assurance according to claim 3 or 4, characterized in that: The aggregating all group pre-allocated parameters of any client to obtain a second optimization parameter pre-allocated to any client includes: A weighted average of all group pre-allocated parameters of the any client is calculated to obtain a second optimization parameter pre-allocated to the any client.

6. The model optimization method for federated learning with fairness assurance according to any one of claims 1 to 4, characterized in that: Before receiving the first optimization parameters of the classification model to be optimized and the image to be tested sent by multiple clients, the method further includes: The classification model to be optimized is sent to each client, so that each client can train the classification model to be optimized based on the sample image and the category corresponding to the sample image to obtain the first optimization parameter of the classification model to be optimized.

7. The model optimization method for federated learning with fairness assurance according to any one of claims 1 to 4, characterized in that: The image to be tested is generated by each client based on a differentially private generative adversarial network.

8. A model optimization system for federated learning with fairness assurance, characterized in that: include: A receiving module, used for receiving first optimization parameters of the classification model to be optimized and images to be tested sent by multiple clients, and obtaining multiple groups of different first optimization parameters and images to be tested; A calculation module, used to calculate the accuracy of the classification model to be optimized corresponding to the first optimization parameter sent by each client on different images to be tested, and use the matrix formed by the accuracy corresponding to all clients as a contribution matrix; A construction module is used to obtain the total accuracy rate corresponding to each client according to the contribution matrix, and to construct an optimization model for parameter allocation to each client according to the total accuracy rate corresponding to each client, the first number and the second number, and the variance between the total accuracy rates corresponding to all clients; wherein the first number is the number of first optimization parameters pre-allocated to each client; and the second number is the number of first optimization parameters uploaded by each client pre-allocated to other clients; The optimization module is used to obtain the second optimization parameters pre-allocated to each client according to the optimal solution of the optimization model, and allocate the corresponding second optimization parameters to each client, so that each client can optimize the classification model to be optimized according to the second optimization parameters.

9. An electronic device 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, the steps of the model optimization method for federated learning with fairness assurance as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the model optimization method for federated learning with fairness assurance as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Recognition model training method, device and equipment and readable storage medium

    CN111428881A

  • Prediction system and method based on federated learning

    CN111753006A