Federal learning security aggregation method and system based on modular component homomorphism
By using the modular component homomorphic encryption algorithm in federated learning to control ciphertext expansion, it solves the problems of low computational efficiency and loss of accuracy, achieves efficient data processing and privacy protection in the encrypted state, and is suitable for large-scale data sets.
Patent Information
- Application Number
- CN202410734238.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing federated learning secure aggregation methods based on homomorphic encryption suffer from low computational efficiency and accuracy loss, which limit their application in real-time or large-scale data sets.
An encryption algorithm based on modular component homomorphism is adopted. By setting the modular base and redundant modular projection, the degree of ciphertext expansion is controlled, and the modular component homomorphic encryption library is expanded to preprocess the parameter data ciphertext after neural network training. Security and efficiency of computing in an encrypted state.
It improves computing efficiency, reduces data transmission risks, ensures the privacy protection of participants' original data, and is suitable for applications with large-scale data sets.
Smart Images

Figure CN118740360A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a federated learning security aggregation method and system based on modular component homomorphism. Background Art
[0002] In IoT devices, such as mobile phones, wearable devices or cars, a large amount of data is generated every moment. Using this data to participate in deep learning can bring us great convenience. The model algorithm of deep learning and a large amount of data make deep learning an effective tool for solving practical problems. In the current era of big data, the field of deep learning is booming. Deep learning model algorithms combined with massive data have become a powerful tool for solving practical problems. However, in many centralized deep learning systems of client-server models, uploading data to the server for training poses the risk of privacy leakage. At the same time, if users only use local data to train the model, the risk of overfitting in the model will increase.
[0003] To address these privacy issues, federated learning came into being. Federated learning is a distributed machine learning method that allows multiple institutions or individuals to jointly train models without sharing original data. Users only need to upload local model parameters to the server, which aggregates the parameters of each user to build a global model and then returns the global model to the user. Through this process, federated learning achieves global optimization while avoiding the leakage of private data. However, even with federated learning, attackers may still be able to restore user data by obtaining the model parameters uploaded by users, thereby infringing privacy.
[0004] To solve this problem, privacy protection has become the core of federated learning research. Homomorphic encryption is a special encryption technology that allows calculations to be performed on ciphertext without decrypting it into plaintext, and the operation of ciphertext is equivalent to the operation of plaintext. This means that various computing operations can be performed in an encrypted state without exposing the original content of the data. This feature makes homomorphic encryption have broad application prospects in privacy-secure outsourced storage and computing.
[0005] The existing federated learning secure aggregation methods based on homomorphic encryption still have the following problems:
[0006] Inefficient computation. Existing homomorphic encryption algorithms tend to have high computational complexity, which is mainly attributed to the encryption and decryption operations and the maintenance of homomorphic properties. Especially when executing complex algorithms and processing large-scale data, the computational overhead may increase significantly, resulting in performance degradation and increased latency. This computational inefficiency may limit its application on real-time or large-scale datasets.
[0007] Precision loss: Some homomorphic encryption schemes may introduce errors or precision loss when performing calculations. This is a serious problem for tasks that require high-precision calculations, as it may lead to inaccurate or distorted results. Therefore, when using homomorphic encryption for calculations, this precision loss must be taken into account and appropriate measures must be taken to reduce its impact.
[0008] Therefore, how to provide a federated learning security aggregation method and system based on modular component homomorphism that meets the data transmission security requirements while effectively improving computing efficiency and accuracy is a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0009] In view of the above research status, the present invention provides a federated learning security aggregation method and system based on modular component homomorphism, which controls the degree of ciphertext expansion by setting the modular cardinality and redundant modular projection, and expands the modular component homomorphic encryption library's ciphertext preprocessing function for parameter data after neural network training.
[0010] The first federated learning security aggregation method based on modular component homomorphism provided by the present invention comprises the following steps:
[0011] S1: Receive global model parameters sent by the server;
[0012] S2: Based on the global model parameters, use the local data set to perform local model training, and when the optimal solution of the current training round is reached, obtain an updated local model and local model parameters;
[0013] S3: Encrypt the local model parameters by a modular component homomorphic encryption algorithm to obtain ciphertext parameters, and then send them to the server, wherein the modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, wherein NlogM>128;
[0014] S4: receiving and decrypting the ciphertext aggregation result returned by the server to obtain new global model parameters, wherein the ciphertext aggregation result includes the ciphertext parameters received from multiple clients and aggregated by the server based on the modular component homomorphic encryption algorithm;
[0015] S5: Perform the next round of iterative training on the updated local model using the new global model parameters, and repeat S2-S5 until a preset number of iterations is reached or the loss function converges, thereby obtaining a trained local model.
[0016] Preferably, the global model parameters are parameters after the server is initialized, including: global model architecture parameters and global parameter constants required for training.
[0017] Preferably, in S2: multiple rounds of training are performed, and in each round of training, the local data is divided into sub-batch data of fixed size for training.
[0018] Preferably, S2 comprises the following steps:
[0019] S21: Load the local data set you hold locally;
[0020] S22, initializing the local model using the global model parameters;
[0021] S23, randomly extracting sub-batch data of a fixed size from the local data set as the number of samples used in each iterative training;
[0022] S24, using the current local model to perform forward propagation calculation on the extracted sub-batch data to obtain the prediction output of the model;
[0023] S25. Calculate the value of the loss function according to the predicted output and the true label corresponding to the sub-batch data;
[0024] S26, using the loss function, calculating the gradient information of the local model parameters with respect to the loss function, and using the back propagation algorithm to back propagate the gradient information back to each layer of the current local model;
[0025] S27, using a stochastic gradient descent algorithm to update local model parameters according to the gradient information;
[0026] S28. Repeat S23-S27 until the iterative training is completed.
[0027] Preferably, the step of encrypting the local model parameters by using a modular component homomorphic encryption algorithm to obtain ciphertext parameters in S3 includes the following steps:
[0028] Generate your own private key SK, public key PK and evaluation key EK based on the user key U;
[0029] The evaluation key EK is used to perform blind calculation on the computing task to hide the specific content of the computing task and obtain the ciphertext after blind calculation; the evaluation key EK includes the magnification a and the modulus B;
[0030] The public key PK is used to encrypt the local model parameters;
[0031] The private key SK is used to decrypt the ciphertext after blind calculation and generate the public key; the private key SK includes the magnification a, the modulus basis B and the real modulus component index S;
[0032] According to the multiplication circuit depth of the homomorphic encryption algorithm, the number of module bases N and the projection position of the obfuscated redundant module M-1 are given.
[0033] Preferably, the step of encrypting the local model parameters by using a modular component homomorphic encryption algorithm to obtain ciphertext parameters in S3 includes the following steps:
[0034] Set the modular base number P and the confusion redundancy number Q;
[0035] Each local model parameter is divided by the number of corresponding module bases to obtain P real module projections, each real module projection is mixed with Q confusion redundancies, and each real projection has R optional positions;
[0036] The optional position of each true modulus projection is determined by the position template in the private key SK, namely the true modulus component index S, and finally a ciphertext of size P×R is obtained.
[0037] Preferably, the ciphertext aggregation result returned by the server in S4 includes: performing weighted averaging on the ciphertext parameters using a modular component homomorphic encryption algorithm to obtain an aggregated ciphertext result.
[0038] The present invention also provides a second federated learning security aggregation method based on modular component homomorphism, comprising the following steps:
[0039] S1: Initialize the global model parameters and send them to each client so that each client can perform the following steps: each client uses the local data set to perform local model training. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained, and the local model parameters are encrypted by the modular component homomorphic encryption algorithm to obtain ciphertext parameters, which are then sent to the server. The modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, where NlogM>128;
[0040] S2: Receive the ciphertext parameters returned by each client, and aggregate the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm to obtain a ciphertext aggregation result, and send it to each client, so that each client can decrypt the ciphertext aggregation result to obtain new global model parameters, and use the new global model parameters to perform the next round of iterative training on the updated local model, repeat the steps of each client in S1 until the preset number of iterations is reached or the loss function converges, and obtain a trained local model.
[0041] The present invention also provides a federated learning security aggregation client system according to the first federated learning security aggregation method based on modular component homomorphism, comprising:
[0042] Global model parameter receiving module: used to receive global model parameters sent by the server;
[0043] Local model training module: used to perform local model training using a local data set based on the global model parameters, and obtain an updated local model and local model parameters when the optimal solution of the current training round is reached;
[0044] Modulus component homomorphic encryption module: used to encrypt the local model parameters through the modulus component homomorphic encryption algorithm to obtain ciphertext parameters, and then send them to the server. The modulus component homomorphic encryption algorithm includes performing modulus component homomorphic encryption calculation based on the local model parameters, the modulus cardinality N and the obfuscated redundant modulus projection position M-1, where NlogM>128;
[0045] Modular component homomorphic decryption module: used to receive and decrypt the ciphertext aggregation result returned by the server to obtain new global model parameters. The ciphertext aggregation result includes the ciphertext parameters received from multiple clients and aggregated by the server based on the modular component homomorphic encryption algorithm;
[0046] Local model parameter update module: used to call the local model training module and use the new global model parameters to perform the next round of iterative training on the updated local model until the preset number of iterations is reached or the loss function converges, thereby obtaining a trained local model.
[0047] The present invention also provides a federated learning security aggregation server-side system according to the second method for federated learning security aggregation based on modular component homomorphism, comprising:
[0048] The global model parameter initialization module is used to initialize the global model parameters and send them to each client so that each client can perform the following steps: each client uses a local data set to perform local model training. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained, and the local model parameters are encrypted by a modular component homomorphic encryption algorithm to obtain ciphertext parameters, which are then sent to the server. The modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, where NlogM>128;
[0049] The ciphertext parameter aggregation module is used to receive the ciphertext parameters returned by each client, and aggregate the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm to obtain a ciphertext aggregation result, and send it to each client, so that each client can decrypt the ciphertext aggregation result to obtain new global model parameters, and use the new global model parameters to perform the next round of iterative training on the updated local model, repeating the step of each client generating ciphertext parameters based on the initialized global model parameters until a preset number of iterations is reached or the loss function converges, thereby obtaining a trained local model.
[0050] The federated learning security aggregation method and system based on modular component homomorphism proposed in the present invention have the following beneficial effects compared with the prior art:
[0051] The obfuscated modular component homomorphic encryption algorithm of the present invention can calculate data in the ciphertext state, thereby protecting the original data privacy of the participants. Even in the encrypted state, the server can calculate the ciphertext without decrypting the original data.
[0052] The present invention expands the function of preprocessing the ciphertext of parameter data after neural network training by the domestic modular component homomorphic encryption library, controls the degree of ciphertext expansion by setting the modular cardinality and redundant modular projection, adjusts the size of memory occupied by the ciphertext, and reduces the bandwidth.
[0053] The present invention enables the server to perform aggregation operations such as weighted averaging on the encryption parameters from each participant to obtain an update of the global model, thereby realizing the integration and improvement of model parameters in federated learning.
[0054] The present invention can reduce the risk of data transmission. Even if the ciphertext parameters are intercepted by an attacker during the transmission process, the attacker cannot obtain the information of the original data due to the security of the encryption parameters.
[0055] The homomorphic encryption algorithm of the modular component used in the present invention requires less amortized running time and is more suitable for applications with large amounts of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work.
[0057] Figure 1 It is a principle diagram of a federated learning security aggregation method based on modular component homomorphism provided in an embodiment of the present invention;
[0058] Figure 2 A diagram of a federated learning architecture based on modular component homomorphic encryption provided in an embodiment of the present invention;
[0059] Figure 3 An architecture diagram of a federated learning security aggregation system provided for an embodiment of the present invention;
[0060] Figure 4 Another diagram of a federated learning security aggregation system provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0062] like Figure 1-2 As shown, the first aspect of the embodiment of the present invention provides a federated learning security aggregation method based on modular component homomorphism, comprising the following steps:
[0063] S1: Receive global model parameters sent by the server;
[0064] S2: Based on the global model parameters, use the local data set to train the local model to ensure that the data does not leave the local area. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained.
[0065] S3: Encrypt the local model parameters through the modular component homomorphic encryption algorithm to obtain the ciphertext parameters, and then send them to the server. The modular component homomorphic encryption allows addition operations in the encrypted state, so the encrypted parameters can be encrypted without leaking the original data; the modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculations based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, where NlogM>128, to ensure that the attacker cannot correctly guess the position of each real number modular projection through brute force decryption, which ensures the security of the system;
[0066] S4: Receive and decrypt the ciphertext aggregation result returned by the server to obtain new global model parameters. The ciphertext aggregation result includes the ciphertext parameters received from multiple clients and aggregated by the server based on the modular component homomorphic encryption algorithm.
[0067] S5: Use the new global model parameters to perform the next round of iterative training on the updated local model, repeat S2-S5 until the preset number of iterations is reached or the loss function converges, and obtain the trained local model.
[0068] It should be noted that in homomorphic encryption, after a ciphertext undergoes a specific operation, its decryption result matches the result of the same operation on the plaintext. This means that data can be encrypted and sent to a cloud service provider, and the cloud service provider can perform the required operations in a ciphertext state without directly accessing or exposing the plaintext content of the data. This provides a safe and efficient solution for some scenarios that require outsourced data processing, such as medical insurance, identity authentication, and other fields. The present invention uses a homomorphic encryption algorithm based on modular components to protect user privacy. Before users upload their model weights, the weight data is encrypted using a homomorphic encryption algorithm using the user's key. The server uses ciphertext operations to aggregate the global model using the encrypted data and returns it to the user. After the user obtains the global model, it decrypts it using the key, and then the client continues training using the global model. The training is iterated multiple times until a consensus is reached.
[0069] This embodiment aims to ensure data privacy and security when exchanging intermediate results of multi-party joint training. When exchanging intermediate results of multi-party joint training, the intermediate results are encrypted using a homomorphic encryption algorithm on the client side, and then sent to the server for aggregation using a modular component homomorphic encryption algorithm, and then the aggregated results are returned to all clients, and the aggregated results are decrypted on the client side. Finally, through the mutual cooperation between the server and the client in each iteration, the optimal global model is generated, which not only ensures that the intermediate results are not leaked, but also completes the training task.
[0070] Specifically, using the homomorphic encryption model, the party that processes the data cannot view the personal encrypted information being processed, but can only see the final ciphertext result after the operation. For cloud computing, homomorphic encryption technology has become a major boost. Through the homomorphic nature, cloud computing can directly operate without accessing the original plaintext data, providing a good privacy protection environment for data providers and attracting more people to participate in federated learning.
[0071] The client and the server constitute the core part of federated learning. The client includes various mobile terminals, while the server has abundant computing and storage resources. Each client runs locally, receives the global weight parameters initialized from the server, and then uses the local data set to perform gradient calculations, and encrypts the parameters through homomorphic encryption to update the local model. The server mainly plays the role of aggregation operation, receives the local optimal parameters from the client, and aggregates the parameters according to the preset aggregation strategy to calculate the optimal parameters of the global model. If the global training reaches the preset goal or converges, the training stops; otherwise, the next round of iterative training is carried out.
[0072] This federated learning solution based on homomorphic encryption is of great significance in the field of cloud computing. Its homomorphic nature enables cloud computing to directly operate encrypted data without obtaining the original plaintext data, effectively protecting the privacy of data providers and attracting more individuals to participate in federated learning.
[0073] In one embodiment, the global model parameters are parameters initialized by the server, including: global model architecture parameters and global parameter constants required for training.
[0074] In one embodiment, in S2: multiple rounds of training are performed, and in each round of training, the local data is divided into sub-batches of fixed size for training.
[0075] In one embodiment, S2 includes the following steps:
[0076] S21: Load the local data set you hold locally;
[0077] S22, initializing the local model using global model parameters;
[0078] S23. Randomly extract sub-batches of fixed size from the local dataset as the number of samples used in each iterative training. Batch training can effectively utilize memory resources. Processing the entire dataset at one time may exceed the memory limit of the computing device. Splitting the dataset into small batches ensures that only a portion of the data is processed each time, so that training can be performed on devices with limited memory capacity.
[0079] S24, using the current local model to perform forward propagation calculation on the extracted sub-batch data to obtain the prediction output of the model;
[0080] S25. Calculate the value of the loss function based on the predicted output and the true label corresponding to the sub-batch data;
[0081] S26, using the loss function, calculating the gradient information of the local model parameters with respect to the loss function, and using the back propagation algorithm to back propagate the gradient information back to each layer of the current local model;
[0082] S27, using a stochastic gradient descent algorithm to update local model parameters according to gradient information;
[0083] S28. Repeat S23-S27 until the iterative training is completed.
[0084] In one embodiment, encrypting the local model parameters by the modular component homomorphic encryption algorithm to obtain the ciphertext parameters in S3 includes the following steps:
[0085] Generate your own private key SK, public key PK and evaluation key EK based on the user key U;
[0086] The evaluation key EK is used to perform blind calculations on the computing task to hide the specific content of the computing task and obtain the ciphertext after blind calculation. The evaluation key EK includes a magnification a and a modulus B. The magnification a is used to eliminate noise to ensure the correctness of the result.
[0087] The public key PK is used to encrypt local model parameters;
[0088] The private key SK is used to decrypt the ciphertext after blind calculation and generate the public key; the private key SK includes the magnification a, the modulus basis B and the real modulus component index S;
[0089] According to the multiplication circuit depth of the homomorphic encryption algorithm, the number of module bases N and the projection position of the obfuscated redundant module M-1 are given.
[0090] In one embodiment, encrypting the local model parameters by the modular component homomorphic encryption algorithm to obtain the ciphertext parameters in S3 includes the following steps:
[0091] Set the modular base number P and the confusion redundancy number Q;
[0092] Each local model parameter is divided by the number of corresponding module bases to obtain P real module projections, each real module projection is mixed with Q confusion redundancies, and each real projection has R optional positions;
[0093] The optional position of each true modulus projection is determined by the position template in the private key SK, namely the true modulus component index S, and finally a ciphertext of size P×R is obtained.
[0094] When executing:
[0095] Assume that the modular base is 64 and the obfuscated redundancy number is 3. For each plaintext and redundant data, add a random noise η. The purpose is to prevent the same plaintext and modular base from producing the same modular projection and the same ciphertext, which requires satisfying η<<α so that decryption eliminates the random number and its derived noise and obtains the correct result.
[0096] Each original data modulo the corresponding modulus base will get 64 real modulus projections, each of which is mixed with 2 confusion redundancies, and each real projection has three optional positions, and the position of the real modulus projection of each position is determined by the real modulus component index S in the key (SK). Finally, a ciphertext of size 64×3 will be obtained. The magnification factor α, similar to the scale factor Δ, also needs to be unified when performing addition, and l and t are used in the ciphertext to record the changes of the magnification factor α and the scale factor Δ during the calculation process.
[0097] It should be noted that for the blind addition operation BlindAdd(c1,c2), two ciphertexts c1 and c2 are added to obtain the ciphertext result C, where the magnification of c1 is recorded as The magnification of c2 is recorded as And t1<t2. The proportional factor of c1 is recorded as The scaling factor of c2 is recorded as And l2<l1.
[0098] The ciphertext c1, c2 are added to the corresponding modulus components:
[0099]
[0100] In one embodiment, S3 generates keys and other related parameter information for encryption by a trusted third party, and the trusted third party does not participate in the interaction between the participants in the training and the server.
[0101] In one embodiment, the modular component homomorphic encryption algorithm is based on a GPU parallel computing strategy, which effectively improves the efficiency of ciphertext computing by utilizing the powerful computing power of the GPU.
[0102] In one embodiment, the ciphertext aggregation result returned by the server in S4 includes: weighted averaging the ciphertext parameters using the modular component homomorphic encryption algorithm to obtain the aggregated ciphertext result. The server performs aggregation operations such as weighted averaging, and when division is required, it is replaced by multiplication by the reciprocal, so that the encrypted weighted average calculation can be realized in this process. All calculations are performed in the ciphertext state, that is, the server does not need to decrypt the parameters, but directly performs addition operations on the ciphertext to obtain the aggregated ciphertext result.
[0103] In one embodiment, by designing the structure of the client neural network to adapt to the modular component homomorphic encryption library, and designing a secure aggregation calculation method on the cloud server side, each client's local data set includes MNIST handwriting training samples, and the training of MNIST handwriting recognition federated learning under ciphertext is realized. The accuracy, efficiency and security of the secure aggregation of federated learning based on the modular component homomorphic encryption library are verified. At the same time, the training efficiency of MNIST handwriting recognition federated learning under ciphertext is improved.
[0104] In one embodiment, floating-point operations and floating-point encoding are supported, and ciphertext calculations with 19 digits after the decimal point can be realized, providing support for the implementation of a federated learning security aggregation method based on a modular component homomorphic encryption algorithm. The parameters passed by the client to the server are all floating-point numbers. The floating-point numbers involved in this experiment reach 19 digits after the decimal point, and floating-point operations are used when performing secure aggregation on the server side.
[0105] In this embodiment, a scalar encoding method is used to retain a certain precision of the floating point number and then convert it into an integer form. The plaintext floating point number data is multiplied by a scale factor Δ and rounded to the nearest integer. During calculation, the ciphertext with the same scale factor can be directly calculated.
[0106] The second aspect of the embodiment of the present invention further provides a federated learning security aggregation method based on modular component homomorphism, comprising the following steps:
[0107] S1: Initialize the global model parameters and send them to each client so that each client can perform the following steps: each client uses the local data set to perform local model training. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained. The local model parameters are encrypted through the modular component homomorphic encryption algorithm to obtain the ciphertext parameters, which are then sent to the server. The modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculations based on local model parameters, modular cardinality N, and obfuscated redundant modular projection position M-1, where NlogM>128; at this stage, the server will broadcast the initialized parameters to all participants to start the federated learning task.
[0108] S2: Receive the ciphertext parameters returned by each client, and aggregate the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm to obtain the ciphertext aggregation result, and send it to each client, so that each client can decrypt the ciphertext aggregation result to obtain the new global model parameters, and use the new global model parameters to perform the next round of iterative training on the updated local model. Repeat the steps of each client in S1 until the preset number of iterations is reached or the loss function converges to obtain the trained local model.
[0109] like Figure 3 As shown, the third aspect of the embodiment of the present invention further provides a federated learning security aggregation client system according to the first aspect of the embodiment, including:
[0110] Global model parameter receiving module: used to receive global model parameters sent by the server;
[0111] Local model training module: used to train the local model using the local data set based on the global model parameters, and obtain the updated local model and local model parameters when the optimal solution of the current training round is reached;
[0112] Modulus component homomorphic encryption module: used to encrypt local model parameters through the modulus component homomorphic encryption algorithm to obtain ciphertext parameters, and then send them to the server. The modulus component homomorphic encryption algorithm includes performing modulus component homomorphic encryption calculation based on local model parameters, modulus cardinality N and obfuscated redundant modulus projection position M-1, where NlogM>128;
[0113] Modular component homomorphic decryption module: used to receive and decrypt the ciphertext aggregation results returned by the server to obtain new global model parameters. The ciphertext aggregation results include the server aggregating the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm;
[0114] Local model parameter update module: used to call the local model training module and use the new global model parameters to perform the next round of iterative training on the updated local model until the preset number of iterations is reached or the loss function converges, thus obtaining a trained local model.
[0115] The federated learning security aggregation client system provided in the third aspect of this embodiment can be used to execute all steps of the federated learning security aggregation method based on modular component homomorphism in the first aspect of the embodiment.
[0116] like Figure 4 As shown, the fourth aspect of the embodiment of the present invention further provides a federated learning security aggregation server-side system according to the second aspect of the embodiment, including:
[0117] The global model parameter initialization module is used to initialize the global model parameters and send them to each client so that each client can perform the following steps: each client uses the local data set to perform local model training. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained. The local model parameters are encrypted by the modular component homomorphic encryption algorithm to obtain ciphertext parameters, which are then sent to the server. The modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, where NlogM>128;
[0118] The ciphertext parameter aggregation module is used to receive the ciphertext parameters returned by each client, and aggregate the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm to obtain the ciphertext aggregation result, and send it to each client, so that each client can decrypt the ciphertext aggregation result, obtain new global model parameters, and use the new global model parameters to perform the next round of iterative training on the updated local model. Repeat the step of each client generating ciphertext parameters based on the initialized global model parameters until the preset number of iterations is reached or the loss function converges, and the trained local model is obtained.
[0119] The federated learning security aggregation server-side system provided in the fourth aspect of this embodiment can be used to execute all steps of the federated learning security aggregation method based on modular component homomorphism in the second aspect of the embodiment.
[0120] The above is a detailed introduction to a federated learning security aggregation method and system based on modular-component homomorphism provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0121] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. A secure aggregation method for federated learning based on modular component homomorphism, characterized by: The steps include: S1: Receive global model parameters sent by the server; S2: Based on the global model parameters, use the local data set to perform local model training, and when the optimal solution of the current training round is reached, obtain an updated local model and local model parameters; S3: Encrypt the local model parameters by a modular component homomorphic encryption algorithm to obtain ciphertext parameters, and then send them to the server, wherein the modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, wherein NlogM>128; S4: receiving and decrypting the ciphertext aggregation result returned by the server to obtain new global model parameters, wherein the ciphertext aggregation result includes the ciphertext parameters received from multiple clients and aggregated by the server based on the modular component homomorphic encryption algorithm; S5: Perform the next round of iterative training on the updated local model using the new global model parameters, and repeat S2-S5 until a preset number of iterations is reached or the loss function converges, thereby obtaining a trained local model.
2. According to claim 1, a method for secure aggregation of federated learning based on modular component homomorphism is characterized in that: The global model parameters are parameters after the server is initialized, including: global model architecture parameters and global parameter constants required for training.
3. According to claim 1, a method for secure aggregation of federated learning based on modular component homomorphism is characterized in that: In S2: multiple rounds of training are performed, and in each round of training, the local data is divided into sub-batch data of fixed size for training.
4. According to claim 1, a method for secure aggregation of federated learning based on modular component homomorphism is characterized in that: The S2 comprises the following steps: S21: Load the local data set you hold locally; S22, initializing the local model using the global model parameters; S23, randomly extracting sub-batch data of a fixed size from the local data set as the number of samples used in each iterative training; S24, using the current local model to perform forward propagation calculation on the extracted sub-batch data to obtain the prediction output of the model; S25. Calculate the value of the loss function according to the predicted output and the true label corresponding to the sub-batch data; S26, using the loss function, calculating the gradient information of the local model parameters with respect to the loss function, and using the back propagation algorithm to back propagate the gradient information back to each layer of the current local model; S27, using a stochastic gradient descent algorithm to update local model parameters according to the gradient information; S28. Repeat S23-S27 until the iterative training is completed.
5. According to claim 1, a method for secure aggregation of federated learning based on modular component homomorphism is characterized in that: The step of encrypting the local model parameters by using the modular component homomorphic encryption algorithm to obtain ciphertext parameters in S3 includes the following steps: Generate your own private key SK, public key PK and evaluation key EK based on the user key U; The evaluation key EK is used to perform blind calculation on the computing task to hide the specific content of the computing task and obtain the ciphertext after blind calculation; the evaluation key EK includes the magnification a and the modulus B; The public key PK is used to encrypt the local model parameters; The private key SK is used to decrypt the ciphertext after blind calculation and generate the public key; the private key SK includes the magnification a, the modulus basis B and the real modulus component index S; According to the multiplication circuit depth of the homomorphic encryption algorithm, the number of module bases N and the projection position of the obfuscated redundant module M-1 are given.
6. According to claim 5, a method for secure aggregation of federated learning based on modular component homomorphism is characterized in that: The step of encrypting the local model parameters by using the modular component homomorphic encryption algorithm to obtain ciphertext parameters in S3 includes the following steps: Set the modular base number P and the confusion redundancy number Q; Each local model parameter is divided by the number of corresponding module bases to obtain P real module projections, each real module projection is mixed with Q confusion redundancies, and each real projection has R optional positions; The optional position of each true modulus projection is determined by the position template in the private key SK, namely the true modulus component index S, and finally a ciphertext of size P×R is obtained.
7. According to claim 1, a method for secure aggregation of federated learning based on modular component homomorphism is characterized in that: The ciphertext aggregation result returned by the server in S4 includes: performing weighted averaging on the ciphertext parameters using a modular component homomorphic encryption algorithm to obtain an aggregated ciphertext result.
8. A method for secure aggregation of federated learning based on modular component homomorphism, characterized by: The steps include: S1: Initialize the global model parameters and send them to each client so that each client can perform the following steps: each client uses the local data set to perform local model training. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained, and the local model parameters are encrypted by the modular component homomorphic encryption algorithm to obtain ciphertext parameters, which are then sent to the server. The modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, where NlogM>128; S2: Receive the ciphertext parameters returned by each client, and aggregate the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm to obtain a ciphertext aggregation result, and send it to each client, so that each client can decrypt the ciphertext aggregation result to obtain new global model parameters, and use the new global model parameters to perform the next round of iterative training on the updated local model, repeat the steps of each client in S1 until the preset number of iterations is reached or the loss function converges, and obtain a trained local model.
9. A federated learning security aggregation client system based on a modular component homomorphism federated learning security aggregation method according to any one of claims 1-7, characterized in that: include: Global model parameter receiving module: used to receive global model parameters sent by the server; Local model training module: used to perform local model training using a local data set based on the global model parameters, and obtain an updated local model and local model parameters when the optimal solution of the current training round is reached; Modulus component homomorphic encryption module: used to encrypt the local model parameters through the modulus component homomorphic encryption algorithm to obtain ciphertext parameters, and then send them to the server. The modulus component homomorphic encryption algorithm includes performing modulus component homomorphic encryption calculation based on the local model parameters, the modulus cardinality N and the obfuscated redundant modulus projection position M-1, where NlogM>128; Modular component homomorphic decryption module: used to receive and decrypt the ciphertext aggregation result returned by the server to obtain new global model parameters. The ciphertext aggregation result includes the ciphertext parameters received from multiple clients and aggregated by the server based on the modular component homomorphic encryption algorithm; Local model parameter update module: used to call the local model training module and use the new global model parameters to perform the next round of iterative training on the updated local model until the preset number of iterations is reached or the loss function converges, thereby obtaining a trained local model.
10. A federated learning security aggregation server-side system according to the method for federated learning security aggregation based on modular component homomorphism according to claim 8, characterized in that: include: The global model parameter initialization module is used to initialize the global model parameters and send them to each client so that each client can perform the following steps: each client uses a local data set to perform local model training. When the optimal solution of the current training round is reached, the updated local model and local model parameters are obtained, and the local model parameters are encrypted by a modular component homomorphic encryption algorithm to obtain ciphertext parameters, which are then sent to the server. The modular component homomorphic encryption algorithm includes performing modular component homomorphic encryption calculation based on the local model parameters, the modular cardinality N, and the obfuscated redundant modular projection position M-1, where NlogM>128; The ciphertext parameter aggregation module is used to receive the ciphertext parameters returned by each client, and aggregate the ciphertext parameters received from multiple clients based on the modular component homomorphic encryption algorithm to obtain a ciphertext aggregation result, and send it to each client, so that each client can decrypt the ciphertext aggregation result to obtain new global model parameters, and use the new global model parameters to perform the next round of iterative training on the updated local model, repeating the step of each client generating ciphertext parameters based on the initialized global model parameters until a preset number of iterations is reached or the loss function converges, thereby obtaining a trained local model.
Citation Information
Patent Citations
Federal learning method based on differential privacy and chaotic encryption
CN113239404A
Verifiable privacy protection federated learning method and system
CN116467736A
Data classification method and system based on improved federal learning and related equipment
CN116503642A
Cited By
Federal learning GPU acceleration ciphertext aggregation method based on homomorphic encryption
CN119483906A
A GPU-accelerated ciphertext aggregation method for federated learning based on homomorphic encryption
CN119483906B
Federal learning method and system based on modular component homomorphic encryption and response verification
CN121125053A
