CN111259446A - Parameter processing method, equipment and storage medium based on federal transfer learning - Google Patents

Parameter processing method, equipment and storage medium based on federal transfer learning Download PDF

Info

Publication number
CN111259446A
CN111259446A CN202010049512.2A CN202010049512A CN111259446A CN 111259446 A CN111259446 A CN 111259446A CN 202010049512 A CN202010049512 A CN 202010049512A CN 111259446 A CN111259446 A CN 111259446A
Authority
CN
China
Prior art keywords
terminal
share
parameter
secret sharing
intermediate result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010049512.2A
Other languages
Chinese (zh)
Other versions
CN111259446B (en
Inventor
康焱
刘洋
陈天健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010049512.2A priority Critical patent/CN111259446B/en
Publication of CN111259446A publication Critical patent/CN111259446A/en
Application granted granted Critical
Publication of CN111259446B publication Critical patent/CN111259446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a parameter processing method, equipment and a storage medium based on federal transfer learning, wherein the method comprises the following steps: the first terminal generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result based on the generated first labeling sample characteristic and the first overlapping sample characteristic, and a second share of the first secret sharing calculation intermediate result is separated from the first secret sharing calculation intermediate result and is sent to the second terminal so that the second terminal can generate a second parameter gradient to update a second parameter; the first terminal calculates a second share of the intermediate result based on the first secret sharing sent by the second terminal, and generates a total loss value and a first parameter gradient by combining the first share of the intermediate result, the first private loss value and the first private parameter gradient of the first secret sharing calculation, so as to update a first parameter in the first terminal according to the first parameter gradient; the training of the model is done by an accurate update of the first and second parameters.

Description

Parameter processing method, equipment and storage medium based on federal transfer learning
Technical Field
The invention relates to the technical field of financial technology (Fintech), in particular to a parameter processing method, equipment and a storage medium based on federal transfer learning.
Background
With the continuous development of financial technology (Fintech), especially internet technology and finance, more and more attention is paid to the characteristics of users by adding different tags to various data of the users; the user data involved in each organization is numerous, and each item of data is often labeled in a machine learning manner.
One prerequisite for the application of current distributed machine learning techniques, including federal learning, is that the data at each node in the distribution is highly coincident in the sample space or feature space. However, in many real scenes, data distributed on each node is often heterogeneous, that is, the coincidence degree of the data on the sample space and the feature space is low; the problem of data heterogeneity causes difficulty in application of distributed machine learning technology in a real scene, and a large amount of data needs to be constructed to ensure the accuracy of federal learning. Meanwhile, with the application of user privacy protection in machine learning, the calculation cost is greatly increased by adopting privacy protection calculation, and the popularization of distributed machine learning is also influenced. Therefore, the complexity of data construction and calculation and the high cost of calculation based on privacy protection are not favorable for popularization while the distributed machine learning efficiency is reduced.
Disclosure of Invention
The invention mainly aims to provide a parameter processing method, a parameter processing device and a parameter processing storage medium based on federated transfer learning, and aims to solve the problems that in the prior art, due to the fact that data construction and calculation for distributed machine learning are complex, and the high cost of privacy protection calculation is based, the efficiency of distributed machine learning is low, and popularization is affected.
In order to achieve the above object, the present invention provides a parameter processing method based on federal transfer learning, which comprises the following steps:
the first terminal calls a first feature conversion function to respectively perform feature conversion on a first labeling sample and a first overlapping sample in the first terminal to obtain a first labeling sample feature and a first overlapping sample feature;
the first terminal generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result based on the first overlapped sample feature, the first labeled sample feature and the first labeled sample label according to a loss function consisting of a sample feature distance function and a labeled prediction model error function;
the first terminal decomposes the intermediate result of the first secret sharing calculation through a secret sharing mechanism to obtain a first share of the intermediate result of the first secret sharing calculation and a second share of the intermediate result of the first secret sharing calculation, sends the second share of the intermediate result of the first secret sharing calculation to the second terminal so that the second terminal can generate a second parameter gradient, and updates a second parameter according to the second parameter gradient, wherein the second parameter comprises all parameters of a second characteristic conversion function, parameters to be updated of a sample characteristic distance function and parameters to be updated of a federal annotation prediction model;
the first terminal receives a first share of a second secret sharing calculation intermediate result sent by the second terminal, generates a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, the first private loss value and the first private parameter gradient, and updates a first parameter according to the first parameter gradient, wherein the first parameter comprises all parameters of a first characteristic conversion function, a parameter to be updated of a sample characteristic distance function and a parameter to be updated of a federal annotation prediction model.
Optionally, the step of generating, by the first terminal, a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, the first private loss value and the first private parameter gradient includes:
the first terminal generates a first share of a secret sharing loss value, a first share of a first secret sharing parameter gradient and a first share of a second secret sharing parameter gradient according to a first share of a first secret sharing calculation intermediate result and a first share of a second secret sharing calculation intermediate result, based on a secret sharing mechanism, and sends the first share of the second secret sharing parameter gradient to the second terminal so that the second terminal can generate a second parameter gradient;
the first terminal receives a second share of the secret sharing loss value, a second share of the first secret sharing parameter gradient and a second private loss value sent by the second terminal, generates a total loss value according to the first private loss value, the second private loss value, the first share of the secret sharing loss value and the second share of the secret sharing loss value, and generates a first parameter gradient according to the first private parameter gradient, the first share of the first secret sharing parameter gradient and the second share of the first secret sharing parameter gradient.
Optionally, the step of updating the first parameter according to the total loss value and the first parameter gradient comprises:
the first terminal judges whether the total loss value is smaller than a preset threshold value;
if the total loss value is smaller than a preset threshold value, judging that the Nippon training is finished, stopping the training by the first terminal, and sending a training stop signal to the second terminal;
and if the total loss value is not less than the preset threshold value, updating the first parameter through the first parameter gradient, and sending a training continuation signal to the second terminal.
Optionally, the step of determining the end of federal training is followed by:
when the first terminal receives a label prediction request for an unlabeled sample of a second terminal, performing feature conversion on the first labeled sample according to a trained first feature conversion function to obtain a first labeled sample feature, generating a first secret shared label prediction intermediate result based on the first labeled sample feature and a first labeled sample label, decomposing the first secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the first secret shared label prediction intermediate result and a second share of the first secret shared label prediction intermediate result, and sending the second share of the first secret shared label prediction intermediate result to the second terminal so that the second terminal can generate a second label prediction result;
the first terminal receives a first share of a second secret shared label predicted intermediate result sent by the second terminal, and generates a first label prediction result according to the first share of the first secret shared label predicted intermediate result and the first share of the second secret shared label predicted intermediate result;
and the first terminal receives a second label prediction result sent by the second terminal, generates a label prediction result according to the first label prediction result and the second label prediction result, and finishes the labeling of the unlabeled sample in the second terminal.
Further, in order to achieve the above object, the present invention further provides a parameter processing device based on federal transfer learning, where the parameter processing method based on federal transfer learning includes the following steps:
the second terminal calls a second feature conversion function, after the parameters of the second feature conversion function are initialized, feature conversion is carried out on a second labeling sample and a second overlapped sample of the second terminal according to the second feature function to generate a second labeling sample feature and a second overlapped sample feature, and a second private loss value, a second private parameter gradient and a second secret sharing calculation intermediate result are generated according to a loss function formed by a sample feature distance function and a labeling prediction model error function and based on the second overlapped sample feature, the second labeling sample feature and a second labeling sample label;
and the second terminal decomposes the second secret sharing calculation intermediate result through a secret sharing mechanism to obtain a first share of the second secret sharing calculation intermediate result and a second share of the second secret sharing calculation intermediate result, and sends a second private loss value and the first share of the second secret sharing calculation intermediate result to the first terminal.
Optionally, the step of sending the second private loss value and the first share of the intermediate result of the second secret sharing calculation to the first terminal includes:
the second terminal receives a second share of the first secret sharing calculation intermediate result sent by the first terminal, generates a second share of the secret sharing loss value, a second share of the first secret sharing parameter gradient and a second share of the second secret sharing parameter gradient according to the second share of the first secret sharing calculation intermediate result and the second share of the second secret sharing calculation intermediate result, and sends the second share of the secret sharing loss value and the second share of the first secret sharing parameter gradient to the first terminal based on a secret sharing mechanism so that the first terminal can generate a total loss value and a first parameter gradient;
and the second terminal receives the first share of the second secret sharing parameter gradient sent by the first terminal, generates a second parameter gradient according to the second private parameter gradient, the first share of the second secret sharing parameter gradient and the second share of the second secret sharing parameter gradient, and updates the second parameter according to the second parameter gradient.
Optionally, the step of updating the second parameter according to the second parameter gradient includes:
if the second terminal receives a training continuation signal sent by the first terminal, the second terminal updates a second parameter through a second parameter gradient;
and if the second terminal receives the training stopping signal sent by the first terminal, the second terminal stops training.
Preferably, the step of the second terminal stopping training comprises the following steps:
the second terminal calls a trained second feature conversion function to perform feature conversion on the unlabeled sample of the second terminal to obtain the unlabeled sample feature, and generates a second secret shared label prediction intermediate result based on the unlabeled sample feature according to the trained labeling prediction model;
the second terminal decomposes the second secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the second secret shared label prediction intermediate result and a second share of the second secret shared label prediction intermediate result, and sends the first share of the second secret shared label prediction intermediate result to the first terminal so that the first terminal can generate a first prediction result;
and the second terminal receives a second share of the intermediate result of the first secret shared label prediction sent by the first terminal, generates a second label prediction result according to the second share of the intermediate result of the second secret shared label prediction and the second share of the intermediate result of the first secret shared label prediction, and sends the second label prediction result to the first terminal so that the first terminal can generate the label prediction result.
Further, in order to achieve the above object, the present invention further provides a parameter processing device based on federated migration learning, where the parameter processing device based on federated migration learning includes a memory, a processor, and a parameter processing program based on federated migration learning, which is stored in the memory and is executable on the processor, and when the parameter processing program based on federated migration learning is executed by the processor, the steps of the parameter processing method based on federated migration learning as described above are implemented.
Further, in order to achieve the above object, the present invention further provides a storage medium, where a parameter processing program based on federated migration learning is stored on the storage medium, and when being executed by a processor, the parameter processing program based on federated migration learning implements the steps of the parameter processing method based on federated migration learning as described above.
The method comprises the steps that a first terminal calls a first feature conversion function to perform feature conversion on a first labeled sample and a first overlapped sample, and a loss function consisting of a sample feature distance function and a labeled prediction model error function generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result; and then the first terminal decomposes the intermediate result of the first secret sharing calculation through a secret sharing mechanism to obtain a first share of the intermediate result of the first secret sharing calculation and a second share of the intermediate result of the first secret sharing calculation, and sends the second share of the intermediate result of the first secret sharing calculation to the second terminal, so that the second terminal can generate a second parameter gradient and update the second parameter. In addition, the first terminal receives a first share of a second secret sharing calculation intermediate result sent by the second terminal, generates a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, a first private loss value and the first private parameter gradient, and updates a first parameter according to the first parameter gradient; therefore, the updating of the parameters to be updated in the federated labeling prediction model is realized.
The first parameter is updated according to the processing of the first share obtained by decomposition in the first terminal and the second terminal, the second parameter is updated according to the processing of the second share obtained by decomposition in the first terminal and the second terminal, and the first share and the second share are generated according to the overlapping sample and the respective labeled sample between the first share and the second share, so that the updating of the first parameter and the second parameter is related to the overlapping sample and the respective labeled sample in the first terminal and the second terminal. The overlapped samples represent the correlation between the first terminal and the second terminal, and the respective labeled samples represent the correlation between the labeled samples and the unlabeled samples, so that the first parameter and the second parameter are updated according to the original samples, the overlapped samples and the labeled sample labels of the first terminal and the second terminal, the correlation between the samples is high, and the data heterogeneity is reduced; the problem that a large amount of data needs to be constructed and processed in a real scene due to the heterogeneity of the data is solved, and the efficiency of distributed machine learning is improved. Meanwhile, the data in the first terminal and the second terminal are decomposed through a secret sharing mechanism, and the data obtained through the decomposition of each terminal are exchanged to update the respective parameters. In the whole process, the first terminal and the second terminal do not know any information before decomposition of the other terminal, the safety of private data between the first terminal and the second terminal is ensured, the calculation cost is low, and the popularization and the application of the distributed machine learning technology in a real scene are facilitated.
Drawings
FIG. 1 is a schematic structural diagram of an equipment hardware operating environment related to an embodiment of a parameter processing equipment based on federated transfer learning according to the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for processing parameters based on federated transfer learning according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for processing parameters based on federated transfer learning according to the present invention;
fig. 4 is a schematic flow chart of iterative updating in the parameter processing method based on federated transfer learning according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a parameter processing device based on federal transfer learning, and referring to fig. 1, fig. 1 is a structural schematic diagram of a device hardware operating environment related to the embodiment of the parameter processing device based on federal transfer learning.
As shown in fig. 1, the parameter processing device based on federated migration 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. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the hardware architecture of the federated migration learning-based parameter processing device shown in FIG. 1 does not constitute a limitation on the federated migration learning-based parameter processing device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a parameter handler based on federal migration learning. The operating system is a program for managing and controlling parameter processing equipment and software resources based on the federal transfer learning, and supports the operation of a network communication module, a user interface module, a parameter processing program based on the federal transfer learning and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.
In the hardware structure of the parameter processing device based on federal migration learning shown in fig. 1, the network interface 1004 is mainly used for connecting a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; the processor 1001 may invoke a federal transfer learning based parameter handler stored in the memory 1005 and perform the following operations:
the first terminal calls a first feature conversion function to respectively perform feature conversion on a first labeling sample and a first overlapping sample in the first terminal to obtain a first labeling sample feature and a first overlapping sample feature;
the first terminal generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result based on the first overlapped sample feature, the first labeled sample feature and the first labeled sample label according to a loss function consisting of a sample feature distance function and a labeled prediction model error function;
the first terminal decomposes the intermediate result of the first secret sharing calculation through a secret sharing mechanism to obtain a first share of the intermediate result of the first secret sharing calculation and a second share of the intermediate result of the first secret sharing calculation, sends the second share of the intermediate result of the first secret sharing calculation to the second terminal so that the second terminal can generate a second parameter gradient, and updates a second parameter according to the second parameter gradient, wherein the second parameter comprises all parameters of a second characteristic conversion function, parameters to be updated of a sample characteristic distance function and parameters to be updated of a federal annotation prediction model;
the first terminal receives a first share of a second secret sharing calculation intermediate result sent by the second terminal, generates a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, the first private loss value and the first private parameter gradient, and updates a first parameter according to the first parameter gradient, wherein the first parameter comprises all parameters of a first characteristic conversion function, a parameter to be updated of a sample characteristic distance function and a parameter to be updated of a federal annotation prediction model.
Further, the step of generating, by the first terminal, a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, the first private loss value and the first private parameter gradient includes:
the first terminal generates a first share of a secret sharing loss value, a first share of a first secret sharing parameter gradient and a first share of a second secret sharing parameter gradient according to a first share of a first secret sharing calculation intermediate result and a first share of a second secret sharing calculation intermediate result, based on a secret sharing mechanism, and sends the first share of the second secret sharing parameter gradient to the second terminal so that the second terminal can generate a second parameter gradient;
the first terminal receives a second share of the secret sharing loss value, a second share of the first secret sharing parameter gradient and a second private loss value sent by the second terminal, generates a total loss value according to the first private loss value, the second private loss value, the first share of the secret sharing loss value and the second share of the secret sharing loss value, and generates a first parameter gradient according to the first private parameter gradient, the first share of the first secret sharing parameter gradient and the second share of the first secret sharing parameter gradient.
Further, the step of updating the first parameter according to the total loss value and the first parameter gradient comprises:
the first terminal judges whether the total loss value is smaller than a preset threshold value;
if the total loss value is smaller than a preset threshold value, judging that the Nippon training is finished, stopping the training by the first terminal, and sending a training stop signal to the second terminal;
and if the total loss value is not less than the preset threshold value, updating the first parameter through the first parameter gradient, and sending a training continuation signal to the second terminal.
Further, after the step of determining that the federal training is finished, the processor 1001 is further configured to call a parameter handler based on federal migration learning stored in the memory 1005, and perform the following operations:
when the first terminal receives a label prediction request for an unlabeled sample of a second terminal, performing feature conversion on the first labeled sample according to a trained first feature conversion function to obtain a first labeled sample feature, generating a first secret shared label prediction intermediate result based on the first labeled sample feature and a first labeled sample label, decomposing the first secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the first secret shared label prediction intermediate result and a second share of the first secret shared label prediction intermediate result, and sending the second share of the first secret shared label prediction intermediate result to the second terminal so that the second terminal can generate a second label prediction result;
the first terminal receives a first share of a second secret shared label predicted intermediate result sent by the second terminal, and generates a first label prediction result according to the first share of the first secret shared label predicted intermediate result and the first share of the second secret shared label predicted intermediate result;
and the first terminal receives a second label prediction result sent by the second terminal, generates a label prediction result according to the first label prediction result and the second label prediction result, and finishes the labeling of the unlabeled sample in the second terminal.
Further, the processor 1001 is further configured to call a parameter handler based on federated migration learning stored in the memory 1005, and perform the following operations:
the second terminal calls a second feature conversion function, after the parameters of the second feature conversion function are initialized, feature conversion is carried out on a second labeling sample and a second overlapped sample of the second terminal according to the second feature function to generate a second labeling sample feature and a second overlapped sample feature, and a second private loss value, a second private parameter gradient and a second secret sharing calculation intermediate result are generated according to a loss function formed by a sample feature distance function and a labeling prediction model error function and based on the second overlapped sample feature, the second labeling sample feature and a second labeling sample label;
and the second terminal decomposes the second secret sharing calculation intermediate result through a secret sharing mechanism to obtain a first share of the second secret sharing calculation intermediate result and a second share of the second secret sharing calculation intermediate result, and sends a second private loss value and the first share of the second secret sharing calculation intermediate result to the first terminal.
Further, the step of sending the second private loss value and the first share of the intermediate result of the second secret sharing calculation to the first terminal includes:
the second terminal receives a second share of the first secret sharing calculation intermediate result sent by the first terminal, generates a second share of the secret sharing loss value, a second share of the first secret sharing parameter gradient and a second share of the second secret sharing parameter gradient according to the second share of the first secret sharing calculation intermediate result and the second share of the second secret sharing calculation intermediate result, and sends the second share of the secret sharing loss value and the second share of the first secret sharing parameter gradient to the first terminal based on a secret sharing mechanism so that the first terminal can generate a total loss value and a first parameter gradient;
and the second terminal receives the first share of the second secret sharing parameter gradient sent by the first terminal, generates a second parameter gradient according to the second private parameter gradient, the first share of the second secret sharing parameter gradient and the second share of the second secret sharing parameter gradient, and updates the second parameter according to the second parameter gradient.
Further, the step of updating the second parameter according to the second parameter gradient comprises:
if the second terminal receives a training continuation signal sent by the first terminal, the second terminal updates a second parameter through a second parameter gradient;
and if the second terminal receives the training stopping signal sent by the first terminal, the second terminal stops training.
Further, after the step of stopping training of the second terminal, the processor 1001 is further configured to call a parameter processing program based on federal migration learning stored in the memory 1005, and perform the following operations:
the second terminal calls a trained second feature conversion function to perform feature conversion on the unlabeled sample of the second terminal to obtain the unlabeled sample feature, and generates a second secret shared label prediction intermediate result based on the unlabeled sample feature according to the trained labeling prediction model;
the second terminal decomposes the second secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the second secret shared label prediction intermediate result and a second share of the second secret shared label prediction intermediate result, and sends the first share of the second secret shared label prediction intermediate result to the first terminal so that the first terminal can generate a first prediction result;
and the second terminal receives a second share of the intermediate result of the first secret shared label prediction sent by the first terminal, generates a second label prediction result according to the second share of the intermediate result of the second secret shared label prediction and the second share of the intermediate result of the first secret shared label prediction, and sends the second label prediction result to the first terminal so that the first terminal can generate the label prediction result.
The specific implementation of the parameter processing device based on the federal migration learning of the present invention is basically the same as each embodiment of the parameter processing method based on the federal migration learning described below, and is not described herein again.
The invention also provides a parameter processing method based on the federal transfer learning.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a parameter processing method based on federal transfer learning according to the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than here.
The parameter processing method based on federal transfer learning in the embodiment of the present invention is applied to the first terminal, and the first terminal and the second terminal in the embodiment of the present invention may be respectively terminal devices such as a PC and a portable computer, which are not specifically limited herein.
Specifically, the parameter processing method based on federal transfer learning in this embodiment includes:
step S10, the first terminal calls a first feature transformation function to respectively perform feature transformation on a first labeling sample and a first overlapping sample in the first terminal to obtain a first labeling sample feature and a first overlapping sample feature;
with the development of science and technology, machine learning becomes one of the core research fields of artificial intelligence, and how to continue machine learning on the premise of protecting data privacy and meeting legal compliance requirements is a trend of current attention in the field of machine learning.
The Federal learning utilizes a technical algorithm to encrypt a built model, both Federal parties can train the model to obtain model parameters under the condition that own Data is not given, the Federal learning protects the privacy of user Data through a parameter exchange mode under an encryption mechanism, the Data and the model can not be transmitted, and the Data of the opposite party can not be guessed reversely, so that the possibility of leakage does not exist in a Data layer, and a stricter Data protection law such as GDPR (General Data protection Regulation ) and the like can be violated, and the Data privacy can be guaranteed while the Data integrity is kept to a higher degree.
One prerequisite for the application of existing distributed machine learning techniques, including federated learning, is that the data on each node in the distribution is highly coincident in the sample space or feature space. However, in many real scenes, data distributed on each node is often heterogeneous, that is, the coincidence degree of the data on the sample space and the feature space is low. Moreover, the sample data in the real scene often has the problem of label missing. The problem of data heterogeneity and label missing causes difficulty in application of the distributed machine learning technology in real scenes. On the other hand, as privacy protection for consumers in various countries is increasingly emphasized, research and application of a distributed machine learning technology based on privacy protection are becoming hot spots. However, one of the challenges in employing privacy preserving techniques is that their computational cost is often prohibitive. This makes the distributed machine learning technique based on privacy protection much less viable. In order to realize effective marking of the heterogeneous data and reduce the calculation cost, the invention provides various embodiments of the parameter processing method based on the federal migration learning.
One type of federal migration federal learning in this embodiment refers to a case where users of two data sets (i.e., data in the first terminal and the second terminal in this embodiment of the present invention) have less overlap with user features, and migration learning is used to overcome data or label deficiency without segmenting data. For example, there are two different institutions, one being a bank located in china and the other being an e-commerce located in the united states. Due to regional limitation, the user population intersection of the two organizations is very small. Meanwhile, due to the difference of mechanism types, the data characteristics of the two are only partially overlapped. At this time, a federal migration learning mode needs to be introduced to solve the problems of small unilateral data size and few label samples.
This exampleIn the method, a first feature conversion function and a second feature conversion function are preset in the first terminal and the second terminal respectively
Figure BDA0002370623240000141
And
Figure BDA0002370623240000142
characterization, wherein θAAnd thetaBAre respectively as
Figure BDA0002370623240000143
And
Figure BDA0002370623240000144
the first function parameter and the second function parameter are obtained by multiple iterations of each item of data in the first terminal and each item of data in the second terminal. Defining the data in the first terminal as a first labeled sample, wherein the corresponding labels are first labeled sample labels, and respectively using XAAnd YAAnd (5) characterizing. Defining the data in the second terminal as a second original sample, using XBCharacterizing; the X isBThe data processing method comprises two parts, wherein one part is marked data with a label, and the other part is unmarked data without a label; wherein the data with label and its label are defined as second labeled sample and second labeled sample label of second terminal, respectively
Figure BDA0002370623240000145
And
Figure BDA0002370623240000146
characterization, data without label is defined as unlabeled sample of the second terminal
Figure BDA0002370623240000147
And (5) characterizing. In addition, for the overlapping samples which carry the same identifier between the first terminal and the second terminal and are characterized as having between the first terminal and the second terminal, the overlapping samples are respectively defined as a first overlapping sample of the first terminal and a second overlapping sample of the second terminal, and the overlapping samples are used
Figure BDA0002370623240000148
And
Figure BDA0002370623240000149
characterization, wherein
Figure BDA00023706232400001410
In order to label the data which is not labeled in the second terminal, the federated label prediction model needs to be trained first, and the parameters to be updated are updated through multiple times of training, so that the accuracy of labeling the data which is not labeled is ensured. Specifically, the first characteristic conversion function is set according to the requirement
Figure BDA00023706232400001411
Middle first function parameter thetaABefore the iterative update, the first function parameter theta of the setting is firstly updatedAPerforming initialization to facilitate the first characteristic transfer function
Figure BDA00023706232400001412
The use of (1). Thereafter, a first feature transfer function is called
Figure BDA00023706232400001413
For the first labeled sample XAPerforming characteristic conversion to obtain a first labeled sample characteristic UA(ii) a Simultaneous first feature transfer function
Figure BDA00023706232400001414
For the first overlapped sample in the first terminal
Figure BDA00023706232400001415
Performing feature conversion to obtain first overlapped sample features
Figure BDA00023706232400001416
The first labeled sample feature and the first overlapped sample feature are obtained by respective formulas
Figure BDA00023706232400001417
And formula
Figure BDA00023706232400001418
To obtain the compound.
Step S20, the first terminal generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result based on the first overlapped sample feature, the first labeled sample feature and the first labeled sample label according to a loss function composed of a sample feature distance function and a labeled prediction model error function;
further, the first terminal determines the distance function by the sample feature
Figure BDA0002370623240000151
And labeling the prediction model error function
Figure BDA0002370623240000152
A loss function of composition to label the first sample feature UAFirst overlapping sample features
Figure BDA0002370623240000153
And its own first labeled sample label YAA calculation is performed to generate a first gradient intermediate result for aiding in the calculation of the loss function L. The sample characteristic distance function is used for converting samples in the first terminal and the second terminal to obtain the distance of the sample characteristic between the first terminal and the second terminal; the label prediction model error function representation utilizes a sample labeled in the second terminal to perform supervised learning to continuously reduce the error obtained between the prediction label and the actual label; the loss function can be used for representing a function with minimum difference of each item of data in the first terminal and the second terminal, and the first gradient intermediate result comprises a first private loss value LAFirst secret sharing computing intermediate results
Figure BDA0002370623240000154
And a first private parameter gradient
Figure BDA0002370623240000155
First private loss value LAThe unique loss of the first terminal is obtained by the independent calculation of the first terminal; first secret sharing computing intermediate result
Figure BDA0002370623240000156
For the intermediate result set, including the pair parameter LABAnd
Figure BDA0002370623240000158
calculated coefficient, wherein parameter LABThe parameter is a parameter dependent on data of both the first terminal and the second terminal and obtained by cooperative calculation based on secret sharing by both the first terminal and the second terminal, and the calculation formula is
Figure BDA0002370623240000159
Figure BDA00023706232400001510
Is LABFor the first function parameter thetaAThe parameters obtained by taking the partial derivatives are calculated,
Figure BDA00023706232400001511
is LABFor the second function parameter thetaBParameters obtained by partial derivatives, and
Figure BDA00023706232400001512
obtained by the first terminal and the second terminal through the cooperative calculation of secret sharing, and the calculation formula is
Figure BDA00023706232400001513
Obtained by the first terminal and the second terminal through the cooperative calculation of secret sharing, and the calculation formula is
Figure BDA00023706232400001514
In addition, the method can be used for producing a composite materialFirst private parameter gradient
Figure BDA00023706232400001515
Is LAWith respect to the first function parameter thetaAOf the gradient of (c).
Step S30, the first terminal decomposes the intermediate result of the first secret sharing calculation through a secret sharing mechanism to obtain a first share of the intermediate result of the first secret sharing calculation and a second share of the intermediate result of the first secret sharing calculation, and sends the second share of the intermediate result of the first secret sharing calculation to the second terminal, so that the second terminal can generate a second parameter gradient, and updates a second parameter according to the second parameter gradient, wherein the second parameter comprises all parameters of a second characteristic conversion function, parameters to be updated of a sample characteristic distance function and parameters to be updated of a federal labeling prediction model;
further, the first terminal calculates an intermediate result for the generated first secret sharing through the secret sharing mechanism
Figure BDA0002370623240000161
Performing a decomposition into a first share of the intermediate result of the first secret sharing calculation
Figure BDA0002370623240000162
Sharing a second share of the intermediate result with the first secret
Figure BDA0002370623240000163
Thereafter, the first terminal shares the first secret with a second share of the intermediate result
Figure BDA0002370623240000164
Is sent to the second terminal so that the second terminal can generate the second parameter gradient
Figure BDA0002370623240000165
And updating the second parameter according to the second parameter gradient. The second parameters comprise all parameters of the second feature conversion function, and a sample feature distance function and a federal label predictionPartial parameters needing to be updated in the model; the parameters in the sample characteristic distance function and the federal labeling prediction model are from the first terminal and the second terminal, only part of the parameters are updated, and the part of the parameters needing to be updated are used as respective parameters to be updated.
Specifically, the second terminal firstly compares the second characteristic parameter function therein
Figure BDA0002370623240000166
Second function parameter θBPerforming initialization to facilitate the second characteristic transfer function
Figure BDA0002370623240000167
The use of (1). Thereafter, a second feature transfer function is called
Figure BDA0002370623240000168
Second annotated sample in second terminal
Figure BDA0002370623240000169
And a second overlapping sample
Figure BDA00023706232400001610
Performing feature conversion to obtain the second labeled sample feature
Figure BDA00023706232400001611
And second overlapping sample features
Figure BDA00023706232400001612
The process of obtaining the second annotated sample feature and the second overlaid sample feature may be formulated separately
Figure BDA00023706232400001613
And formula
Figure BDA00023706232400001614
Figure BDA00023706232400001615
To be implemented.
Thereafter, the second terminal passes through the sample feature distance function
Figure BDA00023706232400001616
And labeling the prediction model error function
Figure BDA00023706232400001617
Loss function of composition, second labeled sample feature
Figure BDA00023706232400001618
Second overlapping sample features
Figure BDA00023706232400001619
And its own second labeled exemplar label
Figure BDA00023706232400001620
And performing calculation to generate a second gradient intermediate result for assisting in calculating the loss function L. The second gradient intermediate result includes a second private loss value LBSecond secret sharing computing intermediate results
Figure BDA00023706232400001621
And a second private parameter gradient
Figure BDA00023706232400001622
Second private loss value LBThe unique loss of the second terminal is obtained by independent calculation of the second terminal; second secret sharing computing intermediate results
Figure BDA0002370623240000171
Computing intermediate results for the set of intermediate results, including parameters and a first secret share
Figure BDA0002370623240000172
The calculation method is the same, but one of the two is calculated at the first terminal, and the other is calculated at the second terminal, which is not described herein again. Second private parameter gradient
Figure BDA0002370623240000173
Is LBWith respect to the gradient of the second function parameter.
Further, the second terminal calculates an intermediate result for the second secret sharing
Figure BDA0002370623240000174
Performing decomposition to obtain the first share of the intermediate result of the second secret sharing calculation
Figure BDA0002370623240000175
Sharing a second share of the intermediate result with a second secret
Figure BDA0002370623240000176
And a second private loss value LBSharing a first share of the intermediate result with a second secret
Figure BDA0002370623240000177
Is transmitted to the first terminal, where LBIs a numerical value, which does not cause information leakage of the second terminal.
Step S40, the first terminal receives a first share of a second secret sharing calculation intermediate result sent by the second terminal, generates a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, a first private loss value and the first private parameter gradient, and updates a first parameter according to the first parameter gradient, wherein the first parameter comprises all parameters of a first characteristic conversion function, parameters to be updated of a sample characteristic distance function and parameters to be updated of a federal labeling prediction model;
further, the first terminal receives the first share of the intermediate result of the second secret sharing calculation sent by the second terminal
Figure BDA0002370623240000178
Then, first combined with the first secret shared computing intermediate result obtained by its own decompositionFirst quota
Figure BDA0002370623240000179
First private loss value LAAnd a first private parameter gradient
Figure BDA00023706232400001710
Generating a total loss value L and a first parameter gradient
Figure BDA00023706232400001711
Then the gradient of the first parameter
Figure BDA00023706232400001712
Updating a first parameter, wherein the first parameter comprises all parameters of the first characteristic conversion function, and part of parameters needing to be updated in the sample characteristic distance function and the federal labeling prediction model; the parameters in the sample characteristic distance function and the federal labeling prediction model are from the first terminal and the second terminal, only part of the parameters are updated, and the part of the parameters needing to be updated are used as respective parameters to be updated.
Specifically, the first terminal calculates a first share of an intermediate result for the first secret sharing based on the secret sharing mechanism
Figure BDA0002370623240000181
Sharing a first share of the intermediate result with a second secret
Figure BDA0002370623240000182
Calculating to obtain the first share of the secret sharing loss value less than LABAFirst share of first secret sharing parameter gradient
Figure BDA0002370623240000183
First share of second secret sharing parameter gradient
Figure BDA0002370623240000184
Then the first share of the gradient of the second secret sharing parameter obtained by calculation is used
Figure BDA0002370623240000185
Sending the parameter gradient to the second terminal so as to generate the second parameter gradient by the second terminal
Figure BDA0002370623240000186
Further, the second terminal calculates the second share of the intermediate result by sharing the first secret sent by the first terminal received before based on the secret sharing mechanism
Figure BDA0002370623240000187
And sharing the intermediate result by its own second secret
Figure BDA0002370623240000188
The decomposed second secret shares a second share of the intermediate result
Figure BDA0002370623240000189
A second share of the secret sharing loss value < LABBSending the second share of the first secret sharing parameter gradient to the first terminal
Figure BDA00023706232400001810
For the first terminal to generate the total loss value L and the first parameter gradient
Figure BDA00023706232400001811
Combine to generate a second share of the secret sharing loss value<LAB>BThe second share of the gradient of the first secret sharing parameter
Figure BDA00023706232400001812
Second share of second secret sharing parameter gradient
Figure BDA00023706232400001813
And sharing the second share of the loss value with the secret generated thereby<LAB>BIs shared with the first secretSharing the second share of the parameter gradient
Figure BDA00023706232400001814
Sent to the first terminal so that the first terminal can generate the total loss value L and the first parameter gradient
Figure BDA00023706232400001815
The first terminal receiving the second share of the secret sharing loss value < LAB>BAnd a second share of the first secret shared parameter gradient
Figure BDA00023706232400001816
Then, the first private loss value L can be determinedASecond private loss value LBSecret sharing the first share of the loss value<LAB>AAnd a second share of the secret sharing loss value<LAB>BThe total loss value L is generated. The specific way of generating the total loss value is shown in formula (1):
L=LA+LB+<LAB>A+<LAB>B(1);
in addition, the first terminal is according to the first private parameter gradient
Figure BDA00023706232400001817
First share of first secret sharing parameter gradient
Figure BDA00023706232400001818
And a second share of the first secret shared parameter gradient
Figure BDA00023706232400001819
Generating a first parameter gradient
Figure BDA00023706232400001820
Specifically, as shown in formula (2):
Figure BDA0002370623240000191
at the same time, the second terminal will receive the first share of the second secret sharing parameter gradient
Figure BDA0002370623240000192
Second private parameter gradient generated in combination with itself
Figure BDA0002370623240000193
And a second secret sharing a second share of the parameter gradient
Figure BDA0002370623240000194
Generating a second parametric gradient
Figure BDA0002370623240000195
Specifically, as shown in formula (3):
Figure BDA0002370623240000196
further, generating a first parameter gradient
Figure BDA0002370623240000197
And a second parameter gradient
Figure BDA0002370623240000198
Thereafter, the first parameter in the first terminal and the second parameter in the second terminal may be updated, wherein the θ is the first function parameterAAnd a second function parameter thetaBCan be respectively passed through
Figure BDA0002370623240000199
And formula
Figure BDA00023706232400001910
Figure BDA00023706232400001911
Updating to implement a first characteristic transfer function in the first parameterUpdating all parameters and all parameters of the second characteristic conversion function in the second parameters.
It should be noted that the iterative update process described above in this embodiment can be implemented by the flow shown in fig. 4, where party a and party B in fig. 4 respectively represent the first terminal and the second terminal, and the character labels of the first terminal and the second terminal are the same as the meanings of the text portions, which is not described herein again.
In the embodiment, a first terminal calls a first feature conversion function to perform feature conversion on a first labeled sample and a first overlapped sample, and a loss function consisting of a sample feature distance function and a labeled prediction model error function generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result; and then the first terminal decomposes the intermediate result of the first secret sharing calculation through a secret sharing mechanism to obtain a first share of the intermediate result of the first secret sharing calculation and a second share of the intermediate result of the first secret sharing calculation, and sends the second share of the intermediate result of the first secret sharing calculation to the second terminal, so that the second terminal can generate a second parameter gradient and update the second parameter. In addition, the first terminal receives a first share of a second secret sharing calculation intermediate result sent by the second terminal, generates a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, a first private loss value and the first private parameter gradient, and updates a first parameter according to the first parameter gradient; therefore, the updating of the parameters to be updated in the federated labeling prediction model is realized.
The first parameter is updated according to the processing of the first share obtained by decomposition in the first terminal and the second terminal, the second parameter is updated according to the processing of the second share obtained by decomposition in the first terminal and the second terminal, and the first share and the second share are generated according to the overlapping sample and the respective labeled sample between the first share and the second share, so that the updating of the first parameter and the second parameter is related to the overlapping sample and the respective labeled sample in the first terminal and the second terminal. The overlapped samples represent the correlation between the first terminal and the second terminal, and the respective labeled samples represent the correlation between the labeled samples and the unlabeled samples, so that the first parameter and the second parameter are updated according to the original samples, the overlapped samples and the labeled sample labels of the first terminal and the second terminal, the correlation between the samples is high, and the data heterogeneity is reduced; the problem that a large amount of data needs to be constructed and processed in a real scene due to the heterogeneity of the data is solved, and the efficiency of distributed machine learning is improved. Meanwhile, the data in the first terminal and the second terminal are decomposed through a secret sharing mechanism, and the data obtained through the decomposition of each terminal are exchanged to update the respective parameters. In the whole process, the first terminal and the second terminal do not know any information before decomposition of the other terminal, the safety of private data between the first terminal and the second terminal is ensured, the calculation cost is low, and the popularization and the application of the distributed machine learning technology in a real scene are facilitated.
Further, based on the first embodiment of the parameter processing method based on the federal migration learning, the second embodiment of the parameter processing method based on the federal migration learning is provided.
Referring to fig. 3, the second embodiment of the method for processing parameters based on federated transfer learning differs from the first embodiment of the method for processing parameters based on federated transfer learning in that the step of updating the first parameter according to the total loss value and the first parameter gradient includes:
step S31, the first terminal judges whether the total loss value is less than a preset threshold value;
step S32, if the total loss value is smaller than a preset threshold value, it is judged that the Nippon training is finished, the first terminal stops training, and a training stop signal is sent to the second terminal;
step S33, if the total loss value is not less than the preset threshold, updating the first parameter by the first parameter gradient, and sending a training continuation signal to the second terminal:
understandably, for the federally labeled predictive model, the smaller the value of the total loss value, the more accurate the prediction of the federally labeled predictive model. In order to judge the numerical value of the total loss value, a preset threshold value is preset, the updated total loss value is compared with the preset threshold value, and whether the total loss value is smaller than the preset threshold value is judged. And if the value is smaller than the preset threshold value, judging that the training of the federal label prediction model is finished, stopping the training of the federal label prediction model by the first terminal, and simultaneously sending a training stop signal to the second terminal. And the second terminal stops training after receiving the training stop signal. And when the total loss value is larger than or equal to the preset threshold value, judging that the training of the federal prediction model is not finished, continuously generating a first parameter gradient to update the first parameter, and sending a training continuation signal to the second terminal. And after receiving the training continuation signal, the second terminal continues to generate a second parameter gradient to update the second parameter until the total loss value generated by the first terminal is smaller than a preset threshold value.
Further, based on the second embodiment of the parameter processing method based on federated transfer learning, the third embodiment of the parameter processing method based on federated transfer learning is provided.
Referring to fig. 3, the difference between the third embodiment of the method for processing parameters based on federated transfer learning and the second embodiment of the method for processing parameters based on federated transfer learning is that the step of determining the end of federated training includes:
step S50, when the first terminal receives a label prediction request for an unlabeled sample of the second terminal, performing feature conversion on the first labeled sample according to a trained first feature conversion function to obtain a first labeled sample feature, generating a first secret shared label prediction intermediate result based on the first labeled sample feature and a first labeled sample label, decomposing the first secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the first secret shared label prediction intermediate result and a second share of the first secret shared label prediction intermediate result, and sending the second share of the first secret shared label prediction intermediate result to the second terminal so that the second terminal can generate a second label prediction result;
step S60, the first terminal receives the first share of the second secret shared label prediction intermediate result sent by the second terminal, and generates a first label prediction result according to the first share of the first secret shared label prediction intermediate result and the first share of the second secret shared label prediction intermediate result;
step S70, the first terminal receives the second label prediction result sent by the second terminal, and generates a label prediction result according to the first label prediction result and the second label prediction result, thereby completing the labeling of the unlabeled sample in the second terminal.
The embodiment is a process of performing label prediction on an unlabeled sample in the second terminal after the model training based on federated migration is completed. Specifically, when a first terminal receives a request for performing label prediction on an unlabeled sample in a second terminal, feature conversion is performed on the first labeled sample through a trained first feature conversion function to obtain a first labeled sample feature UAAnd labeling the first labeled sample characteristic U in the first terminalAAnd a first labeled exemplar label YACalculating to generate a first secret shared label prediction intermediate result KA. Thereafter, predicting an intermediate result K for the first secret shared label based on the secret sharing mechanismADecomposing to obtain a first secret shared label prediction intermediate result with a first quota < KAAAnd a second share of the first secret shared tag prediction intermediate result < KABAnd predicting a second share of the intermediate result by the first secret shared tag < KABSending the predicted result to the second terminal for the second terminal to generate a second label prediction result
Figure BDA0002370623240000221
The second terminal calls the trained second feature conversion function first and carries out the second function parameter theta in the second feature conversion functionBCarrying out initialization; and then, the unlabeled samples in the second terminal are subjected to second characteristic transfer functions
Figure BDA0002370623240000222
Performing feature conversion to obtain the features of the unlabeled sample
Figure BDA0002370623240000223
Thereafter, unlabeled sample features are subjected to the trained labeled prediction model
Figure BDA0002370623240000224
Calculating to obtain a second secret shared label prediction intermediate result KB. The second terminal predicts an intermediate result K for the second secret sharing label based on the secret sharing mechanismBDecomposing to obtain a first share (K) of the intermediate result of the second secret sharing label predictionB>APredicting a second share of the intermediate result with a second secret shared tag<KB>BThen, the second secret sharing label is used for predicting the first share of the intermediate result<KB>ASending the prediction result to the first terminal for the first terminal to generate a first prediction result
Figure BDA0002370623240000225
In addition, the second terminal predicts a second share of the intermediate result from the first secret shared label sent by the first terminal<KA>BSecond share of intermediate result of second secret shared label prediction obtained by decomposing with itself<KB>BCombining to generate a second label prediction result
Figure BDA0002370623240000226
And predicting the result of the second label
Figure BDA0002370623240000227
Sending the label prediction result to the first terminal for the first terminal to generate the label prediction result according to the label prediction result
Figure BDA0002370623240000231
Further, the first terminal predicts the intermediate result after receiving the second secret shared label transmitted by the second terminalFirst quota of<KBAThen, the first share of the intermediate result is predicted to be less than K with the first secret shared labelAAAnd generates a first label prediction result
Figure BDA0002370623240000232
Second label prediction results to be received thereafter
Figure BDA0002370623240000233
And the generated first label prediction result
Figure BDA0002370623240000234
Generating a label prediction result through a formula (4), and realizing the labeling of the unlabeled sample in the second terminal; wherein equation (4) is:
Figure BDA0002370623240000235
according to the parameter processing method based on the federal transfer learning, label prediction is carried out on unlabeled samples in the second terminal by combining various sample data in the first terminal and the second terminal through a trained federal label prediction model; the federal labeling prediction model has high accuracy and has high relevance with sample data between the first terminal and the second terminal, so that the accuracy of label prediction of unlabeled samples is ensured.
In addition, the embodiment of the invention also provides a storage medium.
The storage medium stores a parameter processing program based on the federal transfer learning, and the parameter processing program based on the federal transfer learning realizes the steps of the parameter processing method based on the federal transfer learning when being executed by the processor.
The specific implementation of the storage medium of the present invention is substantially the same as the embodiments of the parameter processing method based on federated migration learning, and is not described herein again.
The present invention is described in connection with the accompanying drawings, but the present invention is not limited to the above embodiments, which are only illustrative and not restrictive, and those skilled in the art can make various changes without departing from the spirit and scope of the invention as defined by the appended claims, and all changes that come within the meaning and range of equivalency of the specification and drawings that are obvious from the description and the attached claims are intended to be embraced therein.

Claims (10)

1. A parameter processing method based on federated transfer learning is characterized by comprising the following steps:
the first terminal calls a first feature conversion function to respectively perform feature conversion on a first labeling sample and a first overlapping sample in the first terminal to obtain a first labeling sample feature and a first overlapping sample feature;
the first terminal generates a first private loss value, a first private parameter gradient and a first secret sharing calculation intermediate result based on the first overlapped sample feature, the first labeled sample feature and the first labeled sample label according to a loss function consisting of a sample feature distance function and a labeled prediction model error function;
the first terminal decomposes the intermediate result of the first secret sharing calculation through a secret sharing mechanism to obtain a first share of the intermediate result of the first secret sharing calculation and a second share of the intermediate result of the first secret sharing calculation, sends the second share of the intermediate result of the first secret sharing calculation to the second terminal so that the second terminal can generate a second parameter gradient, and updates a second parameter according to the second parameter gradient, wherein the second parameter comprises all parameters of a second characteristic conversion function, parameters to be updated of a sample characteristic distance function and parameters to be updated of a federal annotation prediction model;
the first terminal receives a first share of a second secret sharing calculation intermediate result sent by the second terminal, generates a total loss value and a first parameter gradient according to the first share of the first secret sharing calculation intermediate result, the first share of the second secret sharing calculation intermediate result, the first private loss value and the first private parameter gradient, and updates a first parameter according to the total loss value and the first parameter gradient, wherein the first parameter comprises all parameters of a first characteristic conversion function, parameters to be updated of a sample characteristic distance function and parameters to be updated of a federal labeling prediction model.
2. The method according to claim 1, wherein the step of generating the total loss value and the first parameter gradient according to the first secret sharing calculation of the first share of the intermediate result, the second secret sharing calculation of the first share of the intermediate result, the first private loss value and the first private parameter gradient by the first terminal comprises:
the first terminal generates a first share of a secret sharing loss value, a first share of a first secret sharing parameter gradient and a first share of a second secret sharing parameter gradient according to a first share of a first secret sharing calculation intermediate result and a first share of a second secret sharing calculation intermediate result, based on a secret sharing mechanism, and sends the first share of the second secret sharing parameter gradient to the second terminal so that the second terminal can generate a second parameter gradient;
the first terminal receives a second share of the secret sharing loss value, a second share of the first secret sharing parameter gradient and a second private loss value sent by the second terminal, generates a total loss value according to the first private loss value, the second private loss value, the first share of the secret sharing loss value and the second share of the secret sharing loss value, and generates a first parameter gradient according to the first private parameter gradient, the first share of the first secret sharing parameter gradient and the second share of the first secret sharing parameter gradient.
3. The method for processing parameters based on federal transfer learning according to any one of claims 1-2, wherein the step of updating the first parameter according to the total loss value and the first parameter gradient comprises:
the first terminal judges whether the total loss value is smaller than a preset threshold value;
if the total loss value is smaller than a preset threshold value, judging that the Nippon training is finished, stopping the training by the first terminal, and sending a training stop signal to the second terminal;
and if the total loss value is not less than the preset threshold value, updating the first parameter through the first parameter gradient, and sending a training continuation signal to the second terminal.
4. The method of claim 3, wherein the step of determining the end of federal training is followed by the step of:
when the first terminal receives a label prediction request for an unlabeled sample of a second terminal, performing feature conversion on the first labeled sample according to a trained first feature conversion function to obtain a first labeled sample feature, generating a first secret shared label prediction intermediate result based on the first labeled sample feature and a first labeled sample label, decomposing the first secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the first secret shared label prediction intermediate result and a second share of the first secret shared label prediction intermediate result, and sending the second share of the first secret shared label prediction intermediate result to the second terminal so that the second terminal can generate a second label prediction result;
the first terminal receives a first share of a second secret shared label predicted intermediate result sent by the second terminal, and generates a first label prediction result according to the first share of the first secret shared label predicted intermediate result and the first share of the second secret shared label predicted intermediate result;
and the first terminal receives a second label prediction result sent by the second terminal, generates a label prediction result according to the first label prediction result and the second label prediction result, and finishes the labeling of the unlabeled sample in the second terminal.
5. A parameter processing method based on federated transfer learning is characterized by comprising the following steps:
the second terminal calls a second feature conversion function, after the parameters of the second feature conversion function are initialized, feature conversion is carried out on a second labeling sample and a second overlapped sample of the second terminal according to the second feature function to generate a second labeling sample feature and a second overlapped sample feature, and a second private loss value, a second private parameter gradient and a second secret sharing calculation intermediate result are generated according to a loss function formed by a sample feature distance function and a labeling prediction model error function and based on the second overlapped sample feature, the second labeling sample feature and a second labeling sample label;
and the second terminal decomposes the second secret sharing calculation intermediate result through a secret sharing mechanism to obtain a first share of the second secret sharing calculation intermediate result and a second share of the second secret sharing calculation intermediate result, and sends a second private loss value and the first share of the second secret sharing calculation intermediate result to the first terminal.
6. The method for processing parameters based on federated transfer learning as defined in claim 5, wherein the step of sending the second private loss value and the first share of the intermediate result of the second secret sharing computation to the first terminal includes:
the second terminal receives a second share of the first secret sharing calculation intermediate result sent by the first terminal, generates a second share of the secret sharing loss value, a second share of the first secret sharing parameter gradient and a second share of the second secret sharing parameter gradient according to the second share of the first secret sharing calculation intermediate result and the second share of the second secret sharing calculation intermediate result, and sends the second share of the secret sharing loss value and the second share of the first secret sharing parameter gradient to the first terminal based on a secret sharing mechanism so that the first terminal can generate a total loss value and a first parameter gradient;
and the second terminal receives the first share of the second secret sharing parameter gradient sent by the first terminal, generates a second parameter gradient according to the second private parameter gradient, the first share of the second secret sharing parameter gradient and the second share of the second secret sharing parameter gradient, and updates the second parameter according to the second parameter gradient.
7. The method of claim 6, wherein the step of updating the second parameter according to the second parameter gradient comprises:
if the second terminal receives a training continuation signal sent by the first terminal, the second terminal updates a second parameter through a second parameter gradient;
and if the second terminal receives the training stopping signal sent by the first terminal, the second terminal stops training.
8. The federal transfer learning-based parameter processing method of claim 7, wherein the step of stopping training of the second terminal is followed by:
the second terminal calls a trained second feature conversion function to perform feature conversion on the unlabeled sample of the second terminal to obtain the unlabeled sample feature, and generates a second secret shared label prediction intermediate result based on the unlabeled sample feature according to the trained labeling prediction model;
the second terminal decomposes the second secret shared label prediction intermediate result based on a secret sharing mechanism to obtain a first share of the second secret shared label prediction intermediate result and a second share of the second secret shared label prediction intermediate result, and sends the first share of the second secret shared label prediction intermediate result to the first terminal so that the first terminal can generate a first prediction result;
and the second terminal receives a second share of the intermediate result of the first secret shared label prediction sent by the first terminal, generates a second label prediction result according to the second share of the intermediate result of the second secret shared label prediction and the second share of the intermediate result of the first secret shared label prediction, and sends the second label prediction result to the first terminal so that the first terminal can generate the label prediction result.
9. A parameter processing apparatus based on federated migration learning, characterized in that the parameter processing apparatus based on federated migration learning includes a memory, a processor and a parameter processing program based on federated migration learning stored on the memory and operable on the processor, and when being executed by the processor, the parameter processing program based on federated migration learning implements the steps of the parameter processing method based on federated migration learning as set forth in any one of claims 1-8.
10. A storage medium, wherein the storage medium stores thereon a parameter processing program based on federated migration learning, and the parameter processing program based on federated migration learning realizes the steps of the parameter processing method based on federated migration learning as defined in any one of claims 1-8 when being executed by a processor.
CN202010049512.2A 2020-01-16 2020-01-16 Parameter processing method, device and storage medium based on federal migration learning Active CN111259446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010049512.2A CN111259446B (en) 2020-01-16 2020-01-16 Parameter processing method, device and storage medium based on federal migration learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010049512.2A CN111259446B (en) 2020-01-16 2020-01-16 Parameter processing method, device and storage medium based on federal migration learning

Publications (2)

Publication Number Publication Date
CN111259446A true CN111259446A (en) 2020-06-09
CN111259446B CN111259446B (en) 2023-08-22

Family

ID=70950731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010049512.2A Active CN111259446B (en) 2020-01-16 2020-01-16 Parameter processing method, device and storage medium based on federal migration learning

Country Status (1)

Country Link
CN (1) CN111259446B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000988A (en) * 2020-08-28 2020-11-27 深圳前海微众银行股份有限公司 Factorization machine regression model construction method and device and readable storage medium
CN112016698A (en) * 2020-08-28 2020-12-01 深圳前海微众银行股份有限公司 Factorization machine model construction method and device and readable storage medium
CN112257105A (en) * 2020-10-19 2021-01-22 中山大学 Federal learning method and system based on parameter replacement algorithm
CN112651511A (en) * 2020-12-04 2021-04-13 华为技术有限公司 Model training method, data processing method and device
CN113449329A (en) * 2021-08-31 2021-09-28 国网浙江省电力有限公司信息通信分公司 Energy data fusion calculation method under federal learning scene based on safe sharing
CN114648130A (en) * 2022-02-07 2022-06-21 北京航空航天大学 Longitudinal federal learning method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543031A (en) * 2018-10-16 2019-03-29 华南理工大学 A kind of file classification method based on multitask confrontation study
CN109886342A (en) * 2019-02-26 2019-06-14 视睿(杭州)信息科技有限公司 Model training method and device based on machine learning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543031A (en) * 2018-10-16 2019-03-29 华南理工大学 A kind of file classification method based on multitask confrontation study
CN109886342A (en) * 2019-02-26 2019-06-14 视睿(杭州)信息科技有限公司 Model training method and device based on machine learning

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000988A (en) * 2020-08-28 2020-11-27 深圳前海微众银行股份有限公司 Factorization machine regression model construction method and device and readable storage medium
CN112016698A (en) * 2020-08-28 2020-12-01 深圳前海微众银行股份有限公司 Factorization machine model construction method and device and readable storage medium
CN112257105A (en) * 2020-10-19 2021-01-22 中山大学 Federal learning method and system based on parameter replacement algorithm
CN112651511A (en) * 2020-12-04 2021-04-13 华为技术有限公司 Model training method, data processing method and device
CN112651511B (en) * 2020-12-04 2023-10-03 华为技术有限公司 Model training method, data processing method and device
CN113449329A (en) * 2021-08-31 2021-09-28 国网浙江省电力有限公司信息通信分公司 Energy data fusion calculation method under federal learning scene based on safe sharing
CN114648130A (en) * 2022-02-07 2022-06-21 北京航空航天大学 Longitudinal federal learning method and device, electronic equipment and storage medium
CN114648130B (en) * 2022-02-07 2024-04-16 北京航空航天大学 Longitudinal federal learning method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111259446B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN111259446B (en) Parameter processing method, device and storage medium based on federal migration learning
CN110245510B (en) Method and apparatus for predicting information
CN109002861B (en) Federal modeling method, device and storage medium
CN109284313B (en) Federal modeling method, device and readable storage medium based on semi-supervised learning
WO2021179720A1 (en) Federated-learning-based user data classification method and apparatus, and device and medium
CN113159327B (en) Model training method and device based on federal learning system and electronic equipment
US20210004718A1 (en) Method and device for training a model based on federated learning
WO2020177392A1 (en) Federated learning-based model parameter training method, apparatus and device, and medium
WO2020134704A1 (en) Model parameter training method based on federated learning, terminal, system and medium
JP7095140B2 (en) Multi-model training methods and equipment based on feature extraction, electronic devices and media
CN111368901A (en) Multi-party combined modeling method, device and medium based on federal learning
CN113627085B (en) Transverse federal learning modeling optimization method, equipment and medium
CN111241567A (en) Longitudinal federal learning method, system and storage medium based on secret sharing
CN111612167B (en) Combined training method, device, equipment and storage medium of machine learning model
CN108694238A (en) Business data processing method, device based on block chain and storage medium
WO2021174877A1 (en) Processing method for smart decision-based target detection model, and related device
CN113051586B (en) Federal modeling system and method, federal model prediction method, medium, and device
CN110837653A (en) Label prediction method, device and computer readable storage medium
WO2023216494A1 (en) Federated learning-based user service strategy determination method and apparatus
CN113051239A (en) Data sharing method, use method of model applying data sharing method and related equipment
CN114186256A (en) Neural network model training method, device, equipment and storage medium
CN112016698A (en) Factorization machine model construction method and device and readable storage medium
CN116186755A (en) Privacy calculating method, device, terminal equipment and storage medium
CN111858611A (en) Data access method and device, computer equipment and storage medium
CN117473130A (en) Service processing method, device, equipment, medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant