Model training method based on lossless federated learning and related equipment

By using the global model noise matrix and DH key exchange in federated learning, combined with Fisher information matrix clipping of neurons, the problems of privacy attacks and communication overhead in federated learning are solved, and both data privacy protection and model accuracy are achieved.

CN118734940AActive Publication Date: 2024-10-01HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN) +1

Patent Information

Application Number
CN202411220041.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-10-01
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

Federated learning is vulnerable to privacy attacks, such as member inference attacks and reconstruction attacks, and existing solutions based on encryption and perturbation have shortcomings in computational complexity and model accuracy, making it difficult to balance the accuracy of model training and data security. .

Method used

Adopt a model training method based on lossless federated learning, protect data privacy through global model noise matrix and DH key exchange, and use Fisher information matrix to evaluate the importance of neurons, prune unimportant neurons to reduce communication overhead, and ensure final aggregation Stage noise can be eliminated to avoid reducing model accuracy.

Benefits of technology

On the premise of protecting client privacy, the communication overhead of federated learning is reduced, the accuracy of the model is maintained, and effective protection of data privacy and efficient training of the model are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734940A_ABST
    Figure CN118734940A_ABST
Patent Text Reader

Abstract

The invention provides a model training method based on lossless federated learning and related equipment. The method comprises the following steps: generating a public parameter and a server public and private key pair of the server; broadcasting the public parameter and a server public key of the server to a client; performing global disturbance on the current global model based on the noise information to obtain a current disturbance model, and sending the disturbance model to the client; receiving the latest local model processed by the client and a client public key of the client; wherein the client generates a client public and private key pair of the client based on the public parameter; obtaining the current disturbance model based on a client private key of the client and the server public key, and training the current disturbance model based on local training data to obtain the latest local model; and performing aggregation based on the newest local model to obtain a newest global model of which the disturbance is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of model training, and in particular to a model training method based on lossless federated learning and related equipment. Background Art

[0002] Federated Learning (FL) is vulnerable to privacy attacks, such as membership inference attacks and reconstruction attacks. These attacks may cause customer training data to be compromised and personal privacy to be violated. Although there are some methods to alleviate this problem, such as encryption-based solutions and perturbation-based solutions. However, encryption-based solutions, such as homomorphic encryption, have too high computational complexity and may not be practical in real-world scenarios; although perturbation-based solutions have low computational complexity, the added noise is often not removable, resulting in reduced model accuracy or even unusable models. Summary of the invention

[0003] The present disclosure proposes a model training method and related equipment based on lossless federated learning, so as to solve technical problems such as reduced accuracy and data insecurity of model training based on federated learning to a certain extent.

[0004] In a first aspect, the present disclosure provides a model training method based on lossless federated learning, comprising: Generate public parameters and the server's public and private key pair; Broadcasting the public parameters and the server public key of the server to the client; Performing global perturbations on the current global model based on the noise information to obtain a current perturbation model, and sending the perturbation model to the client; Receiving the latest local model processed by the client and the client public key of the client; wherein the client generates a client public-private key pair of the client based on the public parameters; obtaining the current perturbation model based on the client private key of the client and the server public key, and training the current perturbation model based on local training data to obtain the latest local model; Aggregation is performed based on the latest local model to obtain an latest global model that eliminates the global disturbance.

[0005] In a second aspect of the present disclosure, a model training device based on lossless federated learning is provided, comprising: The secret key module is used to generate public parameters and the server's public and private key pairs; A sending module, used for broadcasting the public parameters and the server public key of the server to the client; A disturbance module performs global disturbance on the current global model based on noise information to obtain a current disturbance model, and sends the disturbance model to the client; A receiving module receives the latest local model processed by the client and the client public key of the client; wherein the client generates a client public-private key pair of the client based on the public parameters; obtains the current perturbation model based on the client private key of the client and the server public key, and trains the current perturbation model based on local training data to obtain the latest local model; An aggregation module is used to perform aggregation based on the latest local model to obtain an latest global model that eliminates the global disturbance.

[0006] In a third aspect of the present disclosure, an electronic device is provided, comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the method described in the first aspect.

[0007] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors execute the method described in the first aspect.

[0008] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect.

[0009] From the above, it can be seen that the model training method and related equipment based on lossless federated learning provided by the present disclosure protect the data privacy in the federated learning process through the global model noise matrix and DH key exchange. It can reduce the communication overhead of federated learning without reducing the accuracy of the model while protecting the privacy of the client. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram of a model training architecture based on lossless federated learning according to an embodiment of the present disclosure.

[0012] Figure 2 The figure is a schematic diagram of the hardware structure of an exemplary electronic device according to an embodiment of the present disclosure.

