Efficient federated learning method, electronic device and storage medium for protecting data privacy

By using parameter sparse and feature fuzzification technology in federated learning, partial update gradient components are selected for clipping or zeroing, and combined with other client gradients to generate global model updates, which solves the problem of privacy data leakage and model training efficiency in traditional federated learning. It reduces problems and achieves efficient privacy protection and performance optimization.

CN118378301BActive Publication Date: 2024-10-18BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410807402.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-18
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

Traditional federated learning technology has the risk of privacy data leakage during the model training process, and the large number of model parameters causes network communication to become a bottleneck, affecting training efficiency. Existing privacy processing methods have a negative impact on model performance or increase the amount of calculation, and cannot effectively protect users. Data Privacy.

Method used

Using parameter sparsification and feature fuzzification technology, by dynamically adjusting the degree of sparseness and feature fuzzification, select partial update gradient components for clipping or zeroing, upload non-zero components and their indexes, and combine with other client gradients to generate a global model update , using Adam algorithm to optimize model parameters.

Benefits of technology

It reduces the amount of data and communication delay transmitted by the federated learning network, improves training efficiency, enhances the privacy protection of user data, controls the impact of privacy protection on model performance, avoids model overfitting, and ensures final performance requirements. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378301B_ABST
    Figure CN118378301B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide an efficient federated learning method, electronic device and storage medium for protecting data privacy, and relate to the field of federated learning technology. The method includes: obtaining model parameters, updating the local model according to the model parameters; testing the accuracy of the updated local model on the local sample data set, and determining the first ratio and the second ratio according to the accuracy; training the updated local model with the local sample data set to obtain the updated gradient; selecting several components at the first ratio based on the value of the component in the updated gradient, and selecting several components at the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient; cropping or setting the selected components to zero, and uploading the processed non-zero components of the updated gradient and their position indexes. The implementation method provided by the present invention balances the contradiction between privacy protection and model performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to an efficient federated learning method for protecting data privacy, an electronic device, and a corresponding storage medium. Background Art

[0002] At present, with the rapid development of artificial intelligence technology, the application of artificial intelligence technology is becoming more and more extensive. It has been applied to many fields such as image analysis, speech recognition, text processing, intelligent recommendation, security detection, etc. Federated learning and large model technology have become the forefront of artificial intelligence technology. However, traditional federated learning technology requires users to upload updated data during model training, and there may be a risk of privacy data leakage during the upload process. Moreover, the large number of parameters in the model will cause the federated learning network communication to become a bottleneck in the parameter transmission process, greatly reducing the training efficiency of the federated learning model.

[0003] Although there are some methods for privacy processing in federated learning in the prior art, such as adding bi-norm noise and adding masks to model parameter updates, they will still affect the performance of the model or increase the amount of computation in the model training process, causing many new problems. Although the existing Top-k sparsification method can reduce the amount of update data transmitted by the federated learning network, it cannot effectively protect the privacy of the user's local training data. Therefore, how to balance the contradiction between user privacy protection and model prediction performance has become an urgent problem to be solved. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide an efficient federated learning method, electronic device and storage medium for protecting data privacy. It comprehensively adopts parameter sparsification, feature fuzzification technology, parameter control and other technologies, which not only reduces the amount of updated data transmitted by the network in each round of federated learning, but also enhances the privacy protection of user local training data, so as to at least solve some of the problems in the background technology.

[0005] In order to achieve the above-mentioned purpose, the present invention provides an efficient federated learning method for protecting data privacy, which includes: an efficient federated learning method for protecting data privacy, applied to a client node, the method including: obtaining model parameters, and updating a local model according to the model parameters; testing the accuracy of the updated local model on a local sample data set, and determining a first ratio and a second ratio according to the accuracy; training the updated local model with the local sample data set to obtain an updated gradient; selecting a number of components at the first ratio based on the values ​​of the components in the updated gradient, and selecting a number of components at the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient; cropping or setting the selected components to zero, and uploading the processed non-zero components of the updated gradient and their position indexes.

[0006] Optionally, the method includes a model initialization step; the model initialization step includes: setting initialization parameters and setting counting variables.

[0007] Optionally, obtaining the model parameters includes: a server node randomly selecting a number of client nodes from a whole set consisting of all client nodes of the federated learning system; and receiving the model parameters sent by the server node to the selected client nodes.

[0008] Optionally, the accuracy of the updated local model on the local sample data set is tested, and the first ratio and the second ratio are determined based on the accuracy, including: determining whether the first ratio and the second ratio in the previous round of model training exist; if not, setting the first ratio and the second ratio to initial values ​​respectively; if so, comparing the accuracy obtained by the test with the accuracy obtained by the test in the previous round of model training, and adjusting the first ratio and the second ratio in the previous round of model training according to the comparison result to obtain the first ratio and the second ratio.

[0009] Optionally, the first ratio and the second ratio in the previous round of model training are adjusted according to the comparison result to obtain the first ratio and the second ratio, including: when the comparison result is a decrease in accuracy, the first ratio and the second ratio in the previous round of model training are reduced to obtain the first ratio and the second ratio.

[0010] Optionally, selecting a number of components based on the values ​​of the components in the update gradient at the first ratio includes: obtaining the number of components based on the dimension in the update gradient; determining a first selection amount according to the number of components and the first ratio; and selecting the first selection amount of components with the smallest absolute value in the update gradient.

[0011] Optionally, selecting a number of components at the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient includes: randomly selecting a number of components at the second ratio from all components in the updated gradient that belong to the same convolution kernel and whose absolute values ​​are not zero.

[0012] Optionally, the processed non-zero components of the updated gradient and their position index are used to: upload to a server node, and the server node restores and generates the updated gradient of the client node based on the processed non-zero components of the updated gradient and their position index; the updated gradient of the client node is used to: generate a global model update gradient in combination with the update gradients of other client nodes; the global model update gradient is used to: calculate the model parameters based on the global model update gradient using the Adam algorithm to obtain the updated parameters of the global model.

[0013] Optionally, a global model update gradient is generated in combination with the update gradients of other client nodes, including: determining a weight value based on the local sample data of the client node corresponding to each update gradient; and obtaining a global model update gradient by performing weighted average calculation based on the non-zero components of the update gradient and the corresponding weight values ​​by dimension.

[0014] Optionally, the method is configured to be executed in a loop when the following preset conditions are met; the preset conditions include: after the global model is updated using the updated parameters, it is determined that the current state of the federated learning system does not meet the training stop condition of the federated learning.

[0015] The present invention also provides an efficient federated learning device for protecting data privacy, which includes: a parameter receiving module, used to obtain model parameters and update the local model according to the model parameters; a ratio determination module, used to test the accuracy of the updated local model on the local sample data set, and determine the first ratio and the second ratio according to the accuracy; a gradient generation module, used to train the updated local model with the local sample data set to obtain an updated gradient; a component selection module, used to select a number of components at the first ratio based on the values ​​of the components in the updated gradient, and select a number of components at the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient; and a processing upload module, used to crop or set the selected components to zero, and upload the non-zero components of the processed updated gradient and their position indexes.

[0016] The present invention also provides an electronic device, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the aforementioned efficient federated learning method for protecting data privacy by executing the instructions stored in the memory.

[0017] The present invention also provides a machine-readable storage medium on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned efficient federated learning method for protecting data privacy.

[0018] The present invention also provides a computer program product, including a computer program, which implements the aforementioned efficient federated learning method for protecting data privacy when executed by a processor.

[0019] The above technical solution has the following beneficial effects:

[0020] (1) By improving the Top-k sparsification technology of model parameters, this federated learning method can reduce the amount of data transmitted over the network and the network communication delay in the federated learning scenario, and improve the training efficiency of the federated learning model.

[0021] (2) Enhanced privacy protection of user data, controlled the adverse effects of privacy protection methods on model performance, suppressed model overfitting, and ensured that the final performance of the model met the requirements.

[0022] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0024] Figure 1 Schematically showing a schematic diagram of steps of an efficient federated learning method for protecting data privacy according to an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of the implementation process of an efficient federated learning method for protecting data privacy according to an embodiment of the present invention is schematically shown;

[0026] Figure 3 A schematic diagram of the structure of an efficient federated learning device for protecting data privacy according to an embodiment of the present invention is shown;

[0027] Figure 4 The figure schematically shows the internal structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0029] Figure 1 The following is a schematic diagram showing the steps of an efficient federated learning method for protecting data privacy according to an embodiment of the present invention. Figure 1 As shown, an efficient federated learning method for protecting data privacy includes:

[0030] S01. Obtain model parameters, and update the local model according to the model parameters;

[0031] S02, testing the accuracy of the updated local model on the local sample data set, and determining the first ratio and the second ratio according to the accuracy;

[0032] S03, training the updated local model using the local sample data set to obtain an updated gradient;

[0033] S04, selecting a plurality of components in the first ratio based on the values ​​of the components in the updated gradient, and selecting a plurality of components in the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient;

[0034] S05. Clip or set the selected components to zero, and upload the processed non-zero components of the updated gradient and their position indexes.

[0035] Through the above implementation, by dynamically adjusting the control method of parameter sparsification and feature fuzzification, it is possible to ensure that the privacy of user data is protected to the maximum extent under the premise that the model performance meets the requirements. At the same time, the amount of updated data transmitted by each round of federated learning network is also reduced. It can be seen that this implementation balances the contradiction between privacy protection and model performance.

[0036] In some embodiments of the present application, the method includes a model initialization step; the model initialization step includes: setting initialization parameters and setting count variables. If the federated learning system is in a state before the first round of training, it may be necessary to initialize the model of the federated learning system. In the federated learning system, it is assumed that the federated learning parameter server is S, and the parameter server belongs to the server node in the federated learning system. All federated learning client nodes constitute the set , the total number of all federated learning client nodes is The specific steps of model initialization are: the parameter server S initializes the parameters of the adopted deep neural network model, and the initialization parameters are ,in , is the total number of parameter dimensions of the global model. Set the count variable ,initialization At this time, the previous round of model training does not exist, and the first ratio and the second ratio are set to initial values ​​respectively. However, it should be noted that the model initialization is not necessary. For example, after the federated learning system starts the second round and subsequent training, the aforementioned efficient federated learning method for protecting data privacy can be applied, but it is no longer necessary to perform the initialization before the efficient federated learning method for protecting data privacy.

[0037] In some embodiments of the present application, obtaining model parameters includes: a server node randomly selecting a number of client nodes from a set of all client nodes in the federated learning system; and receiving the model parameters sent by the server node to the selected client nodes. When the round model parameters are issued, the server node S Randomly select from client nodes Client nodes, 0< ≤ , the selected federated learning client node is , where i is the client node number, 0< ≤ . The parameters of the global model of the convolutional neural network model Sent to the selected federated learning client node, starting the Round of local model training and model parameter update. , and are all positive integers. For example, in When the round model parameters are issued, the server node S Randomly select from client nodes The selected federated learning client nodes are . The parameters of the global model of the convolutional neural network model Sent to the selected federated learning client node, starting the Round of local model training and model parameter update.

[0038] In some embodiments of the present application, the accuracy of the updated local model on the local sample data set is tested, and the first ratio and the second ratio are determined according to the accuracy, including: judging whether the first ratio and the second ratio in the previous round of model training exist; if not, setting the first ratio and the second ratio to initial values ​​respectively; if so, comparing the accuracy obtained by the test with the accuracy obtained by the test in the previous round of model training, and adjusting the first ratio and the second ratio in the previous round of model training according to the comparison result to obtain the first ratio and the second ratio. During the local model training, each Using slave server nodes Received global model parameters Update the local model and test the accuracy of the local model on the local sample data set. , that is, if the first ratio and the second ratio in the previous round of model training do not exist, then initialize and is a value in the interval (0,1), where is the first ratio, is the second ratio. For example, the first ratio is initialized to 0.4 and the second ratio is initialized to 0.5. , then there are the first ratio and the second ratio in the previous round of model training, and we need to compare The accuracy of the corresponding model and The accuracy of the corresponding model is compared according to the results. and Continue to make corresponding adjustments.

[0039] Further, adjusting the first ratio and the second ratio in the previous round of model training according to the comparison result to obtain the first ratio and the second ratio includes: when the comparison result is that the accuracy is reduced, reducing the first ratio and the second ratio in the previous round of model training to obtain the first ratio and the second ratio. For example, if and The accuracy of the corresponding model is If the accuracy of the corresponding model is low, and Decrease by 0.01. 0.01 is the preset step value, which is adjustable and and The adjustment steps can be different.

[0040] After the updated local model is trained using the local sample data set in the aforementioned step S03, an updated gradient is obtained, including: During the local model training, each Use all sample data stored locally as training data sets, use the stochastic gradient descent algorithm to train the local model, and calculate the update gradient of the local model ,in Representation vector No. Quantity, , is a vector Dimension.

