Personalized federated learning privacy protection method and system based on homomorphic encryption clustering
By adopting homomorphic encryption-based clustering methods and near-end optimization methods in federated learning, the problems of inaccurate client clustering, high computing and communication overhead and insufficient knowledge sharing are solved, and more efficient model training and stronger generalization capabilities are achieved.
Patent Information
- Application Number
- CN202411821481.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-11
AI Technical Summary
In federated learning, client clustering is inaccurate, high computational and communication overhead, and insufficient knowledge sharing among multitasking, resulting in limited generalization and robustness of the model.
A clustering method based on homomorphic encryption is adopted to regularize and encrypt the data distribution of clients, reduce computing and communication overhead, and promote knowledge migration and sharing between different tasks through near-end optimization methods.
It significantly improves the accuracy of clustering, reduces the computational and communication costs, improves the generalization ability and robustness of the model, and is suitable for federated learning in non-independent and same-distribution scenarios.
Smart Images

Figure CN119760770A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of federated learning, and specifically relates to a personalized federated learning privacy protection method and system based on homomorphic encryption clustering. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Federated learning is a promising distributed neural network training method that enables multiple clients to collaboratively train a global model while keeping data locally to ensure privacy and security. In federated learning, the central server is responsible for coordinating the training process. It aggregates the model parameters uploaded by each client to generate a global model, which enables it to obtain knowledge from data from different clients without accessing local data. Through this collaborative training mechanism, clients can jointly participate in the training of the global model while ensuring data privacy, achieving the dual goals of privacy protection and knowledge sharing.
[0004] However, in federated learning, the data distribution of different clients often differs significantly, which is often referred to as non-IID data. This means that the global model may not be able to generalize effectively on some clients, resulting in a significant drop in the performance of individual clients. Therefore, the problem of data heterogeneity is crucial in federated learning. To address data heterogeneity, research on personalized federated learning is becoming increasingly common. For example, clustering federated learning is an emerging method that aims to alleviate the impact of non-IID data. For example, Sattler et al. used correlation metrics to calculate the similarity between clients to achieve clustering. Ghosh et al. proposed a clustering federated learning framework based on loss function. However, this method requires sending multiple models to each client in each round of communication to determine the optimal model, which significantly increases the communication cost.
[0005] In the prior art, the federated learning method based on the clustering of model parameters uploaded by the client needs to undergo multiple rounds of training before each clustering, and the model parameters obtained by training are clustered. This process significantly increases the computational cost and time overhead of the client, reducing the efficiency of federated learning. Moreover, before the iteration starts, the model parameters need to be uploaded to the central server for clustering. Such an operation causes communication cost overload, increases the network burden, and affects the overall performance of the system. In addition, in practical applications, the number of model parameters often reaches millions, which significantly increases the computational complexity in the clustering process, and then leads to a significant decrease in the accuracy of the clustering results, thereby affecting the training effect of the model. After the clients are divided into different groups by clustering, each group usually performs task training separately. However, in practical applications, the data of a single group is often not enough to effectively improve the generalization ability of the model, which in turn restricts the robustness of the model. The knowledge obtained in a single task is limited, and it is impossible to fully improve the adaptability and robustness of the model to different scenarios. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a personalized federated learning privacy protection method and system based on homomorphic encryption clustering. Aiming at the problems of inaccurate client clustering, high computational and communication overhead, and insufficient knowledge sharing between multiple tasks in federated multi-task learning, this strategy significantly improves the accuracy of clustering while ensuring privacy security. At the same time, through a method based on data distribution, communication and computing costs are reduced, and the overhead caused by uploading a large number of model parameters in traditional methods is avoided. In addition, the present invention also effectively promotes knowledge transfer and sharing between different tasks, thereby improving the overall performance and generalization ability of the model. The scheme is suitable for federated learning in non-independent and identically distributed scenarios.
[0007] According to some embodiments, a first solution of the present invention provides a personalized federated learning privacy protection method based on homomorphic encryption clustering, which adopts the following technical solution:
[0008] A personalized federated learning privacy protection method based on homomorphic encryption clustering, including:
[0009] The client regularizes the local data distribution, receives the public key used for homomorphic encryption from the auxiliary server, encrypts the regularized data distribution to generate a ciphertext vector, and sends it to the central server;
[0010] The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server. The auxiliary server receives the difference calculation result, decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbed noise vector and feeds it back to the central server.
[0011] The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors;
[0012] The central server sends the global model to all clients. The clients use the global model to train local data to obtain the client model and send it to the central server.
[0013] The central server aggregates the client models of the same group based on clustering to obtain an in-group model, and also aggregates each group with the client models outside the group to obtain an out-group model; uses proximal optimization to obtain the out-group model from the in-group model, forms a final fusion global model and sends it to each client;
[0014] The client uses the fused global model to train on local data until the final federated model converges.
[0015] Furthermore, the central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server, specifically:
[0016] Receive ciphertext vectors from all clients;
[0017] Select one of the ciphertext vectors as the minuend and the other ciphertext vectors as the subtrahends, and calculate the difference between the two to obtain a difference calculation result, wherein the difference calculation result includes N-1 ciphertext vectors;
[0018] Send the difference calculation results to the secondary server.
[0019] Furthermore, the auxiliary server receives the difference calculation result and decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbing noise vector and feeds it back to the central server, specifically:
[0020] After receiving the difference calculation result, decrypt it using the private key;
[0021] Use the same random seed to shuffle each vector in the decrypted difference calculation result;
[0022] Multiply each disrupted vector by a noise vector to obtain a disturbed noise vector;
[0023] The perturbation noise vector is sent to the central server.
[0024] Furthermore, the central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors, specifically:
[0025] For the randomly selected client j’s disturbance noise vector, first convert a vector containing C g The all-zero vector of elements is inserted into the j*Cthg The expansion vector is obtained by Right now,
[0026]
[0027] For other clients i, to get First The i-th subvector of As a subtrahend, the other subvectors As the minuend, use the other subvectors Subtract get i,j∈[1,N],i≠j, N is the total number of clients, t is the number of iterations, Represents the normalized data distribution of all clients;
[0028] Based on the above method, Extension to get any That is, all clients except j.
[0029] Furthermore, the central server aggregates the client models of the same group based on clustering grouping to obtain the intra-group model, specifically:
[0030]
[0031] Among them, D i is the local dataset of client i; D r is the local data set of the model of group r; m is the number of clients participating in the training in this round, and m≤N; is the i-th client model in round t, It is one-hot encoding, one for each client Contains C elements inside.
[0032] Furthermore, the client models of each group and outside the group are aggregated to obtain the outside-group model, specifically:
[0033]
[0034] Among them, {1:C}\r means excluding all groups except r groups. is the client model of group s in round t, D s is the local dataset of the model of group s, and the global dataset D.
[0035] Furthermore, the proximal optimization is used to obtain the out-of-group model from the in-group model to form the final fusion global model, specifically:
[0036]
[0037] Among them, the out-of-group models other than the client models that do not belong to the rth group l is the number of proximal optimization rounds, V is the intensity of controlling the acquisition of external knowledge, is the client model of the rth group in round l, is the client model of the rth group in the l-1th round, arg min represents the value of the variable when the objective function reaches the minimum value, and ‖‖ is the second norm.
[0038] According to some embodiments, the second solution of the present invention provides a personalized federated learning privacy protection system based on homomorphic encryption clustering, which adopts the following technical solutions:
[0039] A personalized federated learning privacy protection system based on homomorphic encryption clustering includes a central server, an auxiliary server, and multiple clients. The central server, the auxiliary server, and the multiple clients perform a process of federated multi-task learning, specifically:
[0040] The client regularizes the local data distribution, receives the public key used for homomorphic encryption from the auxiliary server, encrypts the regularized data distribution to generate a ciphertext vector, and sends it to the central server;
[0041] The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server. The auxiliary server receives the difference calculation result, decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbed noise vector and feeds it back to the central server.
[0042] The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors;
[0043] The central server sends the global model to all clients. The clients use the global model to train local data to obtain the client model and send it to the central server.
[0044] The central server aggregates the client models of the same group based on clustering to obtain an in-group model, and also aggregates each group with the client models outside the group to obtain an out-group model; uses proximal optimization to obtain the out-group model from the in-group model, forms a final fusion global model and sends it to each client;
[0045] The client uses the fused global model to train on local data until the final federated model converges.
[0046] According to some embodiments, a third aspect of the present invention provides a computer-readable storage medium.
[0047] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the personalized federated learning privacy protection method based on homomorphic encryption clustering as described in the first aspect above.
[0048] According to some embodiments, a fourth aspect of the present invention provides a computer device.
[0049] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the personalized federated learning privacy protection method based on homomorphic encryption clustering as described in the first aspect above are implemented.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] The innovative method of the present invention in the clustering stage can reduce the computational cost and time overhead: in the clustering stage, only the data distribution needs to be homomorphically encrypted without pre-training. This method avoids the computational cost and time overhead caused by multiple rounds of training in traditional solutions. Since the scale of data distribution is much smaller than the scale of model parameters, the computational overhead of homomorphic encryption of data distribution is significantly lower than the pre-training process of model parameters. Therefore, the present invention has significant advantages in computational and time overhead, and is particularly suitable for scenarios with limited computing resources in edge devices.
[0052] The innovative method of the present invention in the clustering stage can also reduce communication overhead: unlike the traditional method that requires uploading millions of model parameters for clustering, the present invention only needs to upload the ciphertext data of the data distribution before each clustering. This method greatly reduces the communication overhead and significantly reduces the demand for network bandwidth, thereby effectively improving the communication efficiency of the system.
[0053] The innovative method of the present invention in the clustering stage improves clustering accuracy: the clustering input of the present invention depends on the underlying data distribution rather than the intermediate model parameters. Therefore, compared with the method based on intermediate parameter clustering, the clustering accuracy of the present invention is higher. This is because the data distribution can more accurately reflect the feature differences of each client, thereby improving the quality of the clustering results.
[0054] The innovative method of the present invention in the clustering stage also improves the generalization ability of the model: in the training stage, the present invention adopts the proximal optimization method to integrate the knowledge of multiple tasks, thereby improving the generalization ability of the model. This method can better adapt to actual application scenarios and enhance the robustness and applicability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0056] Figure 1 It is a flow chart of a personalized federated learning privacy protection method based on homomorphic encryption clustering in an embodiment of the present invention;
[0057] Figure 2 is a flow chart of the client clustering strategy in an embodiment of the present invention;
[0058] Figure 3 This is the scenario 1 (D imain =0.3) Experimental evaluation results;
[0059] Figure 4 This is the scenario 2 (D imain =0.5) Experimental evaluation results;
[0060] Figure 5 This is the scenario 3 (D imain =0.75) Experimental evaluation results. DETAILED DESCRIPTION
[0061] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0062] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0063] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0064] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0065] Embodiment 1
[0066] This embodiment provides a personalized federated learning privacy protection method based on homomorphic encryption clustering. This embodiment uses the method applied to a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a terminal, a server, and a system, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps:
[0067] The client regularizes the local data distribution, receives the public key used for homomorphic encryption from the auxiliary server, encrypts the regularized data distribution to generate a ciphertext vector, and sends it to the central server;
[0068] The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server. The auxiliary server receives the difference calculation result, decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbed noise vector and feeds it back to the central server.
[0069] The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors;
[0070] The central server sends the global model to all clients. The clients use the global model to train local data to obtain the client model and send it to the central server.
[0071] The central server aggregates the client models of the same group based on clustering to obtain an in-group model, and also aggregates each group with the client models outside the group to obtain an out-group model; uses proximal optimization to obtain the out-group model from the in-group model, forms a final fusion global model and sends it to each client;
[0072] The client uses the fused global model to train on local data until the final federated model converges.
[0073] First, if Figure 2As shown in the figure, before the global training of federated learning begins, the auxiliary server generates a public key and a private key for homomorphic encryption and distributes the public key to all clients. After receiving the public key, the client first regularizes the local data distribution and maps it to the range of 0 to 1. Subsequently, the client uses the public key to encrypt the regularized data to obtain a ciphertext vector, and uploads the ciphertext vector to the central server. The central server performs a difference calculation on the ciphertext and sends the result of the operation to the auxiliary server in the form of ciphertext. After receiving the ciphertext vector, the auxiliary server decrypts it and scrambles the decrypted vector data in segments. Then, the auxiliary server multiplies each segment of the vector by a noise vector element by element and returns the scrambled vector to the central server. The central server first expands the received vector into N vectors. Subsequently, the K-means++ algorithm is used to cluster these N vectors, thereby completing the client clustering stage.
[0074] Next comes the client training phase. First, the central server broadcasts the global model to each client. After receiving the global model, the client uses local data to train the global model and uploads the trained model back to the server. The server aggregates the models within the group according to the grouping of the clients. Subsequently, the framework aggregates the models outside the group. Specifically, each group corresponds to two models: one is the in-group model and the other is the out-group model. Next, the server uses a proximal optimization method to transfer the knowledge of the out-group model to the in-group model. In this process, the in-group model achieves personalized services by learning in-group knowledge, while the out-group model improves generalization ability by learning out-group knowledge. The two coordinate with each other and merge into a unified model through knowledge transfer, so that it can be widely used in federated learning tasks in various scenarios.
[0075] This embodiment mainly includes three roles: Client C participating in federated learning l , Central Server S C , auxiliary server S A .like Figure 1 The specific steps of the scheme are as follows:
[0076] Step 1: The auxiliary server generates a pair of public and private keys for homomorphic encryption and distributes the public key to all clients.
[0077] Step 2: After receiving the public key, the client first regularizes the local data distribution, then uses the public key to homomorphically encrypt the regularized data distribution, generates a ciphertext vector, and uploads the ciphertext vector to the central server.
[0078] Step 3: The central server performs a simple operation on the received ciphertext vector to obtain the difference calculation result, and transmits the difference calculation result back to the auxiliary server, specifically:
[0079] Receive ciphertext vectors from all clients;
[0080] Select one of the ciphertext vectors as the minuend and the other ciphertext vectors as the subtrahends, and calculate the difference between the two to obtain a difference calculation result, wherein the difference calculation result includes N-1 ciphertext vectors;
[0081] Send the difference calculation results to the secondary server.
[0082] Step 4: The auxiliary server uses the private key to decrypt the ciphertext vector of the difference calculation result and scrambles the decrypted data in segments; then, it adds a noise vector to the data and finally returns the disturbed noise vector to the central server, specifically:
[0083] After receiving the difference calculation result, decrypt it using the private key;
[0084] Use the same random seed to shuffle each vector in the decrypted difference calculation result;
[0085] Multiply each disrupted vector by a noise vector to obtain a disturbed noise vector;
[0086] The perturbation noise vector is sent to the central server.
[0087] Step 5: After receiving the disturbance noise vector data, the central server first expands the disturbance noise vector into an extended vector corresponding to each client. Then, all the extended vectors are clustered using the K-means++ method to complete the client clustering.
[0088] Step 6: The central server broadcasts the global model to the clients participating in the training, and the clients use the global model to train in the local dataset. Subsequently, the trained model is sent back to the central server.
[0089] Step 7: After receiving the models of each client, the central server aggregates the client models belonging to the same group according to the clustering results, and also aggregates the models of other groups to form two models: the in-group model and the out-group model.
[0090] Step 8: The central server uses proximal optimization to enable the model to acquire out-of-group knowledge and distributes the final model to each client by group.
[0091] Step 9: After receiving the model, the client uses the model to train the local data set. During the training phase, steps 7-9 are iteratively executed.
[0092] Assume that there are N clients in the system and the global dataset D has C g data categories.
[0093] In step 1, the auxiliary server S A Generate public and private keys for homomorphic encryption (P k ,S k ), and the public key P k Send to all clients C l .
[0094] In step 2, client i first regularizes the local data distribution, i∈[1,N]. The regularization formula is:
[0095]
[0096] Among them, n p Indicates the number of samples of class p, n min Indicates the number of samples of the category with the smallest amount of data, n max Indicates the number of samples of the category with the largest amount of data.
[0097] The regularized data distribution of client i in the tth iteration is expressed as:
[0098]
[0099] Among them, C g Represents the total number of categories in the global dataset, represents the regularized data belonging to the category of client i 1, Indicates that it belongs to client C g The client then uses the public key P k Will Homomorphic encryption obtains the ciphertext vector of client i at the tth iteration and will Upload to S C , all clients perform the above operations to obtain N ciphertext vectors, and upload the N ciphertext vectors to the central server.
[0100] In step 3, after receiving N ciphertext vectors, the central server first randomly selects a client j ciphertext vector As the minuend, the remaining client i ciphertext vector As subtrahends, i,j∈[1,N]. Separately with the remaining client i ciphertext vectors The difference calculation result E(A j ); where E(A j ) contains N-1 sub-vectors, specifically:
[0101]
[0102] Then E(A j )Send to S A , the above calculation process is performed on all ciphertext vectors to obtain N difference calculation results, each difference calculation result includes N-1 sub-vectors, and then all ciphertext vectors are sent to the auxiliary server.
[0103] In step 4, the auxiliary server S A After receiving N difference calculation results, randomly select a difference calculation result E(A j ), first use the private key S k Decrypt it to get A j , where A j Contains N-1 sub-vectors That is, for all clients except j, the subvector is:
[0104]
[0105] Next, S A A j Every subvector of Use the same random seed for shuffling; that is, each subvector The degree of disorder of the internal elements is the same; for each sub-vector after the shuffle, multiply it by a noise vector Get the disturbance noise vector of client j The details are as follows:
[0106]
[0107] in, Finally Send back to the central server S c After decryption, all difference calculation results are shuffled and noise is added to obtain N disturbed noise vectors, and all disturbed noise vectors are transmitted back to the central server.
[0108] In step 5, the central server expands all the disturbance noise vectors respectively to the disturbance noise vector of client j For example, due to It is just the disturbance noise vector corresponding to client j. Before clustering, it needs to be expanded to each client i to correspond to an extended vector Specifically, it is divided into two steps:
[0109] First, expand First, a file containing C g The all-zero vector of elements is inserted into the j*Cth g positions; that is,
[0110]
[0111] so Contains N sub-vectors.
[0112] The second step is to expand the corresponding To get First The i-th subvector of As a subtrahend, the other subvectors As the minuend, use the other subvectors minus Easy to get
[0113] For example, if you want to get
[0114] First, the first subvector The second sub-vector can be written directly to the vector of all 0s. That is The second subvector of minus the first subvector. For example That is The Nth subvector of minus the first subvector. The first subvector of is taken as the subtraction, The other sub-vectors are treated as minuends, and subtraction can obtain the final This way you can Expand to any Δ∈[1,N]\j.
[0115] After getting the extension vectors corresponding to all clients Finally, K-means++ is used to cluster these N extended vectors to obtain C groups. So far, the clustering stage of this system is over.
[0116] In step 6, the client training phase begins. First, the central server broadcasts the global model w to all clients. For client i, the global model w is used to train the local dataset D i We train w i The optimization method is stochastic gradient descent:
[0117]
[0118] Among them, η is the learning rate, F is the loss function, is the model of the i-th client in round t. Upload back to S c .
[0119] In step 7, the central server receives the client models participating in this round of training Finally, according to the clustering results obtained in step 5, the clients are divided into multiple groups. Each group corresponds to two models, namely, the in-group model Out-of-group model Where r is the group number and t is the number of iterations. The calculation method of the model in the group is to use FedAvg (federated aggregation algorithm) to aggregate the models of all clients in the group to obtain the following:
[0120]
[0121] Among them, D i is the local dataset of client i; D r is the local data set of the model of group r; m is the number of clients participating in the training in this round, and m≤N; is the model of the i-th client in round t, It is one-hot encoding, one for each client It contains C elements; when i belongs to the rth group, Other situations
[0122] The out-of-group model is calculated by aggregating the group models of other groups (that is, all client models that do not belong to the rth group):
[0123]
[0124] Among them, {1:C}\r means excluding all groups except r groups. is the group model of group s in round t, D s is the model local dataset of group s.
[0125] In step 8, each group has two models, namely the within-group model and out-group model The central server uses Proximal Policy Optimization to To acquire external knowledge The formula is as follows:
[0126]
[0127] Where l is the number of proximal optimization rounds, V is the intensity of controlling the acquisition of external knowledge, is the model of the rth group in round l, is the model of the rth group in the l-1th round, ‖‖ is the second norm, and arg min represents the value of the variable when the objective function reaches the minimum value. The formula can be understood as follows: our model acquires knowledge by approximating the distance between the in-group model and the out-group model. The penalty term V is used to control the strength of acquiring out-group knowledge. That is to say, when only the personalized ability of the model is needed, we can set it to 0, and when we need generalization, we can set V to a larger parameter value. The following is our knowledge acquisition ability when V approaches infinity.
[0128] If V→∞, the gradient is Gradient Descent:
[0129]
[0130] Where γ is the learning rate,
[0131] Assumptions You can get:
[0132]
[0133] make Then formula (12) can be simplified as:
[0134]
[0135]
[0136] It can be seen that our knowledge acquisition ability can approach the ability of the FedAvg direct aggregation model when assuming that V approaches infinity.
[0137] In step 9, each client C l Need to communicate with the central server S c , and multiple rounds of iterative communication process are carried out until the federated model finally converges.
[0138] Experimental verification results:
[0139] The above solutions are tested on the public dataset Cifar10. Client local dataset D i Divided into main data D imain and secondary data D isecondary , now assume three data distribution scenarios:
[0140] like Figure 3 As shown in the figure, scenario 1: when the client's main data volume accounts for 0.3, D imain = 0.3. In this case, the primary data is assigned data samples of one category, and the secondary data is randomly assigned samples of the remaining categories.
[0141] like Figure 4 As shown, Scenario 2: When D imain When =0.5, two categories of data samples are allocated to the primary data, and the remaining categories of samples are randomly allocated to the secondary data.
[0142] like Figure 5 As shown, Scenario 3: When D imain When =0.75, three categories of data samples are allocated to the primary data, and the remaining categories of samples are randomly allocated to the secondary data.
[0143] Embodiment 2
[0144] This embodiment provides a personalized federated learning privacy protection system based on homomorphic encryption clustering, including a central server, an auxiliary server, and multiple clients. The central server, the auxiliary server, and the multiple clients perform a process of federated multi-task learning, specifically:
[0145] The client regularizes the local data distribution, receives the public key used for homomorphic encryption from the auxiliary server, encrypts the regularized local data to generate a ciphertext vector, and sends it to the central server;
[0146] The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server. The auxiliary server receives the difference calculation result, decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbed noise vector and feeds it back to the central server.
[0147] The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors;
[0148] The central server sends the global model to all clients. The clients use the global model to train local data to obtain the client model and send it to the central server.
[0149] The central server aggregates the client models of the same group based on clustering to obtain an in-group model, and also aggregates each group with the client models outside the group to obtain an out-group model; uses proximal optimization to obtain the out-group model from the in-group model, forms a final fusion global model and sends it to each client;
[0150] The client uses the fused global model to train on local data until the final federated model converges.
[0151] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0152] Embodiment 3
[0153] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the personalized federated learning privacy protection method based on homomorphic encryption clustering as described in the first embodiment above are implemented.
[0154] Embodiment 4
[0155] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the personalized federated learning privacy protection method based on homomorphic encryption clustering as described in the first embodiment are implemented.
[0156] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0157] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce 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.
[0158] 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.
[0159] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0160] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0161] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A personalized federated learning privacy protection method based on homomorphic encryption clustering, characterized by: include: The client regularizes the local data distribution, receives the public key used for homomorphic encryption from the auxiliary server, encrypts the regularized data distribution to generate a ciphertext vector, and sends it to the central server; The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server. The auxiliary server receives the difference calculation result, decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbed noise vector and feeds it back to the central server. The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors; The central server sends the global model to all clients. The clients use the global model to train local data to obtain the client model and send it to the central server. The central server aggregates the client models of the same group based on clustering to obtain an in-group model, and also aggregates each group with the client models outside the group to obtain an out-group model; uses proximal optimization to obtain the out-group model from the in-group model, forms a final fusion global model and sends it to each client; The client uses the fused global model to train on local data until the final federated model converges.
2. The personalized federated learning privacy protection method based on homomorphic encryption clustering as claimed in claim 1, characterized in that: The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server, specifically: Receive ciphertext vectors from all clients; Select one of the ciphertext vectors as the minuend and the other ciphertext vectors as the subtrahends, and calculate the difference between the two to obtain a difference calculation result, wherein the difference calculation result includes N-1 ciphertext vectors; Send the difference calculation results to the secondary server.
3. The personalized federated learning privacy protection method based on homomorphic encryption clustering as claimed in claim 1, characterized in that: The auxiliary server receives the difference calculation result and decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbing noise vector and feeds it back to the central server, specifically: After receiving the difference calculation result, decrypt it using the private key; Use the same random seed to shuffle each vector in the decrypted difference calculation result; Multiply each disrupted vector by a noise vector to obtain a disturbed noise vector; The perturbation noise vector is sent to the central server.
4. The personalized federated learning privacy protection method based on homomorphic encryption clustering according to claim 1, characterized in that: The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors, specifically: For the randomly selected client j’s disturbance noise vector, first convert a vector containing C g The all-zero vector of elements is inserted into the j*Cth g The expansion vector is obtained by Right now, For other clients i, to get First The i-th subvector of As a subtrahend, the other subvectors As the minuend, use the other subvectors Subtract get N is the total number of clients, t is the number of iterations, Represents the normalized data distribution of all clients; Based on the above method, Extension to get any That is, all clients except j.
5. The personalized federated learning privacy protection method based on homomorphic encryption clustering as claimed in claim 1, characterized in that: The central server aggregates the client models of the same group based on clustering to obtain the intra-group model, specifically: Among them, D i is the local dataset of client i; D r is the model local dataset of group r; It is one-hot encoding, one for each client Contains C elements inside.
6. The personalized federated learning privacy protection method based on homomorphic encryption clustering according to claim 1, characterized in that: The client models of each group and outside the group are aggregated to obtain the outside-group model, specifically: Among them, {1:C}\r means excluding all groups except r groups. is the client model of group s in round t, D s is the local dataset of the model of group s, and the global dataset D.
7. The personalized federated learning privacy protection method based on homomorphic encryption clustering according to claim 1, characterized in that: Use proximal optimization to obtain the out-of-group model from the in-group model to form the final fusion global model, specifically: Among them, the out-of-group models other than the client models that do not belong to the rth group l is the number of proximal optimization rounds, V is the intensity of controlling the acquisition of external knowledge, is the client model of the rth group in round l, is the client model of the rth group in the l-1th round, arg min represents the value of the variable when the objective function reaches the minimum value, and ‖‖ is the second norm.
8. Personalized federated learning privacy protection system based on homomorphic encryption clustering, characterized by: The system includes a central server, an auxiliary server, and multiple clients. The central server, the auxiliary server, and the multiple clients perform a process of federated multi-task learning, specifically: The client regularizes the local data distribution, receives the public key used for homomorphic encryption from the auxiliary server, encrypts the regularized data distribution to generate a ciphertext vector, and sends it to the central server; The central server performs difference calculation on the ciphertext vector and sends the result to the auxiliary server. The auxiliary server receives the difference calculation result, decrypts it using the private key, and scrambles and adds noise to the decrypted data in sections to obtain a disturbed noise vector and feeds it back to the central server. The central server performs data expansion on the disturbing noise vector to obtain an extended vector, and clusters and groups all the extended vectors; The central server sends the global model to all clients. The clients use the global model to train local data to obtain the client model and send it to the central server. The central server aggregates the client models of the same group based on clustering to obtain an in-group model, and also aggregates each group with the client models outside the group to obtain an out-group model; uses proximal optimization to obtain the out-group model from the in-group model, forms a final fusion global model and sends it to each client; The client uses the fused global model to train on local data until the final federated model converges.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the personalized federated learning privacy protection method based on homomorphic encryption clustering as described in any one of claims 1 to 7 are implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the personalized federated learning privacy protection method based on homomorphic encryption clustering as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Federal learning privacy protection method based on homomorphic encryption and secret sharing
CN113037460A
Federal learning gradient security aggregation method based on SIGNSGD
CN113407963A
Federal learning privacy protection method based on homomorphic encryption
CN113434873A
Federal learning privacy protection method and system based on homomorphic encryption
CN117640253A
Federal learning-oriented privacy protection difference perception aggregation method
CN118233074A
Cited By
Federal learning privacy protection method and federal learning privacy protection system for label-free public data set
CN120561972A