[0013] Figure 3A flowchart of a model training method based on lossless federated learning according to an embodiment of the present disclosure.

[0014] Figure 4 A schematic diagram of a model training method based on lossless federated learning according to an embodiment of the present disclosure.

[0015] Figure 5 A schematic diagram of the experimental results of the model training method based on lossless federated learning according to an embodiment of the present disclosure.

[0016] Figure 6 It is a schematic diagram of a model training device based on lossless federated learning according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0018] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0019] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0020] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0021] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0022] Figure 1 FIG. 1 is a schematic diagram of a model training architecture based on lossless federated learning according to an embodiment of the present disclosure. Figure 1 , the model training architecture 100 based on lossless federated learning may include a server 110, a client 120, and a network 130 providing a communication link. The server 110 and the client 120 may be connected via a wired or wireless network 130. The server 110 may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, security services, and CDN.

[0023] The client 120 may be implemented in hardware or software. For example, when the client 120 is implemented in hardware, it may be various electronic devices with a display screen and supporting page display, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, and desktop computers, etc. When the client 120 device is implemented in software, it may be installed in the electronic devices listed above; it may be implemented as multiple software or software modules (such as software or software modules used to provide distributed services), or it may be implemented as a single software or software module, which is not specifically limited here.

[0024] It should be noted that the model training method based on lossless federated learning provided in the embodiment of the present application can be executed by the client 120 or by the server 110. It should be understood that Figure 1 The number of clients, networks and servers in the embodiment is only for illustration and is not intended to limit the number of clients, networks and servers. Any number of clients, networks and servers may be provided as required.

[0025] Figure 2 FIG. 2 shows a schematic diagram of the hardware structure of an exemplary electronic device 200 provided in an embodiment of the present disclosure. Figure 2 As shown, the electronic device 200 may include: a processor 202, a memory 204, a network module 206, a peripheral interface 208 and a bus 210. The processor 202, the memory 204, the network module 206 and the peripheral interface 208 are connected to each other in communication within the electronic device 200 through the bus 210.

[0026] Processor 202 may be a central processing unit (CPU), a model trainer based on lossless federated learning, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 202 may be used to perform functions related to the technology described in this disclosure. In some embodiments, processor 202 may also include multiple processors integrated into a single logical component. For example, Figure 2 As shown, processor 202 may include a plurality of processors 202a, 202b, and 202c.

[0027] The memory 204 may be configured to store data (eg, instructions, computer code, etc.). Figure 2 As shown, the data stored in the memory 204 may include program instructions (for example, program instructions for implementing the model training method based on lossless federated learning of the embodiment of the present disclosure) and data to be processed (for example, the memory may store configuration files of other modules, etc.). The processor 202 may also access the program instructions and data stored in the memory 204, and execute the program instructions to operate on the data to be processed. The memory 204 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 204 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.

[0028] The network module 206 can be configured to provide the electronic device 200 with communication with other external devices via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network module 206 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.

[0029] The peripheral interface 208 can be configured to connect the electronic device 200 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.

[0030] The bus 210 may be configured to transmit information between various components of the electronic device 200 (e.g., the processor 202, the memory 204, the network module 206, and the peripheral interface 208), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.

[0031] It should be noted that, although the architecture of the electronic device 200 only shows the processor 202, the memory 204, the network module 206, the peripheral interface 208 and the bus 210, in the specific implementation process, the architecture of the electronic device 200 may also include other components necessary for normal execution. In addition, it can be understood by those skilled in the art that the architecture of the electronic device 200 may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.

[0032] Federated Learning (FL) is widely used because it allows collaborative model training without collecting client data. In FL, there are mainly two types of entities: aggregation servers and local clients. The aggregation server initializes the global model for a specific target and then distributes it to each client. After training the model on the local dataset, the local client uploads the local model parameters / gradients to the aggregation server. The aggregation server aggregates the model parameters from local clients using an aggregation strategy to update the global model. In this way, FL promotes collaborative training of target models between different clients and aggregation servers, maintaining the confidentiality of client data.

[0033] However, recent studies have shown that FL is vulnerable to privacy attacks such as membership inference attacks and reconstruction attacks. These attacks may lead to the compromise of client training data and the violation of personal privacy. Worse, FL suffers from huge communication overhead in practical applications, which poses a major obstacle. As a distributed machine learning, federated learning involves multiple rounds of model parameter exchanges between clients and servers, resulting in huge communication costs. There are two main ways to reduce communication overhead in federated learning. One way is to increase local computing overhead. For example, the FedAvg algorithm requires the client to perform multiple local training rounds before communicating with the aggregation server. This reduces frequent communication. The other is model compression techniques, including model pruning, model parameter quantization, distillation, and other similar methods. These techniques aim to reduce the amount of data transmitted in each round of communication, minimize the transmission of model parameters, and thus reduce communication costs.

