A federated learning method and system based on mode component homomorphic encryption and response verification

CN121125053BActive Publication Date: 2026-09-04BEIJING ELECTRONICS SCI & TECH INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511537255.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-09-04
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

然而,在实际部署中,联邦学习仍面临诸多挑战:首先,不同参与方的数据分布不一致、质量差异较大,容易导致模型收敛速度下降、训练不稳定;其次,存在部分客户端可能上传异常参数甚至故意投毒,从而破坏全局模型的性能;此外,随着客户端数量增加,系统的通信与协调开销也随之增大,制约了联邦学习的大规模应用

Benefits of technology

[0065] 1. This invention introduces modular component homomorphic encryption into the federated learning framework. After the client completes local training, it does not directly upload plaintext parameters, but instead performs homomorphic encryption on the model parameters before transmitting them to the central server. The server completes parameter aggregation without decryption and returns the encrypted global model to the client, which then decrypts it for subsequent training. This achieves end-to-end privacy protection throughout the training process. Homomorphic encryption ensures that the server can never access any plaintext parameters, completely eliminating the risk of plaintext leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125053B_ABST
    Figure CN121125053B_ABST
Patent Text Reader

Abstract

The application discloses a federated learning method and system based on modulus component homomorphic encryption and response verification, relates to the technical field of information security, and comprises the following steps: obtaining initial global model parameters and generating a pre-shared key; a client generates a participation key and a calculation key; a plurality of clients are randomly selected as participation clients and a challenge pair is sent; a participation client generates a challenge response value based on the pre-shared key and the challenge pair, performs local training based on the initial global model parameters, encrypts local model parameters based on the participation key and a modulus component homomorphic encryption algorithm, and obtains model parameter ciphertext; trusted verification is performed based on the challenge response value, and encrypted global model parameters are obtained by aggregating trusted model parameter ciphertext based on the calculation key; the participation client updates the local model based on the encrypted global model parameters, the above process is repeated until the model converges, and a trained global model is obtained. The encryption calculation efficiency, response speed and security robustness of the federated learning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and more specifically to a federated learning method and system based on modular component homomorphic encryption and response verification. Background Technology

[0002] Currently, with the rapid growth of massive amounts of data, various terminal devices and institutions continuously generate multi-source heterogeneous data. Fully utilizing this distributed data can significantly improve the performance of deep learning models, thereby solving practical problems more efficiently. The core idea of ​​Federated Learning (FL) is to allow participating parties to train models locally without uploading the original data, only uploading weighted model parameters or gradients to a central server, which then aggregates the models. This architecture effectively breaks down "data silos," enabling cross-terminal and cross-organizational collaborative modeling while effectively protecting user privacy. However, in actual deployment, Federated Learning still faces many challenges: First, inconsistent data distribution and significant quality differences among different participants can easily lead to slower model convergence and unstable training; second, some clients may upload abnormal parameters or even intentionally poison the data, thereby damaging the overall model performance; furthermore, as the number of clients increases, the system's communication and coordination overhead also increases, restricting the large-scale application of Federated Learning.

[0003] To further enhance the practicality of federated learning in terms of security and scalability, existing technologies have introduced modular component homomorphic encryption into the federated learning framework. However, existing methods of applying homomorphic encryption to federated learning still have the following drawbacks: (1) Low encryption efficiency. When dealing with high-dimensional model parameters in federated learning, traditional homomorphic encryption methods need to encrypt each layer of parameters element by element. Especially when the model is complex or the computing power of the client device is limited, the computational resources required for encryption and aggregation are extremely high, which seriously affects the system response time and training efficiency; (2) The model weights transmitted in federated learning are of floating-point type, while most mainstream homomorphic encryption libraries only support integer operations. If floating-point numbers are directly encrypted, it is necessary to pass through the encryption process. Over-point approximation transformation is prone to cumulative error, and the accuracy of the decrypted model cannot be restored, affecting the training stability and final performance of the model; (3) Malicious client threat: In the traditional federated learning architecture, the client authentication mechanism usually relies on device registration or connection identification, lacking active anti-counterfeiting means based on interactive verification. Once an attacker participates in training by forging a legitimate client identity and uploads malicious model parameters, it not only threatens the integrity of the system, but may also lurk in the training process for a long time, continuously interfering with the aggregation quality, causing model deviation or even overall failure. The existing system lacks an identity protection scheme based on key mechanism and response consistency verification, making it difficult to deal with such active identity impersonation attacks.