[0041] In some embodiments of the present application, selecting a number of components based on the values ​​of the components in the update gradient at the first ratio includes: obtaining the number of components based on the dimension in the update gradient; determining a first selection amount according to the number of components and the first ratio; and selecting the first selection amount of components with the smallest absolute value in the update gradient. During the local model training, each Will The components with the smallest absolute values ​​in are selected as target components. The number of target components is determined according to the first ratio, that is, the ratio is , converted to percentage For example, When it is 0.4, When it is equal to 10, the four components with the smallest absolute values ​​are selected as target components, and the target components are clipped or set to 0. The parameter sparseness of the updated gradient is achieved through this implementation.

[0042] In some embodiments of the present application, selecting a plurality of components in the second proportion based on the convolution kernel features and values ​​of the components in the updated gradient includes: randomly selecting a second proportion of components from all components in the updated gradient that belong to the same convolution kernel and whose absolute values ​​are not zero. During the local model training, each Will be from Among all the components in which the absolute value of the convolution kernel belongs to the same convolution kernel, a number of components are randomly selected as target components. The number of target components is determined according to the second ratio, that is, the ratio is , converted to percentage For example, When is 0.5, when the number of all components belonging to the same convolution kernel and having non-zero absolute values ​​is 6, 3 components are selected as target components, and the target components are clipped or set to 0. This implementation achieves feature fuzzification of the updated gradient.

[0043] In some embodiments of the present application, the processed non-zero components of the updated gradient and their position index are used to: upload to the server node, and the server node restores and generates the updated gradient of the client node based on the processed non-zero components of the updated gradient and their position index; the updated gradient of the client node is used to: generate the global model update gradient in combination with the update gradients of other client nodes; the global model update gradient is used to: calculate the model parameters based on the global model update gradient using the Adam algorithm to obtain the updated parameters of the global model. In this embodiment, in the During the local model training, each The final updated gradient of the local model The non-zero components and their position indexes are sent to the server node S.

[0044] The server node S updates the model parameters, which mainly includes four steps: parameter restoration, parameter aggregation, coefficient control, and parameter distribution.

[0045] The specific steps of “parameter restoration” are as follows: When the round model parameters are updated, the server node S first receives the update gradients uploaded by each client node The non-zero components and their position indices of , and restore to generate the final updated gradient .

[0046] The specific steps of “parameter aggregation” are: When the round model parameters are updated, the server node S calculates the global model update gradient , the Adam optimization algorithm is used to generate the updated parameters of the global model . The weight value is determined based on the local sample data of the client node corresponding to each update gradient; the global model update gradient is obtained by weighted average calculation based on the non-zero components of the update gradient and the corresponding weight values ​​according to the dimensions. The example is as follows:

[0047]

[0048] in, For client nodes A locally stored sample dataset, For collection Contains the number of sample data, For all of The number of samples sum.

[0049] The above calculation method is explained as follows: This implementation method is calculated based on the dimension, j To distinguish and represent. are all non-zero components, Update the gradient for the global model j The above calculation is performed for each dimension, and the final global model update gradient is , , is a vector Dimension.

[0050] In some embodiments of the present application, the "parameter delivery" determines the following logic: loop execution when the following preset conditions are met; the preset conditions include: after the global model is updated using the updated parameters, it is determined that the current state of the federated learning system does not meet the training stop conditions of the federated learning. The training stop conditions include: the parameters of the global model Convergence or If the parameters of the global model Convergence or , then terminate the training process, otherwise The value of is increased by 1, and steps S01 to S05 are repeated to start the next round of model parameter delivery, local model training and model parameter update. is the preset training cycle threshold constant, is a positive integer greater than 1.

[0051] Through the above implementation, the amount of data transmitted over the network and the network communication delay in the federated learning scenario can be reduced, the training efficiency of the federated learning model can be improved, and the contradiction between privacy protection and model performance can be balanced. At the same time, the above implementation also enhances the privacy protection of user data, controls the adverse effects of privacy protection methods on model performance, suppresses model overfitting, and ensures that the final performance of the model meets the requirements.

[0052] Figure 2 The following is a schematic diagram showing the implementation process of an efficient federated learning method for protecting data privacy according to an embodiment of the present invention. Figure 2 As shown, it includes the following implementation steps: the parameter server initializes the model parameters. The parameter server randomly selects the client node and sends the model parameters. The client node tests the model accuracy and adjusts the size of the sparsification parameter, that is, adjusts the first ratio and the second ratio. The client node trains the local model, performs parameter sparsification and feature fuzzification on the update gradient, and uploads the final update gradient. The parameter server receives the final update gradient uploaded by the client, updates the global model parameters, and determines the training termination condition. The parameter server in this embodiment is also called a server node based on the topological relationship.

[0053] Based on the same inventive concept, the present invention also provides an efficient federated learning device that protects data privacy. Figure 3 The schematic diagram of the structure of an efficient federated learning device for protecting data privacy according to an embodiment of the present invention is shown. Figure 3 As shown, the device includes: a parameter receiving module, used to obtain model parameters and update the local model according to the model parameters; a ratio determination module, used to test the accuracy of the updated local model on the local sample data set, and determine the first ratio and the second ratio according to the accuracy; a gradient generation module, used to train the updated local model with the local sample data set to obtain an updated gradient; a component selection module, used to select a number of components at the first ratio based on the values ​​of the components in the updated gradient, and select a number of components at the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient; and a processing upload module, used to crop or set to zero the selected components, and upload the processed non-zero components of the updated gradient and their position indexes.

[0054] In some optional implementations of the present application, the method includes a model initialization step; the model initialization step includes: setting initialization parameters and setting counting variables.

[0055] In some optional embodiments of the present application, obtaining model parameters includes: a server node randomly selects several client nodes from the entire set consisting of all client nodes of the federated learning system; and receiving the model parameters sent by the server node to the selected client nodes.

[0056] In some optional embodiments of the present application, the accuracy of the updated local model on the local sample data set is tested, and the first ratio and the second ratio are determined based on the accuracy, including: determining whether the first ratio and the second ratio in the previous round of model training exist; if not, setting the first ratio and the second ratio to initial values ​​respectively; if so, comparing the accuracy obtained by the test with the accuracy obtained by the test in the previous round of model training, and adjusting the first ratio and the second ratio in the previous round of model training according to the comparison result to obtain the first ratio and the second ratio.

[0057] In some optional embodiments of the present application, the first ratio and the second ratio in the previous round of model training are adjusted according to the comparison result to obtain the first ratio and the second ratio, including: when the comparison result is a decrease in accuracy, the first ratio and the second ratio in the previous round of model training are reduced to obtain the first ratio and the second ratio.

[0058] In some optional embodiments of the present application, selecting several components based on the values ​​of the components in the update gradient at the first ratio includes: obtaining the number of components based on the dimension in the update gradient; determining a first selection amount based on the number of components and the first ratio; and selecting the first selection amount of components with the smallest absolute value in the update gradient.

[0059] In some optional embodiments of the present application, selecting a number of components at the second ratio based on the convolution kernel features and values ​​of the components in the updated gradient includes: randomly selecting a number of components at the second ratio from all components in the updated gradient that belong to the same convolution kernel and whose absolute values ​​are not zero.

[0060] In some optional embodiments of the present application, the processed non-zero components of the update gradient and their position index are used to: upload to a server node, and the server node restores and generates the update gradient of the client node based on the processed non-zero components of the update gradient and their position index; the update gradient of the client node is used to: generate a global model update gradient in combination with the update gradients of other client nodes; the global model update gradient is used to: based on the global model update gradient, calculate the model parameters using the Adam algorithm to obtain the updated parameters of the global model.

[0061] In some optional embodiments of the present application, a global model update gradient is generated in combination with the update gradients of other client nodes, including: determining a weight value based on the local sample data of the client node corresponding to each update gradient; and obtaining a global model update gradient by performing weighted average calculation based on the non-zero components of the update gradient and the corresponding weight values ​​by dimension.

[0062] In some optional embodiments of the present application, the method is configured to be executed in a loop when the following preset conditions are met; the preset conditions include: after updating the global model using the updated parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

[0063] The specific definition of each functional module in the above-mentioned efficient federated learning device for protecting data privacy can be found in the above definition of the efficient federated learning method for protecting data privacy, which will not be repeated here. Each module in the above-mentioned system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It also reduces the amount of update data transmitted by the network in each round of federated learning, enhances the privacy protection of the user's local training data, and balances the contradiction between privacy protection and model performance.

