WO2022141839A1 - 联邦学习模型的更新方法、装置、电子设备及存储介质 - Google Patents

联邦学习模型的更新方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022141839A1
WO2022141839A1 PCT/CN2021/083180 CN2021083180W WO2022141839A1 WO 2022141839 A1 WO2022141839 A1 WO 2022141839A1 CN 2021083180 W CN2021083180 W CN 2021083180W WO 2022141839 A1 WO2022141839 A1 WO 2022141839A1
Authority
WO
WIPO (PCT)
Prior art keywords
federated learning
parameter
gradient
data
learning model
Prior art date
Application number
PCT/CN2021/083180
Other languages
English (en)
French (fr)
Inventor
朱星华
王健宗
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022141839A1 publication Critical patent/WO2022141839A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Definitions

  • the present application relates to the field of intelligent decision-making, and in particular, to a method, apparatus, electronic device, and computer-readable storage medium for updating a federated learning model.
  • the inventor realizes that in the prior art, if a participant wants to withdraw from the federation system after completing the training of the federated model, or if the participant wishes to remove some of the private data's impact on the federated model, the federated model needs to be deleted after the data is deleted.
  • the model is retrained to update the parameters of the federated model.
  • the cost of this method in terms of computing power and communication is very huge, and at the same time, it needs to cooperate with all participants, which is time-consuming and labor-intensive. Therefore, in the prior art, after the data is removed, the efficiency of updating the parameters of the federated learning model is not high.
  • An update method for a federated learning model applied to the server including:
  • a data removal message is sent to all clients participating in the federated learning, so that the target client calculates the removal according to the gradient formula
  • the data is about the gradient parameter of the federated learning model, and the Hessian matrix of the loss function of the federated learning model that enables each client to calculate the full amount of data contained in each client after the removed data is removed according to the matrix formula;
  • the federated learning model is updated using the update parameters.
  • a device for updating a federated learning model applied to a server comprising:
  • the data request module is used to receive the data removal request sent by the target client participating in the federated learning
  • a message sending module configured to send a data removal message to all clients participating in the federated learning after deleting the removed data from the data used for the federated learning model, so that the target client is based on the gradient
  • the formula calculates the gradient parameter of the removed data with respect to the federated learning model, and enables each client to calculate the loss of the federated learning model after the removed data is removed from the full amount of data contained in each client according to the matrix formula the Hessian matrix of the function;
  • a parameter receiving module configured to receive the gradient parameters sent by the target client and the Hessian matrix sent by each client;
  • an update parameter calculation module for calculating update parameters according to the gradient parameters, the Hessian matrix and the preset model parameter formula
  • a model update module configured to update the federated learning model by using the update parameter.
  • An electronic device comprising:
  • a processor that executes the instructions stored in the memory to achieve the following steps:
  • a data removal message is sent to all clients participating in the federated learning, so that the target client calculates the removal according to the gradient formula
  • the data is about the gradient parameter of the federated learning model, and the Hessian matrix of the loss function of the federated learning model that enables each client to calculate the full amount of data contained in each client after the removed data is removed according to the matrix formula;
  • the federated learning model is updated using the update parameters.
  • a computer-readable storage medium having at least one instruction stored in the computer-readable storage medium, the at least one instruction being executed by a processor in an electronic device to implement the following steps:
  • a data removal message is sent to all clients participating in the federated learning, so that the target client calculates the removal according to the gradient formula
  • the data is about the gradient parameter of the federated learning model, and the Hessian matrix of the loss function of the federated learning model that enables each client to calculate the full amount of data contained in each client after the removed data is removed according to the matrix formula;
  • the federated learning model is updated using the update parameters.
  • This application can solve the problem of low update efficiency of the federated learning model.
  • FIG. 1 is a schematic flowchart of a method for updating a federated learning model provided by a first method embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for updating a federated learning model provided by a second method embodiment of the present application;
  • FIG. 3 is a schematic block diagram of an apparatus for updating a federated learning model provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of the internal structure of an electronic device implementing a method for updating a federated learning model provided by an embodiment of the present application;
  • the embodiment of the present application provides a method for updating a federated learning model.
  • the execution body of the method for updating the federated learning model includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the method for updating the federated learning model can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • FIG. 1 it is a schematic flowchart of a method for updating a federated learning model provided by a first method embodiment of the present application.
  • the method for updating the federated learning model is applied to the server, including:
  • the server described in this application is a server participating in federated learning.
  • a server can use multiple clients.
  • the server opens a listening port according to the number of clients, so as to perform data transmission with each client.
  • the server opens K listening ports.
  • the client calculates the gradient parameter, and at the same time, each client participating in the federated learning calculates the Hessian Matrix, and then multiple Hessian Matrix can be obtained. Hessian matrix. That is, other clients including the target client perform calculations to obtain the Hessian matrix.
  • the receiving the gradient parameter sent by the target client and the Hessian matrix sent by each client includes:
  • the gradient parameter sent by the target client and the Hessian matrix sent by each client are received through the listening port by using a preset request-response protocol.
  • the preset model parameter formula includes:
  • w (-m) is the update parameter
  • w is the parameter vector of the federated learning model
  • is the gradient parameter
  • m is the number of the removed data
  • k is the number of all clients participating in the federated learning.
  • the method before calculating the update parameter according to the gradient parameter, the Hessian matrix and the preset model parameter formula, the method further includes:
  • the gradient parameter or the Hessian matrix is encrypted data
  • the encrypted data is decrypted according to the preset decryption formula, and the decrypted gradient parameters and the Hessian matrix are obtained, including:
  • the preset decryption formula is:
  • m is the decrypted gradient parameter or Hessian matrix
  • c is the encrypted gradient parameter or Hessian matrix
  • mod is the modulo operator
  • n p ⁇ q, where p, q satisfy pq and (p-1)(q-1) is a large prime number whose greatest common multiple is 1
  • is the Carmichael function
  • is a preset parameter.
  • the encrypted gradient parameter or the Hessian matrix is decrypted by using the public key (n, g) to obtain the decrypted gradient parameter or the Hessian matrix.
  • the method further includes:
  • the gradient parameter sent by the target client and the Hessian matrix sent by each client are received; the update parameter is calculated according to the gradient parameter, the Hessian matrix and the preset model parameter formula;
  • the federated learning model is updated with the update parameters.
  • the concurrent calculation of gradient parameters and gradient parameters on the client side is conducive to the rapid update of the federated learning model, and also reduces the computing pressure on the server side and improves the overall computing efficiency. Therefore, the update method of the federated learning model proposed in this application can solve the problem of low update efficiency of the federated learning model.
  • the schematic flowchart shown in FIG. 2 describes the update method of the federated learning model provided by the second method embodiment of the present application.
  • the method for updating the federated learning model is applied to the client, including:
  • the federated learning model may be a federated linear model or a federated logistic regression model.
  • the gradient formula includes a first gradient sub-formula and a second gradient sub-formula
  • the matrix formula includes a first matrix sub-formula and a second matrix sub-formula
  • the federated learning model is a federated linear model, calculate the gradient parameter of the removed data with respect to the federated learning model according to the first gradient sub-formula, and calculate the full amount of data contained in the client according to the first matrix sub-formula
  • the Hessian matrix of the loss function of the federated learning model after the removal of the removed data is a federated linear model, calculate the gradient parameter of the removed data with respect to the federated learning model according to the first gradient sub-formula, and calculate the full amount of data contained in the client according to the first matrix sub-formula
  • the federated learning model belongs to the federated logistic regression model, calculate the gradient parameters of the removed data with respect to the federated learning model according to the second gradient sub-formula, and calculate the full amount of data contained in the client according to the second matrix sub-formula
  • the Hessian matrix of the loss function of the federated learning model after the removal of the data is the Hessian matrix of the loss function of the federated learning model after the removal of the data.
  • the first gradient sub-formula includes:
  • is the gradient parameter
  • m is the number of removed data
  • is the regularization factor
  • w is the parameter vector of the federated learning model
  • b is the preset loss disturbance factor
  • x j and y j are the model’s Input data
  • T is the preset parameter.
  • the second gradient sub-formula includes:
  • is the gradient parameter
  • m is the number of removed data
  • w is the parameter vector of the federated learning model
  • x j and y j are the input data of the model
  • T is a preset parameter.
  • the first matrix sub-formula includes:
  • the loss function of the federated learning model includes:
  • n is the parameter federated learning the number of clients.
  • the second matrix sub-formula includes:
  • the loss function of the federated learning model includes:
  • the gradient parameter and the Hessian matrix are sent to the server, so that the server can
  • the Hessian matrix described above adjusts the parameters of the federated learning model.
  • the method before the gradient parameter and the Hessian matrix are sent to the server, the method further includes:
  • the encrypted calculation of the gradient parameter and the Hessian matrix includes:
  • the public key is (n, g), and the private key is ( ⁇ , ⁇ );
  • the gradient parameter and the Hessian matrix are encrypted by using the private key ( ⁇ , ⁇ ) to obtain the encrypted gradient parameter and the Hessian matrix.
  • Prime number refers to a natural number that has no other factors other than 1 and itself among the natural numbers greater than 1, and the large prime number refers to the largest one or more of the natural numbers that satisfy the definition of a prime number.
  • the client transmits the public key to the server, and uses the private key ( ⁇ , ⁇ ) to encrypt the gradient parameters and the Hessian matrix to obtain the encrypted gradient parameters and Hessian matrix.
  • the embodiment of the present application uses the private key to encrypt the gradient parameter and the Hessian matrix, thereby improving the security of data transmission.
  • the embodiment of the present application reduces the computing pressure of the server by computing the gradient parameters and the Hessian matrix in parallel on the client, and improves the speed of acquiring the gradient parameters and the Hessian matrix, and then transmits the calculated gradient parameters and the Hessian matrix to the server.
  • the server side enables fast model updates on the server side. Therefore, the update method of the federated learning model proposed in this application can solve the problem of low update efficiency of the federated learning model.
  • FIG. 3 it is a functional block diagram of an apparatus for updating a federated learning model provided by an embodiment of the present application.
  • the apparatus for updating the federated learning model described in this application may be divided into an apparatus for updating the first federated learning model 100 and an apparatus for updating the second federated learning model 200 .
  • the updating apparatus 100 of the first federated learning model may be installed in the server and the updating apparatus 200 of the second federated learning model may be installed in the client.
  • the updating apparatus 100 of the first federated learning model may include a data requesting module 101, a message sending module 102, a parameter receiving module 103, an updating parameter module 104 and a model updating module 105; and the second federated learning
  • the model updating apparatus 200 may include a model obtaining module 201 , a gradient and matrix calculation module 202 and a parameter sending module 203 .
  • modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module in the updating apparatus 100 of the first federated learning model and the updating apparatus 200 of the second federated learning model are as follows:
  • the data request module 101 is configured to receive a data removal request sent by a target client participating in federated learning
  • the message sending module 102 is configured to send a data removal message to all clients participating in the federated learning after deleting the removed data from the data used for the federated learning model, so that the target client
  • the terminal calculates the gradient parameters of the removed data with respect to the federated learning model according to the gradient formula, and enables each client to calculate the full amount of data contained in each client according to the matrix formula.
  • the federated learning The Hessian matrix of the loss function of the model;
  • the parameter receiving module 103 is configured to receive the gradient parameter sent by the target client and the Hessian matrix sent by each client;
  • the update parameter calculation module 104 is configured to calculate the update parameter according to the gradient parameter, the Hessian matrix and the preset model parameter formula;
  • the model update module 105 is configured to update the federated learning model by using the update parameter.
  • the model acquisition module 201 is configured to acquire the federated learning model when there is removal data for the federated learning model in the client;
  • the gradient and matrix calculation module 202 is configured to calculate the gradient parameter of the removed data with respect to the federated learning model according to the gradient formula, and calculate the full amount of data contained in the client in the removed data according to the matrix formula. After removing the Hessian matrix of the loss function of the federated learning model;
  • the parameter sending module 203 is configured to send the gradient parameter and the Hessian matrix to the server, so that the server can update the parameters of the federated learning model according to the gradient parameter and the Hessian matrix .
  • each module of the updating apparatus 100 of the first federated learning model is as follows:
  • the data request module 101 is configured to receive a data removal request sent by a target client participating in federated learning.
  • the server described in this application is a server participating in federated learning.
  • a server can use multiple clients.
  • the server opens a listening port according to the number of clients, so as to perform data transmission with each client.
  • the server opens K listening ports.
  • the message sending module 102 is configured to send a data removal message to all clients participating in the federated learning after deleting the removed data from the data used for the federated learning model, so that the target client
  • the terminal calculates the gradient parameters of the removed data with respect to the federated learning model according to the gradient formula, and enables each client to calculate the full amount of data contained in each client according to the matrix formula.
  • the federated learning The Hessian matrix of the model's loss function.
  • the client calculates the gradient parameter, and at the same time, each client participating in the federated learning calculates the Hessian Matrix, and then multiple Hessian Matrix can be obtained. Hessian matrix. That is, other clients including the target client perform calculations to obtain the Hessian matrix.
  • the parameter receiving module 103 is configured to receive the gradient parameters sent by the target client and the Hessian matrix sent by each client.
  • the receiving the gradient parameter sent by the target client and the Hessian matrix sent by each client includes:
  • the gradient parameter sent by the target client and the Hessian matrix sent by each client are received through the listening port by using a preset request-response protocol.
  • the update parameter calculation module 104 is configured to calculate the update parameter according to the gradient parameter, the Hessian matrix and the preset model parameter formula.
  • the preset model parameter formula includes:
  • w (-m) is the update parameter
  • w is the parameter vector of the federated learning model
  • is the gradient parameter
  • m is the number of the removed data
  • k is the number of all clients participating in the federated learning.
  • the device before calculating the update parameter according to the gradient parameter, the Hessian matrix and the preset model parameter formula, the device further includes a decryption module, and the decryption module is used to determine whether the gradient parameter or Whether the Hessian matrix is encrypted data; if the gradient parameter or the Hessian matrix is encrypted data, decrypt the encrypted data according to a preset decryption formula, and obtain the decrypted gradient parameter and Hessian matrix .
  • the encrypted data is decrypted according to the preset decryption formula, and the decrypted gradient parameters and the Hessian matrix are obtained, including:
  • the preset decryption formula is:
  • m is the decrypted gradient parameter or Hessian matrix
  • c is the encrypted gradient parameter or Hessian matrix
  • mod is the modulo operator
  • n p ⁇ q, where p, q satisfy pq and (p-1)(q-1) is a large prime number whose greatest common multiple is 1
  • is the Carmichael function
  • is a preset parameter.
  • the encrypted gradient parameter or the Hessian matrix is decrypted by using the public key (n, g) to obtain the decrypted gradient parameter or the Hessian matrix.
  • the apparatus further includes a model updating module, and the model updating module 105 is configured to send the updated federated learning model to participating federations Learn all clients.
  • the gradient parameter sent by the target client and the Hessian matrix sent by each client are received; the update parameter is calculated according to the gradient parameter, the Hessian matrix and the preset model parameter formula;
  • the federated learning model is updated with the update parameters.
  • the concurrent calculation of gradient parameters and gradient parameters on the client side is conducive to the rapid update of the federated learning model, and also reduces the computing pressure on the server side and improves the overall computing efficiency. Therefore, the update method of the federated learning model proposed in this application can solve the problem of low update efficiency of the federated learning model.
  • each module of the updating apparatus 200 of the second federated learning model is as follows:
  • the model obtaining module 201 is configured to obtain the federated learning model when the client has removed data for the federated learning model.
  • the federated learning model may be a federated linear model or a federated logistic regression model.
  • the gradient and matrix calculation module 202 is configured to calculate the gradient parameter of the removed data with respect to the federated learning model according to the gradient formula, and calculate the full amount of data contained in the client in the removed data according to the matrix formula.
  • the gradient formula includes a first gradient sub-formula and a second gradient sub-formula
  • the matrix formula includes a first matrix sub-formula and a second matrix sub-formula
  • the device also includes the gradient and matrix calculation module 202, the gradient and matrix calculation module 202 is used to determine the type of the federated learning model; if the federated learning model belongs to the federated linear model, calculate the Removing data about the gradient parameters of the federated learning model, and calculating the Hessian of the loss function of the federated learning model after the removed data is removed from the full amount of data contained in the client according to the first matrix sub-formula matrix; if the federated learning model belongs to the federated logistic regression model, calculate the gradient parameters of the removed data with respect to the federated learning model according to the second gradient sub-formula, and calculate according to the second matrix sub-formula
  • the first gradient sub-formula includes:
  • is the gradient parameter
  • m is the number of removed data
  • is the regularization factor
  • w is the parameter vector of the federated learning model
  • b is the preset loss disturbance factor
  • x j and y j are the model’s Input data
  • T is the preset parameter.
  • the second gradient sub-formula includes:
  • is the gradient parameter
  • m is the number of removed data
  • w is the parameter vector of the federated learning model
  • x j and y j are the input data of the model
  • T is a preset parameter.
  • the first matrix sub-formula includes:
  • the loss function of the federated learning model includes:
  • n is the parameter federated learning the number of clients.
  • the second matrix sub-formula includes:
  • the loss function of the federated learning model includes:
  • the parameter sending module 203 is configured to send the gradient parameter and the Hessian matrix to the server, so that the server can update the parameters of the federated learning model according to the gradient parameter and the Hessian matrix .
  • the gradient parameter and the Hessian matrix are sent to the server, so that the server can
  • the Hessian matrix described above adjusts the parameters of the federated learning model.
  • the apparatus before the gradient parameter and the Hessian matrix are sent to the server, the apparatus further includes an encryption module 204, and the encryption module 204 is used for:
  • the encrypted calculation of the gradient parameter and the Hessian matrix includes:
  • the public key is (n, g), and the private key is ( ⁇ , ⁇ );
  • the gradient parameter and the Hessian matrix are encrypted by using the private key ( ⁇ , ⁇ ) to obtain the encrypted gradient parameter and the Hessian matrix.
  • Prime number refers to a natural number that has no other factors other than 1 and itself among the natural numbers greater than 1, and the large prime number refers to the largest one or more of the natural numbers that satisfy the definition of a prime number.
  • the client transmits the public key to the server, and uses the private key ( ⁇ , ⁇ ) to encrypt the gradient parameters and the Hessian matrix to obtain encrypted gradient parameters and Hessian matrix.
  • the embodiment of the present application uses the private key to encrypt the gradient parameter and the Hessian matrix, thereby improving the security of data transmission.
  • the embodiment of the present application reduces the computing pressure of the server by computing the gradient parameters and the Hessian matrix in parallel on the client, and improves the speed of obtaining the gradient parameters and the Hessian matrix, and then transmits the calculated gradient parameters and the Hessian matrix to the server.
  • the server side enables fast model updates on the server side. Therefore, the update method of the federated learning model proposed in this application can solve the problem of low update efficiency of the federated learning model.
  • FIG. 4 it is a schematic structural diagram of an electronic device for implementing a method for updating a federated learning model provided by an embodiment of the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an update program 12 for a federated learning model.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store application software installed in the electronic device 1 and various data, such as the code of the update program 12 of the federated learning model, etc., but also can be used to temporarily store the data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing programs or modules (such as federal update program of the learning model, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process the data.
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 4 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the drawings. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the update program 12 of the federated learning model stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
  • the method for updating the federated learning model includes:
  • a data removal message is sent to all clients participating in the federated learning, so that the target client calculates the removal according to the gradient formula
  • the data is related to the gradient parameter of the federated learning model, and the Hessian matrix of the loss function of the federated learning model that enables each client to calculate the full amount of data contained in each client after the removed data is removed according to the matrix formula;
  • the federated learning model is updated using the update parameters.
  • the updating method of the federated learning model includes:
  • the gradient parameter and the Hessian matrix are sent to the server, so that the server updates the parameters of the federated learning model according to the gradient parameter and the Hessian matrix.
  • the integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
  • the method for updating the federated learning model includes:
  • a data removal message is sent to all clients participating in the federated learning, so that the target client calculates the removal according to the gradient formula
  • the data is related to the gradient parameter of the federated learning model, and the Hessian matrix of the loss function of the federated learning model that enables each client to calculate the full amount of data contained in each client after the removed data is removed according to the matrix formula;
  • the federated learning model is updated using the update parameters.
  • the updating method of the federated learning model includes:
  • the gradient parameter and the Hessian matrix are sent to the server, so that the server updates the parameters of the federated learning model according to the gradient parameter and the Hessian matrix.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种联邦学习模型的更新方法、更新装置、电子设备以及计算机可读存储介质。该方法包括:服务器端接收参与联邦学习的目标客户端发送的数据移除请求,在根据数据移除请求进行数据移除之后,向目标客户端以及参与联邦学习的其他客户端发送数据移除消息,根据预设的梯度公式计算移除数据的梯度参数,其他客户端根据预设的矩阵公式计算得到黑塞矩阵,根据所述梯度参数、所述黑塞矩阵和预设的模型参数公式更新联邦学习模型的参数。此外,还涉及区块链技术,所述梯度参数可存储于区块链的节点。可以解决联邦学习模型的更新效率低的问题。

Description

联邦学习模型的更新方法、装置、电子设备及存储介质
本申请要求于2020年12月31日提交中国专利局、申请号为CN202011640520.0,发明名称为“联邦学习模型的更新方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及智能决策领域,尤其涉及一种联邦学习模型的更新方法、装置、电子设备及计算机可读存储介质。
背景技术
现在人们越来越注重数据信息的安全性,为了保障大数据交换时的信息安全、保护终端数据和个人数据隐私,出现了在多参与方或多计算结点之间开展高效率的机器学习的方法,即联邦学习方法。
发明人意识到现有技术中,若有参与者在完成联邦模型训练后想要退出联邦系统,或是参与者希望移除一部分私有数据对联邦模型造成的影响,需要在将数据删除之后对联邦模型进行重新训练以更新联邦模型的参数。但是该方法在算力与通信方面的成本非常巨大,同时要联合各参与方给予配合,耗时耗力。因此,现有技术中,在移除数据之后,对联邦学习模型进行参数更新的效率不高。
发明内容
一种应用于服务器端的联邦学习模型的更新方法,包括:
接收参与联邦学习的目标客户端发送的数据移除请求;
在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
利用所述更新参数对所述联邦学习模型进行更新。
一种应用于服务器端的联邦学习模型的更新装置,所述装置包括:
数据请求模块,用于接收参与联邦学习的目标客户端发送的数据移除请求;
消息发送模块,用于在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
参数接收模块,用于接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
更新参数计算模块,用于根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
模型更新模块,用于利用所述更新参数对所述联邦学习模型进行更新。
一种电子设备,所述电子设备包括:
存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现如下步骤:
接收参与联邦学习的目标客户端发送的数据移除请求;
在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
利用所述更新参数对所述联邦学习模型进行更新。
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:
接收参与联邦学习的目标客户端发送的数据移除请求;
在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
利用所述更新参数对所述联邦学习模型进行更新。
本申请可以解决联邦学习模型的更新效率低的问题。
附图说明
图1为本申请第一方法实施例提供的联邦学习模型的更新方法的流程示意图;
图2为本申请第二方法实施例提供的联邦学习模型的更新方法的流程示意图;
图3为本申请一实施例提供的联邦学习模型的更新装置的模块示意图;
图4为本申请一实施例提供的实现联邦学习模型的更新方法的电子设备的内部结构示意图;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种联邦学习模型的更新方法。所述联邦学习模型的更新方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述联邦学习模型的更新方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请第一方法实施例提供的联邦学习模型的更新方法的流程示意图。在本实施例中,所述联邦学习模型的更新方法应用于服务器端中,包括:
S11、接收参与联邦学习的目标客户端发送的数据移除请求。
本申请所述服务器为参与联邦学习的服务器。一个服务器可以对用多个客户端。
本申请实施例中,所述服务器端根据客户端的数量开启监听端口,以便与每一个客户端之间执行数据传输。
例如,客户端的数量为K,则服务器开启K个监听端口。
S12、在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵。
本申请实施例中,若某个客户端存在移除数,则该客户端计算梯度参数,同时,每个参与联邦学习的客户端都计算得到黑塞矩阵(Hessian Matrix),则可以得到多个黑塞矩阵。即包括目标客户端在内的其他客户端都进行计算,得到黑塞矩阵。
具体的,有关客户端计算的说明请参见本申请第二方法实施例中的描述。
S13、接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵。
本申请实施例中,所述接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵,包括:
获取所述监听端口;
利用预设的请求响应协议通过所述监听端口接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵。
S14、根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数。
优选的,所述预设模型参数公式包括:
Figure PCTCN2021083180-appb-000001
其中,w (-m)为所述更新参数,w为所述联邦学习模型的参数向量,
Figure PCTCN2021083180-appb-000002
为第i个客户端的黑塞矩阵,Δ为所述梯度参数,m为所述移除数据的个数,k为参与所述联邦学习的所有客户端的个数。
本申请实施例中,所述根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数之前,所述方法还包括:
判断所述梯度参数或所述黑塞矩阵是否为加密数据;
若所述梯度参数或所述黑塞矩阵中是加密数据,根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵。
具体地,所述根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵,包括:
所述预设的解密公式为:
m=L(c λmod n 2)*μmod n
Figure PCTCN2021083180-appb-000003
其中,m是解密后的梯度参数或者黑塞矩阵,c是指加密后的梯度参数或者黑塞矩阵,mod是指取模运算符,n=p×q,其中,p,q为满足pq与(p-1)(q-1)的最大公倍数为1的大质数,λ为卡迈克尔函数,μ为预设参数。
详细地,利用所述公钥(n,g)对所述加密后的梯度参数或者黑塞矩阵进行解密处理,得到解密后的梯度参数或者黑塞矩阵。
详细地,所述利用所述更新参数对所述联邦学习模型进行更新之后,所述方法还包括:
将更新后的所述联邦学习模型发送至参与联邦学习的所有客户端。
本申请实施例通过接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;并根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;再利用所述更新参数对所述联邦学习模型进行更新。在将用于联邦学习的数据删除之后不仅无需重新训练联邦学习模型,并且可以保持联邦学习模型的可用性和准确性,提高了联邦学习模型更新的效率。同时,通过客户端并发计算梯度参数和梯度参数,有利于快速对联邦学习模型进行更新,同时也减轻了服务器端的运算压力,提高整体的运算效率。因此本申请提出的联邦学习模型的更新方法可以解决联邦学习模型的更新效率低的问题。
图2所示的流程示意图描述了本申请第二方法实施例提供的联邦学习模型的更新方法。在本实施例中,所述联邦学习模型的更新方法应用于客户端,包括:
S21、当所述客户端存在移除用于联邦学习模型的移除数据时,获取所述联邦学习模型。
本申请实施例中,所述联邦学习模型可以是联邦线性模型或者联邦逻辑回归模型。
S22、根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据矩阵公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵。
进一步的,所述梯度公式包括第一梯度子公式和第二梯度子公式,所述矩阵公式包括第一矩阵子公式和第二矩阵子公式,所述获取所述联邦学习模型之后,所述方法还包括:
判断所述联邦学习模型的类型;
若所述联邦学习模型属于联邦线性模型,根据第一梯度子公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据第一矩阵子公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
若所述联邦学习模型属于联邦逻辑回归模型,根据第二梯度子公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据第二矩阵子公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵。
具体的,所述第一梯度子公式包括:
Figure PCTCN2021083180-appb-000004
其中,Δ为梯度参数,m为移除数据的个数,λ为正则化因子,w为所述联邦学习模型的参数向量,b为预设的损失扰动因子,x j和y j为模型的输入数据,T为预设参数。
具体的,所述第二梯度子公式包括:
Figure PCTCN2021083180-appb-000005
Figure PCTCN2021083180-appb-000006
其中,Δ为梯度参数,m为移除数据的个数,w为所述联邦学习模型的参数向量,x j和y j为模型的输入数据,T为预设参数。
具体的,所述第一矩阵子公式包括:
Figure PCTCN2021083180-appb-000007
其中,
Figure PCTCN2021083180-appb-000008
为黑塞矩阵,
Figure PCTCN2021083180-appb-000009
为损失函数,
Figure PCTCN2021083180-appb-000010
为客户端i包含的全量数据,
Figure PCTCN2021083180-appb-000011
为客户端i移除数据,x j和y j为模型的输入数据,m和T为预设参数。
本实施例中,所述联邦学习模型为联邦线性模型时,所述联邦学习模型的损失函数包括:
Figure PCTCN2021083180-appb-000012
其中,
Figure PCTCN2021083180-appb-000013
为损失函数,λ为正则化因子,w为所述联邦学习模型的参数向量,b为预设的损失扰动因子,(x,y)为所述联邦学习模型的输入数据,n为参数联邦学习的客户端的个数。
具体的,所述第二矩阵子公式包括:
Figure PCTCN2021083180-appb-000014
Figure PCTCN2021083180-appb-000015
其中,
Figure PCTCN2021083180-appb-000016
为黑塞矩阵,
Figure PCTCN2021083180-appb-000017
为损失函数,
Figure PCTCN2021083180-appb-000018
为旋度。
本实施例中,所述联邦学习模型为联邦逻辑回归模型时,所述联邦学习模型的损失函数包括:
Figure PCTCN2021083180-appb-000019
Figure PCTCN2021083180-appb-000020
其中,
Figure PCTCN2021083180-appb-000021
为损失函数,x和y为模型的输入数据,T为预设参数。
S23、将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵更新所述联邦学习模型的参数。
本申请实施例中,当所述客户端与所述服务器为已连接状态时,将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵调整联邦学习模型的参数。
具体地,本申请实施例中,所述将所述梯度参数和所述黑塞矩阵发送至服务器端之前,所述方法还包括:
对所述梯度参数和所述黑塞矩阵进行加密计算。
进一步地,所述对所述梯度参数和所述黑塞矩阵进行加密计算,包括:
随机选取两个满足预设条件的大质数p,q,使得pq与(p-1)(q-1)的最大公倍数为1;
计算n=p×q,且满足λ(n)=lcm(p-1,q-1),其中,lcm为最小公倍数,λ为卡迈克尔函数;
随机选择一个小于n 2的正整数g,并计算μ=(L(g λmod n 2)) -1mod n;
根据所述n、g、λ,和μ,得到公钥为(n,g),私钥为(λ,μ);
利用所述私钥(λ,μ)对所述梯度参数和所述黑塞矩阵进行加密处理,得到加密后的梯度参数和黑塞矩阵。
其中,质数是指在大于1的自然数中,除了1和它本身以外不再有其他因数的自然数,所述大质数则是指满足质数定义的自然数中最大的一个或者多个。
进一步地,本申请实施例中,客户端将所述公钥传输给服务器,利用所述私钥(λ,μ)对所述梯度参数和黑塞矩阵进行加密处理,得到加密后的梯度参数和黑塞矩阵。
本申请实施例利用所述私钥对梯度参数和黑塞矩阵进行加密,提高了数据传输的安全性。
本申请实施例通过在客户端并行计算梯度参数和黑塞矩阵,减轻了服务器的计算压力,提高了获取梯度参数和黑塞矩阵的速度,再将计算得到的梯度参数和黑塞矩阵传输至服务器端,使服务器端能够快速地进行模型更新。因此本申请提出的联邦学习模型的更新方法可以解决联邦学习模型的更新效率低的问题。
如图3所示,是本申请一实施例提供的联邦学习模型的更新装置的功能模块图。
本申请所述联邦学习模型的更新装置可以被划分为第一联邦学习模型的更新装置100以及第二联邦学习模型的更新装置200。其中,所述第一联邦学习模型的更新装置100可以安装于服务器端中以及所述第二联邦学习模型的更新装置200可以安装在客户端中。
根据实现的功能,所述第一联邦学习模型的更新装置100可以包括数据请求模块101、消息发送模块102、参数接收模块103、更新参数模块104及模型更新模块105;以及所述第二联邦学习模型的更新装置200可以包括模型获取模块201、梯度与矩阵计算模块202 及参数发送模块203。
本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,所述第一联邦学习模型的更新装置100中和所述第二联邦学习模型的更新装置200各模块的功能如下:
所述数据请求模块101,用于接收参与联邦学习的目标客户端发送的数据移除请求;
所述消息发送模块102,用于在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
所述参数接收模块103,用于接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
所述更新参数计算模块104,用于根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
所述模型更新模块105,用于利用所述更新参数对所述联邦学习模型进行更新。
所述模型获取模块201,用于当所述客户端存在移除用于联邦学习模型的移除数据时,获取所述联邦学习模型;
所述梯度与矩阵计算模块202,用于根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据矩阵公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
所述参数发送模块203,用于将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵更新所述联邦学习模型的参数。
详细地,所述第一联邦学习模型的更新装置100各模块的具体实施方式如下:
所述数据请求模块101,用于接收参与联邦学习的目标客户端发送的数据移除请求。
本申请所述服务器为参与联邦学习的服务器。一个服务器可以对用多个客户端。
本申请实施例中,所述服务器端根据客户端的数量开启监听端口,以便与每一个客户端之间执行数据传输。
例如,客户端的数量为K,则服务器开启K个监听端口。
所述消息发送模块102,用于在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵。
本申请实施例中,若某个客户端存在移除数,则该客户端计算梯度参数,同时,每个参与联邦学习的客户端都计算得到黑塞矩阵(Hessian Matrix),则可以得到多个黑塞矩阵。即包括目标客户端在内的其他客户端都进行计算,得到黑塞矩阵。
具体的,有关客户端计算的说明请参见本申请第二方法实施例中的描述。
所述参数接收模块103,用于接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵。
本申请实施例中,所述接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵,包括:
获取所述监听端口;
利用预设的请求响应协议通过所述监听端口接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵。
所述更新参数计算模块104,用于根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数。
优选的,所述预设模型参数公式包括:
Figure PCTCN2021083180-appb-000022
其中,w (-m)为所述更新参数,w为所述联邦学习模型的参数向量,
Figure PCTCN2021083180-appb-000023
为第i个客户端的黑塞矩阵,Δ为所述梯度参数,m为所述移除数据的个数,k为参与所述联邦学习的所有客户端的个数。
本申请实施例中,所述根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数之前,所述装置还包括解密模块,所述解密模块用于判断所述梯度参数或所述黑塞矩阵是否为加密数据;若所述梯度参数或所述黑塞矩阵中是加密数据,根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵。
具体地,所述根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵,包括:
所述预设的解密公式为:
m=L(c λmod n 2)*μmod n
Figure PCTCN2021083180-appb-000024
其中,m是解密后的梯度参数或者黑塞矩阵,c是指加密后的梯度参数或者黑塞矩阵,mod是指取模运算符,n=p×q,其中,p,q为满足pq与(p-1)(q-1)的最大公倍数为1的大质数,λ为卡迈克尔函数,μ为预设参数。
详细地,利用所述公钥(n,g)对所述加密后的梯度参数或者黑塞矩阵进行解密处理,得到解密后的梯度参数或者黑塞矩阵。
详细地,所述利用所述更新参数对所述联邦学习模型进行更新之后,所述装置还包括模型更新模块,所述模型更新模块105用于将更新后的所述联邦学习模型发送至参与联邦学习的所有客户端。
本申请实施例通过接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;并根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;再利用所述更新参数对所述联邦学习模型进行更新。在将用于联邦学习的数据删除之后不仅无需重新训练联邦学习模型,并且可以保持联邦学习模型的可用性和准确性,提高了联邦学习模型更新的效率。同时,通过客户端并发计算梯度参数和梯度参数,有利于快速对联邦学习模型进行更新,同时也减轻了服务器端的运算压力,提高整体的运算效率。因此本申请提出的联邦学习模型的更新方法可以解决联邦学习模型的更新效率低的问题。
详细地,所述第二联邦学习模型的更新装置200各模块的具体实施方式如下:
所述模型获取模块201,用于当所述客户端存在移除用于联邦学习模型的移除数据时,获取所述联邦学习模型。
本申请实施例中,所述联邦学习模型可以是联邦线性模型或者联邦逻辑回归模型。
所述梯度与矩阵计算模块202,用于根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据矩阵公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵。
进一步的,所述梯度公式包括第一梯度子公式和第二梯度子公式,所述矩阵公式包括第一矩阵子公式和第二矩阵子公式,所述获取所述联邦学习模型之后,所述装置还包括所述梯度与矩阵计算模块202,所述梯度与矩阵计算模块202用于判断所述联邦学习模型的类型;若所述联邦学习模型属于联邦线性模型,根据第一梯度子公式计算所述移除数据关 于所述联邦学习模型的梯度参数,以及根据第一矩阵子公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;若所述联邦学习模型属于联邦逻辑回归模型,根据第二梯度子公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据第二矩阵子公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵。
具体的,所述第一梯度子公式包括:
Figure PCTCN2021083180-appb-000025
其中,Δ为梯度参数,m为移除数据的个数,λ为正则化因子,w为所述联邦学习模型的参数向量,b为预设的损失扰动因子,x j和y j为模型的输入数据,T为预设参数。
具体的,所述第二梯度子公式包括:
Figure PCTCN2021083180-appb-000026
Figure PCTCN2021083180-appb-000027
其中,Δ为梯度参数,m为移除数据的个数,w为所述联邦学习模型的参数向量,x j和y j为模型的输入数据,T为预设参数。
具体的,所述第一矩阵子公式包括:
Figure PCTCN2021083180-appb-000028
其中,
Figure PCTCN2021083180-appb-000029
为黑塞矩阵,
Figure PCTCN2021083180-appb-000030
为损失函数,
Figure PCTCN2021083180-appb-000031
为客户端i包含的全量数据,
Figure PCTCN2021083180-appb-000032
为客户端i移除数据,x j和y j为模型的输入数据,m和T为预设参数。
本实施例中,所述联邦学习模型为联邦线性模型时,所述联邦学习模型的损失函数包括:
Figure PCTCN2021083180-appb-000033
其中,
Figure PCTCN2021083180-appb-000034
为损失函数,λ为正则化因子,w为所述联邦学习模型的参数向量,b为预设的损失扰动因子,(x,y)为所述联邦学习模型的输入数据,n为参数联邦学习的客户端的个数。
具体的,所述第二矩阵子公式包括:
Figure PCTCN2021083180-appb-000035
Figure PCTCN2021083180-appb-000036
其中,
Figure PCTCN2021083180-appb-000037
为黑塞矩阵,
Figure PCTCN2021083180-appb-000038
为损失函数,
Figure PCTCN2021083180-appb-000039
为旋度。
本实施例中,所述联邦学习模型为联邦逻辑回归模型时,所述联邦学习模型的损失函数包括:
Figure PCTCN2021083180-appb-000040
Figure PCTCN2021083180-appb-000041
其中,
Figure PCTCN2021083180-appb-000042
为损失函数,x和y为模型的输入数据,T为预设参数。
所述参数发送模块203,用于将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵更新所述联邦学习模型的参数。
本申请实施例中,当所述客户端与所述服务器为已连接状态时,将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵调整联邦学习模型的参数。
具体地,本申请实施例中,所述将所述梯度参数和所述黑塞矩阵发送至服务器端之前,所述装置还包括加密模块204,所述加密模块204用于:
对所述梯度参数和所述黑塞矩阵进行加密计算。
进一步地,所述对所述梯度参数和所述黑塞矩阵进行加密计算,包括:
随机选取两个满足预设条件的大质数p,q,使得pq与(p-1)(q-1)的最大公倍数为1;
计算n=p×q,且满足λ(n)=lcm(p-1,q-1),其中,lcm为最小公倍数,λ为卡迈克尔函数;
随机选择一个小于n 2的正整数g,并计算μ=(L(g λmod n 2)) -1mod n;
根据所述n、g、λ,和μ,得到公钥为(n,g),私钥为(λ,μ);
利用所述私钥(λ,μ)对所述梯度参数和所述黑塞矩阵进行加密处理,得到加密后的梯度参数和黑塞矩阵。
其中,质数是指在大于1的自然数中,除了1和它本身以外不再有其他因数的自然数,所述大质数则是指满足质数定义的自然数中最大的一个或者多个。
进一步地,本申请实施例中,客户端将所述公钥传输给服务器,利用所述私钥(λ,μ)对所述梯度参数和黑塞矩阵进行加密处理,得到加密后的梯度参数和黑塞矩阵。
本申请实施例利用所述私钥对梯度参数和黑塞矩阵进行加密,提高了数据传输的安全性。
本申请实施例通过在客户端并行计算梯度参数和黑塞矩阵,减轻了服务器的计算压力,提高了获取梯度参数和黑塞矩阵的速度,再将计算得到的梯度参数和黑塞矩阵传输至服务器端,使服务器端能够快速地进行模型更新。因此本申请提出的联邦学习模型的更新方法可以解决联邦学习模型的更新效率低的问题。
如图4所示,是本申请一实施例提供的实现联邦学习模型的更新方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如联邦学习模型的更新程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如联邦学习模型的更新程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如联邦学习模型的更新程序等),以及调用存储在所述存储器11内的数 据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图4仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图4示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的联邦学习模型的更新程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
详细地,当所述电子设备为服务器端电子设备时,所述联邦学习模型的更新方法包括:
接收参与联邦学习的目标客户端发送的数据移除请求;
在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
利用所述更新参数对所述联邦学习模型进行更新。
进一步地,当所述电子设备为客户端电子设备时,所述联邦学习模型的更新方法包括:
当所述客户端存在移除用于联邦学习模型的移除数据时,获取所述联邦学习模型;
根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据矩阵公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵更新所述联邦学习模型的参数。
具体地,所述处理器10对上述指令的具体实现方法可参考图1至图4对应实施例中相关步骤的描述,在此不赘述。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独 立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是易失性的,也可以是非易失性的,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:
详细地,当所述电子设备为服务器端电子设备时,所述联邦学习模型的更新方法包括:
接收参与联邦学习的目标客户端发送的数据移除请求;
在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
利用所述更新参数对所述联邦学习模型进行更新。
进一步地,当所述电子设备为客户端电子设备时,所述联邦学习模型的更新方法包括:
当所述客户端存在移除用于联邦学习模型的移除数据时,获取所述联邦学习模型;
根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及根据矩阵公式计算所述客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
将所述梯度参数和所述黑塞矩阵发送至服务器端,以使所述服务器端根据所述梯度参数和所述黑塞矩阵更新所述联邦学习模型的参数。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种联邦学习模型的更新方法,其中,所述方法应用于服务器端,包括:
    接收参与联邦学习的目标客户端发送的数据移除请求;
    在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
    接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
    根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
    利用所述更新参数对所述联邦学习模型进行更新。
  2. 如权利要求1所述的联邦学习模型的更新方法,其中,所述预设模型参数公式包括:
    Figure PCTCN2021083180-appb-100001
    其中,w (-m)为所述更新参数,w为所述联邦学习模型的参数向量,
    Figure PCTCN2021083180-appb-100002
    为第i个客户端的黑塞矩阵,Δ为所述梯度参数,m为所述移除数据的个数,k为参与所述联邦学习的所有客户端的个数。
  3. 如权利要求1所述的联邦学习模型的更新方法,其中,所述利用所述更新参数对所述联邦学习模型进行更新之后,所述方法还包括:
    将更新后的所述联邦学习模型发送至参与联邦学习的所有客户端。
  4. 如权利要求1所述的联邦学习模型的更新方法,其中,所述根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数之前,所述方法还包括:
    判断所述梯度参数或所述黑塞矩阵是否为加密数据;
    若所述梯度参数或所述黑塞矩阵中是加密数据,根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵。
  5. 如权利要求4所述的联邦学习模型的更新方法,其中,所述根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵,包括:
    所述预设的解密公式为:
    m=L(c λmodn 2)*μmodn
    Figure PCTCN2021083180-appb-100003
    其中,m是解密后的梯度参数或者黑塞矩阵,c是指加密后的梯度参数或者黑塞矩阵,mod是指取模运算符,n=p×q,其中,p,q为满足pq与(p-1)(q-1)的最大公倍数为1的大质数,λ为卡迈克尔函数,μ为预设参数。
  6. 如权利要求1所述的联邦学习模型的更新方法,其中,所述接收参与联邦学习的目标客户端发送的数据移除请求之后,所述方法还包括:
    根据客户端的数量开启监听端口。
  7. 如权利要求1所述的联邦学习模型的更新方法,其中,所述接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵,包括:
    获取所述监听端口;
    利用预设的请求响应协议通过所述监听端口接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵。
  8. 一种联邦学习模型的更新装置,其中,所述装置应用于服务器端,所述装置包括:
    数据请求模块,用于接收参与联邦学习的目标客户端发送的数据移除请求;
    消息发送模块,用于在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
    参数接收模块,用于接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
    更新参数计算模块,用于根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
    模型更新模块,用于利用所述更新参数对所述联邦学习模型进行更新。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:
    接收参与联邦学习的目标客户端发送的数据移除请求;
    在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
    接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
    根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
    利用所述更新参数对所述联邦学习模型进行更新。
  10. 如权利要求9所述的电子设备,其中,所述预设模型参数公式包括:
    Figure PCTCN2021083180-appb-100004
    其中,w (-m)为所述更新参数,w为所述联邦学习模型的参数向量,
    Figure PCTCN2021083180-appb-100005
    为第i个客户端的黑塞矩阵,Δ为所述梯度参数,m为所述移除数据的个数,k为参与所述联邦学习的所有客户端的个数。
  11. 如权利要求9所述的电子设备,其中,所述利用所述更新参数对所述联邦学习模型进行更新之后,所述至少一个处理器还执行如下步骤:
    将更新后的所述联邦学习模型发送至参与联邦学习的所有客户端。
  12. 如权利要求9所述的电子设备,其中,所述根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数之前,所述至少一个处理器还执行如下步骤:
    判断所述梯度参数或所述黑塞矩阵是否为加密数据;
    若所述梯度参数或所述黑塞矩阵中是加密数据,根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵。
  13. 如权利要求12所述的电子设备,其中,所述根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵,包括:
    所述预设的解密公式为:
    m=L(c λmodn 2)*μmodn
    Figure PCTCN2021083180-appb-100006
    其中,m是解密后的梯度参数或者黑塞矩阵,c是指加密后的梯度参数或者黑塞矩阵,mod是指取模运算符,n=p×q,其中,p,q为满足pq与(p-1)(q-1)的最大公倍数为1的大质数,λ为卡迈克尔函数,μ为预设参数。
  14. 如权利要求9所述的电子设备,其中,所述接收参与联邦学习的目标客户端发送的数据移除请求之后,所述至少一个处理器还执行如下步骤:
    根据客户端的数量开启监听端口。
  15. 如权利要求9所述的电子设备,其中,所述接收所述目标客户端发送的梯度参和各个客户端发送的黑塞矩阵,包括:
    获取所述监听端口;
    利用预设的请求响应协议通过所述监听端口接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵。
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:
    接收参与联邦学习的目标客户端发送的数据移除请求;
    在从用于联邦学习模型的数据中删除所述移除数据之后,向参与所述参与联邦学习的所有客户端发送数据移除消息,以使得所述目标客户端根据梯度公式计算所述移除数据关于所述联邦学习模型的梯度参数,以及使得各个客户端根据矩阵公式计算各个客户端所包含的全量数据在所述移除数据移除之后所述联邦学习模型的损失函数的黑塞矩阵;
    接收所述目标客户端发送的梯度参数和各个客户端发送的黑塞矩阵;
    根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数;
    利用所述更新参数对所述联邦学习模型进行更新。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述预设模型参数公式包括:
    Figure PCTCN2021083180-appb-100007
    其中,w (-m)为所述更新参数,w为所述联邦学习模型的参数向量,
    Figure PCTCN2021083180-appb-100008
    为第i个客户端的黑塞矩阵,Δ为所述梯度参数,m为所述移除数据的个数,k为参与所述联邦学习的所有客户端的个数。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述更新参数对所述联邦学习模型进行更新之后,所述至少一个处理器还执行如下步骤:
    将更新后的所述联邦学习模型发送至参与联邦学习的所有客户端。
  19. 如权利要求16所述的计算机可读存储介质,其中,所述根据所述梯度参数、所述黑塞矩阵和预设模型参数公式计算更新参数之前,所述至少一个处理器还执行如下步骤:
    判断所述梯度参数或所述黑塞矩阵是否为加密数据;
    若所述梯度参数或所述黑塞矩阵中是加密数据,根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵。
  20. 如权利要求19所述的计算机可读存储介质,其中,所述根据预设的解密公式对所述加密数据进行解密,得到解密后的梯度参数和黑塞矩阵,包括:
    所述预设的解密公式为:
    m=L(c λmodn 2)*μmodn
    Figure PCTCN2021083180-appb-100009
    其中,m是解密后的梯度参数或者黑塞矩阵,c是指加密后的梯度参数或者黑塞矩阵,mod是指取模运算符,n=p×q,其中,p,q为满足pq与(p-1)(q-1)的最大公倍数为1的大质数,λ为卡迈克尔函数,μ为预设参数。
