WO2020029585A1 - Neural network federation modeling method and device employing transfer learning, and storage medium - Google Patents
Neural network federation modeling method and device employing transfer learning, and storage medium Download PDFInfo
- Publication number
- WO2020029585A1 WO2020029585A1 PCT/CN2019/078522 CN2019078522W WO2020029585A1 WO 2020029585 A1 WO2020029585 A1 WO 2020029585A1 CN 2019078522 W CN2019078522 W CN 2019078522W WO 2020029585 A1 WO2020029585 A1 WO 2020029585A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- terminal
- neural network
- value
- encrypted
- loss value
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/06—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N3/063—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
Definitions
- the present invention relates to the technical field of machine learning, and in particular, to a neural network federation modeling method, device, and storage medium based on transfer learning.
- Machine learning can be applied to various fields, such as data mining, computer vision, natural language processing, biometric recognition, medical diagnosis, detection of credit card fraud, securities market analysis, and DNA sequence sequencing.
- Machine learning includes a learning part and an execution part.
- the learning part uses sample data to modify the system's knowledge base to improve the efficiency of the system's execution part to complete the task.
- the execution part completes the task according to the knowledge base, and at the same time feeds the obtained information to the learning part.
- the main purpose of the present invention is to provide a neural network federation modeling method, equipment and storage medium based on transfer learning, which aims to improve the privacy and utilization of sample data of all parties.
- the present invention provides a neural network federation modeling method based on transfer learning.
- the neural network federation modeling method based on transfer learning includes the following steps:
- the first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;
- the second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;
- the model parameters to be converged are used to establish the model to be trained.
- the third terminal receives the encrypted third loss value sent by the first terminal, it obtains the encrypted historical loss value sent by the first terminal last time, and according to the pre-stored private key pair
- the encrypted third loss value, the historical loss value, and the third gradient value are decrypted, and the decrypted third loss value, the historical loss value, and the third gradient value are returned to the first terminal.
- the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption includes:
- the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
- the encrypted first gradient value and the first loss value are combined with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain an encrypted third loss value and After the step of the third gradient value, the method further includes:
- the second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value.
- the third terminal ;
- the method further includes:
- a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;
- the first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data
- the vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined.
- the second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
- the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the first terminal
- the two terminals respectively store the public key in respective preset storage areas.
- the third terminal generates a set of public key and private key at a preset interval, and transmits the generated public key to the first terminal and the second terminal, and the first terminal and the The second terminal updates the public key stored in the respective preset storage area according to the received public key, respectively.
- step of encrypting the first gradient value and the first loss value includes:
- the first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
- the neural network federation modeling method based on transfer learning further includes:
- the present invention also provides a neural network federation modeling device based on transfer learning.
- the neural network federation modeling device based on transfer learning includes: a memory, a processor, and a memory stored on the memory and A neural network federation modeling program based on transfer learning that can be run on the processor, and the neural network federation modeling program based on transfer learning implements the neural network based on transfer learning as described above when executed by the processor Steps in federated modeling method.
- the present invention also provides a storage medium storing a neural network federation modeling program based on transfer learning, and implementing the neural network federation modeling program based on transfer learning to implement The steps of a neural network federation modeling method for transfer learning.
- the present invention provides a neural network federation modeling method, device, and storage medium based on transfer learning.
- the present invention inputs feature vectors of sample data of two parties into two neural networks, and two parties correspondingly obtain two neural networks with the same feature dimension.
- Vector and get the respective gradient and loss values according to the neural network vectors with the same feature dimensions, and one of them encrypts the gradient and loss values, and then combines the encrypted gradient and loss values sent by the other party To obtain the encrypted total loss value and total gradient value, and transmit the encrypted total loss value to a third party, and finally determine whether the model to be trained converges based on the decrypted total loss value and historical loss value returned by the third party.
- the model parameters to be trained are used to establish the model to be trained. Because the data to be transmitted by both parties is encrypted, and joint training can be performed in an encrypted form, the privacy of the sample data of all parties is effectively improved. , Multi-layer neural network of joint parties for machine learning can effectively use the sample of all parties Data, improve the utilization of the parties to the sample data.
- FIG. 1 is a schematic diagram of a device structure of a hardware operating environment according to an embodiment of the present invention
- FIG. 2 is a schematic flowchart of a first embodiment of a neural network federation modeling method based on transfer learning according to the present invention
- FIG. 3 is a schematic flowchart of a second embodiment of a neural network federation modeling method based on transfer learning according to the present invention.
- FIG. 1 is a schematic diagram of a device structure of a hardware operating environment according to an embodiment of the present invention.
- the neural network federation modeling device based on the transfer learning in the embodiment of the present invention may be a PC, or a mobile terminal device with a display function such as a smart phone, a tablet computer, a portable computer, or the like.
- the neural network federation modeling device based on transfer learning may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
- the communication bus 1002 is used to implement connection and communication between these components.
- the user interface 1003 may include a display screen, an input unit such as a keyboard, and the optional user interface 1003 may further include a standard wired interface and a wireless interface.
- the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
- the memory 1005 may be a high-speed RAM memory or a non-volatile memory. memory), such as disk storage.
- the memory 1005 may optionally be a storage device independent of the foregoing processor 1001.
- the structure of the neural network federation modeling device based on transfer learning shown in FIG. 1 does not constitute a limitation on the neural network federation modeling device based on transfer learning, and may include more or more than illustrated Fewer components, or some components combined, or different component arrangements.
- the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a neural network federation modeling program based on transfer learning.
- the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server;
- the user interface 1003 is mainly used to connect to the client (user), and The client performs data communication;
- the processor 1001 can be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and execute the following steps:
- the first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;
- the second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;
- the model parameters to be converged are used to establish the model to be trained.
- the third terminal receives the encrypted third loss value sent by the first terminal, it obtains the encrypted historical loss value sent by the first terminal last time, and according to the pre-stored private key pair
- the encrypted third loss value, the historical loss value, and the third gradient value are decrypted, and the decrypted third loss value, the historical loss value, and the third gradient value are returned to the first terminal.
- processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
- the difference is less than or equal to a preset threshold, it is determined that the model to be trained is in a convergence state, otherwise it is determined that the model to be trained is not in a convergence state.
- processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
- the second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value.
- the third terminal ;
- the method further includes:
- a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;
- the first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data
- the vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined.
- the second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
- the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the first terminal
- the two terminals respectively store the public key in respective preset storage areas.
- the third terminal generates a set of public key and private key at a preset interval, and transmits the generated public key to the first terminal and the second terminal, and the first terminal and the The second terminal updates the public key stored in the respective preset storage area according to the received public key, respectively.
- processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
- the first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
- processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
- the specific embodiments of the neural network federation modeling device based on transfer learning of the present invention are basically the same as the specific embodiments of the neural network federation modeling method based on transfer learning described below, and will not be repeated here.
- FIG. 2 is a schematic flowchart of a first embodiment of a neural network federation modeling method based on transfer learning according to the present invention.
- a first terminal inputs a feature vector of first sample data to a first neural network, obtains a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector.
- a gradient value and a first loss value are encrypted;
- the present invention can combine multi-party sample data to train the model to be trained.
- the following uses the joint two-party sample data as an example to explain, where one sample data is the first sample data and is stored in the first terminal. And the first neural network is deployed at the first terminal, and the other party ’s sample data is the second sample data, which is stored in the second terminal, and the second neural network is deployed at the second terminal, and the first terminal is connected to the second terminal,
- a third terminal is introduced.
- the third terminal stores a set of public and private keys required for encryption, and the first terminal is connected to the third terminal.
- the second terminal is connected to the third terminal and can transmit data.
- the labeling of the sample data of both parties includes labeling the first sample data without labeling the second sample data, not labeling the first sample data, and labeling the second sample data, the first sample data, and the second sample data are labeled or Neither the first sample data nor the second sample data are labeled.
- the labeling of the sample data of both parties is not specifically limited.
- the network parameters of the first neural network and the second neural network can be set by those skilled in the art based on the actual situation and the actual situation, which is not specifically limited in this embodiment.
- the network parameters include, but are not limited to, the number of network nodes in each layer, the number of hidden layers, the initial weight of each synapse, the learning rate, dynamic parameters, allowable errors, the number of iterations, and the activation function.
- the first terminal inputs the first sample data to the first neural network, and when the last layer of the first neural network is reached, the characteristics of the first sample data are obtained.
- Expression that is, the first neural network vector, and the first gradient value and the first loss value are determined according to the first neural network vector, that is, the first gradient value is the gradient function of the model to be trained.
- the first A loss value is a loss of the loss function of the model to be trained for the first common feature vector, and the first gradient value and the first loss value are encrypted.
- the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the second terminal store the public key respectively in respective presets.
- the first terminal obtains a public key from a preset storage area, and homomorphizes the first gradient value and the first loss value according to the public key. Encrypt, and send the encrypted first gradient value and first loss value to the second terminal.
- the encryption method is homomorphic encryption (processing the homomorphically encrypted data to obtain an output, and decrypting this output, the result is the same as the output obtained by processing the unencrypted original data in the same method) , Can be calculated in the form of cipher text, does not affect the results obtained by the calculation.
- Step S102 Combine the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value. ;
- the second terminal inputs the second sample data to the second neural network for iteration, and when it reaches the last layer of the second neural network, it obtains the characteristic expression of the second sample data, that is, the second neural network vector, and Determine the second gradient value and the second loss value according to the first neural network vector, that is, the second gradient value is the gradient function of the model to be trained for the gradient of the second common feature vector, and the second loss value is the loss function of the model to be trained for The second common feature vector is lost, and the second gradient value and the second loss value are encrypted and sent to the first terminal, that is, the public key in the pre-stored storage area is obtained, and the second gradient value and the second loss value are the same. State encryption, and send the encrypted second gradient value and the second loss value to the first terminal.
- the feature dimensions of the first neural network vector and the second neural network vector are the same.
- the first terminal combines the encrypted first gradient value and the first loss value with the encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value. That is, the first terminal receives the encrypted second gradient value and the second loss value sent by the second terminal, and combines the encrypted first gradient value and the second gradient value to obtain an encrypted third gradient value, and combines the encrypted first A loss value and a second loss value to obtain an encrypted third loss value.
- the first terminal and the second terminal obtain a public key from the third terminal at a preset interval to update the local storage in the pre-
- the public key in the storage area is set.
- a timer is set in the third terminal.
- the timer starts timing.
- the timer reaches a preset time
- the third terminal generates a group of public keys. Key and private key, and sends the public key to the first terminal and the second terminal, and the timer restarts, and the first terminal and the second terminal update the public key stored in the preset storage area .
- the preset time can be set by a person skilled in the art based on the actual situation, which is not specifically limited in this embodiment.
- Step S103 Send the encrypted third loss value and the third gradient value to the third terminal, and determine whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
- the first terminal sends the encrypted third loss value and the third gradient value to the third terminal
- the third terminal receives the encrypted third loss value and the third gradient value sent by the first terminal, and obtains
- the first encrypted historical loss value sent by the first terminal, and the encrypted third loss value, historical loss value, and third gradient value are decrypted according to the pre-stored private key, and the decrypted third loss value and history are decrypted.
- the loss value and the third gradient value are returned to the first terminal, and the first terminal determines whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
- the first terminal receives the third loss value and the historical loss value returned by the third terminal, and then calculates a difference between the third loss value and the historical loss value returned by the decryption, and determines whether the difference is less than or equal to A preset threshold. If the difference is less than or equal to the preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
- the preset threshold may be set by a person skilled in the art based on actual conditions, and this embodiment does not specifically limit this.
- Step S104 If the model to be trained converges, establish the model to be trained based on the model parameters during convergence.
- the model parameter to be trained is used to establish the model to be trained.
- the operation of determining whether the model to be converged can also be performed by the third terminal. Specifically, the third terminal receives the encrypted third loss value sent by the first terminal, and obtains the encryption history sent by the first terminal last time. Loss value, and then decrypt the encrypted third loss value and historical loss value according to the pre-stored private key, and determine whether the model to be trained converges based on the decrypted third loss value and historical loss value, and determine the model convergence Deploying on the third terminal can reduce the resource occupation of the second terminal or the third terminal, and improve the resource utilization of the third terminal.
- step S102 the method further includes:
- step a the second terminal combines the encrypted second gradient value with the encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value to the first Three terminals
- the second terminal when the first terminal performs the determination of the gradient value and the loss value, the second terminal combines the encrypted second gradient value with the encrypted first gradient value sent by the first terminal to obtain encryption.
- the third terminal that sends the encrypted fourth gradient value that is, the second terminal receives the encrypted first gradient value sent by the first terminal, and combines the encrypted second gradient value to obtain the encrypted first gradient value.
- step S103 the method further includes:
- Step b if the model to be trained does not converge, send a gradient update instruction to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted third
- the gradient value is returned to the first terminal, and the decrypted fourth gradient value is returned to the second terminal;
- the local gradients of the first neural network and the second neural network need to be updated, that is, the first terminal sends a gradient update instruction to the third terminal, and the third terminal sends the encrypted first
- the three gradient values and the fourth gradient value are decrypted, and the decrypted third gradient value is returned to the first terminal, and the decrypted fourth gradient value is returned to the second terminal.
- the first terminal updates the local gradient of the first neural network according to the third gradient value decrypted by the third terminal, and after the update is completed, returns to step S101, that is, the first terminal inputs the feature vector of the first sample data to the first
- a neural network obtains a first neural network vector, determines a first gradient value and a first loss value according to the first neural network vector, and encrypts the first gradient value and the first loss value.
- the second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to execute step a, that is, the second terminal encrypts the second gradient value and the received second gradient value.
- the encrypted first gradient value sent by the first terminal is combined to obtain an encrypted fourth gradient value, and the encrypted fourth gradient value is sent to a third terminal.
- the first terminal transmits the weight parameter value WA of the first neural network to the second after being encrypted.
- Terminal transmits the weight parameter value WB of the second neural network to the first terminal, and the first terminal trains the first neural network according to the encrypted weight parameter values WA and WB, until convergence, and the second terminal
- the second neural network is trained according to the encrypted weight parameter values WA and WB until convergence, and when both the first neural network and the second neural network converge, a model to be trained is established according to the weight parameter values WA and WB in the convergence state.
- the present invention inputs the feature vectors of the sample data of the two parties into two neural networks respectively, and the two parties correspondingly obtain two neural network vectors with the same feature dimension, and obtain the respective neural network vectors according to the respective neural network vectors with the same feature dimension.
- Gradient value and loss value, and one of them encrypts the gradient value and loss value, and then combines the encrypted gradient value and loss value sent by the other party to obtain the encrypted total loss value and total gradient value, and encrypts the encrypted value.
- the total loss value is transmitted to a third party. Finally, based on the decrypted total loss value and the historical loss value returned by the third party, it is determined whether the model to be trained converges.
- the model parameters at the time of convergence are used to establish the model to be trained. Because the data that the two parties need to transmit is encrypted, and joint training can be performed in an encrypted form, the privacy of the sample data of all parties is effectively improved, and at the same time, the multi-layer neural network of the parties is used for machine learning, which can effectively Use the sample data of all parties to improve the utilization of the sample data of all parties.
- a second embodiment of the neural network federation modeling method based on transfer learning of the present invention is proposed.
- the difference from the foregoing embodiment is that the neural network federation based on transfer learning
- the modeling method also includes:
- Step 105 when the configuration instruction of the initial weight is detected, count the number of synapses in the first neural network, and call a preset random number generator to generate a set of random numbers corresponding to the number of synapses;
- the initial weights of each synapse in the model to be trained need to be configured before training the model to be trained.
- the first terminal counts the synapses in the first neural network. Number of contacts, and call a preset random number generator to generate a set of random numbers corresponding to the number of synapses, while the second terminal counts the number of synapses in the second neural network, and calls the preset random number generator To generate another set of random numbers corresponding to the number of synapses.
- the value range of the random number can be set by a person skilled in the art based on the actual situation, which is not specifically limited in this embodiment.
- the value range of the random number is -0.5 to +0.5.
- Step 106 Configure an initial weight of each synapse in the first neural network according to the generated set of random numbers.
- the first terminal configures the initial weight of each synapse in the first neural network according to the generated set of random numbers, that is, from the generated set of random numbers, according to the generated sequence of random numbers
- a random number is sequentially selected as the initial weight and assigned to a synapse in the first neural network
- the second terminal configures the initial weight of each synapse in the second neural network according to another set of random numbers generated, that is, based on The order of the size of the generated another set of random numbers. From the generated another set of random numbers, a random number is sequentially selected as the initial weight and assigned to a synapse in the second neural network. Each synapse is configured once. Initial weight.
- the present invention uses a random number generator to assign random initial weights to each synapse of the first neural network and the second neural network in the model to be trained to prevent the initial weights of the synapses from being the same, resulting in training During the process, the weight of each synapse is always kept equal, which effectively improves the accuracy of the model obtained by training.
- an embodiment of the present invention further provides a storage medium that stores a neural network federation modeling program based on transfer learning.
- the storage medium is executed. The following steps:
- the first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;
- the second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;
- the model parameters to be converged are used to establish the model to be trained.
- the third terminal receives the encrypted third loss value sent by the first terminal, it obtains the encrypted historical loss value sent by the first terminal last time, and according to the pre-stored private key pair
- the encrypted third loss value, the historical loss value, and the third gradient value are decrypted, and the decrypted third loss value, the historical loss value, and the third gradient value are returned to the first terminal.
- the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
- the second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value.
- the third terminal ;
- the method further includes:
- a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;
- the first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data
- the vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined.
- the second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
- the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the first terminal
- the two terminals respectively store the public key in respective preset storage areas.
- the third terminal generates a set of public key and private key at a preset interval, and transmits the generated public key to the first terminal and the second terminal, and the first terminal and the The second terminal updates the public key stored in the respective preset storage area according to the received public key, respectively.
- the first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
- the specific embodiments of the storage medium of the present invention are basically the same as the above embodiments of the neural network federation modeling method based on transfer learning, and will not be repeated here.
- the methods in the above embodiments can be implemented by means of software plus a necessary universal hardware platform, and of course, also by hardware, but in many cases the former is better.
- Implementation Based on such an understanding, the technical solution of the present invention in essence or a part that contributes to the existing technology can be embodied in the form of a software product, which is stored in a storage medium such as ROM / RAM as described above , Magnetic disk, optical disc), including a number of instructions to enable a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the embodiments of the present invention.
- a terminal device which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Neurology (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Machine Translation (AREA)
Abstract
A neural network federation modeling method and device employing transfer learning, and a storage medium. The method comprises: a first terminal inputting a feature vector of first sample data to a first neural network so as to acquire a first neural network vector, determining a first gradient value and a first loss value according to the first neural network vector, and encrypting the first gradient value and the first loss value (S101); combining the encrypted first gradient value and the encrypted first loss value with a received encrypted second gradient value and encrypted second loss value sent by a second terminal so as to acquire an encrypted third loss value and encrypted third gradient value (S102); sending the encrypted third loss value and the encrypted third gradient value to a third terminal, and determining, according to the third loss value and a historical loss value decrypted and returned by the third terminal, whether a model to be trained converges (S103); and if the model converges, using a model parameter at the time of convergence to establish the model (S104).
Description
技术领域Technical field
本发明涉及机器学习的技术领域,尤其涉及一种基于迁移学习的神经网络联邦建模方法、设备及存储介质。The present invention relates to the technical field of machine learning, and in particular, to a neural network federation modeling method, device, and storage medium based on transfer learning.
背景技术Background technique
随着机器学习的快速发展,机器学习可应用于各个领域,如数据挖掘、计算机视觉、自然语言处理、生物特征识别、医学诊断、检测信用卡欺诈、证券市场分析和DNA序列测序等。机器学习包括学习部分和执行部分,学习部分利用样本数据修改系统的知识库,以增进系统执行部分完成任务的效能,执行部分根据知识库完成任务,同时把获得的信息反馈给学习部分。With the rapid development of machine learning, machine learning can be applied to various fields, such as data mining, computer vision, natural language processing, biometric recognition, medical diagnosis, detection of credit card fraud, securities market analysis, and DNA sequence sequencing. Machine learning includes a learning part and an execution part. The learning part uses sample data to modify the system's knowledge base to improve the efficiency of the system's execution part to complete the task. The execution part completes the task according to the knowledge base, and at the same time feeds the obtained information to the learning part.
目前,由于各方的样本数据具有密切联系,如果机器学习仅使用一方的样本数据,则学习得到的模型不准确,为解决上述问题,通过联合各方的样本数据,应用逻辑回归或决策树等单层简单模型进行机器学习。然而,由于需要联合各方的样本数据,存在一方的样本数据被另一方知晓的情况,此外,目前的联合学习主要依托于共同样本数据,而各方的共同样本数据是有限的,使得各方独有的样本数据无法被有效利用。At present, because the sample data of all parties are closely related, if machine learning uses only one party's sample data, the learned model is inaccurate. To solve the above problems, by combining the sample data of all parties, applying logistic regression or decision trees, etc. Single layer simple model for machine learning. However, due to the need to combine the sample data of the parties, there is a case where the sample data of one party is known by the other party. In addition, the current joint learning is mainly based on the common sample data, and the common sample data of the parties is limited, making the parties Unique sample data cannot be effectively used.
因此,如何提高各方样本数据的私密性和利用率是目前亟待解决的问题。Therefore, how to improve the privacy and utilization of the sample data of all parties is an urgent problem.
发明内容Summary of the invention
本发明的主要目的在于提供一种基于迁移学习的神经网络联邦建模方法、设备及存储介质,旨在提高各方样本数据的私密性和利用率。The main purpose of the present invention is to provide a neural network federation modeling method, equipment and storage medium based on transfer learning, which aims to improve the privacy and utilization of sample data of all parties.
为实现上述目的,本发明提供一种基于迁移学习的神经网络联邦建模方法,所述基于迁移学习的神经网络联邦建模方法包括以下步骤:To achieve the above object, the present invention provides a neural network federation modeling method based on transfer learning. The neural network federation modeling method based on transfer learning includes the following steps:
第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;
将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,其中,第二终端将第二样本数据输入至所述第二神经网络,得到第二神经网络向量,并依据所述第一神经网络向量确定第二梯度值和第二损失值,且将所述第二梯度值和所述第二损失值加密之后,传输至所述第一终端,所述第一神经网络向量与所述第二神经网络向量的特征维度相同;Combining the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value, The second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;
将加密的第三损失值和第三梯度值发送至第三终端,并依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Sending the encrypted third loss value and the third gradient value to a third terminal, and determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。If the model to be trained converges, the model parameters to be converged are used to establish the model to be trained.
进一步地,当所述第三终端接收到所述第一终端发送的加密的第三损失值时,获取所述第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给所述第一终端。Further, when the third terminal receives the encrypted third loss value sent by the first terminal, it obtains the encrypted historical loss value sent by the first terminal last time, and according to the pre-stored private key pair The encrypted third loss value, the historical loss value, and the third gradient value are decrypted, and the decrypted third loss value, the historical loss value, and the third gradient value are returned to the first terminal.
进一步地,依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤包括:Further, the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption includes:
接收所述第三终端解密返回的第三损失值和历史损失值;Receiving a third loss value and a historical loss value returned by the third terminal decryption;
计算解密返回的第三损失值和历史损失值之间的差值,并判断所述差值是否小于或等于预设阈值;Calculating a difference between the third loss value and the historical loss value returned by the decryption, and determining whether the difference is less than or equal to a preset threshold;
若所述差值小于或等于预设阈值,则确定待训练模型收敛,否则确定待训练模型不收敛。If the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
进一步地,所述将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值的步骤之后,还包括:Further, the encrypted first gradient value and the first loss value are combined with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain an encrypted third loss value and After the step of the third gradient value, the method further includes:
所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端;The second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value. The third terminal;
依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤之后,还包括:After the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption, the method further includes:
若待训练模型未收敛,则向所述第三终端发送梯度更新指令,由所述第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至所述第二终端;If the model to be trained does not converge, a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;
所述第一终端依据所述第三终端解密返回的第三梯度值更新所述第一神经网络的本地梯度,且在更新完成后,返回执行步骤:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data The vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined. encryption;
所述第二终端依据所述第三终端解密返回的第四梯度值更新所述第二神经网络的本地梯度,且在更新完成后,返回执行步骤:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
进一步地,所述第三终端产生一组公有密钥和私有密钥,并将所述公有密钥传输至所述第一终端和所述第二终端,由所述第一终端和所述第二终端分别将所述公有密钥存储各自的预设存储区域中。Further, the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the first terminal The two terminals respectively store the public key in respective preset storage areas.
进一步地,所述第三终端以间隔预设时间生成一组公有密钥和私有密钥,并将生成的公有密钥传输至所述第一终端和第二终端,由所述第一终端和第二终端分别依据接收到的公有密钥更新存储在各自预设存储区域中的公有密钥。Further, the third terminal generates a set of public key and private key at a preset interval, and transmits the generated public key to the first terminal and the second terminal, and the first terminal and the The second terminal updates the public key stored in the respective preset storage area according to the received public key, respectively.
进一步地,对所述第一梯度值和所述第一损失值加密的步骤包括:Further, the step of encrypting the first gradient value and the first loss value includes:
所述第一终端从预设存储区域中获取公有密钥,并依据所述公有密钥对所述第一梯度值和所述第一损失值进行同态加密。The first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
进一步地,所述基于迁移学习的神经网络联邦建模方法还包括:Further, the neural network federation modeling method based on transfer learning further includes:
当检测到初始权值的配置指令时,统计所述第一神经网络中的突触个数,并调用预设随机数生成器,生成与所述突触个数对应的一组随机数;When the configuration instruction of the initial weight is detected, counting the number of synapses in the first neural network, and calling a preset random number generator to generate a set of random numbers corresponding to the number of synapses;
依据生成的一组随机数,配置所述第一神经网络中各突触的初始权值。Configure the initial weights of each synapse in the first neural network according to the generated set of random numbers.
此外,为实现上述目的,本发明还提供一种基于迁移学习的神经网络联邦建模设备,所述基于迁移学习的神经网络联邦建模设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于迁移学习的神经网络联邦建模程序,所述基于迁移学习的神经网络联邦建模程序被所述处理器执行时实现如上所述的基于迁移学习的神经网络联邦建模方法的步骤。In addition, in order to achieve the above object, the present invention also provides a neural network federation modeling device based on transfer learning. The neural network federation modeling device based on transfer learning includes: a memory, a processor, and a memory stored on the memory and A neural network federation modeling program based on transfer learning that can be run on the processor, and the neural network federation modeling program based on transfer learning implements the neural network based on transfer learning as described above when executed by the processor Steps in federated modeling method.
本发明还提供一种存储介质,所述存储介质上存储有基于迁移学习的神经网络联邦建模程序,所述基于迁移学习的神经网络联邦建模程序被处理器执行时实现如上所述的基于迁移学习的神经网络联邦建模方法的步骤。The present invention also provides a storage medium storing a neural network federation modeling program based on transfer learning, and implementing the neural network federation modeling program based on transfer learning to implement The steps of a neural network federation modeling method for transfer learning.
本发明提供一种基于迁移学习的神经网络联邦建模方法、设备及存储介质,本发明将两方样本数据的特征向量分别输入两个神经网络,两方对应得到两个特征维度相同的神经网络向量,并依据各自的特征维度相同的神经网络向量得到各自的梯度值和损失值,且其中一方将梯度值和损失值进行加密,然后结合接收到的另一方发送的加密的梯度值和损失值,得到加密的总损失值和总梯度值,并将加密的总损失值传输给第三方,最后依据第三方返回的解密后的总损失值和历史损失值,确定待训练模型是否收敛,如果待训练模型收敛,则以收敛时的模型参数,建立待训练模型,由于对双方需要传输的数据进行加密,且可在加密的形式下进行联合训练,有效的提高各方样本数据的私密性,同时,联合各方的多层神经网络进行机器学习,可有效的利用各方的样本数据,提高各方样本数据的利用率。The present invention provides a neural network federation modeling method, device, and storage medium based on transfer learning. The present invention inputs feature vectors of sample data of two parties into two neural networks, and two parties correspondingly obtain two neural networks with the same feature dimension. Vector, and get the respective gradient and loss values according to the neural network vectors with the same feature dimensions, and one of them encrypts the gradient and loss values, and then combines the encrypted gradient and loss values sent by the other party To obtain the encrypted total loss value and total gradient value, and transmit the encrypted total loss value to a third party, and finally determine whether the model to be trained converges based on the decrypted total loss value and historical loss value returned by the third party. When the training model converges, the model parameters to be trained are used to establish the model to be trained. Because the data to be transmitted by both parties is encrypted, and joint training can be performed in an encrypted form, the privacy of the sample data of all parties is effectively improved. , Multi-layer neural network of joint parties for machine learning can effectively use the sample of all parties Data, improve the utilization of the parties to the sample data.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明实施例方案涉及的硬件运行环境的设备结构示意图;FIG. 1 is a schematic diagram of a device structure of a hardware operating environment according to an embodiment of the present invention;
图2为本发明基于迁移学习的神经网络联邦建模方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a neural network federation modeling method based on transfer learning according to the present invention;
图3为本发明基于迁移学习的神经网络联邦建模方法第二实施例的流程示意图。3 is a schematic flowchart of a second embodiment of a neural network federation modeling method based on transfer learning according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional characteristics and advantages of the present invention will be further explained with reference to the embodiments and the drawings.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
如图1所示,图1是本发明实施例方案涉及的硬件运行环境的设备结构示意图。As shown in FIG. 1, FIG. 1 is a schematic diagram of a device structure of a hardware operating environment according to an embodiment of the present invention.
本发明实施例基于迁移学习的神经网络联邦建模设备可以是PC,也可以是智能手机、平板电脑、便携计算机等具有显示功能的可移动式终端设备。The neural network federation modeling device based on the transfer learning in the embodiment of the present invention may be a PC, or a mobile terminal device with a display function such as a smart phone, a tablet computer, a portable computer, or the like.
如图1所示,该基于迁移学习的神经网络联邦建模设备可以包括:处理器1001,例如CPU,通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选的用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile
memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1, the neural network federation modeling device based on transfer learning may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen, an input unit such as a keyboard, and the optional user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory.
memory), such as disk storage. The memory 1005 may optionally be a storage device independent of the foregoing processor 1001.
本领域技术人员可以理解,图1中示出的基于迁移学习的神经网络联邦建模设备结构并不构成对基于迁移学习的神经网络联邦建模设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the neural network federation modeling device based on transfer learning shown in FIG. 1 does not constitute a limitation on the neural network federation modeling device based on transfer learning, and may include more or more than illustrated Fewer components, or some components combined, or different component arrangements.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及基于迁移学习的神经网络联邦建模程序。As shown in FIG. 1, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a neural network federation modeling program based on transfer learning.
在图1所示的基于迁移学习的神经网络联邦建模设备中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的基于迁移学习的神经网络联邦建模程序,并执行以下步骤:In the neural network federation modeling device based on transfer learning shown in FIG. 1, the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client (user), and The client performs data communication; and the processor 1001 can be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and execute the following steps:
第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;
将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,其中,第二终端将第二样本数据输入至所述第二神经网络,得到第二神经网络向量,并依据所述第一神经网络向量确定第二梯度值和第二损失值,且将所述第二梯度值和所述第二损失值加密之后,传输至所述第一终端,所述第一神经网络向量与所述第二神经网络向量的特征维度相同;Combining the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value, The second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;
将加密的第三损失值和第三梯度值发送至第三终端,并依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Sending the encrypted third loss value and the third gradient value to a third terminal, and determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。If the model to be trained converges, the model parameters to be converged are used to establish the model to be trained.
进一步地,当所述第三终端接收到所述第一终端发送的加密的第三损失值时,获取所述第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给所述第一终端。Further, when the third terminal receives the encrypted third loss value sent by the first terminal, it obtains the encrypted historical loss value sent by the first terminal last time, and according to the pre-stored private key pair The encrypted third loss value, the historical loss value, and the third gradient value are decrypted, and the decrypted third loss value, the historical loss value, and the third gradient value are returned to the first terminal.
进一步地,处理器1001可以用于调用存储器1005中存储的基于迁移学习的神经网络联邦建模程序,还执行以下步骤:Further, the processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
接收所述第三终端解密返回的第三损失值和历史损失值;Receiving a third loss value and a historical loss value returned by the third terminal decryption;
计算解密返回的第三损失值和历史损失值之间的差值,并判断所述差值是否小于或等于预设阈值;Calculating a difference between the third loss value and the historical loss value returned by the decryption, and determining whether the difference is less than or equal to a preset threshold;
若所述差值小于或等于预设阈值,则确定待训练模型处于收敛状态,否则确定待训练模型不处于收敛状态。If the difference is less than or equal to a preset threshold, it is determined that the model to be trained is in a convergence state, otherwise it is determined that the model to be trained is not in a convergence state.
进一步地,处理器1001可以用于调用存储器1005中存储的基于迁移学习的神经网络联邦建模程序,还执行以下步骤:Further, the processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端;The second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value. The third terminal;
依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤之后,还包括:After the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption, the method further includes:
若待训练模型未收敛,则向所述第三终端发送梯度更新指令,由所述第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至所述第二终端;If the model to be trained does not converge, a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;
所述第一终端依据所述第三终端解密返回的第三梯度值更新所述第一神经网络的本地梯度,且在更新完成后,返回执行步骤:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data The vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined. encryption;
所述第二终端依据所述第三终端解密返回的第四梯度值更新所述第二神经网络的本地梯度,且在更新完成后,返回执行步骤:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
进一步地,所述第三终端产生一组公有密钥和私有密钥,并将所述公有密钥传输至所述第一终端和所述第二终端,由所述第一终端和所述第二终端分别将所述公有密钥存储各自的预设存储区域中。Further, the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the first terminal The two terminals respectively store the public key in respective preset storage areas.
进一步地,所述第三终端以间隔预设时间生成一组公有密钥和私有密钥,并将生成的公有密钥传输至所述第一终端和第二终端,由所述第一终端和第二终端分别依据接收到的公有密钥更新存储在各自预设存储区域中的公有密钥。Further, the third terminal generates a set of public key and private key at a preset interval, and transmits the generated public key to the first terminal and the second terminal, and the first terminal and the The second terminal updates the public key stored in the respective preset storage area according to the received public key, respectively.
进一步地,处理器1001可以用于调用存储器1005中存储的基于迁移学习的神经网络联邦建模程序,还执行以下步骤:Further, the processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
所述第一终端从预设存储区域中获取公有密钥,并依据所述公有密钥对所述第一梯度值和所述第一损失值进行同态加密。The first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
进一步地,处理器1001可以用于调用存储器1005中存储的基于迁移学习的神经网络联邦建模程序,还执行以下步骤:Further, the processor 1001 may be used to call a neural network federation modeling program based on transfer learning stored in the memory 1005, and further perform the following steps:
当检测到初始权值的配置指令时,统计所述第一神经网络中的突触个数,并调用预设随机数生成器,生成与所述突触个数对应的一组随机数;When the configuration instruction of the initial weight is detected, counting the number of synapses in the first neural network, and calling a preset random number generator to generate a set of random numbers corresponding to the number of synapses;
依据生成的一组随机数,配置所述第一神经网络中各突触的初始权值。Configure the initial weights of each synapse in the first neural network according to the generated set of random numbers.
本发明基于迁移学习的神经网络联邦建模设备的具体实施例与下述基于迁移学习的神经网络联邦建模方法的各具体实施例基本相同,在此不作赘述。The specific embodiments of the neural network federation modeling device based on transfer learning of the present invention are basically the same as the specific embodiments of the neural network federation modeling method based on transfer learning described below, and will not be repeated here.
参照图2,图2为本发明基于迁移学习的神经网络联邦建模方法第一实施例的流程示意图。Referring to FIG. 2, FIG. 2 is a schematic flowchart of a first embodiment of a neural network federation modeling method based on transfer learning according to the present invention.
步骤S101,第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据第一神经网络向量确定第一梯度值和第一损失值,且对第一梯度值和第一损失值加密;In step S101, a first terminal inputs a feature vector of first sample data to a first neural network, obtains a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector. A gradient value and a first loss value are encrypted;
本实施例中,本发明可联合多方样本数据进行待训练模型的训练,以下以联合两方样本数据为例进行解释说明,其中,一方样本数据为第一样本数据,存储于第一终端中,且第一神经网络部署于第一终端,另一方样本数据为第二样本数据,存储于第二终端中,且第二神经网络部署于第二终端,第一终端与第二终端连接,可传输数据,此外,为保证双方样本数据的私密性,引入第三终端,第三终端中存储有加密所需要的一组公有密钥和私有密钥,且第一终端与第三终端连接,可传输数据,第二终端与第三终端连接,可传输数据。双方样本数据的标注情况包括标注第一样本数据,而不标注第二样本数据、不标注第一样本数据,而标注第二样本数据、第一样本数据和第二样本数据均标注或者第一样本数据和第二样本数据均不标注。需要说明的是,本实施例中对双方样本数据的标注情况不做具体限定。需要说明的是,第一神经网络和第二神经网络的网络参数可由本领域技术人员基于实际情况基于实际情况进行设置,本实施例对此不作具体限定。其中,网络参数包括但不限于各层网络节点个数、隐含层数、各突触的初始权值、学习率、动态参数、允许误差、迭代次数和激活函数。In this embodiment, the present invention can combine multi-party sample data to train the model to be trained. The following uses the joint two-party sample data as an example to explain, where one sample data is the first sample data and is stored in the first terminal. And the first neural network is deployed at the first terminal, and the other party ’s sample data is the second sample data, which is stored in the second terminal, and the second neural network is deployed at the second terminal, and the first terminal is connected to the second terminal, In addition, in order to ensure the privacy of the sample data of both parties, a third terminal is introduced. The third terminal stores a set of public and private keys required for encryption, and the first terminal is connected to the third terminal. When transmitting data, the second terminal is connected to the third terminal and can transmit data. The labeling of the sample data of both parties includes labeling the first sample data without labeling the second sample data, not labeling the first sample data, and labeling the second sample data, the first sample data, and the second sample data are labeled or Neither the first sample data nor the second sample data are labeled. It should be noted that, in this embodiment, the labeling of the sample data of both parties is not specifically limited. It should be noted that the network parameters of the first neural network and the second neural network can be set by those skilled in the art based on the actual situation and the actual situation, which is not specifically limited in this embodiment. The network parameters include, but are not limited to, the number of network nodes in each layer, the number of hidden layers, the initial weight of each synapse, the learning rate, dynamic parameters, allowable errors, the number of iterations, and the activation function.
本实施例中,在对待训练模型进行训练的过程中,第一终端将第一样本数据输入至第一神经网络,到达第一神经网络的最后一层时,得到第一样本数据的特征表达,即第一神经网络向量,并依据该第一神经网络向量确定第一梯度值和第一损失值,即第一梯度值为待训练模型的梯度函数对于第一共同特征向量的梯度,第一损失值为待训练模型的损失函数对于第一共同特征向量的损失,并对第一梯度值和第一损失值进行加密。In this embodiment, in the process of training the model to be trained, the first terminal inputs the first sample data to the first neural network, and when the last layer of the first neural network is reached, the characteristics of the first sample data are obtained. Expression, that is, the first neural network vector, and the first gradient value and the first loss value are determined according to the first neural network vector, that is, the first gradient value is the gradient function of the model to be trained. For the gradient of the first common feature vector, the first A loss value is a loss of the loss function of the model to be trained for the first common feature vector, and the first gradient value and the first loss value are encrypted.
具体地,第三终端产生一组公有密钥和私有密钥,并将公有密钥传输至第一终端和第二终端,由第一终端和第二终端分别将公有密钥存储各自的预设存储区域中,第一终端在得到第一梯度值和第一损失值之后,从预设存储区域中获取公有密钥,对依据该公有密钥对第一梯度值和第一损失值进行同态加密,并将加密后的第一梯度值和第一损失值发送至第二终端。其中,加密的方式为同态加密(对经过同态加密的数据进行处理得到一个输出,将这一输出进行解密,其结果与用同一方法处理未加密的原始数据得到的输出结果是一样的),可以在密文的形式下计算,不影响计算得到的结果。Specifically, the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the second terminal store the public key respectively in respective presets. In the storage area, after obtaining the first gradient value and the first loss value, the first terminal obtains a public key from a preset storage area, and homomorphizes the first gradient value and the first loss value according to the public key. Encrypt, and send the encrypted first gradient value and first loss value to the second terminal. Among them, the encryption method is homomorphic encryption (processing the homomorphically encrypted data to obtain an output, and decrypting this output, the result is the same as the output obtained by processing the unencrypted original data in the same method) , Can be calculated in the form of cipher text, does not affect the results obtained by the calculation.
步骤S102,将加密的第一梯度值和第一损失值,与接收到的第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值;Step S102: Combine the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value. ;
本实施例中,第二终端将第二样本数据输入至第二神经网络进行迭代,到达第二神经网络的最后一层时,得到第二样本数据的特征表达,即第二神经网络向量,并依据第一神经网络向量确定第二梯度值和第二损失值,即第二梯度值为待训练模型的梯度函数对于第二共同特征向量的梯度,第二损失值为待训练模型的损失函数对于第二共同特征向量的损失,且将第二梯度值和第二损失值加密之后发送至第一终端,即获取预存存储区域中的公有密钥,对第二梯度值和第二损失值进行同态加密,并将加密后的第二梯度值和第二损失值发送至第一终端。其中,第一神经网络向量与第二神经网络向量的特征维度相同。In this embodiment, the second terminal inputs the second sample data to the second neural network for iteration, and when it reaches the last layer of the second neural network, it obtains the characteristic expression of the second sample data, that is, the second neural network vector, and Determine the second gradient value and the second loss value according to the first neural network vector, that is, the second gradient value is the gradient function of the model to be trained for the gradient of the second common feature vector, and the second loss value is the loss function of the model to be trained for The second common feature vector is lost, and the second gradient value and the second loss value are encrypted and sent to the first terminal, that is, the public key in the pre-stored storage area is obtained, and the second gradient value and the second loss value are the same. State encryption, and send the encrypted second gradient value and the second loss value to the first terminal. Wherein, the feature dimensions of the first neural network vector and the second neural network vector are the same.
第一终端将加密的第一梯度值和第一损失值,与接收到的第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,即第一终端接收第二终端发送的加密的第二梯度值和第二损失值,并结合加密的第一梯度值和第二梯度值,得到加密的第三梯度值,以及结合加密的第一损失值和第二损失值,得到加密的第三损失值。The first terminal combines the encrypted first gradient value and the first loss value with the encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value. That is, the first terminal receives the encrypted second gradient value and the second loss value sent by the second terminal, and combines the encrypted first gradient value and the second gradient value to obtain an encrypted third gradient value, and combines the encrypted first A loss value and a second loss value to obtain an encrypted third loss value.
进一步地,为进一步地的提高双方数据的安全性,在训练模型的过程中,第一终端和第二终端以间隔预设时间从第三终端中获取一公有密钥,以更新本地存储在预设存储区域中的公有密钥,具体为在第三终端中设置一定时器,在开始训练模型时,定时器开始计时,当定时器的计时达到预设时间时,第三终端生成一组公有密钥和私有密钥,并将公有密钥下发给第一终端和第二终端,且定时器重新开始计时,由第一终端和第二终端更新存储在预设存储区域中的公有密钥。需要说明的是,上述预设时间可由本领域技术人员基于实际情况进行设置,本实施例对此不作具体限定。Further, in order to further improve the security of the data of both parties, during the training of the model, the first terminal and the second terminal obtain a public key from the third terminal at a preset interval to update the local storage in the pre- The public key in the storage area is set. Specifically, a timer is set in the third terminal. When the model is trained, the timer starts timing. When the timer reaches a preset time, the third terminal generates a group of public keys. Key and private key, and sends the public key to the first terminal and the second terminal, and the timer restarts, and the first terminal and the second terminal update the public key stored in the preset storage area . It should be noted that the preset time can be set by a person skilled in the art based on the actual situation, which is not specifically limited in this embodiment.
步骤S103,将加密的第三损失值和第三梯度值发送至第三终端,并依据第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Step S103: Send the encrypted third loss value and the third gradient value to the third terminal, and determine whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
本实施例中,第一终端将加密的第三损失值和第三梯度值发送至第三终端,由第三终端接收第一终端发送的加密的第三损失值和第三梯度值,并获取第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给第一终端,第一终端依据第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;In this embodiment, the first terminal sends the encrypted third loss value and the third gradient value to the third terminal, and the third terminal receives the encrypted third loss value and the third gradient value sent by the first terminal, and obtains The first encrypted historical loss value sent by the first terminal, and the encrypted third loss value, historical loss value, and third gradient value are decrypted according to the pre-stored private key, and the decrypted third loss value and history are decrypted. The loss value and the third gradient value are returned to the first terminal, and the first terminal determines whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
具体地,第一终端接收第三终端解密返回的第三损失值和历史损失值,然后计算解密返回的第三损失值和历史损失值之间的差值,并判断该差值是否小于或等于预设阈值,如果该差值小于等于预设阈值,则确定待训练模型收敛,否则确定待训练模型不收敛。需要说明的是,上述预设阈值可由本领域技术人员基于实际情况进行设置,本实施例对此不作具体限定。Specifically, the first terminal receives the third loss value and the historical loss value returned by the third terminal, and then calculates a difference between the third loss value and the historical loss value returned by the decryption, and determines whether the difference is less than or equal to A preset threshold. If the difference is less than or equal to the preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge. It should be noted that the preset threshold may be set by a person skilled in the art based on actual conditions, and this embodiment does not specifically limit this.
步骤S104、若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。Step S104: If the model to be trained converges, establish the model to be trained based on the model parameters during convergence.
本实施例中,如果待训练模型收敛,则以收敛时的模型参数,建立待训练模型。具体实施中,确定待训练模型是否收敛的操作也可以由第三终端执行,具体为第三终端接收第一终端发送的加密的第三损失值,并获取第一终端前一次发送的加密的历史损失值,然后依据预存的私有密钥对加密的第三损失值和历史损失值进行解密,并依据解密后的第三损失值和历史损失值确定待训练模型是否收敛,将模型收敛的判断操作部署于第三终端,可以减少第二终端或第三终端的资源占用,同时提高第三终端的资源利用率。In this embodiment, if the model to be trained converges, the model parameter to be trained is used to establish the model to be trained. In specific implementation, the operation of determining whether the model to be converged can also be performed by the third terminal. Specifically, the third terminal receives the encrypted third loss value sent by the first terminal, and obtains the encryption history sent by the first terminal last time. Loss value, and then decrypt the encrypted third loss value and historical loss value according to the pre-stored private key, and determine whether the model to be trained converges based on the decrypted third loss value and historical loss value, and determine the model convergence Deploying on the third terminal can reduce the resource occupation of the second terminal or the third terminal, and improve the resource utilization of the third terminal.
进一步地,步骤S102之后,还包括:Further, after step S102, the method further includes:
步骤a,第二终端将加密的第二梯度值,与接收到的第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的第三终端;In step a, the second terminal combines the encrypted second gradient value with the encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value to the first Three terminals
本实施例中,在第一终端执行梯度值和损失值的确定操作时,第二终端将加密的第二梯度值,与接收到的第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的第三终端,即第二终端接收第一终端发送的加密的第一梯度值,并结合加密的第二梯度值,得到加密的第四梯度值。In this embodiment, when the first terminal performs the determination of the gradient value and the loss value, the second terminal combines the encrypted second gradient value with the encrypted first gradient value sent by the first terminal to obtain encryption. The third terminal that sends the encrypted fourth gradient value, that is, the second terminal receives the encrypted first gradient value sent by the first terminal, and combines the encrypted second gradient value to obtain the encrypted first gradient value. Four gradient values.
步骤S103之后,还包括:After step S103, the method further includes:
步骤b,若待训练模型未收敛,则向第三终端发送梯度更新指令,由第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至第二终端;Step b, if the model to be trained does not converge, send a gradient update instruction to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted third The gradient value is returned to the first terminal, and the decrypted fourth gradient value is returned to the second terminal;
如果待训练模型未处于收敛,则需要更新第一神经网络和第二神经网络的本地梯度,即第一终端向第三终端发送梯度更新指令,由第三终端依据该梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至第一终端,且将解密后的第四梯度值返回至第二终端。If the model to be trained is not in convergence, the local gradients of the first neural network and the second neural network need to be updated, that is, the first terminal sends a gradient update instruction to the third terminal, and the third terminal sends the encrypted first The three gradient values and the fourth gradient value are decrypted, and the decrypted third gradient value is returned to the first terminal, and the decrypted fourth gradient value is returned to the second terminal.
第一终端依据第三终端解密返回的第三梯度值更新第一神经网络的本地梯度,且在更新完成后,返回执行步骤S101,即第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密。The first terminal updates the local gradient of the first neural network according to the third gradient value decrypted by the third terminal, and after the update is completed, returns to step S101, that is, the first terminal inputs the feature vector of the first sample data to the first A neural network obtains a first neural network vector, determines a first gradient value and a first loss value according to the first neural network vector, and encrypts the first gradient value and the first loss value.
第二终端依据第三终端解密返回的第四梯度值更新第二神经网络的本地梯度,且在更新完成后,返回执行步骤a,即第二终端将加密的第二梯度值,与接收到的第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to execute step a, that is, the second terminal encrypts the second gradient value and the received second gradient value. The encrypted first gradient value sent by the first terminal is combined to obtain an encrypted fourth gradient value, and the encrypted fourth gradient value is sent to a third terminal.
具体实施中,如果第一神经网络和第二神经网络中标记的神经网络层以后的神经网络层结构完全相同,则第一终端将第一神经网络的权重参数值WA经加密之后传输给第二终端,而第二终端将第二神经网络的权重参数值WB传输给第一终端,由第一终端依据加密的权重参数值WA和WB对第一神经网络进行训练,直至收敛,由第二终端依据加密的权重参数值WA和WB对第二神经网络进行训练,直至收敛,在第一神经网络和第二神经网络均收敛时,依据收敛状态下的权重参数值WA和WB建立待训练模型。In specific implementation, if the structure of the neural network layer after the labeled neural network layer in the first neural network and the second neural network is completely the same, the first terminal transmits the weight parameter value WA of the first neural network to the second after being encrypted. Terminal, and the second terminal transmits the weight parameter value WB of the second neural network to the first terminal, and the first terminal trains the first neural network according to the encrypted weight parameter values WA and WB, until convergence, and the second terminal The second neural network is trained according to the encrypted weight parameter values WA and WB until convergence, and when both the first neural network and the second neural network converge, a model to be trained is established according to the weight parameter values WA and WB in the convergence state.
本实施例中,本发明将两方样本数据的特征向量分别输入两个神经网络,两方对应得到两个特征维度相同的神经网络向量,并依据各自的特征维度相同的神经网络向量得到各自的梯度值和损失值,且其中一方将梯度值和损失值进行加密,然后结合接收到的另一方发送的加密的梯度值和损失值,得到加密的总损失值和总梯度值,并将加密的总损失值传输给第三方,最后依据第三方返回的解密后的总损失值和历史损失值,确定待训练模型是否收敛,如果待训练模型收敛,则以收敛时的模型参数,建立待训练模型,由于对双方需要传输的数据进行加密,且可在加密的形式下进行联合训练,有效的提高各方样本数据的私密性,同时,联合各方的多层神经网络进行机器学习,可有效的利用各方的样本数据,提高各方样本数据的利用率。In this embodiment, the present invention inputs the feature vectors of the sample data of the two parties into two neural networks respectively, and the two parties correspondingly obtain two neural network vectors with the same feature dimension, and obtain the respective neural network vectors according to the respective neural network vectors with the same feature dimension. Gradient value and loss value, and one of them encrypts the gradient value and loss value, and then combines the encrypted gradient value and loss value sent by the other party to obtain the encrypted total loss value and total gradient value, and encrypts the encrypted value. The total loss value is transmitted to a third party. Finally, based on the decrypted total loss value and the historical loss value returned by the third party, it is determined whether the model to be trained converges. If the model to be trained converges, the model parameters at the time of convergence are used to establish the model to be trained. Because the data that the two parties need to transmit is encrypted, and joint training can be performed in an encrypted form, the privacy of the sample data of all parties is effectively improved, and at the same time, the multi-layer neural network of the parties is used for machine learning, which can effectively Use the sample data of all parties to improve the utilization of the sample data of all parties.
进一步地,参照图3,基于上述第一,实施例,提出了本发明基于迁移学习的神经网络联邦建模方法的第二实施例,与前述实施例的区别在于,基于迁移学习的神经网络联邦建模方法还包括:Further, referring to FIG. 3, based on the first embodiment described above, a second embodiment of the neural network federation modeling method based on transfer learning of the present invention is proposed. The difference from the foregoing embodiment is that the neural network federation based on transfer learning The modeling method also includes:
步骤105,当检测到初始权值的配置指令时,统计第一神经网络中的突触个数,并调用预设随机数生成器,生成与突触个数对应的一组随机数;Step 105: when the configuration instruction of the initial weight is detected, count the number of synapses in the first neural network, and call a preset random number generator to generate a set of random numbers corresponding to the number of synapses;
本实施例中,在对待训练模型进行训练之前,需要配置待训练模型中各突触的初始权值,则当检测到初始权值的配置指令时,第一终端统计第一神经网络中的突触个数,并调用预设随机数生成器,生成与突触个数对应的一组随机数,同时第二终端统计第二神经网络中的突触个数,并调用预设随机数生成器,生成与突触个数对应的另一组随机数。需要说明的是,上述随机数的取值范围可由本领域技术人员基于实际情况进行设置,本实施例对此不作具体限定,优选地,随机数的取值范围为-0.5~+0.5。In this embodiment, before training the model to be trained, the initial weights of each synapse in the model to be trained need to be configured. When a configuration instruction of the initial weight is detected, the first terminal counts the synapses in the first neural network. Number of contacts, and call a preset random number generator to generate a set of random numbers corresponding to the number of synapses, while the second terminal counts the number of synapses in the second neural network, and calls the preset random number generator To generate another set of random numbers corresponding to the number of synapses. It should be noted that the value range of the random number can be set by a person skilled in the art based on the actual situation, which is not specifically limited in this embodiment. Preferably, the value range of the random number is -0.5 to +0.5.
步骤106,依据生成的一组随机数,配置第一神经网络中各突触的初始权值。Step 106: Configure an initial weight of each synapse in the first neural network according to the generated set of random numbers.
本实施例中,第一终端依据生成的一组随机数,配置第一神经网络中各突触的初始权值,即依据生成的一组随机数的大小顺序,从生成的一组随机数中依次选择一随机数作为初始权值,配置给第一神经网络中的一突触;第二终端依据生成的另一组随机数,配置第二神经网络中各突触的初始权值,即依据生成的另一组随机数的大小顺序,从生成的另一组随机数中依次选择一随机数作为初始权值,配置给第二神经网络中的一突触,其中,每个突触配置一次初始权值。In this embodiment, the first terminal configures the initial weight of each synapse in the first neural network according to the generated set of random numbers, that is, from the generated set of random numbers, according to the generated sequence of random numbers A random number is sequentially selected as the initial weight and assigned to a synapse in the first neural network; the second terminal configures the initial weight of each synapse in the second neural network according to another set of random numbers generated, that is, based on The order of the size of the generated another set of random numbers. From the generated another set of random numbers, a random number is sequentially selected as the initial weight and assigned to a synapse in the second neural network. Each synapse is configured once. Initial weight.
本实施例中,本发明利用随机数生成器,给待训练模型中第一神经网络和第二神经网络的各突触配置随机的初始权值,防止各突触的初始权值相同,导致训练过程中各突触的权值始终保持相等,有效的提高训练得到模型的准确性。In this embodiment, the present invention uses a random number generator to assign random initial weights to each synapse of the first neural network and the second neural network in the model to be trained to prevent the initial weights of the synapses from being the same, resulting in training During the process, the weight of each synapse is always kept equal, which effectively improves the accuracy of the model obtained by training.
此外,本发明实施例还提出一种存储介质,所述存储介质上存储有基于迁移学习的神经网络联邦建模程序,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,执行以下步骤:In addition, an embodiment of the present invention further provides a storage medium that stores a neural network federation modeling program based on transfer learning. When the neural network federation modeling program based on transfer learning is executed by a processor, the storage medium is executed. The following steps:
第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;
将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,其中,第二终端将第二样本数据输入至所述第二神经网络,得到第二神经网络向量,并依据所述第一神经网络向量确定第二梯度值和第二损失值,且将所述第二梯度值和所述第二损失值加密之后,传输至所述第一终端,所述第一神经网络向量与所述第二神经网络向量的特征维度相同;Combining the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value, The second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;
将加密的第三损失值和第三梯度值发送至第三终端,并依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Sending the encrypted third loss value and the third gradient value to a third terminal, and determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;
若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。If the model to be trained converges, the model parameters to be converged are used to establish the model to be trained.
进一步地,当所述第三终端接收到所述第一终端发送的加密的第三损失值时,获取所述第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给所述第一终端。Further, when the third terminal receives the encrypted third loss value sent by the first terminal, it obtains the encrypted historical loss value sent by the first terminal last time, and according to the pre-stored private key pair The encrypted third loss value, the historical loss value, and the third gradient value are decrypted, and the decrypted third loss value, the historical loss value, and the third gradient value are returned to the first terminal.
进一步地,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,还执行以下步骤:Further, when the neural network federation modeling program based on transfer learning is executed by a processor, the following steps are also performed:
接收所述第三终端解密返回的第三损失值和历史损失值;Receiving a third loss value and a historical loss value returned by the third terminal decryption;
计算解密返回的第三损失值和历史损失值之间的差值,并判断所述差值是否小于或等于预设阈值;Calculating a difference between the third loss value and the historical loss value returned by the decryption, and determining whether the difference is less than or equal to a preset threshold;
若所述差值小于或等于预设阈值,则确定待训练模型收敛,否则确定待训练模型不收敛。If the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
进一步地,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,还执行以下步骤:Further, when the neural network federation modeling program based on transfer learning is executed by a processor, the following steps are also performed:
所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端;The second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value. The third terminal;
依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤之后,还包括:After the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption, the method further includes:
若待训练模型未收敛,则向所述第三终端发送梯度更新指令,由所述第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至所述第二终端;If the model to be trained does not converge, a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;
所述第一终端依据所述第三终端解密返回的第三梯度值更新所述第一神经网络的本地梯度,且在更新完成后,返回执行步骤:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data The vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined. encryption;
所述第二终端依据所述第三终端解密返回的第四梯度值更新所述第二神经网络的本地梯度,且在更新完成后,返回执行步骤:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
进一步地,所述第三终端产生一组公有密钥和私有密钥,并将所述公有密钥传输至所述第一终端和所述第二终端,由所述第一终端和所述第二终端分别将所述公有密钥存储各自的预设存储区域中。Further, the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal, and the first terminal and the first terminal The two terminals respectively store the public key in respective preset storage areas.
进一步地,所述第三终端以间隔预设时间生成一组公有密钥和私有密钥,并将生成的公有密钥传输至所述第一终端和第二终端,由所述第一终端和第二终端分别依据接收到的公有密钥更新存储在各自预设存储区域中的公有密钥。Further, the third terminal generates a set of public key and private key at a preset interval, and transmits the generated public key to the first terminal and the second terminal, and the first terminal and the The second terminal updates the public key stored in the respective preset storage area according to the received public key, respectively.
进一步地,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,还执行以下步骤:Further, when the neural network federation modeling program based on transfer learning is executed by a processor, the following steps are also performed:
所述第一终端从预设存储区域中获取公有密钥,并依据所述公有密钥对所述第一梯度值和所述第一损失值进行同态加密。The first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
进一步地,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,还执行以下步骤:Further, when the neural network federation modeling program based on transfer learning is executed by a processor, the following steps are also performed:
当检测到初始权值的配置指令时,统计所述第一神经网络中的突触个数,并调用预设随机数生成器,生成与所述突触个数对应的一组随机数;When the configuration instruction of the initial weight is detected, counting the number of synapses in the first neural network, and calling a preset random number generator to generate a set of random numbers corresponding to the number of synapses;
依据生成的一组随机数,配置所述第一神经网络中各突触的初始权值。Configure the initial weights of each synapse in the first neural network according to the generated set of random numbers.
本发明存储介质的具体实施例与上述基于迁移学习的神经网络联邦建模方法各实施例基本相同,在此不作赘述。The specific embodiments of the storage medium of the present invention are basically the same as the above embodiments of the neural network federation modeling method based on transfer learning, and will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, in this article, the terms "including", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, It also includes other elements not explicitly listed, or elements inherent to such a process, method, article, or system. Without more restrictions, an element limited by the sentence "including a ..." does not exclude the existence of other identical elements in the process, method, article, or system that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The sequence numbers of the foregoing embodiments of the present invention are only for description, and do not represent the superiority or inferiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus a necessary universal hardware platform, and of course, also by hardware, but in many cases the former is better. Implementation. Based on such an understanding, the technical solution of the present invention in essence or a part that contributes to the existing technology can be embodied in the form of a software product, which is stored in a storage medium such as ROM / RAM as described above , Magnetic disk, optical disc), including a number of instructions to enable a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the description and drawings of the present invention, or directly or indirectly used in other related technical fields All are included in the patent protection scope of the present invention.
Claims (20)
- 一种基于迁移学习的神经网络联邦建模方法,其特征在于,所述基于迁移学习的神经网络联邦建模方法包括以下步骤: A neural network federation modeling method based on transfer learning, characterized in that the neural network federation modeling method based on transfer learning includes the following steps:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,其中,第二终端将第二样本数据输入至所述第二神经网络,得到第二神经网络向量,并依据所述第一神经网络向量确定第二梯度值和第二损失值,且将所述第二梯度值和所述第二损失值加密之后,传输至所述第一终端,所述第一神经网络向量与所述第二神经网络向量的特征维度相同;Combining the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value, The second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;将加密的第三损失值和第三梯度值发送至第三终端,并依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Sending the encrypted third loss value and the third gradient value to a third terminal, and determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。If the model to be trained converges, the model parameters to be converged are used to establish the model to be trained.
- 如权利要求1所述的基于迁移学习的神经网络联邦建模方法,其特征在于,当所述第三终端接收到所述第一终端发送的加密的第三损失值时,获取所述第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给所述第一终端。The neural network federation modeling method based on transfer learning according to claim 1, wherein, when the third terminal receives the encrypted third loss value sent by the first terminal, the first terminal acquires the first The encrypted historical loss value sent by the terminal last time, and the encrypted third loss value, historical loss value, and third gradient value are decrypted according to the pre-stored private key, and the decrypted third loss value and historical loss value are decrypted. And a third gradient value is returned to the first terminal.
- 如权利要求2所述的基于迁移学习的神经网络联邦建模方法,其特征在于,依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤包括:The neural network federation modeling method based on transfer learning according to claim 2, wherein the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption comprises:接收所述第三终端解密返回的第三损失值和历史损失值;Receiving a third loss value and a historical loss value returned by the third terminal decryption;计算解密返回的第三损失值和历史损失值之间的差值,并判断所述差值是否小于或等于预设阈值;Calculating a difference between the third loss value and the historical loss value returned by the decryption, and determining whether the difference is less than or equal to a preset threshold;若所述差值小于或等于预设阈值,则确定待训练模型收敛,否则确定待训练模型不收敛。If the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
- 如权利要求1所述的基于迁移学习的神经网络联邦建模方法,其特征在于,所述将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值的步骤之后,还包括:The neural network federation modeling method based on transfer learning according to claim 1, wherein the encrypted first gradient value and the first loss value are compared with the encrypted encrypted data sent by the second terminal. After the step of combining the second gradient value and the second loss value to obtain the encrypted third loss value and the third gradient value, the method further includes:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端;The second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value. The third terminal;依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤之后,还包括:After the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption, the method further includes:若待训练模型未收敛,则向所述第三终端发送梯度更新指令,由所述第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至所述第二终端;If the model to be trained does not converge, a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;所述第一终端依据所述第三终端解密返回的第三梯度值更新所述第一神经网络的本地梯度,且在更新完成后,返回执行步骤:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data The vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined. encryption;所述第二终端依据所述第三终端解密返回的第四梯度值更新所述第二神经网络的本地梯度,且在更新完成后,返回执行步骤:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
- 如权利要求1所述的基于迁移学习的神经网络联邦建模方法,其特征在于,所述第三终端产生一组公有密钥和私有密钥,并将所述公有密钥传输至所述第一终端和所述第二终端,由所述第一终端和所述第二终端分别将所述公有密钥存储各自的预设存储区域中。The neural network federation modeling method based on transfer learning according to claim 1, wherein the third terminal generates a set of public key and private key, and transmits the public key to the first A terminal and the second terminal, and the first terminal and the second terminal respectively store the public key in respective preset storage areas.
- 如权利要求5所述的基于迁移学习的神经网络联邦建模方法,其特征在于,所述第三终端以间隔预设时间生成一组公有密钥和私有密钥,并将生成的公有密钥传输至所述第一终端和第二终端,由所述第一终端和第二终端分别依据接收到的公有密钥更新存储在各自预设存储区域中的公有密钥。The neural network federation modeling method based on transfer learning according to claim 5, wherein the third terminal generates a set of public key and private key at a preset interval, and generates the generated public key And transmitting to the first terminal and the second terminal, and the first terminal and the second terminal update the public key stored in the respective preset storage areas according to the received public key, respectively.
- 如权利要求5所述的基于迁移学习的神经网络联邦建模方法,其特征在于,对所述第一梯度值和所述第一损失值加密的步骤包括:The neural network federation modeling method based on transfer learning according to claim 5, wherein the step of encrypting the first gradient value and the first loss value comprises:所述第一终端从预设存储区域中获取公有密钥,并依据所述公有密钥对所述第一梯度值和所述第一损失值进行同态加密。The first terminal obtains a public key from a preset storage area, and performs homomorphic encryption on the first gradient value and the first loss value according to the public key.
- 如权利要求1所述的基于迁移学习的神经网络联邦建模方法,其特征在于,所述基于迁移学习的神经网络联邦建模方法还包括:The neural network federation modeling method based on transfer learning according to claim 1, wherein the neural network federation modeling method based on transfer learning further comprises:当检测到初始权值的配置指令时,统计所述第一神经网络中的突触个数,并调用预设随机数生成器,生成与所述突触个数对应的一组随机数;When the configuration instruction of the initial weight is detected, counting the number of synapses in the first neural network, and calling a preset random number generator to generate a set of random numbers corresponding to the number of synapses;依据生成的一组随机数,配置所述第一神经网络中各突触的初始权值。Configure the initial weights of each synapse in the first neural network according to the generated set of random numbers.
- 一种基于迁移学习的神经网络联邦建模设备,其特征在于,所述基于迁移学习的神经网络联邦建模设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于迁移学习的神经网络联邦建模程序,所述基于迁移学习的神经网络联邦建模程序被所述处理器执行时实现以下步骤:A neural network federation modeling device based on transfer learning, characterized in that the neural network federation modeling device based on transfer learning includes: a memory, a processor, and can be stored on the memory and can be on the processor A running neural network federation modeling program based on transfer learning, which implements the following steps when executed by the processor:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,其中,第二终端将第二样本数据输入至所述第二神经网络,得到第二神经网络向量,并依据所述第一神经网络向量确定第二梯度值和第二损失值,且将所述第二梯度值和所述第二损失值加密之后,传输至所述第一终端,所述第一神经网络向量与所述第二神经网络向量的特征维度相同;Combining the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value, The second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;将加密的第三损失值和第三梯度值发送至第三终端,并依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Sending the encrypted third loss value and the third gradient value to a third terminal, and determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。If the model to be trained converges, the model parameters to be converged are used to establish the model to be trained.
- 如权利要9所述的基于迁移学习的神经网络联邦建模设备,其特征在于,当所述第三终端接收到所述第一终端发送的加密的第三损失值时,获取所述第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给所述第一终端。The neural network federation modeling device based on transfer learning according to claim 9, characterized in that when the third terminal receives the encrypted third loss value sent by the first terminal, the first terminal acquires the first The encrypted historical loss value sent by the terminal last time, and the encrypted third loss value, historical loss value, and third gradient value are decrypted according to the pre-stored private key, and the decrypted third loss value and historical loss value are decrypted. And a third gradient value is returned to the first terminal.
- 如权利要10所述的基于迁移学习的神经网络联邦建模设备,其特征在于,所述基于迁移学习的神经网络联邦建模程序被所述处理器执行时,还实现以下步骤:The neural network federation modeling device based on transfer learning according to claim 10, wherein when the neural network federation modeling program based on transfer learning is executed by the processor, the following steps are further implemented:接收所述第三终端解密返回的第三损失值和历史损失值;Receiving a third loss value and a historical loss value returned by the third terminal decryption;计算解密返回的第三损失值和历史损失值之间的差值,并判断所述差值是否小于或等于预设阈值;Calculating a difference between the third loss value and the historical loss value returned by the decryption, and determining whether the difference is less than or equal to a preset threshold;若所述差值小于或等于预设阈值,则确定待训练模型收敛,否则确定待训练模型不收敛。If the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
- 如权利要9所述的基于迁移学习的神经网络联邦建模设备,其特征在于,所述基于迁移学习的神经网络联邦建模程序被所述处理器执行时,还实现以下步骤:The neural network federation modeling device based on transfer learning according to claim 9, wherein when the neural network federation modeling program based on transfer learning is executed by the processor, the following steps are further implemented:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端;The second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value. The third terminal;依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤之后,还包括:After the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption, the method further includes:若待训练模型未收敛,则向所述第三终端发送梯度更新指令,由所述第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至所述第二终端;If the model to be trained does not converge, a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;所述第一终端依据所述第三终端解密返回的第三梯度值更新所述第一神经网络的本地梯度,且在更新完成后,返回执行步骤:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data The vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined. encryption;所述第二终端依据所述第三终端解密返回的第四梯度值更新所述第二神经网络的本地梯度,且在更新完成后,返回执行步骤:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
- 如权利要9所述的基于迁移学习的神经网络联邦建模设备,其特征在于,所述第三终端产生一组公有密钥和私有密钥,并将所述公有密钥传输至所述第一终端和所述第二终端,由所述第一终端和所述第二终端分别将所述公有密钥存储各自的预设存储区域中。The neural network federation modeling device based on transfer learning according to claim 9, wherein the third terminal generates a set of public key and private key, and transmits the public key to the first A terminal and the second terminal, and the first terminal and the second terminal respectively store the public key in respective preset storage areas.
- 如权利要13所述的基于迁移学习的神经网络联邦建模设备,其特征在于,所述第三终端以间隔预设时间生成一组公有密钥和私有密钥,并将生成的公有密钥传输至所述第一终端和第二终端,由所述第一终端和第二终端分别依据接收到的公有密钥更新存储在各自预设存储区域中的公有密钥。The neural network federation modeling device based on transfer learning according to claim 13, wherein the third terminal generates a set of public keys and private keys at preset intervals, and generates the generated public keys And transmitting to the first terminal and the second terminal, and the first terminal and the second terminal update the public key stored in the respective preset storage areas according to the received public key, respectively.
- 一种存储介质,其特征在于,所述存储介质上存储有基于迁移学习的神经网络联邦建模程序,所述基于迁移学习的神经网络联邦建模程序被处理器执行时实现以下步骤:A storage medium is characterized in that the storage medium stores a neural network federation modeling program based on transfer learning, and the neural network federation modeling program based on transfer learning implements the following steps when executed by a processor:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal inputs a feature vector of the first sample data to a first neural network to obtain a first neural network vector, and determines a first gradient value and a first loss value according to the first neural network vector, and applies the The first gradient value and the first loss value are encrypted;将加密的第一梯度值和第一损失值,与接收到的所述第二终端发送的加密的第二梯度值和第二损失值结合,得到加密的第三损失值和第三梯度值,其中,第二终端将第二样本数据输入至所述第二神经网络,得到第二神经网络向量,并依据所述第一神经网络向量确定第二梯度值和第二损失值,且将所述第二梯度值和所述第二损失值加密之后,传输至所述第一终端,所述第一神经网络向量与所述第二神经网络向量的特征维度相同;Combining the encrypted first gradient value and the first loss value with the received encrypted second gradient value and the second loss value sent by the second terminal to obtain the encrypted third loss value and the third gradient value, The second terminal inputs the second sample data to the second neural network to obtain a second neural network vector, determines a second gradient value and a second loss value according to the first neural network vector, and applies the After the second gradient value and the second loss value are encrypted, and transmitted to the first terminal, the feature dimensions of the first neural network vector and the second neural network vector are the same;将加密的第三损失值和第三梯度值发送至第三终端,并依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛;Sending the encrypted third loss value and the third gradient value to a third terminal, and determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption;若待训练模型收敛,则以收敛时的模型参数,建立待训练模型。If the model to be trained converges, the model parameters to be converged are used to establish the model to be trained.
- 如权利要求15所述的存储介质,其特征在于,当所述第三终端接收到所述第一终端发送的加密的第三损失值时,获取所述第一终端前一次发送的加密的历史损失值,并依据预存的私有密钥对加密的第三损失值、历史损失值和第三梯度值进行解密,且将解密后的第三损失值、历史损失值和第三梯度值返回给所述第一终端。The storage medium according to claim 15, wherein when the third terminal receives the encrypted third loss value sent by the first terminal, the third terminal obtains an encryption history sent by the first terminal last time. Loss value, and decrypt the encrypted third loss value, historical loss value, and third gradient value according to the pre-stored private key, and return the decrypted third loss value, historical loss value, and third gradient value to the Mentioned first terminal.
- 如权利要求16所述的存储介质,其特征在于,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,还实现以下步骤:The storage medium according to claim 16, wherein when the neural network federation modeling program based on transfer learning is executed by a processor, the following steps are further implemented:接收所述第三终端解密返回的第三损失值和历史损失值;Receiving a third loss value and a historical loss value returned by the third terminal decryption;计算解密返回的第三损失值和历史损失值之间的差值,并判断所述差值是否小于或等于预设阈值;Calculating a difference between the third loss value and the historical loss value returned by the decryption, and determining whether the difference is less than or equal to a preset threshold;若所述差值小于或等于预设阈值,则确定待训练模型收敛,否则确定待训练模型不收敛。If the difference is less than or equal to a preset threshold, it is determined that the model to be trained converges, otherwise it is determined that the model to be trained does not converge.
- 如权利要求15所述的存储介质,其特征在于,所述基于迁移学习的神经网络联邦建模程序被处理器执行时,还实现以下步骤:The storage medium according to claim 15, wherein when the neural network federation modeling program based on transfer learning is executed by a processor, the following steps are further implemented:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端;The second terminal combines the encrypted second gradient value with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sends the encrypted fourth gradient value. The third terminal;依据所述第三终端解密返回的第三损失值和历史损失值,确定待训练模型是否收敛的步骤之后,还包括:After the step of determining whether the model to be trained converges according to the third loss value and the historical loss value returned by the third terminal decryption, the method further includes:若待训练模型未收敛,则向所述第三终端发送梯度更新指令,由所述第三终端依据梯度更新指令对加密的第三梯度值和第四梯度值进行解密,并将解密后的第三梯度值返回至所述第一终端,且将解密后的第四梯度值返回至所述第二终端;If the model to be trained does not converge, a gradient update instruction is sent to the third terminal, and the third terminal decrypts the encrypted third gradient value and the fourth gradient value according to the gradient update instruction, and decrypts the decrypted first A three gradient value is returned to the first terminal, and a decrypted fourth gradient value is returned to the second terminal;所述第一终端依据所述第三终端解密返回的第三梯度值更新所述第一神经网络的本地梯度,且在更新完成后,返回执行步骤:第一终端将第一样本数据的特征向量输入至第一神经网络,得到第一神经网络向量,并依据所述第一神经网络向量确定第一梯度值和第一损失值,且对所述第一梯度值和所述第一损失值加密;The first terminal updates the local gradient of the first neural network according to the third gradient value returned by the third terminal decryption, and after the update is completed, returns to the execution step: the first terminal updates the characteristics of the first sample data The vector is input to the first neural network to obtain a first neural network vector, and a first gradient value and a first loss value are determined according to the first neural network vector, and the first gradient value and the first loss value are determined. encryption;所述第二终端依据所述第三终端解密返回的第四梯度值更新所述第二神经网络的本地梯度,且在更新完成后,返回执行步骤:所述第二终端将加密的第二梯度值,与接收到的所述第一终端发送的加密的第一梯度值结合,得到加密的第四梯度值,并将加密的第四梯度值发送的所述第三终端。The second terminal updates the local gradient of the second neural network according to the fourth gradient value decrypted by the third terminal, and after the update is completed, returns to the execution step: the second terminal encrypts the second gradient Value, combined with the received encrypted first gradient value sent by the first terminal to obtain an encrypted fourth gradient value, and sending the encrypted fourth gradient value to the third terminal.
- 如权利要求15所述的存储介质,其特征在于,所述第三终端产生一组公有密钥和私有密钥,并将所述公有密钥传输至所述第一终端和所述第二终端,由所述第一终端和所述第二终端分别将所述公有密钥存储各自的预设存储区域中。The storage medium according to claim 15, wherein the third terminal generates a set of public key and private key, and transmits the public key to the first terminal and the second terminal , The first terminal and the second terminal respectively store the public key in respective preset storage areas.
- 如权利要求19所述的存储介质,其特征在于,所述第三终端以间隔预设时间生成一组公有密钥和私有密钥,并将生成的公有密钥传输至所述第一终端和第二终端,由所述第一终端和第二终端分别依据接收到的公有密钥更新存储在各自预设存储区域中的公有密钥。 The storage medium according to claim 19, wherein the third terminal generates a set of a public key and a private key at a preset interval, and transmits the generated public key to the first terminal and The second terminal updates the public key stored in the respective preset storage area by the first terminal and the second terminal according to the received public key, respectively. Ranch
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810913188.7A CN109165725B (en) | 2018-08-10 | 2018-08-10 | Neural network federal modeling method, equipment and storage medium based on transfer learning |
CN201810913188.7 | 2018-08-10 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020029585A1 true WO2020029585A1 (en) | 2020-02-13 |
Family
ID=64895593
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/078522 WO2020029585A1 (en) | 2018-08-10 | 2019-03-18 | Neural network federation modeling method and device employing transfer learning, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109165725B (en) |
WO (1) | WO2020029585A1 (en) |
Cited By (36)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111368314A (en) * | 2020-02-28 | 2020-07-03 | 深圳前海微众银行股份有限公司 | Modeling and predicting method, device, equipment and storage medium based on cross features |
CN111428887A (en) * | 2020-03-19 | 2020-07-17 | 腾讯云计算(北京)有限责任公司 | Model training control method, device and system based on multiple computing nodes |
CN111538608A (en) * | 2020-04-30 | 2020-08-14 | 深圳前海微众银行股份有限公司 | Method for preventing terminal equipment from being down, terminal equipment and storage medium |
CN111553745A (en) * | 2020-05-08 | 2020-08-18 | 深圳前海微众银行股份有限公司 | Federal-based model updating method, device, equipment and computer storage medium |
CN111724000A (en) * | 2020-06-29 | 2020-09-29 | 南方电网科学研究院有限责任公司 | Method, device and system for predicting user electric charge recycling risk |
CN111783038A (en) * | 2020-06-30 | 2020-10-16 | 北京百度网讯科技有限公司 | Risk assessment method, device, equipment, system and medium based on intelligent learning |
CN111882054A (en) * | 2020-05-27 | 2020-11-03 | 杭州中奥科技有限公司 | Method and related equipment for cross training of network data of encryption relationship between two parties |
CN111898769A (en) * | 2020-08-17 | 2020-11-06 | 中国银行股份有限公司 | Method and system for establishing user behavior period model based on horizontal federal learning |
CN111915004A (en) * | 2020-06-17 | 2020-11-10 | 北京迈格威科技有限公司 | Neural network training method and device, storage medium and electronic equipment |
CN112085159A (en) * | 2020-07-24 | 2020-12-15 | 西安电子科技大学 | User tag data prediction system, method and device and electronic equipment |
CN112232518A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Lightweight distributed federated learning system and method |
CN112231308A (en) * | 2020-10-14 | 2021-01-15 | 深圳前海微众银行股份有限公司 | Method, device, equipment and medium for removing weight of horizontal federal modeling sample data |
CN112232519A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Joint modeling method based on federal learning |
CN112257873A (en) * | 2020-11-11 | 2021-01-22 | 深圳前海微众银行股份有限公司 | Training method, device, system, equipment and storage medium of machine learning model |
CN112396189A (en) * | 2020-11-27 | 2021-02-23 | 中国银联股份有限公司 | Method and device for multi-party construction of federal learning model |
CN112417478A (en) * | 2020-11-24 | 2021-02-26 | 深圳前海微众银行股份有限公司 | Data processing method, device, equipment and storage medium |
CN112508907A (en) * | 2020-12-02 | 2021-03-16 | 平安科技(深圳)有限公司 | CT image detection method based on federal learning and related device |
CN112633146A (en) * | 2020-12-21 | 2021-04-09 | 杭州趣链科技有限公司 | Multi-pose face gender detection training optimization method and device and related equipment |
CN112862507A (en) * | 2021-03-15 | 2021-05-28 | 深圳前海微众银行股份有限公司 | Method, device, equipment, medium and product for preventing network appointment vehicle driver and passenger disputes |
CN112860800A (en) * | 2021-02-22 | 2021-05-28 | 深圳市星网储区块链有限公司 | Trusted network application method and device based on block chain and federal learning |
CN113011603A (en) * | 2021-03-17 | 2021-06-22 | 深圳前海微众银行股份有限公司 | Model parameter updating method, device, equipment, storage medium and program product |
CN113051586A (en) * | 2021-03-10 | 2021-06-29 | 北京沃东天骏信息技术有限公司 | Federal modeling system and method, and federal model prediction method, medium, and device |
CN113269232A (en) * | 2021-04-25 | 2021-08-17 | 北京沃东天骏信息技术有限公司 | Model training method, vectorization recall method, related device and storage medium |
CN113362160A (en) * | 2021-06-08 | 2021-09-07 | 南京信息工程大学 | Federal learning method and device for credit card anti-fraud |
CN113409134A (en) * | 2021-06-30 | 2021-09-17 | 中国工商银行股份有限公司 | Enterprise financing trust method and device based on federal learning |
CN113449872A (en) * | 2020-03-25 | 2021-09-28 | 百度在线网络技术(北京)有限公司 | Parameter processing method, device and system based on federal learning |
CN113537512A (en) * | 2021-07-15 | 2021-10-22 | 青岛海尔工业智能研究院有限公司 | Model training method, device, system, equipment and medium based on federal learning |
CN113536770A (en) * | 2021-09-09 | 2021-10-22 | 平安科技(深圳)有限公司 | Text analysis method, device and equipment based on artificial intelligence and storage medium |
CN113806759A (en) * | 2020-12-28 | 2021-12-17 | 京东科技控股股份有限公司 | Federal learning model training method and device, electronic equipment and storage medium |
CN113923225A (en) * | 2020-11-16 | 2022-01-11 | 京东科技控股股份有限公司 | Distributed architecture-based federated learning platform, method, device and storage medium |
CN114429223A (en) * | 2022-01-26 | 2022-05-03 | 上海富数科技有限公司 | Heterogeneous model establishing method and device |
CN114595835A (en) * | 2022-05-07 | 2022-06-07 | 腾讯科技(深圳)有限公司 | Model training method and device based on federal learning, equipment and storage medium |
WO2023124219A1 (en) * | 2021-12-30 | 2023-07-06 | 新智我来网络科技有限公司 | Joint learning model iterative update method, apparatus, system, and storage medium |
CN116633704A (en) * | 2023-07-25 | 2023-08-22 | 北京数牍科技有限公司 | Graph calculation method and device |
CN117278540A (en) * | 2023-11-23 | 2023-12-22 | 中国人民解放军国防科技大学 | Self-adaptive edge federal learning client scheduling method and device and electronic equipment |
WO2024007189A1 (en) * | 2022-07-06 | 2024-01-11 | Nokia Shanghai Bell Co., Ltd. | Scalable and quick waveform learning in multi-user communication system |
Families Citing this family (33)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109165725B (en) * | 2018-08-10 | 2022-03-29 | 深圳前海微众银行股份有限公司 | Neural network federal modeling method, equipment and storage medium based on transfer learning |
CN110414631B (en) * | 2019-01-29 | 2022-02-01 | 腾讯科技(深圳)有限公司 | Medical image-based focus detection method, model training method and device |
CN109871702B (en) * | 2019-02-18 | 2024-06-28 | 深圳前海微众银行股份有限公司 | Federal model training method, system, apparatus, and computer-readable storage medium |
CN109902742B (en) * | 2019-02-28 | 2021-07-16 | 深圳前海微众银行股份有限公司 | Sample completion method, terminal, system and medium based on encryption migration learning |
CN109886417B (en) * | 2019-03-01 | 2024-05-03 | 深圳前海微众银行股份有限公司 | Model parameter training method, device, equipment and medium based on federal learning |
CN111800538B (en) * | 2019-04-09 | 2022-01-25 | Oppo广东移动通信有限公司 | Information processing method, device, storage medium and terminal |
CN110175283B (en) * | 2019-05-10 | 2021-04-13 | 深圳前海微众银行股份有限公司 | Recommendation model generation method and device |
CN110263908B (en) * | 2019-06-20 | 2024-04-02 | 深圳前海微众银行股份有限公司 | Federal learning model training method, apparatus, system and storage medium |
CN112149706B (en) * | 2019-06-28 | 2024-03-15 | 北京百度网讯科技有限公司 | Model training method, device, equipment and medium |
CN110399742B (en) * | 2019-07-29 | 2020-12-18 | 深圳前海微众银行股份有限公司 | Method and device for training and predicting federated migration learning model |
CN110443416A (en) * | 2019-07-30 | 2019-11-12 | 卓尔智联(武汉)研究院有限公司 | Federal model building device, method and readable storage medium storing program for executing based on shared data |
CN112308233B (en) * | 2019-08-02 | 2024-07-19 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for processing data |
CN110610140B (en) * | 2019-08-23 | 2024-01-19 | 平安科技(深圳)有限公司 | Training method, device and equipment of face recognition model and readable storage medium |
CN111222646B (en) * | 2019-12-11 | 2021-07-30 | 深圳逻辑汇科技有限公司 | Design method and device of federal learning mechanism and storage medium |
CN111144576A (en) * | 2019-12-13 | 2020-05-12 | 支付宝(杭州)信息技术有限公司 | Model training method and device and electronic equipment |
CN111126609B (en) * | 2019-12-20 | 2021-04-23 | 深圳前海微众银行股份有限公司 | Knowledge migration method, device, equipment and medium based on federal learning |
CN111125735B (en) * | 2019-12-20 | 2021-11-02 | 支付宝(杭州)信息技术有限公司 | Method and system for model training based on private data |
CN111178524B (en) * | 2019-12-24 | 2024-06-14 | 中国平安人寿保险股份有限公司 | Data processing method, device, equipment and medium based on federal learning |
CN111210003B (en) * | 2019-12-30 | 2021-03-19 | 深圳前海微众银行股份有限公司 | Longitudinal federated learning system optimization method, device, equipment and readable storage medium |
CN111401277B (en) * | 2020-03-20 | 2024-10-25 | 深圳前海微众银行股份有限公司 | Face recognition model updating method, device, equipment and medium |
CN111428265B (en) * | 2020-03-20 | 2024-09-20 | 深圳前海微众银行股份有限公司 | Statement quality inspection method, device, equipment and storage medium based on federal learning |
CN111428881B (en) * | 2020-03-20 | 2021-12-07 | 深圳前海微众银行股份有限公司 | Recognition model training method, device, equipment and readable storage medium |
CN113554476B (en) * | 2020-04-23 | 2024-04-19 | 京东科技控股股份有限公司 | Training method and system of credit prediction model, electronic equipment and storage medium |
CN111582505A (en) * | 2020-05-14 | 2020-08-25 | 深圳前海微众银行股份有限公司 | Federal modeling method, device, equipment and computer readable storage medium |
CN111737921B (en) * | 2020-06-24 | 2024-04-26 | 深圳前海微众银行股份有限公司 | Data processing method, equipment and medium based on cyclic neural network |
CN112001502B (en) * | 2020-08-24 | 2022-06-21 | 平安科技(深圳)有限公司 | Federal learning training method and device for high-delay network environment robustness |
CN114257386B (en) * | 2020-09-10 | 2023-03-21 | 华为技术有限公司 | Training method, system, equipment and storage medium for detection model |
CN112016632B (en) * | 2020-09-25 | 2024-04-26 | 北京百度网讯科技有限公司 | Model joint training method, device, equipment and storage medium |
CN112149171B (en) * | 2020-10-27 | 2021-07-09 | 腾讯科技(深圳)有限公司 | Method, device, equipment and storage medium for training federal neural network model |
CN112348199B (en) * | 2020-10-30 | 2022-08-30 | 河海大学 | Model training method based on federal learning and multi-task learning |
CN113011598B (en) * | 2021-03-17 | 2023-06-02 | 深圳技术大学 | Financial data information federation migration learning method and device based on blockchain |
CN112733967B (en) * | 2021-03-30 | 2021-06-29 | 腾讯科技(深圳)有限公司 | Model training method, device, equipment and storage medium for federal learning |
CN113902137B (en) * | 2021-12-06 | 2022-04-08 | 腾讯科技(深圳)有限公司 | Streaming model training method and device, computer equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760932A (en) * | 2016-02-17 | 2016-07-13 | 北京物思创想科技有限公司 | Data exchange method, data exchange device and calculating device |
CN107704930A (en) * | 2017-09-25 | 2018-02-16 | 阿里巴巴集团控股有限公司 | Modeling method, device, system and electronic equipment based on shared data |
US20180096248A1 (en) * | 2016-09-30 | 2018-04-05 | Safran Identity & Security | Methods for secure learning of parameters of a convolution neural network, and for secure input data classification |
CN108259158A (en) * | 2018-01-11 | 2018-07-06 | 西安电子科技大学 | Efficient and secret protection individual layer perceptron learning method under a kind of cloud computing environment |
CN109165725A (en) * | 2018-08-10 | 2019-01-08 | 深圳前海微众银行股份有限公司 | Neural network federation modeling method, equipment and storage medium based on transfer learning |
CN109255444A (en) * | 2018-08-10 | 2019-01-22 | 深圳前海微众银行股份有限公司 | Federal modeling method, equipment and readable storage medium storing program for executing based on transfer learning |
CN109325584A (en) * | 2018-08-10 | 2019-02-12 | 深圳前海微众银行股份有限公司 | Federation's modeling method, equipment and readable storage medium storing program for executing neural network based |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101580353B1 (en) * | 2010-03-02 | 2015-12-23 | 인터디지탈 패튼 홀딩스, 인크 | Migration of credentials and/or domains between trusted hardware subscription modules |
US8761160B2 (en) * | 2010-06-25 | 2014-06-24 | Acme Packet, Inc. | Service path routing between session border controllers |
US20180089587A1 (en) * | 2016-09-26 | 2018-03-29 | Google Inc. | Systems and Methods for Communication Efficient Distributed Mean Estimation |
CN107610709B (en) * | 2017-08-01 | 2021-03-19 | 百度在线网络技术(北京)有限公司 | Method and system for training voiceprint recognition model |
CN108229646A (en) * | 2017-08-08 | 2018-06-29 | 北京市商汤科技开发有限公司 | neural network model compression method, device, storage medium and electronic equipment |
CN108182427B (en) * | 2018-01-30 | 2021-12-14 | 电子科技大学 | Face recognition method based on deep learning model and transfer learning |
CN108197670B (en) * | 2018-01-31 | 2021-06-15 | 国信优易数据股份有限公司 | Pseudo label generation model training method and device and pseudo label generation method and device |
-
2018
- 2018-08-10 CN CN201810913188.7A patent/CN109165725B/en active Active
-
2019
- 2019-03-18 WO PCT/CN2019/078522 patent/WO2020029585A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760932A (en) * | 2016-02-17 | 2016-07-13 | 北京物思创想科技有限公司 | Data exchange method, data exchange device and calculating device |
US20180096248A1 (en) * | 2016-09-30 | 2018-04-05 | Safran Identity & Security | Methods for secure learning of parameters of a convolution neural network, and for secure input data classification |
CN107704930A (en) * | 2017-09-25 | 2018-02-16 | 阿里巴巴集团控股有限公司 | Modeling method, device, system and electronic equipment based on shared data |
CN108259158A (en) * | 2018-01-11 | 2018-07-06 | 西安电子科技大学 | Efficient and secret protection individual layer perceptron learning method under a kind of cloud computing environment |
CN109165725A (en) * | 2018-08-10 | 2019-01-08 | 深圳前海微众银行股份有限公司 | Neural network federation modeling method, equipment and storage medium based on transfer learning |
CN109255444A (en) * | 2018-08-10 | 2019-01-22 | 深圳前海微众银行股份有限公司 | Federal modeling method, equipment and readable storage medium storing program for executing based on transfer learning |
CN109325584A (en) * | 2018-08-10 | 2019-02-12 | 深圳前海微众银行股份有限公司 | Federation's modeling method, equipment and readable storage medium storing program for executing neural network based |
Cited By (58)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111368314A (en) * | 2020-02-28 | 2020-07-03 | 深圳前海微众银行股份有限公司 | Modeling and predicting method, device, equipment and storage medium based on cross features |
CN111428887A (en) * | 2020-03-19 | 2020-07-17 | 腾讯云计算(北京)有限责任公司 | Model training control method, device and system based on multiple computing nodes |
CN111428887B (en) * | 2020-03-19 | 2023-05-12 | 腾讯云计算(北京)有限责任公司 | Model training control method, device and system based on multiple computing nodes |
CN113449872B (en) * | 2020-03-25 | 2023-08-08 | 百度在线网络技术(北京)有限公司 | Parameter processing method, device and system based on federal learning |
CN113449872A (en) * | 2020-03-25 | 2021-09-28 | 百度在线网络技术(北京)有限公司 | Parameter processing method, device and system based on federal learning |
CN111538608A (en) * | 2020-04-30 | 2020-08-14 | 深圳前海微众银行股份有限公司 | Method for preventing terminal equipment from being down, terminal equipment and storage medium |
CN111553745A (en) * | 2020-05-08 | 2020-08-18 | 深圳前海微众银行股份有限公司 | Federal-based model updating method, device, equipment and computer storage medium |
CN111882054A (en) * | 2020-05-27 | 2020-11-03 | 杭州中奥科技有限公司 | Method and related equipment for cross training of network data of encryption relationship between two parties |
CN111882054B (en) * | 2020-05-27 | 2024-04-12 | 杭州中奥科技有限公司 | Method for cross training of encryption relationship network data of two parties and related equipment |
CN111915004B (en) * | 2020-06-17 | 2024-08-02 | 北京迈格威科技有限公司 | Neural network training method and device, storage medium and electronic equipment |
CN111915004A (en) * | 2020-06-17 | 2020-11-10 | 北京迈格威科技有限公司 | Neural network training method and device, storage medium and electronic equipment |
CN111724000A (en) * | 2020-06-29 | 2020-09-29 | 南方电网科学研究院有限责任公司 | Method, device and system for predicting user electric charge recycling risk |
CN111724000B (en) * | 2020-06-29 | 2024-02-09 | 南方电网科学研究院有限责任公司 | User electricity charge recycling risk prediction method, device and system |
CN111783038B (en) * | 2020-06-30 | 2024-04-12 | 北京百度网讯科技有限公司 | Risk assessment method, device, equipment, system and medium based on intelligent learning |
CN111783038A (en) * | 2020-06-30 | 2020-10-16 | 北京百度网讯科技有限公司 | Risk assessment method, device, equipment, system and medium based on intelligent learning |
CN112085159B (en) * | 2020-07-24 | 2023-08-15 | 西安电子科技大学 | User tag data prediction system, method and device and electronic equipment |
CN112085159A (en) * | 2020-07-24 | 2020-12-15 | 西安电子科技大学 | User tag data prediction system, method and device and electronic equipment |
CN111898769A (en) * | 2020-08-17 | 2020-11-06 | 中国银行股份有限公司 | Method and system for establishing user behavior period model based on horizontal federal learning |
CN112231308B (en) * | 2020-10-14 | 2024-05-03 | 深圳前海微众银行股份有限公司 | Method, device, equipment and medium for de-duplication of transverse federal modeling sample data |
CN112231308A (en) * | 2020-10-14 | 2021-01-15 | 深圳前海微众银行股份有限公司 | Method, device, equipment and medium for removing weight of horizontal federal modeling sample data |
CN112232519B (en) * | 2020-10-15 | 2024-01-09 | 成都数融科技有限公司 | Joint modeling method based on federal learning |
CN112232518A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Lightweight distributed federated learning system and method |
CN112232519A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Joint modeling method based on federal learning |
CN112232518B (en) * | 2020-10-15 | 2024-01-09 | 成都数融科技有限公司 | Lightweight distributed federal learning system and method |
CN112257873A (en) * | 2020-11-11 | 2021-01-22 | 深圳前海微众银行股份有限公司 | Training method, device, system, equipment and storage medium of machine learning model |
CN113923225A (en) * | 2020-11-16 | 2022-01-11 | 京东科技控股股份有限公司 | Distributed architecture-based federated learning platform, method, device and storage medium |
CN112417478A (en) * | 2020-11-24 | 2021-02-26 | 深圳前海微众银行股份有限公司 | Data processing method, device, equipment and storage medium |
CN112396189B (en) * | 2020-11-27 | 2023-09-01 | 中国银联股份有限公司 | Method and device for constructing federal learning model by multiple parties |
CN112396189A (en) * | 2020-11-27 | 2021-02-23 | 中国银联股份有限公司 | Method and device for multi-party construction of federal learning model |
CN112508907B (en) * | 2020-12-02 | 2024-05-14 | 平安科技(深圳)有限公司 | CT image detection method and related device based on federal learning |
CN112508907A (en) * | 2020-12-02 | 2021-03-16 | 平安科技(深圳)有限公司 | CT image detection method based on federal learning and related device |
CN112633146A (en) * | 2020-12-21 | 2021-04-09 | 杭州趣链科技有限公司 | Multi-pose face gender detection training optimization method and device and related equipment |
CN112633146B (en) * | 2020-12-21 | 2024-03-26 | 杭州趣链科技有限公司 | Multi-pose face gender detection training optimization method, device and related equipment |
CN113806759A (en) * | 2020-12-28 | 2021-12-17 | 京东科技控股股份有限公司 | Federal learning model training method and device, electronic equipment and storage medium |
CN112860800A (en) * | 2021-02-22 | 2021-05-28 | 深圳市星网储区块链有限公司 | Trusted network application method and device based on block chain and federal learning |
CN113051586B (en) * | 2021-03-10 | 2024-05-24 | 北京沃东天骏信息技术有限公司 | Federal modeling system and method, federal model prediction method, medium, and device |
CN113051586A (en) * | 2021-03-10 | 2021-06-29 | 北京沃东天骏信息技术有限公司 | Federal modeling system and method, and federal model prediction method, medium, and device |
CN112862507A (en) * | 2021-03-15 | 2021-05-28 | 深圳前海微众银行股份有限公司 | Method, device, equipment, medium and product for preventing network appointment vehicle driver and passenger disputes |
CN113011603A (en) * | 2021-03-17 | 2021-06-22 | 深圳前海微众银行股份有限公司 | Model parameter updating method, device, equipment, storage medium and program product |
CN113269232A (en) * | 2021-04-25 | 2021-08-17 | 北京沃东天骏信息技术有限公司 | Model training method, vectorization recall method, related device and storage medium |
CN113269232B (en) * | 2021-04-25 | 2023-12-08 | 北京沃东天骏信息技术有限公司 | Model training method, vectorization recall method, related equipment and storage medium |
CN113362160B (en) * | 2021-06-08 | 2023-08-22 | 南京信息工程大学 | Federal learning method and device for credit card anti-fraud |
CN113362160A (en) * | 2021-06-08 | 2021-09-07 | 南京信息工程大学 | Federal learning method and device for credit card anti-fraud |
CN113409134A (en) * | 2021-06-30 | 2021-09-17 | 中国工商银行股份有限公司 | Enterprise financing trust method and device based on federal learning |
CN113537512A (en) * | 2021-07-15 | 2021-10-22 | 青岛海尔工业智能研究院有限公司 | Model training method, device, system, equipment and medium based on federal learning |
CN113537512B (en) * | 2021-07-15 | 2024-03-15 | 卡奥斯工业智能研究院(青岛)有限公司 | Model training method, device, system, equipment and medium based on federal learning |
CN113536770A (en) * | 2021-09-09 | 2021-10-22 | 平安科技(深圳)有限公司 | Text analysis method, device and equipment based on artificial intelligence and storage medium |
CN113536770B (en) * | 2021-09-09 | 2021-11-30 | 平安科技(深圳)有限公司 | Text analysis method, device and equipment based on artificial intelligence and storage medium |
WO2023124219A1 (en) * | 2021-12-30 | 2023-07-06 | 新智我来网络科技有限公司 | Joint learning model iterative update method, apparatus, system, and storage medium |
CN114429223B (en) * | 2022-01-26 | 2023-11-07 | 上海富数科技有限公司 | Heterogeneous model building method and device |
CN114429223A (en) * | 2022-01-26 | 2022-05-03 | 上海富数科技有限公司 | Heterogeneous model establishing method and device |
CN114595835B (en) * | 2022-05-07 | 2022-07-22 | 腾讯科技(深圳)有限公司 | Model training method and device based on federal learning, equipment and storage medium |
CN114595835A (en) * | 2022-05-07 | 2022-06-07 | 腾讯科技(深圳)有限公司 | Model training method and device based on federal learning, equipment and storage medium |
WO2024007189A1 (en) * | 2022-07-06 | 2024-01-11 | Nokia Shanghai Bell Co., Ltd. | Scalable and quick waveform learning in multi-user communication system |
CN116633704B (en) * | 2023-07-25 | 2023-10-31 | 北京数牍科技有限公司 | Graph calculation method and device |
CN116633704A (en) * | 2023-07-25 | 2023-08-22 | 北京数牍科技有限公司 | Graph calculation method and device |
CN117278540A (en) * | 2023-11-23 | 2023-12-22 | 中国人民解放军国防科技大学 | Self-adaptive edge federal learning client scheduling method and device and electronic equipment |
CN117278540B (en) * | 2023-11-23 | 2024-02-13 | 中国人民解放军国防科技大学 | Self-adaptive edge federal learning client scheduling method and device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN109165725A (en) | 2019-01-08 |
CN109165725B (en) | 2022-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020029585A1 (en) | Neural network federation modeling method and device employing transfer learning, and storage medium | |
WO2021092973A1 (en) | Sensitive information processing method and device, and readable storage medium | |
WO2020147383A1 (en) | Process examination and approval method, device and system employing blockchain system, and non-volatile storage medium | |
WO2019132272A1 (en) | Id as blockchain based service | |
WO2021095998A1 (en) | A trusted computing method and system | |
WO2018151390A1 (en) | Internet of things device | |
WO2016137304A1 (en) | Trust-zone-based end-to-end security | |
WO2021003975A1 (en) | Gateway interface test method, terminal device, storage medium and apparatus | |
WO2014063455A1 (en) | Instant messaging method and system | |
WO2014069783A1 (en) | Password-based authentication method, and apparatus for performing same | |
WO2017119548A1 (en) | Security-reinforced user authentication method | |
WO2019024126A1 (en) | Blockchain-based knowledge management method, and terminal and server | |
WO2013005989A2 (en) | Method and apparatus for managing group key for mobile device | |
WO2018072261A1 (en) | Information encryption method and device, information decryption method and device, and terminal | |
WO2023120906A1 (en) | Method for receiving firmware and method for transmitting firmware | |
WO2021027134A1 (en) | Data storage method, apparatus and device and computer storage medium | |
WO2020062658A1 (en) | Contract generation method and apparatus, and device and storage medium | |
WO2020062661A1 (en) | Method, device and apparatus for verifying consistency of contract data and storage medium | |
WO2020032351A1 (en) | Method for establishing anonymous digital identity | |
WO2019132270A1 (en) | Secure communication method in nfv environment and system therefor | |
WO2019182377A1 (en) | Method, electronic device, and computer-readable recording medium for generating address information used for transaction of blockchain-based cryptocurrency | |
WO2021060720A1 (en) | Blockchain system supporting change in plain text data included in transaction | |
WO2016137291A1 (en) | Pg server system using time stamp-based security code and driving method there of | |
WO2020114184A1 (en) | Joint modeling method, apparatus and device, and computer-readable storage medium | |
WO2018053904A1 (en) | Information processing method and terminal |
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: 19848010 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: 19848010 Country of ref document: EP Kind code of ref document: A1 |