[0034] Many researchers have proposed solutions to FL privacy protection without affecting the effectiveness of collaborative training. Privacy protection techniques can be divided into two categories: encryption-based solutions and perturbation-based solutions. However, encryption-based solutions, such as homomorphic encryption, have high computational complexity and may not be practical in real-world scenarios; although perturbation-based solutions have low computational complexity, the added noise is often not removable, resulting in reduced model accuracy or even unusable models.

[0035] Therefore, how to balance the accuracy of model training, reduce communication overhead and data security has become a technical problem that needs to be solved urgently.

[0036] In view of this, the embodiments of the present disclosure provide a model training method and related equipment based on lossless federated learning. The data privacy in the federated learning process is protected through the global model noise matrix and DH key exchange; the importance of each neuron is evaluated through the Fisher information matrix, and unimportant neurons are cut off to reduce communication overhead; since the noise added in the federated learning is carefully designed and can be offset in the final aggregation stage, this method will not reduce the accuracy of the model. It can reduce the communication overhead of federated learning without reducing the accuracy of the model while protecting the privacy of the client.

[0037] See also Figure 3 , Figure 3 A schematic flow chart of a model training method based on lossless federated learning according to an embodiment of the present disclosure is shown. The model training method based on lossless federated learning according to an embodiment of the present disclosure can be deployed on a server side. Figure 3 In the present invention, the model training method 300 based on lossless federated learning may further include the following steps.

[0038] In step S310, public parameters and a server public-private key pair of the server are generated.

[0039] Among them, public parameters can refer to a set of predefined values, which are usually public and accessible to all participants. In the public key cryptography system, each pair of participants will generate a pair of keys, namely a public key and a private key. The public key can be shared publicly with anyone, while the private key needs to be kept strictly confidential and can only be held by the owner of the key. The server public-private key pair refers to the public key and private key owned by the server. The public key can be a key used to encrypt data or verify signatures, which can be safely shared with other parties. The private key can be a key used to decrypt data or generate signatures, which must be kept confidential by the owner of the key.

[0040] In some embodiments, generating a public parameter and a server public-private key pair of the server includes: Generate a q-order cyclic group G based on the primitive root of the prime number p, and determine a generator g from the cyclic group G to obtain the common parameters (G, g, q); Determining a server private key of the server from the cyclic group G; Generate a server public key of the server based on the public parameters (G, g, q) and the server private key; The public-private key pair is obtained based on the server private key and the server public key.

[0041] Among them, the server can determine the set of clients participating in the aggregation , i is the client, k is the client's attribute, and k is a positive integer. Generate public parameters and the client's public and private key pair based on the DH key exchange algorithm. Among them, Diffie-Hellman (DH) key exchange can help both parties to generate session keys in a public channel. The key exchange protocol consists of three algorithms, which are respectively , and . (1) :This algorithm is used to generate common parameters, such as the order Group and generators . (2) :The user uses this algorithm to generate a public-private key pair. and pass and Generate a public-private key pair, where is the private key, is the public key. (3) :user Use its private key and users The public key Calculate the public session key .

[0042] Specifically, the server can define a large prime number q (the order of the group), a cyclic group G, and a generator g in the group. The operation in group G is usually a multiplication operation, and the generator g is chosen so that the power of g can generate all elements in group G. The server can choose a random number sk u As a private key, the private key must be an identity element in the sense of the modulus of the group order q. Then calculate the public key , multiply the generator g by sk u After raising to the power, modulo q. Client v Follow this step to generate your own key pair ( pk v , sk v ). Server u uses sk u and pk v calculate , and client v can obtain the same shared key through similar operations (due to the nature of group operations, even if the calculation order is reversed, the result is the same). It is the secure basis for communication between two parties, and they can reach agreement secretly without direct exchange.

[0043] In step S320, the public parameters and the server public key of the server are broadcast to the client.

[0044] Broadcasting can refer to sending information to all potential recipients in the network. For example, public parameters and the server's public key are sent to all clients. The public parameters and the server's public key are encoded into an appropriate data format (such as JSON) and sent to all clients in a reliable manner. For easy transmission on the network. This can be done through HTTP / HTTPS, WebSocket or any other suitable protocol. After receiving this information, the client will store it and use it for subsequent encrypted communication.

[0045] In step S330, the current global model is globally perturbed based on the noise information to obtain a current perturbation model, and the perturbation model is sent to the client.