PCT/CN2021/083180 2020-12-31 2021-03-26 联邦学习模型的更新方法、装置、电子设备及存储介质 WO2022141839A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011640520.0 2020-12-31
CN202011640520.0A CN112732297B (zh) 2020-12-31 2020-12-31 联邦学习模型的更新方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022141839A1 true WO2022141839A1 (zh) 2022-07-07

Family

ID=75609096

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083180 WO2022141839A1 (zh) 2020-12-31 2021-03-26 联邦学习模型的更新方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112732297B (zh)
WO (1) WO2022141839A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225405A (zh) * 2022-07-28 2022-10-21 上海光之树科技有限公司 联邦学习框架下基于安全聚合和密钥交换的矩阵分解方法
CN115329985A (zh) * 2022-09-07 2022-11-11 北京邮电大学 无人集群智能模型训练方法、装置和电子设备
CN117094410A (zh) * 2023-07-10 2023-11-21 西安电子科技大学 一种面向投毒受损联邦学习的模型修复方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851786B (zh) * 2019-11-14 2023-06-06 深圳前海微众银行股份有限公司 基于纵向联邦学习的企业间数据交互方法、装置、设备及存储介质
CN113887743B (zh) * 2021-09-29 2022-07-22 浙江大学 一种联邦学习中数据遗忘与验证的平台

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189825A (zh) * 2018-08-10 2019-01-11 深圳前海微众银行股份有限公司 横向数据切分联邦学习建模方法、服务器及介质
CN110378488A (zh) * 2019-07-22 2019-10-25 深圳前海微众银行股份有限公司 客户端变化的联邦训练方法、装置、训练终端及存储介质
CN110610242A (zh) * 2019-09-02 2019-12-24 深圳前海微众银行股份有限公司 一种联邦学习中参与者权重的设置方法及装置
US20200050443A1 (en) * 2018-08-10 2020-02-13 Nvidia Corporation Optimization and update system for deep learning models
CN111553483A (zh) * 2020-04-30 2020-08-18 同盾控股有限公司 基于梯度压缩的联邦学习的方法、装置及系统
CN111814985A (zh) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 联邦学习网络下的模型训练方法及其相关设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189825A (zh) * 2018-08-10 2019-01-11 深圳前海微众银行股份有限公司 横向数据切分联邦学习建模方法、服务器及介质
US20200050443A1 (en) * 2018-08-10 2020-02-13 Nvidia Corporation Optimization and update system for deep learning models
CN110378488A (zh) * 2019-07-22 2019-10-25 深圳前海微众银行股份有限公司 客户端变化的联邦训练方法、装置、训练终端及存储介质
CN110610242A (zh) * 2019-09-02 2019-12-24 深圳前海微众银行股份有限公司 一种联邦学习中参与者权重的设置方法及装置
CN111553483A (zh) * 2020-04-30 2020-08-18 同盾控股有限公司 基于梯度压缩的联邦学习的方法、装置及系统
CN111814985A (zh) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 联邦学习网络下的模型训练方法及其相关设备

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225405A (zh) * 2022-07-28 2022-10-21 上海光之树科技有限公司 联邦学习框架下基于安全聚合和密钥交换的矩阵分解方法
CN115225405B (zh) * 2022-07-28 2023-04-21 上海光之树科技有限公司 联邦学习框架下基于安全聚合和密钥交换的矩阵分解方法
CN115329985A (zh) * 2022-09-07 2022-11-11 北京邮电大学 无人集群智能模型训练方法、装置和电子设备
CN115329985B (zh) * 2022-09-07 2023-10-27 北京邮电大学 无人集群智能模型训练方法、装置和电子设备
CN117094410A (zh) * 2023-07-10 2023-11-21 西安电子科技大学 一种面向投毒受损联邦学习的模型修复方法
CN117094410B (zh) * 2023-07-10 2024-02-13 西安电子科技大学 一种面向投毒受损联邦学习的模型修复方法