[0004] Therefore, how to improve the efficiency of encrypted computation, response speed, and security robustness of federated learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a federated learning method and system based on modular component homomorphic encryption and response verification, which improves the encryption computation efficiency, response speed and security robustness of federated learning.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] Federated learning methods based on modular component homomorphic encryption and response verification include:

[0008] Obtain initial global model parameters and generate a pre-shared key;

[0009] The client receives the pre-shared key and generates a participation key and a computation key;

[0010] Randomly select multiple clients as participating clients and send challenge pairs;

[0011] The participating client generates a challenge response value based on the pre-shared key and the challenge pair, and performs local training using the FedProx algorithm based on the initial global model parameters to obtain local model parameters;

[0012] The local model parameters are encrypted based on the participation key and the modular component homomorphic encryption algorithm to obtain the ciphertext of the model parameters;

[0013] Trustworthy verification is performed based on the challenge response value, and the trusted model parameter ciphertext is aggregated based on the computing key to obtain encrypted global model parameters;

[0014] The participating client updates its local model based on the encrypted global model parameters, and repeats the above process until the model converges, thus obtaining the trained global model.

[0015] In one embodiment, obtaining initial global model parameters and generating a pre-shared key specifically includes:

[0016] The server initializes the built-in global model weight parameters to obtain the initial global model parameters;

[0017] The server generates a unique pre-shared key for each client.

[0018] The initial global model parameters and the pre-shared key are jointly sent to the corresponding client.

[0019] The server locally records a mapping table between the client and the pre-shared key.

[0020] In one embodiment, generating the participation key and the computation key specifically includes:

[0021] Based on the client, n coprime mode bases are selected to form a mode projection basis;

[0022] Based on the client settings, the magnification factor, scaling factor, and user master key are configured.

[0023] Generate a location template based on the user's master key;

[0024] The participation key is composed of the modal projection base, the magnification factor, the scaling factor, and the position template.

[0025] The calculation key is composed of the modulus projection base, the magnification factor, and the scaling factor.

[0026] In one embodiment, the challenge response value is specifically:

[0027] Ri = HASH(Ki, Ci);

[0028] Where Ri represents the challenge response value of the i-th participating client, HASH represents the cryptographic hash algorithm, Ki represents the pre-shared key of the i-th participating client, and Ci represents the challenge pair of the i-th participating client;

[0029] The challenge pair includes a random number and the current timestamp.

[0030] In one embodiment, obtaining local model parameters specifically includes:

[0031] The participating client initializes the parameters of the local model based on the received initial global model parameters to obtain the trained model;

[0032] The training model is trained on local data using the FedProx algorithm, and a regularization constraint term for the global model is added to the loss function.

[0033] The client performs multiple rounds of forward propagation, loss calculation, backpropagation and parameter update based on the trained model until the local training termination condition is met, thus obtaining the pre-trained model.

[0034] The local model parameters are obtained based on the pre-trained model.

[0035] In one embodiment, the method for obtaining the encrypted model parameters is as follows:

[0036] The participating client randomly generates multiple random data;

[0037] Based on the local model parameters multiplied by the scaling factor, rounded to the nearest integer, and then multiplied by the magnification factor, and with random noise added, the preprocessed model parameters are obtained.

[0038] Based on the random data multiplied by the amplification factor and the random noise added, scrambled redundant and confused data is obtained;

[0039] Based on the preprocessed model parameters and the redundant scrambled data, modulo is taken according to the modulo projection basis to obtain the set of real modulo projection components and the set of redundant random modulo projections.

[0040] Based on the location template, the set of real model projection components is inserted into the set of redundant random model projections at predetermined positions to obtain a ciphertext matrix as the ciphertext of the model parameters.

[0041] In one embodiment, the trusted verification specifically includes:

[0042] The server receives the challenge response values ​​and the encrypted model parameters sent by all participating clients;

[0043] The server calculates a challenge response value as a verification response value based on the challenge pair and the pre-shared key;

[0044] Determine whether the verification response value is equal to the received challenge response value;

[0045] If they are equal, the verification is successful. The encrypted model parameters uploaded by the participating client that have passed the verification are trusted encrypted text and will be included in the subsequent global model aggregation process.

[0046] If they are not equal, the verification fails, and the participating client that failed the verification is marked as an abnormal client, and the encrypted model parameters uploaded by it are rejected from entering the subsequent global model aggregation process.

[0047] Repeatedly verify the abnormal client. Any abnormal client that fails verification three times will be blacklisted and no longer participate in subsequent training.

[0048] In one embodiment, the method for obtaining encrypted global model parameters is as follows:

[0049] Obtain the computation key and the model parameter ciphertext corresponding to all verified participating clients as trusted computation key and trusted model parameter ciphertext;

[0050] Based on the amplification factor and the scaling factor in the trusted computing key, the corresponding trusted model parameter ciphertexts are aligned to obtain multiple aligned ciphertexts.

[0051] Based on the projection model basis in the trusted computing key, an addition operation is performed on all the parallel ciphertexts to obtain the encryption global model parameters;

[0052] The order of the magnification factor and the order of the scaling factor of the encrypted global model parameters are updated based on the order of the magnification factor and the order of the scaling factor of the ciphertext of the trusted model parameters.

[0053] In one embodiment, obtaining the trained global model specifically includes:

[0054] The participating client decrypts the received encrypted global model parameters based on the participating key to obtain new global model parameters;

[0055] The participating client updates its local model parameters based on the new global model parameters and trains using local data to obtain the locally updated model parameters.

[0056] Repeat the above process until the model converges, and output the trained global model.

[0057] The federated learning system based on modular component homomorphic encryption and response verification includes: a key generation module, a client selection module, a local training module, a parameter encryption module, a verification aggregation module, and an iterative update module;

[0058] The key generation module is used to obtain initial global model parameters and generate a pre-shared key; the client receives the pre-shared key and generates a participation key and a computation key;

[0059] The client selection module is used to randomly select multiple clients as participating clients and send challenge pairs;

[0060] The local training module is used by the participating client to generate a challenge response value based on the pre-shared key and the challenge pair, and to perform local training using the FedProx algorithm based on the initial global model parameters to obtain local model parameters;

[0061] The parameter encryption module is used to encrypt the local model parameters based on the participation key and the modular component homomorphic encryption algorithm to obtain the model parameter ciphertext.

[0062] The verification aggregation module is used to perform trusted verification based on the challenge response value, and to aggregate trusted model parameter ciphertext based on the computing key to obtain encrypted global model parameters;

[0063] The iterative update module is used by the participating client to update the local model based on the encrypted global model parameters, and to repeatedly execute the above process until the model converges and a trained global model is obtained.

[0064] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a federated learning method and system based on modular component homomorphic encryption and response verification, which has the following beneficial effects:

[0065] 1. This invention introduces modular component homomorphic encryption into the federated learning framework. After the client completes local training, it does not directly upload plaintext parameters, but instead performs homomorphic encryption on the model parameters before transmitting them to the central server. The server completes parameter aggregation without decryption and returns the encrypted global model to the client, which then decrypts it for subsequent training. This achieves end-to-end privacy protection throughout the training process. Homomorphic encryption ensures that the server can never access any plaintext parameters, completely eliminating the risk of plaintext leakage.

[0066] 2. This invention uses modular component technology to divide data into multiple independent modular space components, enabling parallel encryption and aggregation, significantly reducing computational overhead and improving system response speed. At the same time, to improve the aggregation effect in heterogeneous data and non-independent identically distributed (Non-IID) scenarios, this invention uses the FedProx algorithm as the basic federated optimization strategy, introducing a regularization term to limit the offset between client updates and the global model, alleviating the contradiction between local optima and global model convergence, and improving the overall modeling robustness.

[0067] 3. In terms of dealing with malicious clients, this invention designs a challenge-response mechanism protection strategy: First, the system pre-distributes keys and performs HMAC-based response authentication on the client's uploaded results in each round. Once a client whose uploaded results are found to deviate significantly from the group distribution is found, its key will be revoked and blacklisted to prevent it from participating in subsequent model updates, thereby effectively improving the robustness and security of the federated training process.

[0068] 4. This invention deeply integrates modular component homomorphic encryption, the FedProx algorithm, and a challenge-response authentication mechanism to construct a highly secure, efficient, and robust federated learning method. The entire process does not require centralized transmission or storage of the original data, which greatly enhances user trust and willingness to participate in high-privacy scenarios such as healthcare and finance. It is suitable for sensitive fields with extremely high requirements for data security and privacy protection, such as healthcare, finance, and government affairs, and achieves high-quality distributed collaborative modeling while ensuring privacy. Attached Figure Description

[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0070] Figure 1 The flowchart of the federated learning method based on modular component homomorphic encryption and response verification provided by this invention is shown.

[0071] Figure 2 The flowchart shows the method for obtaining encrypted model parameters provided by this invention.

[0072] Figure 3 This is a schematic diagram of the federated learning system structure based on modular component homomorphic encryption and response verification provided by the present invention. Detailed Implementation

[0073] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0074] Example 1

[0075] like Figure 1 As shown, this embodiment of the invention discloses a federated learning method based on modular component homomorphic encryption and response verification, including the following steps. For ease of description, these steps are numbered S1 to S7, and these numbers are not used to limit the sequential relationship between the various steps of this invention:

[0076] S1 obtains the initial global model parameters and generates a pre-shared key.

[0077] The server initializes the built-in global model weight parameters to obtain the initial global model parameters;

[0078] The server generates a unique pre-shared key Ki for each client, which is used in the subsequent challenge-response authentication process.

[0079] The initial global model parameters and the pre-shared key are sent together to the corresponding registered clients;

[0080] The server locally stores a mapping table between clients and pre-shared keys.

[0081] The S2 client receives the pre-shared key and generates the participation key and computation key.

[0082] Furthermore, each registered client receives a unique pre-shared key Ki and the same initial global model parameters.

[0083] Furthermore, generating the participation key and computation key specifically includes:

[0084] Based on the client, n coprime modulus bases are selected to form a modulus projection basis;

[0085] The client-side settings include magnification, scaling factor, and user master key.

[0086] Generate a location template based on the user's master key;

[0087] The participation key is composed of modal projection basis, magnification factor, scaling factor and position template;

[0088] The computation key is composed of the modal projection basis, magnification factor, and scaling factor.

[0089] Furthermore, an amplification factor 'a' is set to resist the influence of noise during the encryption calculation process; a scaling factor '∆' is set to ensure that the numerical range of the calculation result is consistent with the accuracy requirements; and a position template S is generated based on the user's master key U to determine the insertion position of the real modulus component in the redundant position.

[0090] S3 randomly selects multiple clients as participating clients and sends challenge pairs.

[0091] The server randomly selects a number of clients from all clients as training nodes for this round, i.e., participating clients, based on the set participation ratio.

[0092] Furthermore, the server generates a unique random number for each participating client selected in this round, and generates a challenge pair based on the random number and the current timestamp to prevent replay attacks, and then distributes the challenge pair to each participating client.

[0093] The S4 participating client generates challenge response values ​​based on the pre-shared key and challenge pair, and performs local training using the fedprox algorithm based on the initial global model parameters to obtain local model parameters.

[0094] Furthermore, the challenge response value is specifically defined as follows:

[0095] Ri = HASH(Ki, Ci);

[0096] Where Ri represents the challenge response value of the i-th participating client, HASH represents the cryptographic hash algorithm, Ki represents the pre-shared key of the i-th participating client, and Ci represents the challenge pair of the i-th participating client;

[0097] The challenge includes a random number and the current timestamp.

[0098] Furthermore, the local model parameters are obtained, specifically including:

[0099] The participating client initializes the parameters of the local model based on the received initial global model parameters, and obtains the trained model;

[0100] The FedProx algorithm is used to train local data based on the training model, and a regularization constraint term for the global model is added to the loss function to mitigate the impact of data heterogeneity.

[0101] The client performs multiple rounds of forward propagation, loss calculation, backpropagation and parameter update based on the trained model until the local training termination condition is met, such as local convergence, and obtains the pre-trained model.

[0102] Obtain local model parameters based on pre-trained models.

[0103] Furthermore, the regularization constraint term is:

[0104] ;

[0105] Where μ≥0 represents the proximal parameters, and w represents the new model parameters to be optimized by the client during local training. t Represents the global model parameters in round t. The new parameter w and the initial global parameter w were calculated. t The distance between them quantifies how much the model changes during local updates.

[0106] S5 encrypts the local model parameters based on the participation key and the modular component homomorphic encryption algorithm to obtain the ciphertext of the model parameters.

[0107] Furthermore, such as Figure 2 As shown, the method for obtaining the encrypted model parameters is as follows:

[0108] The client randomly generates multiple random data items.

[0109] The preprocessed model parameters are obtained by multiplying the local model parameters by a scaling factor, rounding to the nearest integer, multiplying by the magnification factor, and adding random noise.

[0110] Based on random data multiplied by an amplification factor and random noise added, scrambled redundant and confused data is obtained;

[0111] Based on the preprocessed model parameters and redundant scrambled data, modulo is taken according to the modal projection basis to obtain the set of real modal projection components and the set of redundant random modal projections.

[0112] Based on the location template, the set of real model projection components is inserted into the set of redundant random model projections at predetermined positions to obtain the ciphertext matrix as the ciphertext of model parameters.

[0113] Furthermore, the size of the ciphertext matrix is ​​n*(m+1), where n represents the number of coprime modular bases and m represents the number of random data.

[0114] S6 performs trusted verification based on challenge response values ​​and obtains encrypted global model parameters by aggregating trusted model parameter ciphertexts based on the computation key.

[0115] Furthermore, trusted verification specifically includes:

[0116] The server receives the challenge response values ​​and encrypted model parameters sent by all participating clients;

[0117] The server calculates the challenge response value as the verification response value based on the challenge pair and the pre-shared key;

[0118] Determine whether the verification response value is equal to the received challenge response value;

[0119] If they are equal, the verification passes. The encrypted model parameters uploaded by the participating clients that pass the verification are considered trusted encrypted text and are included in the subsequent global model aggregation process.

[0120] If they are not equal, the verification fails, and the participating client that failed the verification is marked as an abnormal client. The encrypted model parameters uploaded by the client are rejected from entering the subsequent global model aggregation process to prevent model poisoning or malicious interference.

[0121] Repeated verification of abnormal clients will result in the client being blacklisted after three failed verifications and will no longer be allowed to participate in subsequent training.

[0122] This invention uses a challenge-response mechanism to verify the identity of participating clients and the legitimacy of computation in real time, effectively resisting model poisoning and replay attacks, and ensuring that each model update comes from a trustworthy source.

[0123] Furthermore, the method for obtaining the encrypted global model parameters is as follows:

[0124] Obtain the computation keys and model parameter ciphertexts corresponding to all verified participating clients as trusted computation keys and trusted model parameter ciphertexts;

[0125] Based on the amplification factor and scaling factor in the trusted computing key, the corresponding trusted model parameter ciphertext is aligned to obtain multiple aligned ciphertexts.

[0126] Based on the projection basis in the trusted computing key, add operations are performed on all the parallel ciphertexts to obtain the global encryption model parameters;

[0127] The order of the magnification factor and the order of the scaling factor of the encrypted global model parameters are updated based on the order of the magnification factor and the order of the scaling factor of the ciphertext of the trusted model parameters.

[0128] Furthermore, based on the amplification factor and scaling factor in the computation key of each verified participating client, the generated model parameter ciphertext is aligned to the correct order, ultimately resulting in multiple aligned ciphertexts.

[0129] Furthermore, during the aggregation process, the server remains invisible to all encrypted model parameters. Any encrypted model parameter remains encrypted on the server side to prevent data leakage. After the server completes the update of the encrypted global model parameters, it sends the encrypted global model parameters to all participating clients through a secure channel.

[0130] This invention integrates homomorphic encryption with the FedProx algorithm, enabling the server to perform weighted aggregation in the ciphertext domain without decryption. It also improves the stability and convergence speed of the model in non-IID data scenarios through proximal term regularization, thus balancing security and performance.

[0131] The S7 client updates its local model based on the encrypted global model parameters, repeating the above process until the model converges and a trained global model is obtained.

[0132] Furthermore, the obtained trained global model specifically includes:

[0133] The participating client decrypts the received encrypted global model parameters based on the participation key pair to obtain new global model parameters;

[0134] The participating client updates the local model parameters based on the new global model parameters and trains using local data to obtain the locally updated model parameters;

[0135] Repeat the above process until the model converges and output the trained global model.

[0136] Furthermore, the conditions for model convergence are: reaching the preset number of iterations or the loss function no longer changing.

[0137] This invention combines a challenge-response mechanism, homomorphic encryption, and the FedProx federated learning algorithm, providing multiple security safeguards that significantly improve system robustness and reliability. It is particularly suitable for fields such as finance and healthcare, where privacy protection and model reliability are extremely important, and can enhance user participation.

[0138] Example 2

[0139] like Figure 3 As shown, based on the same inventive concept, the present invention also provides a federated learning system based on modular component homomorphic encryption and response verification, including: a key generation module, a client selection module, a local training module, a parameter encryption module, a verification aggregation module, and an iterative update module;

[0140] The key generation module is used to obtain the initial global model parameters and generate a pre-shared key; the client receives the pre-shared key and generates the participation key and computation key;

[0141] The client selection module is used to randomly select multiple clients as participating clients and send challenge pairs;

[0142] The local training module is used by participating clients to generate challenge response values ​​based on pre-shared keys and challenge pairs, and to perform local training using the FedProx algorithm based on initial global model parameters to obtain local model parameters;

[0143] The parameter encryption module is used to encrypt local model parameters based on the participation key and the modular component homomorphic encryption algorithm to obtain the ciphertext of the model parameters.

[0144] The verification aggregation module is used to perform trusted verification based on challenge response values ​​and to aggregate trusted model parameter ciphertexts based on the computation key to obtain encrypted global model parameters;

[0145] The iterative update module is used to participate in updating the local model based on the encrypted global model parameters on the client side, and to repeatedly execute the above process until the model converges and the trained global model is obtained.

[0146] Furthermore, in this embodiment, the functional implementation methods of each functional module correspond one-to-one with the methods described above, and will not be repeated here.

[0147] Example 3

[0148] Based on the same inventive concept, the present invention also provides an electronic device, which includes a processor and a memory, wherein the memory stores instructions, characterized in that the instructions are loaded and executed by the processor to implement the federated learning method based on modular component homomorphic encryption and response verification as in Embodiment 1.

[0149] Based on the same inventive concept, the present invention also provides a computer device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0150] Memory, used to store computer programs;

[0151] When the processor executes a program stored in memory, it is able to implement a federated learning method based on modular component homomorphic encryption and response verification, as described in Example 1.

[0152] The electronic device may include a processor, a communications interface, a memory, and a communication bus, wherein the processor, communications interface, and memory communicate with each other via the communication bus. The processor can invoke logical instructions in the memory to execute the federated learning method based on modular component homomorphic encryption and response verification in Embodiment 1.

[0153] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0154] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0155] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A federated learning method based on modular component homomorphic encryption and response verification, characterized in that, include: Obtain initial global model parameters and generate a pre-shared key; The client receives the pre-shared key and generates a participation key and a computation key; Randomly select multiple clients as participating clients and send challenge pairs; The participating client generates a challenge response value based on the pre-shared key and the challenge pair, and performs local training using the FedProx algorithm based on the initial global model parameters to obtain local model parameters; The specific challenge response value is: Ri = HASH(Ki, Ci); Where Ri represents the challenge response value of the i-th participating client, HASH represents the cryptographic hash algorithm, Ki represents the pre-shared key of the i-th participating client, and Ci represents the challenge pair of the i-th participating client; The challenge pair includes a random number and the current timestamp; The participating client initializes the parameters of the local model based on the received initial global model parameters to obtain the trained model; The training model is trained on local data using the FedProx algorithm, and a regularization constraint term for the global model is added to the loss function. The regularization constraint is: ; in, μ ≥0 indicates the proximal parameter. w This indicates the new model parameters that the client needs to optimize during local training. w t Indicates the first t Round global model parameters, New parameters were calculated w With initial global parameters w t The distance between them quantifies how much the model changes during local updates; The local model parameters are encrypted based on the participation key and the modular component homomorphic encryption algorithm to obtain the ciphertext of the model parameters; Trustworthy verification is performed based on the challenge response value, and the trusted model parameter ciphertext is aggregated based on the computing key to obtain encrypted global model parameters; The trusted verification specifically includes: The server receives the challenge response values ​​and encrypted model parameters sent by all participating clients; The server calculates a challenge response value as a verification response value based on the challenge pair and the pre-shared key; Determine whether the verification response value is equal to the received challenge response value; If they are equal, the verification is successful. The encrypted model parameters uploaded by the participating client that have passed the verification are trusted encrypted text and will be included in the subsequent global model aggregation process. If they are not equal, the verification fails, and the participating client that failed the verification is marked as an abnormal client, and the encrypted model parameters uploaded by it are rejected from entering the subsequent global model aggregation process. Repeatedly verify the abnormal client. The abnormal client that fails to verify three times will be blacklisted and will no longer participate in subsequent training. The participating client updates its local model based on the encrypted global model parameters, and repeats the above process until the model converges, thus obtaining the trained global model.

2. The federated learning method based on modular component homomorphic encryption and response verification according to claim 1, characterized in that, Obtain initial global model parameters and generate a pre-shared key, specifically including: The server initializes the built-in global model weight parameters to obtain the initial global model parameters; The server generates a unique pre-shared key for each client. The initial global model parameters and the pre-shared key are jointly sent to the corresponding client. The server locally records a mapping table between the client and the pre-shared key.

3. The federated learning method based on modular component homomorphic encryption and response verification according to claim 2, characterized in that, The generation of participation keys and computation keys specifically includes: Based on the client, n coprime mode bases are selected to form a mode projection basis; Based on the client settings, the magnification factor, scaling factor, and user master key are configured. Generate a location template based on the user's master key; The participation key is composed of the modal projection base, the magnification factor, the scaling factor, and the position template. The calculation key is composed of the modulus projection base, the magnification factor, and the scaling factor.

4. The federated learning method based on modular component homomorphic encryption and response verification according to claim 1, characterized in that, Obtain the local model parameters, specifically including: The client performs multiple rounds of forward propagation, loss calculation, backpropagation and parameter update based on the trained model until the local training termination condition is met, thus obtaining the pre-trained model. The local model parameters are obtained based on the pre-trained model.

5. The federated learning method based on modular component homomorphic encryption and response verification according to claim 3, characterized in that, The method for obtaining the encrypted model parameters is as follows: The participating client randomly generates multiple random data; Based on the local model parameters multiplied by the scaling factor, rounded to the nearest integer, and then multiplied by the magnification factor, and with random noise added, the preprocessed model parameters are obtained. Based on the random data multiplied by the amplification factor and the random noise added, scrambled redundant and confused data is obtained; Based on the preprocessed model parameters and the redundant scrambled data, modulo is taken according to the modulo projection basis to obtain the set of real modulo projection components and the set of redundant random modulo projections. Based on the location template, the set of real model projection components is inserted into the set of redundant random model projections at predetermined positions to obtain a ciphertext matrix as the ciphertext of the model parameters.

6. The federated learning method based on modular component homomorphic encryption and response verification according to claim 3, characterized in that, The method for obtaining encrypted global model parameters is as follows: Obtain the computation key and the model parameter ciphertext corresponding to all verified participating clients as trusted computation key and trusted model parameter ciphertext; Based on the amplification factor and the scaling factor in the trusted computing key, the corresponding trusted model parameter ciphertexts are aligned to obtain multiple aligned ciphertexts. Based on the projection model basis in the trusted computing key, an addition operation is performed on all the parallel ciphertexts to obtain the encryption global model parameters; The order of the magnification factor and the order of the scaling factor of the encrypted global model parameters are updated based on the order of the magnification factor and the order of the scaling factor of the ciphertext of the trusted model parameters.

7. The federated learning method based on modular component homomorphic encryption and response verification according to claim 1, characterized in that, The trained global model specifically includes: The participating client decrypts the received encrypted global model parameters based on the participating key to obtain new global model parameters; The participating client updates its local model parameters based on the new global model parameters and trains using local data to obtain the locally updated model parameters. Repeat the above process until the model converges, and output the trained global model.

8. A federated learning system based on modular component homomorphic encryption and response verification, used to execute the federated learning method based on modular component homomorphic encryption and response verification as described in any one of claims 1-7, characterized in that, include: The module includes a key generation module, a client selection module, a local training module, a parameter encryption module, a verification aggregation module, and an iterative update module. The key generation module is used to obtain initial global model parameters and generate a pre-shared key; the client receives the pre-shared key and generates a participation key and a computation key; The client selection module is used to randomly select multiple clients as participating clients and send challenge pairs; The local training module is used by the participating client to generate a challenge response value based on the pre-shared key and the challenge pair, and to perform local training using the FedProx algorithm based on the initial global model parameters to obtain local model parameters; The parameter encryption module is used to encrypt the local model parameters based on the participation key and the modular component homomorphic encryption algorithm to obtain the model parameter ciphertext. The verification aggregation module is used to perform trusted verification based on the challenge response value, and to aggregate trusted model parameter ciphertext based on the computing key to obtain encrypted global model parameters; The iterative update module is used by the participating client to update the local model based on the encrypted global model parameters, and to repeatedly execute the above process until the model converges and a trained global model is obtained.

Citation Information

Patent Citations

  • Federal learning GPU acceleration ciphertext aggregation method based on homomorphic encryption

    CN119483906A

  • Consistency verification method and device

    CN119670104A