[0046] Among them, the method of perturbing the global model by introducing additive noise and multiplicative noise is aimed at protecting data privacy or increasing the robustness of the model. Specifically, an additive noise matrix and a multiplicative noise matrix are first generated, and then these two noise matrices are added and multiplied with the current global model respectively to obtain a new perturbation model. This perturbation method enables the model to reduce the sensitivity of the model to external data while maintaining a certain predictive performance, thereby achieving the purpose of protecting the privacy of the data involved in the training. In addition, introducing noise in this way can also help the model better generalize to unseen data sets.

[0047] In some embodiments, perturbing the current global model based on the noise information to obtain the current perturbation model includes: Generate an additive noise matrix and a multiplicative noise matrix to obtain the noise information; The additive noise matrix and the multiplicative noise matrix are added to the current global model for disturbance to obtain a current disturbance model.

[0048] Among them, the additive noise matrix can be a randomly generated noise matrix added to the original data matrix (or vector) in order to protect data privacy or realize homomorphic encryption characteristics. The "addition" here means that the noise is added directly to the original data. For example, in the context of homomorphic encryption, it is allowed to perform addition operations on encrypted data, and the result obtained after decryption is consistent with the direct operation on the plaintext data. Additive noise is usually used to ensure the privacy and security of calculations, making it difficult to infer the original data or calculation details based on the encryption results alone. The multiplication noise matrix can be the noise introduced when performing multiplication operations.

[0049] In some embodiments, globally perturbing the current global model based on the noise information to obtain the current perturbation model includes: Randomly select multiplicative noise , additive noise And random numbers generating the noise information; Generate an additive noise matrix based on the noise information and the multiplication noise matrix ;in, Additive Noise Matrix , , ;n L is the number of layers of the model, 1≤q≤m, m is the number of neurons in the pth layer of the model; Multiplication Noise Matrix , ; The additive noise matrix and the multiplication noise matrix Add the current global model to perturb and obtain the current perturbation model ,include: ,in, Represents the current global model.

[0050] in, , the range of m can be determined according to the number of neurons in the corresponding layer. Multiplicative noise and additive noise are randomly selected, as well as a random number, to generate noise information. The additive noise matrix and the multiplicative noise matrix are generated using this noise information. For each layer of the neural network, the number of elements in the additive noise matrix is ​​the same as the number of neurons in the layer, while the multiplicative noise matrix is ​​composed of multiplicative noise. Subsequently, these noise matrices are applied to the current global model, and the model weights are perturbed by addition and multiplication operations to obtain the perturbed model. The perturbation at this time is based on the analysis of the forward propagation and backpropagation processes of the model, combined with the perturbation derived by the mathematical formula, which protects the privacy of the global model. This method can effectively protect the privacy of the training data, because by adding random noise, even if the attacker obtains the perturbed model, it is difficult to infer the specific details of the original training data. At the same time, this perturbation also helps to improve the generalization ability of the model, making it more stable and reliable when facing new data. It should be noted that the selection of noise needs to be cautious, and too large or too small noise may have a negative impact on the performance of the model. Appropriate selection of the size of the noise can ensure a balance between the accuracy of the model and privacy protection.

[0051] In step S340, the latest local model processed by the client and the client public key of the client are received; wherein the client generates a client public-private key pair of the client based on the public parameters; the current perturbation model is obtained based on the client private key of the client and the server public key, and the current perturbation model is trained based on local training data to obtain the latest local model.

[0052] In this process, the server receives the latest local model and the public key of the client from the client. The client here has generated its own public-private key pair based on a set of pre-set public parameters (for example, parameters for the key generation algorithm). The client uses its own private key and the server's public key to decrypt and obtain the current perturbation model. This perturbation model is a perturbation of the global model by adding noise on the server to increase the security and privacy protection of the model. The client further trains this perturbation model with its own local data set to update the model parameters and obtain the latest local model. The above process can not only promote the learning and updating of models between different clients, but also protect the data privacy of each participant. Through encrypted communication and the use of perturbation models, the original data is not easily leaked even when the model parameters are shared. In addition, this method helps to improve the robustness of the model because the perturbation can simulate different data distributions, allowing the model to perform well on a wider range of data. In short, this method not only ensures the security and privacy of the data, but also promotes the effective training and optimization of the model.

[0053] In some embodiments, receiving the latest local model processed by the client includes: Acquiring the latest local model based on the client public key and the server private key; wherein the latest local model is obtained based on the client training the current perturbation model, including: The client performs local training on the current disturbance model using local training data; Determining an information matrix of neurons in the current disturbance model based on parameter importance of model parameters of the current disturbance model during the local training process; determining a neuron importance of the neuron based on the information matrix; Pruning neurons corresponding to the neuron importance level being less than the level threshold, to obtain a pruned disturbance model; Local disturbances are added based on the pruned disturbance model to obtain the latest local model.