Also Published As

Publication number Publication date
CN112732297A (zh) 2021-04-30
CN112732297B (zh) 2022-09-27

Similar Documents

Publication Publication Date Title
WO2022141839A1 (zh) 联邦学习模型的更新方法、装置、电子设备及存储介质
WO2022142038A1 (zh) 数据传输方法及相关设备
EP3335117B1 (en) Data center privacy
WO2021208701A1 (zh) 代码变更的注释生成方法、装置、电子设备及存储介质
WO2022134760A1 (zh) 数据处理方法、装置、电子设备及介质
JP2003512649A (ja) 暗号アクセラレータ
CN112949760A (zh) 基于联邦学习的模型精度控制方法、装置及存储介质
US10594804B2 (en) Directory service discovery and/or learning
WO2022227317A1 (zh) 基于区块链的资源转移方法、装置、电子设备及存储介质
CN112953930A (zh) 一种云存储数据的处理方法、装置及计算机系统
CN114389889B (zh) 基于区块链技术的文件全生命周期管理方法及装置
WO2021217939A1 (zh) 用于区块链数据处理的方法、装置及可读存储介质
CN107251480A (zh) 数据保管装置、数据更新系统、数据处理方法和数据处理程序
CN113420049A (zh) 数据流通方法、装置、电子设备及存储介质
WO2022012162A1 (zh) 基于矩阵运算的数据加密方法、装置、电子设备及存储介质
CN109165080A (zh) 虚拟机在线迁移过程内存数据的保护方法、装置及物理机
CN115374150A (zh) 字符串数据查询方法、装置、电子设备及存储介质
CN111400270B (zh) 一种基于区块链的文件授时的方法和装置
CN112217639A (zh) 数据的加密共享方法、装置、电子设备及计算机存储介质
WO2022116422A1 (zh) 产品推荐方法、装置、电子设备及计算机可读存储介质
WO2021239034A1 (zh) 基于身份加密的数据传送方法、装置、电子设备及存储介质
CN112182598A (zh) 公有样本id识别方法、装置、服务器及可读存储介质
CN114826613B (zh) 基于区块链的身份信息查询方法、装置、设备及存储介质
US11727154B2 (en) Crypto device operation
US11449494B2 (en) Distributed secure database system using an evolving nonce

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21912609

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21912609

Country of ref document: EP

Kind code of ref document: A1