[0064] In some embodiments of the present invention, an electronic device is also provided, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the above-mentioned efficient federated learning method for protecting data privacy. Its internal structure diagram can be as follows Figure 4 shown. Figure 4 The internal structure diagram of an electronic device according to an embodiment of the present invention is schematically shown. The electronic device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The network interface A02 of the electronic device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, an efficient federated learning method for protecting data privacy is implemented.

[0065] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0066] In one embodiment of the present invention, a machine-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned efficient federated learning method for protecting data privacy.

[0067] In one embodiment of the present invention, a computer program product is provided, including a computer program, which implements the aforementioned efficient federated learning method for protecting data privacy when executed by a processor.

[0068] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0069] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0070] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0072] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0073] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0074] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic 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. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0075] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0076] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. An efficient federated learning method for protecting data privacy, applied to client nodes, characterized in that: The method includes: Acquire model parameters, and update the local model according to the model parameters; Testing the accuracy of the updated local model on the local sample data set, and determining the first ratio and the second ratio according to the accuracy; After training the updated local model using the local sample data set, an update gradient is obtained; Selecting a number of components in the first ratio based on the values ​​of the components in the update gradient includes: obtaining the number of components in the update gradient based on the dimension; determining a first selection amount according to the number of components and the first ratio; selecting the first selection amount of components with the smallest absolute value in the update gradient; Selecting a number of components at the second ratio based on the convolution kernel features and values ​​of the components in the update gradient includes: randomly selecting a number of components at the second ratio from all components in the update gradient that belong to the same convolution kernel and whose absolute values ​​are not zero; The components selected twice are clipped or set to zero, and the non-zero components of the processed updated gradient and their position indexes are uploaded.

2. The method according to claim 1, characterized in that: The method comprises a model initialization step; The model initialization step includes: setting initialization parameters and setting counting variables.

3. The method according to claim 1, characterized in that Get model parameters, including: The server node randomly selects a number of client nodes from the entire set of all client nodes in the federated learning system; The model parameters sent by the server node to the selected client node are received.

4. The method according to claim 1, characterized in that Testing the accuracy of the updated local model on the local sample data set, and determining the first ratio and the second ratio according to the accuracy, including: Determine whether the first ratio and the second ratio in the previous round of model training exist; If not, the first ratio and the second ratio are set to initial values ​​respectively; If so, the accuracy obtained from the test is compared with the accuracy obtained from the test in the previous round of model training, and the first ratio and the second ratio in the previous round of model training are adjusted according to the comparison result to obtain the first ratio and the second ratio.

5. The method according to claim 4, characterized in that Adjusting the first ratio and the second ratio in the previous round of model training according to the comparison result to obtain the first ratio and the second ratio includes: When the comparison result is that the accuracy is reduced, the first ratio and the second ratio in the previous round of model training are reduced to obtain the first ratio and the second ratio.

6. The method according to claim 1, characterized in that The processed non-zero components of the updated gradient and their position indexes are used to: upload to a server node, and the server node restores and generates the updated gradient of the client node based on the processed non-zero components of the updated gradient and their position indexes; The update gradient of the client node is used to: generate a global model update gradient in combination with the update gradients of other client nodes; the global model update gradient is used to: calculate the model parameters based on the global model update gradient using the Adam algorithm to obtain the updated parameters of the global model.

7. The method according to claim 6, characterized in that Combine the update gradients of other client nodes to generate the global model update gradient, including: Determine a weight value based on local sample data of the client node corresponding to each updated gradient; The global model update gradient is obtained by performing weighted average calculation based on the non-zero components of the updated gradient and the corresponding weight values ​​by dimension.

8. The method according to claim 6, characterized in that The method is configured to be executed cyclically when the following preset conditions are met; The preset condition includes: after the global model is updated using the updated parameters, it is determined that the current state of the federated learning system does not meet the training stop condition of the federated learning.

9. An electronic device, characterized in that: include: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the steps of the efficient federated learning method for protecting data privacy as described in any one of claims 1 to 8 by executing the instructions stored in the memory.

10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the efficient federated learning method for protecting data privacy as described in any one of claims 1 to 8 are implemented.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the efficient federated learning method for protecting data privacy as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Federal learning method and device thereof, equipment and storage medium

    CN113516252A

  • Decentralization federated learning method, device and system based on local area communication network

    CN115190028A