[0054] Among them, the information matrix of each neuron in the current perturbation model may contain information about weights, gradients, etc., which is used to evaluate the contribution of neurons to the overall model performance. Based on the above information matrix, the system can calculate the importance of each neuron. Once the importance of the neuron is determined, a threshold can be set to decide which neurons should be pruned. Neurons with an importance lower than the threshold will be removed to obtain a pruned perturbation model. This can reduce the size and computational cost of the model while maintaining the prediction accuracy of the model as much as possible. Based on the pruned model, some local perturbations can be further added (such as adding random noise or fine-tuning parameters) to obtain the final latest local model. This step helps to improve the generalization and robustness of the model. The effect of the whole process is to significantly reduce the size and computational requirements of the model while retaining the predictive ability of the model as much as possible. Local perturbations can also enhance the model's resistance to potential overfitting problems, making the model perform better on new data sets.

[0055] Specifically, Fisher information represents the average amount of information about state parameters that a random variable sample can provide under specific circumstances. Assume that the client has a local data set and a parameter of The model is based on , The log-likelihood function of is , the score function of this function is: . Then, the Fisher information matrix of this parameter is: .in, Represents expectations. The larger it is, the more information the parameter contains.

[0056] In some embodiments, the latest local model is obtained based on the client training the current disturbance model, and further includes: generating a public session key based on the client public key and the server private key; Calculate the importance of each model parameter in the current disturbance model ,in, It means that when the model parameters are , input is When The probability of , n is the number of model parameters; Determine the information matrix of neurons in the current disturbance model based on the importance of the model parameters ,in, , express expectations; Calculating the neuron importance based on the information matrix includes: ,in, represents the jth parameter of the i-th layer, represents the output neuron N i The importance of neurons, represents the input neuron N j The importance of neurons; All neurons are sorted based on the neuron importance, and neurons whose neuron importance is less than the degree threshold are eliminated to obtain the pruned disturbance model.

[0057] The client's public key and the server's private key are used to generate a public session key, which is then used to generate a shared key. , the shared key is generated by a pseudo-random generator to generate pseudo-random noise , which ensures that subsequent data exchange and model updates can be carried out in an encrypted secure channel. Calculate the importance of each model parameter in the current perturbation model. The importance defined here is related to the model parameters, input data, and the probability of the model output. Specifically, the importance reflects the influence of the model parameters on the probability of producing a specific output when a specific input is given. Based on the importance of the model parameters, construct the information matrix of the neurons. The information matrix reflects the connection strength between neurons and their relative importance in the entire model. Use the information matrix to calculate the importance of each neuron. This step involves statistical analysis, that is, calculating the interaction strength between output neurons and input neurons, and determining their importance based on this. Sort the neurons according to their calculated importance, and remove those neurons whose importance is lower than the set threshold. In this way, a smaller but still effective pruned perturbation model is obtained. The client trains based on the pruned perturbation model to obtain the latest local model. In this way, not only the size of the model is significantly reduced by pruning redundant neurons, the computational efficiency of the model is improved, but also the security of data transmission is guaranteed through encrypted communication. This model compression and optimization method helps to improve the deployment efficiency and performance on edge devices while protecting user data privacy. In addition, through local client training, it can better adapt to personalized needs and improve the generalization ability of the model.

[0058] In some embodiments, adding a local perturbation based on the pruned perturbation model to obtain the latest local model includes: , in, is the local gradient of the pruned perturbation model, D i represents the i-th client, , , , x i is the input data of the i-th client, y i is the output data of the i-th client, Represents the final output data of the local model, represents the final model parameters; Generate a shared key based on the public session key, and generate a pseudo-random noise based on the shared key via a pseudo-random generator ; Based on pseudo-random noise Generate the auxiliary variables ,in, ; Based on the local gradient of the pruned perturbation model , the auxiliary variable and the neuron position information of the pruned perturbation model , and obtain the latest local model.

[0059] The local gradient of the pruned perturbation model calculated by the client on its local data set is constructed based on cryptographic methods. First, a shared key is constructed based on DH key exchange, and then it is used as the seed of a pseudo-random generator to generate perturbations. It effectively combines model compression (through pruning), encrypted communication (through shared keys), and model perturbations (through adding noise), ensuring that the client can perform efficient and secure model training while protecting privacy. This method not only improves the efficiency of model training, but also enhances data security and protects the privacy of each client model.

[0060] In step S350, aggregation is performed based on the latest local model to obtain an latest global model that eliminates the disturbance.

[0061] Among them, the server collects the latest local model updates from each client participating in the training. These updates already contain the local gradients of the pruned perturbation model, the influence of auxiliary variables, and the position information of neurons. The server can use an aggregation strategy (such as the FedAvg algorithm) to merge the local model updates provided by all clients. This usually involves calculating the average or weighted average of the updates of each client to form a global model update. Since the introduced perturbations included in the local model update are design-specific, the noise can be offset by aggregation. After aggregation and denoising, the server applies the obtained updates to the current global model to generate the latest global model. This process can include directly updating model parameters or gradually adjusting the state of the global model through an iterative optimization algorithm. Once the new global model is generated, it will be sent back to all clients participating in the training so that they can continue to perform the next step of local training on this basis. The whole process ensures that a more accurate version of the global model can be restored through aggregation operations even in the presence of perturbations. It is crucial to be able to protect user privacy and improve the overall performance of distributed machine learning systems.

[0062] In some embodiments, the latest global model obtained by aggregating the latest local models includes: Based on the neuron position information, the model parameters corresponding to the pruned neurons in the pruned perturbation model are restored to 0 to obtain the local gradient of the restored model. ; Based on the local gradient of the recovery model Aggregate to get the global gradient ,include: , , Where Di is the local training data of client i, , , ; based on Update the current parameters of the current global model , get the latest parameters The latest global model of is the learning rate.

[0063] Among them, based on the neuron position information, the model parameters corresponding to the pruned neurons in the pruned perturbation model are restored to 0, thereby obtaining the local gradient of the restored model. Using these restored local gradients, combined with the local training data of each client, the global gradient is aggregated by weighted average. The parameters of the current global model are updated using the global gradient and the preset learning rate, thereby obtaining the latest global model with the latest parameters.

[0064] There has been a lot of work on distributed machine learning before Federated Learning (FL), which mainly solves problems such as distributed training of machine learning models using multiple computing resources. Federated learning can be regarded as a special type of distributed machine learning. Federated learning is divided into cross-device federated learning (CdFL) and cross-silo federated learning (CsFL). In CsFL, the participants are a small number of large companies with large data holdings. These companies jointly train a global model for the same goal and participate in each round of calculations in collaborative training. In CsFL, companies are considered semi-trusted. They honestly perform joint model training according to the specified protocol while inferring the privacy information of other participants. FedAvg is a widely used optimization algorithm in FL. Three steps are iteratively performed during model training, which involves a certain number of clients and servers. The algorithm flow is as follows: Gradient calculation: Each client uses its local dataset Calculate the current global model parameters The local gradient on , and send the gradient to the server; Gradient aggregation: The server calculates Aggregate local gradients; Global model update: The server calculates Update the current global model , the learning rate is .

[0065] See also Figure 4 , Figure 4 A schematic diagram of a model training method based on lossless federated learning according to an embodiment of the present disclosure is shown. System initialization: The server determines the client set, generates public parameters and public-private key pairs, and broadcasts the necessary parameters. In the process of system initialization, the server needs to determine the client set participating in the aggregation. , generate public parameters through DH key exchange And the client's public and private key pair , and broadcast the public key . Server Broadcast .

[0066] Global model perturbation: The server generates an additive noise matrix and a multiplicative noise matrix, uses these two noise matrices to perturb the global model, and sends the perturbed model to the client. During the global model perturbation process, the aggregation server generates two carefully designed noise matrices so that the added noise can be eliminated when the global model is aggregated.

[0067] Local model training and pruning: After the client receives the perturbed global model, it performs model training based on the local data set, and judges the importance of neurons according to the Fisher information matrix, performs gradient pruning, and uploads the pruned model to the server. The lightweight lossless federated learning privacy protection method based on gradient pruning includes local model training, model pruning, and model uploading. After the client receives the global perturbation model, the client performs local model training based on the local data set, evaluates the importance of neurons through the Fisher information matrix, and prunes unimportant neurons. In order to protect the privacy of the aggregated model, the client adds perturbations to the pruned model through DH key exchange, and finally uploads it to the server.

[0068] Global model update: The server receives the model uploaded by the client and aggregates the model according to a specific aggregation method. The server aggregates the model uploaded by the client using two carefully constructed noise matrices and DH key exchange to obtain the final global model of this round.

[0069] It can be seen that according to the method of the embodiment of the present disclosure, before distributing the global model to the client, the aggregation server adds removable perturbations to the global model to prevent the client from inferring valuable information from multiple rounds of the global model. Then, the local clients train the perturbation model based on their data sets. In order to reduce communication overhead, the Fisher information matrix is ​​used to prune model parameters with low contributions. In order to protect client privacy, the parameters calculated by the client are perturbed using the Diffie-Hellman key exchange. Through extensive experiments on a large number of data sets, the proposed scheme protects client privacy without affecting the accuracy of the model while reducing the communication overhead between the client and the server.

[0070] The method of the disclosed embodiment can be experimented with, and the code can use PyTorch. For example, each client can be trained for 500 rounds, with a batch size of 32 and a learning rate of 0.0001. For model accuracy, the learning accuracy on regression and classification tasks can be evaluated and compared with the most advanced schemes, such as FedAvg without privacy protection and PBPFL with privacy protection. For privacy protection performance, the defense capability against the most advanced privacy attacks launched by curious clients and aggregation servers on the LDC and Cifar10 datasets can be evaluated.

[0071] With respect to the model accuracy, the learning accuracy of the present disclosure, FedAvg and PBPFL schemes on regression and classification tasks can be compared. The comparison results are shown in Tables 1 and 2. In Table 1, on the regression task based on the UMBD dataset, the model accuracy of the present disclosure is roughly consistent with that of FedAvg, which indicates that the accuracy of the present disclosure has not decreased. As shown in Table 2, on the classification task based on the LDC dataset, it is shown that the accuracy of the present disclosure is roughly the same as that of FedAvg without privacy protection.

[0072] Table 1

[0073]

[0074] Table 2

[0075] Regarding privacy protection performance, the success rates of scheme 1 (e.g., DLG) and scheme 2 (e.g., iDLG) implemented on the client and server respectively by the disclosed method and the FedAvg and PBPFL schemes can be compared. First, for membership reasoning attacks, the experimental results are shown in Table 3. From the experimental results, it can be seen that the accuracy of the server's membership reasoning attack on PBPFL is roughly the same as that of FedAvg, which also shows that PBPFL cannot resist the membership reasoning attack initiated by the server. Compared with PBPFL, the accuracy of the disclosed member reasoning attack on the server is basically the same as that on the client, and the accuracy is significantly lower than the other two methods. Secondly, for reconstruction attacks, the experimental results are shown in Table 3. Figure 5 As shown, it can be seen from the figure that the present disclosure can perfectly resist DLG and iDLG attacks initiated by the server and the client.

[0076] Table 3

[0077]

[0078] In summary, the method of the embodiment of the present disclosure uses the Fisher information matrix to evaluate the importance of neurons, and unimportant neurons are deleted, thereby significantly reducing the model parameter size and reducing communication overhead. Considering the situation where both the client and the server are semi-honest, it is more in line with the actual scenario and can maintain the accuracy of the global model while protecting the privacy of the client. Without compromising the accuracy of the model, the privacy of the client is effectively protected while reducing the communication overhead.

[0079] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0080] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0081] Based on the same technical concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a model training device based on lossless federated learning, see Figure 6, the model training device based on lossless federated learning includes: The secret key module is used to generate public parameters and the server's public and private key pairs; A sending module, used for broadcasting the public parameters and the server public key of the server to the client; A disturbance module performs global disturbance on the current global model based on noise information to obtain a current disturbance model, and sends the disturbance model to the client; A receiving module receives the latest local model processed by the client and the client public key of the client; wherein the client generates a client public-private key pair of the client based on the public parameters; obtains the current perturbation model based on the client private key of the client and the server public key, and trains the current perturbation model based on local training data to obtain the latest local model; An aggregation module is used to perform aggregation based on the latest local model to obtain an latest global model that eliminates the global disturbance.

[0082] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0083] The device of the above embodiment is used to implement the corresponding model training method based on lossless federated learning in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0084] Based on the same technical concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the model training method based on lossless federated learning as described in any of the above embodiments.

[0085] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0086] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the model training method based on lossless federated learning as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0087] It should be understood by those skilled in the art that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0088] In addition, to simplify the description and discussion, and in order not to obscure the embodiments of the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, devices may be shown in the form of block diagrams to avoid obscuring the embodiments of the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0089] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.

[0090] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A model training method based on lossless federated learning, the method include: Generate public parameters and the server's public and private key pair; Broadcasting the public parameters and the server public key of the server to the client; Performing global perturbation on the current global model based on the noise information to obtain a current perturbation model, and sending the current perturbation model to the client; Receiving the latest local model processed by the client and the client public key of the client; wherein the client generates a client public-private key pair of the client based on the public parameters; obtaining the current perturbation model based on the client private key of the client and the server public key, and training the current perturbation model based on local training data to obtain the latest local model; Aggregation is performed based on the latest local model to obtain an latest global model that eliminates the global disturbance.

2. The method according to claim 1, in, Generate public parameters and the server's public and private key pair, including: Generate a q-order cyclic group G based on the primitive root of the prime number p, and determine a generator g from the cyclic group G to obtain the common parameters (G, g, q); Determining a server private key of the server from the cyclic group G; Generate the server public key based on the public parameters (G, g, q) and the server private key; The server public-private key pair is obtained based on the server private key and the server public key.

3. The method according to claim 2, in, Based on the noise information, the current global model is globally perturbed to obtain the current perturbation model, including: Randomly select multiplicative noise , additive noise And random numbers generating the noise information; Generate an additive noise matrix based on the noise information and the multiplication noise matrix ; The additive noise matrix and the multiplication noise matrix Add the current global model to perturb and obtain the current perturbation model ,include: ,in, Represents the current global model, p is the serial number of the layer in the model, and q is the serial number of the neuron in each layer of the model.

4. The method according to claim 3, in, Receiving the latest local model processed by the client, including: Acquiring the latest local model based on the client public key and the server private key; wherein the latest local model is obtained based on the client training the current perturbation model, including: The client performs local training on the current disturbance model using local training data; Determining an information matrix of neurons in the current disturbance model based on parameter importance of model parameters of the current disturbance model during the local training process; determining a neuron importance of the neuron based on the information matrix; Pruning neurons corresponding to the neuron importance level being less than the level threshold, to obtain a pruned disturbance model; Local disturbances are added based on the pruned disturbance model to obtain the latest local model.

5. The method according to claim 4, in, The latest local model is obtained based on the client training the current disturbance model, and further includes: generating a public session key based on the client public key and the server private key; Calculate the importance of each model parameter in the current disturbance model ,in, It means that when the model parameters are , input data is When the output data is equal to The probability of n is the number of data corresponding to the client's data set; Determine the information matrix of neurons in the current disturbance model based on the importance of the model parameters ,in, , express expectations; Calculating the neuron importance based on the information matrix includes: ,in, represents the jth model parameter of the i-th layer, represents the output neuron N i The importance of neurons, represents the input neuron N j The importance of neurons; All neurons are sorted based on the neuron importance, and neurons whose neuron importance is less than the degree threshold are eliminated to obtain the pruned disturbance model.

6. The method according to claim 5, in, Adding local disturbance based on the pruned disturbance model to obtain the latest local model includes: , in, is the local gradient of the pruned perturbation model, D i represents the local training data of the i-th client, , , , x i is the input data of the i-th client, y i is the output data of the i-th client, Represents the final output data of the local model, represents the final model parameters; Generate a shared key based on the public session key, and generate a pseudo-random noise based on the shared key via a pseudo-random generator ; Based on pseudo-random noise Generate auxiliary variables ,in, ; Based on the local gradient of the pruned perturbation model , the auxiliary variable and the neuron position information of the pruned perturbation model , and obtain the latest local model.

7. The method according to claim 6, in, The latest global model obtained by aggregating the latest local models includes: Based on the neuron position information, the model parameters corresponding to the pruned neurons in the pruned perturbation model are restored to 0 to obtain the local gradient of the restored model. ; Based on the local gradient of the recovery model Aggregate to get the global gradient ,include: , , in, , , ; based on Update the current parameters of the current global model , get the latest parameters The latest global model of is the learning rate.

8. A model training device based on lossless federated learning, include: The secret key module is used to generate public parameters and the server's public and private key pairs; A sending module, used for broadcasting the public parameters and the server public key of the server to the client; A disturbance module performs global disturbance on the current global model based on noise information to obtain a current disturbance model, and sends the current disturbance model to the client; A receiving module receives the latest local model processed by the client and the client public key of the client; wherein the client generates a client public-private key pair of the client based on the public parameters; obtains the current perturbation model based on the client private key of the client and the server public key, and trains the current perturbation model based on local training data to obtain the latest local model; An aggregation module is used to perform aggregation based on the latest local model to obtain an latest global model that eliminates the global disturbance.

9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program. 10 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to claim 1 .

Citation Information

Patent Citations

  • Federated learning training data privacy enhancement method and system

    CN110572253A

  • Neural network multi-party cooperation lossless training method and system for privacy protection

    CN113435592A

  • Federal learning privacy protection system and method based on hierarchical aggregation and block chain

    CN114254386A

  • Model processing method, device and equipment

    CN115345233A

  • Federal learning privacy protection model training method and system based on knowledge distillation

    CN116957064A

Cited By

  • Federal learning method based on Wiener deconvolution and diagonal Fischer pruning

    CN119180353A

  • A federated learning method based on Wiener deconvolution and diagonal Fisher pruning

    CN119180353B

  • Segmentation federal learning model training method based on heterogeneous system

    CN119312947A

  • Method and device for detecting wear resistance of cutting edge of coating scraper

    CN120275221A

  • Multi-party collaborative data availability security detection method and system

    CN120342738A