CN111428887A - Model training control method, device and system based on multiple computing nodes - Google Patents

Model training control method, device and system based on multiple computing nodes Download PDF

Info

Publication number
CN111428887A
CN111428887A CN202010198359.XA CN202010198359A CN111428887A CN 111428887 A CN111428887 A CN 111428887A CN 202010198359 A CN202010198359 A CN 202010198359A CN 111428887 A CN111428887 A CN 111428887A
Authority
CN
China
Prior art keywords
computing node
model
output result
determined
encryption
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
CN202010198359.XA
Other languages
Chinese (zh)
Other versions
CN111428887B (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.)
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Cloud Computing Beijing 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 Tencent Cloud Computing Beijing Co Ltd filed Critical Tencent Cloud Computing Beijing Co Ltd
Priority to CN202010198359.XA priority Critical patent/CN111428887B/en
Publication of CN111428887A publication Critical patent/CN111428887A/en
Application granted granted Critical
Publication of CN111428887B publication Critical patent/CN111428887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning
    • 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/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Technology Law (AREA)
  • Game Theory and Decision Science (AREA)
  • Complex Calculations (AREA)
  • Feedback Control In General (AREA)

Abstract

The embodiment of the application provides a model training control method, a model training control device and a model training control system based on a plurality of computing nodes, which relate to the technical field of data processing, wherein each iteration training process comprises the following steps: the first computing node obtains a first model output result of each first sample data, and determines a model total output result according to each first model output result, each second model output result and a safe multiparty summation protocol; the first computing node determines a loss value, and determines an updating gradient value and an encryption loss value of the iterative training process based on the loss value; and the first computing node updates the first model parameter to be determined in the iterative process based on the updating gradient value, decrypts each encryption gradient value of each second computing node to obtain each decryption gradient value, and each encryption gradient value is determined by each second computing node based on the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node. According to the method and the device, an intermediate party is not required to be introduced, and the safety of each computing node is guaranteed.

Description

Model training control method, device and system based on multiple computing nodes
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a model training control method, device and system based on multiple computing nodes.
Background
In recent years, methods based on machine learning or deep learning have been applied to various technical fields and have had great success due to the wide application of machine learning. When training each machine learning model or deep learning, data required for machine learning often involves a plurality of fields. For example, at least two data owners, namely, enterprise a and enterprise B, are required to train in the machine learning process, and enterprise a owns sales data and enterprise B owns loan data. Further, due to the problems of industry competition, data security, user privacy and the like, data interaction between the enterprise A and the enterprise B cannot be directly carried out due to the consideration of security factors, and data often exists in an isolated island form. Therefore, how to combine multiple data parties to perform joint training of the machine learning model is a problem to be solved urgently in the prior art.
Content of application
The embodiment of the application provides a model training control method, a model training control device and a model training control system based on a plurality of computing nodes, which are used for improving the accuracy and the safety of a combined training model of the computing nodes.
In a first aspect, an embodiment of the present application provides a model training control method based on multiple computing nodes, where the multiple computing nodes include a first computing node and at least one second computing node, the first computing node has a first model parameter to be determined and a first sample data set composed of multiple first sample data, and the second computing node has a respective second model parameter to be determined and a respective second sample data set composed of multiple second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains the determined first model parameters and each second computing node respectively obtains the respective determined second model parameters, wherein each iteration training process comprises the following steps:
the first computing node obtains a first model output result of each first sample data based on the first model parameter to be determined, and determines a model total output result according to each first model output result, each second model output result and the safe multiparty summation protocol, wherein each second model output result is determined by each second computing node based on each second model parameter to be determined and each second sample data of each second computing node;
the first computing node determines a loss value according to the sample label of each sample datum and the total output result of the model, determines an updated gradient value and an encryption loss value of the iterative training process based on the loss value, and sends the encryption loss value to each second computing node;
the first computing node updates the first to-be-determined model parameter of the first computing node in the iteration process based on the updating gradient value, decrypts each encryption gradient value of each second computing node to obtain each decryption gradient value, and sends each decryption gradient value to each corresponding second computing node, wherein each decryption gradient value is used for updating the second to-be-determined model parameter of each second computing node in the iteration process, and each encryption gradient value is determined by each second computing node based on the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node.
In a second aspect, an embodiment of the present application provides a model training control method based on multiple computing nodes, where the multiple computing nodes include a first computing node and at least one second computing node, the first computing node possesses a first model parameter to be determined and a first sample data set composed of multiple first sample data, and the second computing node possesses a respective second model parameter to be determined and a respective second sample data set composed of multiple second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains the determined first model parameters and each second computing node respectively obtains the respective determined second model parameters, wherein each iteration training process comprises the following steps:
each second computing node obtains a second model output result of each second sample data of each second computing node based on the respective second model parameter to be determined;
each second computing node receives an encryption loss value sent by the first computing node, wherein the encryption loss value is determined by the first computing node according to a model total output result determined by the first computing node and a sample label of each sample data, the model total output result is determined by the first computing node according to each first model output result, each second model output result and a safe multiparty summation protocol, and the first model output result is determined by the first computing node based on a first model parameter to be determined and each first sample data;
each second computing node determines corresponding encryption gradient values according to the encryption loss values and the Hadamard product of the encryption random vectors corresponding to the second computing nodes, sends the encryption gradient values to the first computing node, and receives decryption gradient values determined by the first computing node aiming at the encryption gradient values;
and each second computing node updates each second model parameter to be determined in the iteration process according to each corresponding decryption gradient value.
In a third aspect, an embodiment of the present application provides a model training control system based on multiple computing nodes, where the system includes a first computing node and at least one second computing node, the first computing node has a first model parameter to be determined and a first sample data set composed of multiple first sample data, and the second computing node has a respective second model parameter to be determined and a respective second sample data set composed of multiple second sample data;
the first computing node and each second computing node train the model through at least one iterative training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and each second computing node respectively obtains a respective determined second model parameter, wherein each iterative training process the first computing node performs the steps of any one of the methods in the first aspect, updates a first model parameter to be determined of the first computing node in the iterative process, and the second computing node performs the steps of the methods in the second aspect, and updates a second model parameter to be determined of each second computing node in the iterative process.
In a fourth aspect, an embodiment of the present application provides a model training control apparatus based on multiple computing nodes, where the multiple computing nodes include a first computing node and at least one second computing node, the first computing node possesses a first model parameter to be determined and a first sample data set composed of multiple first sample data, and the second computing node possesses a respective second model parameter to be determined and a respective second sample data set composed of multiple second sample data;
the model training control device comprises a model total output result determining unit, a loss value determining unit and a first model parameter updating unit, wherein the model training control device comprises a model total output result determining unit, a loss value determining unit and a first model parameter updating unit;
wherein, in each iterative training process, the model total output result determining unit is used for:
obtaining a first model output result of each first sample data based on the first model parameter to be determined, and determining a model total output result according to each first model output result, each second model output result and a safe multiparty summation protocol, wherein each second model output result is determined by each second computing node based on each second model parameter to be determined and each second sample data of each second computing node;
the loss value determination unit is to: determining a loss value according to the sample label of each sample data and the total output result of the model, determining an updated gradient value and an encryption loss value of the iterative training process based on the loss value, and sending the encryption loss value to each second computing node;
the first model parameter updating unit is used for: and updating the first to-be-determined model parameter of the first computing node in the iteration process based on the updating gradient value, decrypting each encryption gradient value of each second computing node to obtain each decryption gradient value, and sending each decryption gradient value to each corresponding second computing node, wherein each decryption gradient value is used for updating the second to-be-determined model parameter of each second computing node in the iteration process, and each encryption gradient value is determined by each second computing node based on the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node.
In a fifth aspect, an embodiment of the present application provides a model training control apparatus based on multiple computing nodes, where the multiple computing nodes include a first computing node and at least one second computing node, the first computing node possesses a first model parameter to be determined and a first sample data set composed of multiple first sample data, and the second computing node possesses a respective second model parameter to be determined and a respective second sample data set composed of multiple second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and each second computing node respectively obtains a respective determined second model parameter, the device is deployed at any second computing node, and the model training control device comprises a second model output result determining unit, an encryption loss value receiving unit, an encryption gradient value determining unit and a second model parameter updating unit;
wherein, in each iterative training process, the second model output result determining unit is configured to:
obtaining a second model output result of each second sample data of each second computing node based on the respective second model parameter to be determined;
the encryption loss value receiving unit is configured to: receiving an encryption loss value sent by a first computing node, wherein the encryption loss value is determined by the first computing node according to a model total output result determined by the first computing node and a sample label of each sample data, the model total output result is determined by the first computing node according to each first model output result, each second model output result and a safe multiparty summation protocol, and the first model output result is determined by the first computing node based on a first model parameter to be determined and each first sample data;
the encryption gradient value determination unit is configured to: determining each corresponding encryption gradient value according to the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node, sending each encryption gradient value to the first computing node, and receiving the decryption gradient value determined by the first computing node aiming at each encryption gradient value;
the second model parameter updating unit is used for: and updating each second model parameter to be determined in the iterative process according to each corresponding decryption gradient value.
In a sixth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing the computer program, implements any of the above steps of the model training control method based on multiple computing nodes.
In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device, and when the program runs on the computer device, the computer device is caused to execute the steps of any one of the above-mentioned model training control methods based on multiple computing nodes.
The model training control method provided by the embodiment of the application can perform joint training based on a plurality of computing nodes, and only interaction between the first computing node and each second computing node is performed without introducing an intermediate party in the training process.
In order to ensure data security and privacy of the first computing node and each second computing node, in the application, the first computing node and each second computing node jointly determine a model total output result based on a secure multiparty summation protocol, and when determining the model total output result, each computing node can only determine the respective model output result, but cannot analyze the model output results of other computing nodes. In addition, in the embodiment of the application, the first computing node further encrypts the total output result of the model, the total output result of the model is also encrypted in the interaction process of the first computing node and the second computing node, and each computing node performs a process of updating the model parameters according to the encrypted result, so that the data security and the privacy of the first computing node and each second computing node can be comprehensively ensured.
Similarly, in order to further ensure the security of data transmission between the first computing node and the second computing node, in the implementation of the present application, each encryption gradient value is determined by each second computing node based on the encryption loss value and the hadamard product of the encrypted random vector corresponding to each second computing node. Therefore, the first computing node cannot acquire the gradient values of the second computing nodes after decrypting the encrypted gradient values.
In addition, in the embodiment of the application, the Hadamard product is used without firstly encrypting the plaintext by using the public key of homomorphic encryption, so that the application range of the encryption mode is expanded, and the second asymmetric encryption field of the homomorphic encryption system can be expanded to the asymmetric encryption field and the symmetric encryption field.
Further, in the application, the first computing node with the sample label determines the loss value, the first computing node determines the loss value according to the sample label and the total output result of the model determined by the secure multiparty summation protocol, the loss value is a real loss value, and in the process of multiple iterations, the problem of approximation does not exist, so that the data accuracy in the training process is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic architecture diagram of a model training control system based on multiple computing nodes according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating the physical significance of a logistic regression function provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of a model training control method based on multiple computing nodes according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of interaction among computing nodes based on a secure multiparty summation protocol according to an embodiment of the present application;
fig. 5 is a schematic view of an application scenario of a model training control method based on multiple computing nodes according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a model training control method based on multiple computing nodes according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a model training control device based on multiple computing nodes according to an embodiment of the present disclosure;
fig. 8 is a schematic flowchart of a model training control method based on multiple computing nodes according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a model training control device based on multiple computing nodes according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
For convenience of understanding, terms referred to in the embodiments of the present application are explained below:
machine learning (M L, Machine L earning), is a multi-domain interdisciplinary subject, involving multiple subjects such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. it is a core of artificial intelligence that is the fundamental approach to making computers intelligent.
Deep learning (D L, Deep L earning) is a new research direction in the field of machine learning, which is introduced into machine learning to make it closer to the original target, Artificial Intelligence (AI).
Federal learning (Federated L earning) is an emerging artificial intelligence basic technology, and the design goal of the Federal learning is to carry out efficient machine learning among multiple parties or multiple computing nodes on the premise of guaranteeing information safety during big data exchange, protecting terminal data and personal data privacy and ensuring legal compliance.
Secure multiparty summation protocol: the method is a summation protocol based on safe multi-party computation, the safe multi-party computation is a technology for solving a global problem, the problem that two or more users can collaboratively execute a certain computation task in a mutual untrusted multi-user network without leaking respective private input information is solved, and the method is a core technology of federated machine learning. Specifically, the safety summation protocol is one of basic protocols for safe multiparty computation, and the problem to be solved is that when n participants respectively possess a secret s1,…,snHow to obtain ∑ S without mutual secret leakagekskTo a problem of (a).
Homomorphic encryption: is a cryptographic technique based on the theory of computational complexity of mathematical problems. The homomorphic encrypted data is processed to produce an output, which is decrypted, the result being the same as the output obtained by processing the unencrypted original data in the same way. That is, others can process the encrypted data, but the process does not reveal any of the original content. Meanwhile, the user with the key decrypts the processed data to obtain the processed result.
Hadamard product (Hadamard product): is a type of operation of a matrix, if A ═ aij) And B ═ Bij) Are two matrices of the same order, if cij=aij×bijThen, the matrix C is called (C)ij) Is the Hadamard product of A and B.
In a specific practice process, the problem of how to combine multiple data holders to perform a combined training model needs to be solved in the prior art, so the inventor invented a control method of a training model, and specifically, the inventor introduced an intermediate party M, which is a trusted party of each data holder, and realized a method of a combined training model through an encryption processing process of the intermediate party.
In particular, in the present application, the intermediate party M may instantiate a homomorphic cryptosystem, and send the public key to all data holders, in the following, denoted by computational nodes, each of which initializes model parameters of the computational node, and in each iteration process, each computing node encrypts the model result of the computing node by using the public key, and each computing node sends the encrypted model results to one of the computing nodes, the computing nodes are provided with sample labels, the nodes approximately obtain encrypted loss values according to the sample labels, homomorphic encryption algorithms and Taylor expansion of the models, the encrypted loss values are sent to other computing nodes, each computing node determines gradient ciphertext according to the encrypted loss values and respective sample data, and the respective gradient ciphertext is sent to the middle party M.
Because the intermediate party M has the decryption key encrypted in the same state, each gradient ciphertext can be decrypted to obtain gradient plaintext, each gradient plaintext is sent to the corresponding computing node, and each computing node updates the respective model parameter according to the respective gradient plaintext.
However, the inventor of the present application finds that, due to the introduction of the middle party M, a potential safety hazard is caused to the entire model training process, for example, when the middle party M is a malicious computing node or the middle party M is communicated with any computing node, data leakage may be caused.
Moreover, the inventor finds that if the method is used, in the model training process, when the computing node with the label determines the encrypted loss value, in order to match the homomorphic encryption process, the taylor expansion is used to approximate the expression formula of the actual loss value of the model, so that after the iterative training process is performed for multiple times, errors are accumulated, and the training effect is poor.
The inventor redesigns a model training control method by analyzing the above method, which does not include an intermediate party except each data holder, but realizes the process of model training by the interaction between each data holder.
Specifically, the inventor invented a model training control method, in which a first computing node is a data holder with a sample label, a second computing node is another data holder, the first computing node determines a model total output result according to a model output result of the first computing node, a model output result of each second computing node and a safe multiparty summation protocol in each iteration process, and determines a loss value based on the sample label and the model total output result. When the novel model training control method is conceived, the first computing node instantiates an encryption system which can be in a homomorphic encryption mode or in other encryption modes. The first computing node encrypts the loss value to obtain an encrypted loss value, sends the encrypted loss value to each second computing node, determines an encryption gradient according to the encrypted loss value, decrypts the encrypted gradient value according to a decryption mode corresponding to encryption, and sends a decryption result to each second computing node so as to update the model parameter of each second computing node.
Specifically, in the embodiment of the present application, the encryption loss function is determined by each second computing node based on the encryption loss value and the hadamard product of the encrypted random vector corresponding to each second computing node, and the use of the hadamard product does not require that the public key of homomorphic encryption be used first to encrypt the plaintext, so that the application range of the encryption manner is expanded, and the second asymmetric encryption field of the homomorphic encryption system can be expanded to the asymmetric encryption field and the symmetric encryption field.
The model control method of the invention does not need to add any intermediate node, and performs data interaction in an encryption mode, thereby ensuring the privacy and the safety of data, further, the loss value is determined according to the sample label and the total output result of the model, the problem of approximation does not exist, the problem of error accumulation in repeated iterative computation does not exist, and the accuracy of model training is improved.
After introducing the design concept of the embodiment of the present application, some simple descriptions are provided below for application scenarios to which the technical solution of the embodiment of the present application can be applied, and it should be noted that the application scenarios described below are only used for describing the embodiment of the present application and are not limited. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
To further illustrate the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide method steps as shown in the following embodiments or figures, more or fewer steps may be included in the method based on conventional or non-inventive efforts. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application.
Reference is made to fig. 1, which is a schematic diagram of a model training control system based on multiple computing nodes according to an embodiment of the present application. The application scenario at least includes a first computing node 101 and at least one second computing node 102, where the first computing node 101 has a first model parameter to be determined and a first sample data set composed of a plurality of first sample data, the second computing node 102 has a respective second model parameter to be determined and a respective second sample data set composed of a plurality of second sample data, the first computing node 101 further has sample labels of all samples, and each sample data is obtained from target service data corresponding to a second model, it can be considered that the models correspond to different target services and the data obtained by the first computing node 101 and the second computing node 102 are different. For example, if the target service corresponding to the model is a credit card overdue classification service, the first computing node 101 and the second computing node 102 acquire data of the credit card.
In this application, the first computing node 101 and each second computing node 102 may be a computing node on a blockchain, or may be an independent computing device with computing capability, which is not limited in this application.
In the application, a first computing node 101 stores a sample label of a training sample required by model training and a first sample data set, and the first computing node 101 has a first model parameter to be determined of a model; the second computing node 102 stores a second sample data set and second model parameters to be determined, where the first model parameters to be determined and the second model parameters to be determined are all model parameters to be determined in the model or model parameters to be determined except for a constant term. Illustratively, the model includes k model parameters, where the model parameter for the first compute node 101 is θ1The model parameter corresponding to the second calculation node is θ2、θ3、…、θkCan be regarded as theta1Is the first model parameter to be determined, theta2、θ3、…、θkThe second model parameters to be determined.
Each sample in the first computing node 101 and the second computing node 102 constitutes all samples required for model training, and the labels of all samples are stored in the first computing node 101. Illustratively, the first computing node 101 has n first sample data, where each sample data may correspond to one sample data or a set of sample data, and similarly, each second computing node 102 has n second sample data, where each sample data may correspond to one sample data or a set of sample data.
The sample data included in the first computing node 101 has a part of characteristics, and the sample data included in the second computing node 102 has another part of characteristics, so that the characteristics of the data between the first computing node 101 and each second computing node 102 are different as much as possible in order to ensure the diversity of the training data for model training.
In order to perform joint training on the model, the model parameters corresponding to each computing node may be adjusted in a gradient descent manner. Therefore, in each iteration, the first computing node 101 determines a first model output result according to the first sample data, each second computing node 102 determines a second model output result according to the second sample data, and the first computing node 101 and each second computing node determine a model total output result according to the first model output result, the second model output and the safe multi-square summation protocol.
The first computing node 101 determines a loss value according to the total model output result and the stored sample label, and the first computing node 101 instantiates an encryption system and encrypts the loss value to determine an encryption loss value; the first computing node 101 sends the encryption loss value to other second computing nodes 102, and receives an encryption gradient value determined by the second computing node 102 according to the encryption loss value and a Hadamard product of an encryption random vector corresponding to the second computing node 102; the first computing node 101 decrypts the encrypted gradient value according to the decryption processing mode corresponding to the encryption to obtain a decrypted gradient value, and sends the decrypted gradient value to each second computing node 102.
The first computing node 101 updates the first model parameter to be determined according to the loss value, and each second computing node 102 updates each second model parameter to be determined according to the decryption gradient value.
Of course, the method provided in the embodiment of the present application is not limited to be used in the application scenario shown in fig. 1, and may also be used in other possible application scenarios, and the embodiment of the present application is not limited. The functions that can be implemented by each device in the application scenario shown in fig. 1 will be described in the following method embodiments, and will not be described in detail herein.
To further illustrate the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide method steps as shown in the following embodiments or figures, more or fewer steps may be included in the method based on conventional or non-inventive efforts. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application.
The following describes the technical solution provided in the embodiment of the present application with reference to the application scenario shown in fig. 1.
In the embodiment of the present application, the included computing nodes are a first computing node and a plurality of second computing nodes, and the model training control method based on the plurality of computing nodes provided in the embodiment of the present application is explained through interaction between the first computing node and the second computing nodes.
Specifically, in the embodiment of the present application, each second computing node of the first computing node trains the model through at least one iterative training process until the iteration termination condition is reached, and the first computing node obtains the determined first model parameter and the second computing nodes respectively obtain the respective determined second model parameters.
In the embodiment of the present application, the training model is at least one regression model, and may be a logistic regression model, a linear regression model, a polynomial regression model, or other regression models.
Illustratively, the training model in the embodiment of the present application is a logistic regression model, and the logistic regression algorithm is actually a classification algorithm. The logistic regression model can predict the class label for many known features x through which it is desired to predict the class label, and for the binary problem, the labels are only two, and are labeled 0 and 1 (or +1 and-1). And for the characteristic x, obtaining a numerical value to be judged by the logistic regression model, if the value to be judged is greater than a set threshold, determining that the characteristic x is a category corresponding to the set threshold, and if not, determining that the characteristic x is another category.
Specifically, the logistic regression model is specifically shown in formula 1:
Figure BDA0002418437540000131
wherein, Y is a decision value and a numerical value to be judged in the above contents, x is a specific value of the feature, which can be understood as a feature value, e is a natural logarithm, and θ is a model parameter of the logistic regression model. The specific logistic regression model can be represented graphically as shown in fig. 2, the logistic regression model represents an S-shaped curve, and the curve has a faster growth rate near the center point and a slower growth rate in two segments. The larger the value of θ, the faster the center of the curve increases. As can be seen from the second fig. 2, if the value range of Y is (0, 1), the objects with the corresponding x feature attribute having the decision value greater than or equal to 0.5 can be classified as positive samples, and the objects with the corresponding x feature attribute having the decision function value less than 0.5 can be classified as negative samples. This allows for two classifications of sample data.
Will be theta in formula 1Tx is used as a function value, the formula 1 is deformed to obtain a formula 2, and the specific formula 2 is as follows:
Figure BDA0002418437540000132
z in formula 2θ Equation 2 can also be characterized as a polynomial of a plurality of model parameters and a plurality of data characteristics, modified to equation 3, specifically equation 3:
zθ(x)=θ01x12x23x3+...+θnxn equation 3
In formula 3, x1、x2、x3、…、xnIs expressed as a characteristic, theta0、θ1、θ2、…、θnAre model parameters.
That is, for the classification task of a logistic regression model, the data x to be classified is obtained1、x2、x3、…、xnAnd the parameter θ of the logistic regression model0、θ1、θ2、…、θnThen z in equation 3 is determinedθAnd z is given by equation 2θConverting into the value of g (z), and determining the classification according to the value of g (z).
So in this application, x1、x2、x3、…、xnIs sample data, θ, used by each compute node0、θ1、θ2、…、θnThe model parameters that need to be determined for each computing node.
After the structure of the logistic regression model is introduced, the interaction process between the first computing node and the second computing node in each iterative training process is specifically introduced by combining the structure of the logistic regression model.
As shown in fig. 3, in each iterative training process, the method specifically includes:
in step S301, the first computing node obtains a first model output result of each first sample data based on the first model parameter to be determined.
Step S302, each second computing node obtains a second model output result of each second sample data based on the second model parameter to be determined; step S301 and step S302 may be performed concurrently, or may be performed sequentially according to a certain set order, which is not described in detail in this embodiment of the application.
In step S303, in order to implement data privacy and security between the first computing node and the second computing node, in this embodiment of the present application, a total model output result is determined based on a secure multiparty summation protocol, that is, a first model output result and a second model output result are summed through the secure multiparty summation protocol, and each computing node cannot obtain a model output result of another node. As shown in FIG. 3, based on the secure multiparty summation protocol, each second computing node determines a protocol-based model output result that is sent to the first computing node, which may be represented herein as a protocol model output result.
And step S304, the second computing node sends the output results of the second models to the first computing node.
In step S305, the first computing node determines a total output result of the model according to the received output result of the second model, the determined output result of the first model, and the secure multiparty summation protocol.
And S306, determining a loss value by the first computing node according to the sample label and the model total output result, and determining an update gradient value and an encryption loss value of the iterative training process based on the loss value.
And step S307, the first computing node determines a gradient value according to the loss value and updates the first model parameter to be determined according to the gradient value.
In step S308, the first computing node sends the encryption loss value to each second computing node.
In step S309, each second computing node determines an encryption gradient value according to the encryption loss value.
In step S310, each second computing node sends the encrypted gradient value to the first computing node.
In step S311, the first computing node decrypts the encrypted gradient value according to the decryption processing mode corresponding to the encryption mode, so as to obtain a decrypted gradient value.
In step S312, the first computing node sends the decrypted gradient value to each second computing node.
In step S313, the second computing node updates the second model parameter to be determined according to the decrypted gradient value.
In the above embodiment, the sequence of step S308 and step S309 is not limited, and may be executed concurrently or sequentially, and is not limited herein.
After the above-mentioned interaction flow between the first computing node and the second computing node is introduced, a specific description is made below with respect to a plurality of steps therein.
In step S301 and step S302, the first computing node and the second computing node may determine corresponding model output results for all sample data, or may determine a model output result for one sample of the respective sample data.
Specifically, in step S301, the first computing node may determine, for each first sample data and the first model parameter to be determined, a first model output result corresponding to each first sample data; similarly, each second computing node determines, for each second sample data and each second model parameter to be determined, a second model output result corresponding to each second sample data.
Optionally, if the first computing node and the second computing node select part of sample data to determine respective model results, the first computing node and the second computing node select the first sample data and the second sample data identified by the same sample to determine respective model results.
In the embodiment of the present application, the first sample data set includes first sample data of each sample identifier, and each second sample data set also includes second sample data of each sample identifier, and when the total output result of the model is calculated, a first model output result determined by the first sample data having the same sample identifier and a second model output result determined by the second sample data are used.
In the embodiment of the present application, the sample identifier may refer to attribute information of the sample, for example, the sample identifier refers to a name of the data source, or the sample identifier refers to information such as an identity of the data source.
Illustratively, if the node identification of the first computing node is 1, then the data in the first sample data set is
Figure BDA0002418437540000161
Figure BDA0002418437540000162
Wherein data in the second sample data set for the second computing node having node identification i is
Figure BDA0002418437540000163
Can choose
Figure BDA0002418437540000164
The first sample data and the second sample data of the same sample identification determine the total output result of the model.
In step S303 and step S305, the first computing node and each second computing node need to be based on a secure multiparty summation protocol, and the interactive process of the first computing node and each second computing node based on the secure multiparty summation protocol is described below.
The safe multiparty summation protocol is a protocol based on safe multiparty computation, when the protocol is used for summation computation, the total output result of the model determined by a plurality of computation nodes can be determined, but the output result of the model of each computation node cannot be leaked to other computation nodes, and the data safety is ensured.
In an alternative embodiment, a first computing node interacts with a second computing node in a circular order, as shown in fig. 4, a first computing node and three second computing nodes are exemplarily shown in fig. 4, and for convenience of description, the second computing node adjacent to the first computing node in a first direction and the second computing node adjacent to the first computing node in a second direction are sequentially described as well as a second computing node adjacent to the first computing node in the first direction and a second computing node existing between the second computing node adjacent to the first computing node in the second direction.
After determining the first model output result, the first computing node determines the first model output result according to the first encrypted random vector of the first computing node, that is, after determining the first model output result, the first computing node encrypts the first model output result according to the first random vector which can be obtained only by the first computing node.
The first computing node sends the first model random output result to a second computing node adjacent to the first computing node in the first direction, the second computing node adjacent to the first direction determines a second model random output result according to the first random output result and the second model output result determined by the second computing node, sends the second model random output result to a next second computing node along the first direction, and the second computing node determines a random output result according to the second model random output result and the second model output result of the second computing node, and sends the random output result to the second computing node adjacent to the first computing node in the second direction.
And the second computing node adjacent to the first computing node in the second direction determines a third model random output result according to the second model random output result, the random output result determined by the previous second computing node and the second model output result determined by the second computing node adjacent to the first computing node in the second direction, and sends the third model random output result to the first computing node.
The first computing node can determine a model total output result according to the third model random output result and the first encrypted random vector.
In another alternative embodiment, the first computing node and each second computing node may further implement a process of determining a total output result of the model based on the secure multiparty summation protocol through the following interactive process.
Specifically, in the embodiment of the present application, after determining the respective model output result, each computing node divides the respective model output result into multiple parts according to the number of all computing nodes, and sends the multiple parts to other computing nodes, each computing node sums the received and respective remaining model output result parts, and sends the summed result to the first computing node, and the first computing node determines the total model output result.
For example, in the embodiment of the present application, there are one first computing node and three second computing nodes, where the first computing node divides the determined output result of the first model into four parts, and sends three parts of the output result to the other three second computing nodes; similarly, the three second computing nodes divide the determined output result of the second model into four parts, and send three parts of the output result to other second computing nodes and the first computing node.
The first computing node determines a first summation result of the first computing node according to the sum of the received three results sent by the other three second computing nodes and one result reserved by the second computing node, and the three second computing nodes compute respective summation results in the same way, namely a second summation result, a third summation result and a fourth summation result.
And the corresponding second computing nodes send the second summation result, the third summation result and the fourth summation result to the first computing node, and the first computing node determines a model total output result according to the first summation result, the second summation result, the third summation result and the fourth summation result.
Of course, in the embodiment of the present application, other methods based on a secure multiparty summation protocol may also be used to calculate the total output result of the model, which is not described in detail in the present application.
In step S306 and step S308, after the first computing node determines the model total output result, the loss value is determined according to the model total output result and the sample label, and the loss value is encrypted to obtain an encrypted loss value.
Specifically, the process of determining the loss value is related to the sample data selected by the first computing node and each second computing node, and if the sample data selected by the first computing node and each second computing node is the first sample data and the second sample data of the sample identifier i, the loss value may be determined according to formula 4, which is specifically shown in formula 4:
Figure BDA0002418437540000181
wherein, giIs a loss value of yiIdentify the sample label, l, corresponding to the sampleiAnd (5) outputting a result for the model. That is, in the embodiment of the present application, the total model output result is converted into the nonlinear model output result according to the total model output result and the nonlinear mapping function, and the loss value is determined according to the sample label and the nonlinear model output result, where a value range of the nonlinear mapping function corresponds to a value range of the label value. In the above equation 4
Figure BDA0002418437540000182
I.e. the part that is non-linearly mapped.
The loss value corresponding to each sample identifier can be determined according to the output result of each nonlinear model, wherein the value range of the nonlinear mapping function corresponds to the value range of the label value;
further, if the sample data selected by the first computing node and each second computing node is the first sample data and the second sample data of all the sample identifiers, the loss value corresponding to each sample identifier may also be calculated by formula 4.
In an optional embodiment, the first computing node determines an average loss value according to the loss value corresponding to each sample identifier, encrypts the average loss value to obtain an encryption loss value, and sends the encryption loss value to each second computing node.
In another optional embodiment, the first computing node determines the encryption loss values respectively according to the loss values corresponding to the sample identifications, and sends the encryption loss values to the second computing nodes.
That is to say, in the embodiment of the present application, each second computing node may receive an average encryption loss value, or may receive a plurality of encryption loss values identified for different samples.
In this embodiment of the present application, the first computing node may employ multiple encryption manners, which may be symmetric encryption or asymmetric encryption manners, and in an optional embodiment, the first computing node may instantiate a homomorphic encryption system and send the encryption public key to each second computing node, so that the second computing node performs a homomorphic encryption process.
In another alternative embodiment, the first computing node may encrypt the loss value based on the first encrypted random vector to obtain an encrypted loss value.
Of course, the first computing node may also encrypt the loss value by other encryption processing manners, which is not described herein.
In step S307, the first computing node may determine a gradient value according to the loss value, and update the first model parameter to be determined according to the gradient value.
Specifically, in this embodiment of the present application, the first computing node may obtain an initial gradient value in the current iteration process. And the first computing node determines a gradient value according to the loss value and updates the first model parameter to be determined according to the initial gradient value and the gradient value determined in the iteration process.
Specifically, the first computing node determines the gradient value according to a formula in formula 5, where formula 5 is specifically as follows:
G1=∑igixiequation 5
Wherein G is1Representing the gradient value of the first computing node, giIs a loss value, xiFirst sample data of a first computing node is represented. In the examples of the present application, giThe average loss value may be used, or each loss value may be used. If g isiIs each loss value, then x corresponds toiIs the corresponding first sample data.
After determining the gradient value, the first computing node may update the first model parameter to be determined according to equation 6, specifically, equation 6 is as follows:
w1(t+1)=w1(t)-ηG1equation 6
In equation 6, w1(t +1) is the updated first model parameter to be determined, η is the learning rate, w1And (t) is the initial model parameter of the iteration process.
In step S309, after the first computing node sends the encryption loss value to each second computing node, each second computing node determines its own encryption gradient value according to the encryption loss value.
Specifically, each second computing node may determine the encryption gradient value according to a formula 7, specifically, the formula 7 is:
Figure BDA0002418437540000201
wherein the content of the first and second substances,<Gk>it is indicated that the value of the encrypted gradient,
Figure BDA0002418437540000202
denotes second sample data, likewise, giThe average loss value may be used, or each loss value may be used. If g isiIs the loss value, corresponding
Figure BDA0002418437540000203
Is the corresponding second sample data.
Further, in this embodiment of the present application, each second calculation may further encrypt the result in formula 7 again to ensure the security of the gradient value, and optionally, in this embodiment of the present application, the encrypted gradient value may be determined by the second encrypted random vector, the result in formula 7, and the hadamard product.
In the embodiment of the present application, the second encrypted random vector is generated by each second computing node, e.g., there is AkK2, …, K second compute nodes, randomly generating a series of random vectors
Figure BDA0002418437540000204
For each second compute node, the encryption result may be determined according to equation 8:
specifically, it can be shown as formula 8:
Figure BDA0002418437540000205
in the formula 8, the process is described,<G′k>it is shown that the encryption loss value is determined by the hadamard product in formula 8 according to the encryption loss value after the encryption of the second encrypted random vector.
In an embodiment of the application, a Hadamard product is used to determine a plaintext second encrypted random vector and ciphertext < Gk>The product value does not need to encrypt the plaintext by using a homomorphic encrypted public key at first, the application range of an encryption mode is expanded, and the second asymmetric encryption field of the homomorphic encryption system can be expanded to the asymmetric encryption field and the symmetric encryption field。
In step S310 and step S311, each second computing node sends the encrypted gradient value to the first computing node, and the first computing node decrypts the encrypted gradient value according to the decryption processing method corresponding to the encryption method, so as to obtain a decrypted gradient value.
Specifically, in this embodiment of the present application, if the first computing node uses an encryption method of homomorphic encryption for encryption, the first computing node decrypts the encrypted gradient value according to a decryption private key corresponding to the homomorphic encryption, and of course, if the first computing node uses another encryption method, for example, uses the first encrypted random vector for encryption, the first encrypted random vector may be used for decryption.
Optionally, in this embodiment of the application, the decryption result of the first computing node is determined according to the encryption gradient value sent by the second computing node, that is, the decryption result of the first computing node may be a gradient plaintext, or may be an encryption gradient with a second random encryption vector.
In step S313, the second computing node updates the second model parameter to be determined according to the decrypted gradient value.
Specifically, in this embodiment of the application, if the second computing node obtains the gradient plaintext, the second to-be-determined model parameter may be updated by using a formula shown in formula 6, that is, the initial model parameter corresponding to the current iteration is obtained, and the second to-be-determined model parameter is updated according to the decryption gradient value, the learning rate, and the initial model parameter.
Or, in this embodiment of the application, if the decryption gradient received by the second computing node is determined by the hadamard product and the second encrypted random vector, the second computing node determines a true encryption gradient according to the second encrypted random vector, and updates the second model parameter to be determined according to the true decryption gradient value, the learning rate, and the initial model parameter.
The above description describes an interaction process between a first computing node and a second computing node in an iteration process, and repeats the above description until an iteration termination condition is reached, where a current first model parameter to be determined is taken as a determined first model parameter, and current second model parameters to be determined are taken as determined second model parameters.
In order to better explain the embodiment of the present application, the model training control method based on multiple computing nodes provided by the embodiment of the present application is described below in conjunction with a specific implementation scenario, in the method in the embodiment of the present application, three companies are involved in model training, namely a, B, and C, where company a and company B are two social media companies and possess a large number of social related features of numerous groups of people; c is a credit company, which has a small portion of records of the default of numerous people, and the acquisition of each record of the default by C causes huge economic loss due to the nature of C. Therefore, company C hopes to be able to jointly train the model by means of the wide features of company A and company B and the default label of company C, and to use the trained model to make default prediction on numerous people, and according to the prediction result, determine whether the new user is default, and can make default decision according to default conditions, reduce the default rate of the user, and ensure the virtuous circle of funds.
Specifically, when data interaction is performed, company a, company B, and company C perform data interaction through a terminal or a server having computing power.
Specifically, in this embodiment of the application, the terminal may be a terminal device such as a mobile phone, a Personal Computer (PC), a tablet computer (PAD), a Personal Digital Assistant (PDA), a notebook computer, or an intelligent wearable device (e.g., an intelligent watch and an intelligent bracelet). The server may be a server cluster or may be a single server. Meanwhile, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like.
The server can also be a cloud computing module, and cloud computing is a computing mode, and distributes computing tasks on a resource pool formed by a large number of computers, so that various application systems can acquire computing power, storage space and information services according to needs. The network that provides the resources is referred to as the "cloud". Resources in the "cloud" appear to the user as being infinitely expandable and available at any time, available on demand, expandable at any time, and paid for on-demand.
As shown in fig. 5, the server 501 represents a computing node of company C, which is denoted as a first computing node a1 in the embodiment of the present application, the server 502 represents a computing node of company a, which is denoted as a second computing node a2 in the embodiment of the present application, and the server 503 identifies a computing node of company B, which is denoted as a second computing node A3 in the embodiment of the present application.
In the present application, the servers 501 and 503 need to read data and store data, so in the embodiment of the present application, databases corresponding to the servers are further included, which are 5011, 5021, and 5031, respectively. Each server and the corresponding database may be connected by a wired or wireless connection.
In this embodiment of the present application, the database may also be a cloud database, where the cloud database refers to a storage system that integrates a large number of storage devices (storage devices are also referred to as storage nodes) of different types in a network through application software or an application interface to cooperatively work through functions such as cluster application, a grid technology, and a distributed storage file system, and provides data storage and service access functions to the outside. In the embodiment of the application, each server accesses the cloud database through the access structure of the cloud database.
Specifically, after the architecture of the embodiment of the present application is introduced, the following describes the interaction process of the server 501 and 503.
Server a1 first instantiates a homomorphic cryptosystem, which may send homomorphically encrypted public keys to a2, and A3. A1, a2, and A3 initialize the respective model parameters w1, w2, and w 3. In the iterative process thereafter, each computing node AkMaintaining and updating only its own model parameters wk
The interaction process among a1, a2 and A3 is specifically described for one iteration process.
Each computing node determines a respective model output result, specifically,
Figure BDA0002418437540000231
shown is the result of the model output determined by a1 from the sample data of sample id i,
Figure BDA0002418437540000232
shown is the result of the model output determined by a2 from the sample data of sample id i,
Figure BDA0002418437540000233
shown is the output result of the model determined by A3 according to the sample data of sample identification i.
Specifically, in the embodiment of the present application, sample data used by a1 is x1, x2, and x3, sample data used by 1 is x4, x5, and x6, sample data used by A3 is x7, x8, and x9, x1, x4, and x7 have the same sample identifier 1, x2, x5, and x8 have the same sample identifier 2, and x3, x6, and x9 have the same sample identifier 3.
A1 is determined according to sample data x1
Figure BDA0002418437540000234
From sample data x2 determine
Figure BDA0002418437540000235
From sample data x3 determine
Figure BDA0002418437540000236
A2 is determined according to sample data x4
Figure BDA0002418437540000239
From sample data x5 determine
Figure BDA00024184375400002310
From sample data x6 determine
Figure BDA0002418437540000238
A3 is determined according to sample data x7
Figure BDA00024184375400002311
From sample data x8 determine
Figure BDA0002418437540000237
From sample data x9 determine
Figure BDA00024184375400002312
A1 obtains a first encrypted random vector r1, and generates a first encrypted random vector based on r1 and r
Figure BDA0002418437540000244
Determining a random output result of the first model, and sending the random output result of the first model to A2; a2 is according to
Figure BDA0002418437540000245
Determining a second model random output result according to the first model random output result; a3 is according to
Figure BDA0002418437540000246
And the first model random output result determines a third model random output result, A3 sends the third model random output result to A1, A1 determines a model total output result l according to the first encrypted random vector r11
Similarly, A1 obtains a first encrypted random vector r1, based on r1 and
Figure BDA0002418437540000247
determining a random output result of the first model, and sending the random output result of the first model to A2; a2 is according to
Figure BDA0002418437540000248
Determining a second model random output result according to the first model random output result; a3 is according to
Figure BDA0002418437540000249
And the first model random output result determines a third model random output result, A3 sends the third model random output result to A1, A1 determines a model total output result l according to the first encrypted random vector r12
A1 obtains a first encrypted random vector r1, and generates a first encrypted random vector based on r1 and r
Figure BDA00024184375400002410
Determining a random output result of the first model, and sending the random output result of the first model to A2; a2 is according to
Figure BDA00024184375400002411
Determining a second model random output result according to the first model random output result; a3 is according to
Figure BDA00024184375400002412
And the first model random output result determines a third model random output result, A3 sends the third model random output result to A1, A1 determines a model total output result l according to the first encrypted random vector r13
A1 calculating loss value
Figure BDA0002418437540000241
And obtaining the encryption loss value according to the processing procedure of homomorphic encryption<g1>,A1Will be provided with<g1>To all a2, A3. Similarly, A1 calculates the loss value
Figure BDA0002418437540000242
And obtaining the encryption loss value according to the processing procedure of homomorphic encryption<g2>,A1Will be provided with<g2>To all a2, A3. A1 calculating loss value
Figure BDA0002418437540000243
And obtaining the encryption loss value according to the processing procedure of homomorphic encryption<g3>A1 will<g3>To all a2, A3. Wherein y is1Is shown asThe sample identifier 1 corresponds to the tag value, y2Indicates the label value y corresponding to the sample identifier 23Indicating the label value corresponding to sample identification 3.
A2 is according to<g2>、<g3>And sample data x4, x5, and x6, determining gradient ciphertext in ciphertext space<G2>=<g1>x4+<g2>x5+<g3>x6. A3 is according to<g2>、<g3>And sample data x7, x8, and x9, determining gradient ciphertext in ciphertext space<G3>=<g1>x7+<g2>x8+<g3>x9
And, a2, A3 generate a series of random vectors, r2 and r3 respectively,
Figure BDA0002418437540000251
k is in the range of 2 or 3, m is greater than 0, and the confusion gradient is calculated in the ciphertext space
Figure BDA0002418437540000252
Figure BDA0002418437540000253
Where ° is the hadamard product in algebra.
A2 will<G′2>Sent to A1, A3 will<G′3>Sent to A1, A1 decrypts with the homomorphic encrypted private key to obtain G'2And G'3And respectively sent to A2, A3, A2 according to G'2And r2 to obtain G2And according to G2Model parameters for A2 were updated, and similarly, A3 was from G'3And r3 to obtain G3And according to G3The model parameters of a3 are updated.
Similarly, in the examples of the present application, A1 calculated the value of G1, G1=g1x1+g2x2+g3x3And according to G1The model parameters of a1 are updated.
Through the multiple iteration processes of the contents, until the iteration termination condition is reached, the default prediction model aiming at numerous crowds is completed through the data combined training of the three companies, default prediction can be carried out, and if the user is judged to be default behavior, default decision can be carried out aiming at default conditions.
Based on the foregoing embodiments, in particular, the present application provides a model training control method based on multiple computing nodes, where a first body of execution of the method is a first computing node, and processing steps of the first computing node in each iteration process are shown in fig. 6, and the method includes:
step S601, the first computing node obtains a first model output result of each first sample data based on the first model parameter to be determined, and determines a model total output result according to each first model output result, each second model output result and the safe multiparty summation protocol, wherein each second model output result is determined by each second computing node based on each second model parameter to be determined and each second sample data of each second computing node;
step S602, the first computing node determines a loss value according to the sample label of each sample data and the total output result of the model, determines an updated gradient value and an encryption loss value of the iterative training process based on the loss value, and sends the encryption loss value to each second computing node;
step S603, the first computing node updates the first to-be-determined model parameter of the first computing node in the iterative process based on the update gradient value, decrypts each encrypted gradient value of each second computing node to obtain each decrypted gradient value, and sends each decrypted gradient value to each corresponding second computing node, where each decrypted gradient value is used to update the second to-be-determined model parameter of each second computing node in the iterative process, and each encrypted gradient value is determined by each second computing node based on the encryption loss value and the hadamard product of the encrypted random vector corresponding to each second computing node.
Optionally, the sequentially interacting of the first computing node and each second computing node according to the ring sequence, the determining, by the first computing node, the total output result of the model according to each first model output result, each second model output result, and the secure multiparty summation protocol includes:
the first computing node determines a first model random output result of the first computing node according to a first encryption random vector corresponding to the first computing node and the first model output result, wherein the first encryption random vector is determined according to a secure multiparty summation protocol;
the first computing node sends a first model random output result to a second computing node adjacent to the first computing node in the first direction, the first model random output result is used for determining a second model random output result of the second computing node adjacent to the first computing node in the first direction and receiving a third model random output result sent by the second computing node adjacent to the first computing node in the second direction, and the third model random output result is determined by the second computing node adjacent to the first computing node in the second direction according to the second model random output result and each second model output result of each second computing node existing between the second computing node adjacent to the first computing node in the first direction and the second computing node adjacent to the first computing node in the second direction;
and the first computing node determines the total model output result of the training model according to the first encrypted random vector and the random output result of the third model.
Optionally, the determining, by the first computing node, a total output result of the model according to each output result of the first model, each output result of the second model, and the secure multiparty summation protocol includes:
the first computing node determines a total model output result aiming at the sample identification according to a first model output result, a second model output result and a safe multiparty summation protocol corresponding to the same sample identification;
the first computing node determines a loss value according to the sample label and the model total output result, and the method comprises the following steps:
the first computing node converts the model total output result of each sample identifier into each nonlinear model output result according to the model total output result of each sample identifier and a nonlinear mapping function, and determines a loss value corresponding to each sample identifier according to a sample label corresponding to each sample identifier and each nonlinear model output result, wherein the value range of the nonlinear mapping function corresponds to the value range of the label value;
the first computing node determines an updated gradient value of the iterative training process based on the loss value, including:
for each sample identification, the first computing node determines a sub-update gradient value of the sample identification based on a product of a loss function corresponding to the sample identification and first sample data corresponding to the sample identification;
and the first computing node determines an updating gradient value according to the sum of the sub-updating gradient values identified by each sample.
Optionally, the determining, by the first computing node, the encryption loss value of the iterative training process based on the loss value includes:
the first computing node determines an encryption loss value based on the homomorphic encryption key and the loss value;
the first computing node decrypts each encrypted gradient value of each second computing node, including:
the first computing node decrypts each encrypted gradient value based on the homomorphic decryption key, and the homomorphic encryption key corresponds to the homomorphic decryption key.
Optionally, the determining, by the first computing node, the encryption loss value of the iterative training process based on the loss value further includes:
the first computing node determines an encryption loss value based on the second encryption random vector and the loss value;
the first computing node decrypts each encrypted gradient value of each second computing node, including:
the first computing node decrypts each encrypted gradient value based on the second encrypted random vector.
Based on the foregoing embodiments, referring to fig. 7, an embodiment of the present invention provides a model training control apparatus 700 based on a plurality of computing nodes, where the plurality of computing nodes include a first computing node and at least one second computing node, the first computing node possesses a first model parameter to be determined and a first sample data set composed of a plurality of first sample data, and the second computing node possesses a respective second model parameter to be determined and a respective second sample data set composed of a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and the second computing node respectively obtains a respective determined second model parameter, the device 700 is deployed at the first computing node, and the model training control device 700 comprises a model total output result determining unit 701, a loss value determining unit 702 and a first model parameter updating unit 703;
wherein, in each iterative training process, the model total output result determining unit 701 is configured to:
obtaining a first model output result of each first sample data based on the first model parameter to be determined, and determining a model total output result according to each first model output result, each second model output result and a safe multiparty summation protocol, wherein each second model output result is determined by each second computing node based on each second model parameter to be determined and each second sample data of each second computing node;
the loss value determination unit is configured to 702: the loss value determination unit is to: determining a loss value according to the sample label of each sample data and the total output result of the model, determining an updated gradient value and an encryption loss value of the iterative training process based on the loss value, and sending the encryption loss value to each second computing node;
the first model parameter updating unit is used for 703: and updating the first to-be-determined model parameter of the first computing node in the iteration process based on the updating gradient value, decrypting each encryption gradient value of each second computing node to obtain each decryption gradient value, and sending each decryption gradient value to each corresponding second computing node, wherein each decryption gradient value is used for updating the second to-be-determined model parameter of each second computing node in the iteration process, and each encryption gradient value is determined by each second computing node based on the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node.
Optionally, the first computing node and each second computing node sequentially interact according to a ring sequence, and the model total output result determining unit 701 is specifically configured to:
determining a first model random output result of the first computing node according to a first encrypted random vector corresponding to the first computing node and the first model output result, wherein the first encrypted random vector is determined according to a secure multiparty summation protocol;
sending the first model random output result to a second computing node adjacent to the first computing node in the first direction, wherein the first model random output result is used for determining a second model random output result of the second computing node adjacent to the first computing node in the first direction and receiving a third model random output result sent by the second computing node adjacent to the first computing node in the second direction, and the third model random output result is determined by the second computing node adjacent to the first computing node in the second direction according to the second model random output result and each second model output result of each second computing node existing between the second computing node adjacent to the first computing node in the first direction and the second computing node adjacent to the first computing node in the second direction;
and determining the total model output result of the training model according to the first encrypted random vector and the random output result of the third model.
Optionally, the model total output result determining unit 701 is specifically configured to:
determining a total model output result aiming at the sample identification according to a first model output result, a second model output result and a safe multiparty summation protocol corresponding to the same sample identification;
the loss value determining unit 702 is specifically configured to:
converting the model total output result of each sample identifier into each nonlinear model output result according to the model total output result of each sample identifier and a nonlinear mapping function, and determining a loss value corresponding to each sample identifier according to a sample label corresponding to each sample identifier and each nonlinear model output result, wherein the value range of the nonlinear mapping function corresponds to the value range of the label value;
for each sample identification, determining a sub-update gradient value of the sample identification based on the product of the loss function corresponding to the sample identification and the first sample data corresponding to the sample identification;
and determining the updating gradient value according to the sum of the sub updating gradient values of the sample identifications.
Optionally, the loss value determining unit 702 is configured to:
determining an encryption loss value based on the homomorphic encryption key and the loss value;
the first model parameter updating unit 703 is specifically configured to:
and decrypting each encrypted gradient value based on the homomorphic decryption key, wherein the homomorphic encryption key corresponds to the homomorphic decryption key.
Optionally, the loss value determining unit 702 is further configured to:
determining an encryption loss value based on the second encrypted random vector and the loss value;
decrypting each encrypted gradient value based on the second encrypted random vector.
Further, in this embodiment of the present application, the present application provides a model training control method based on multiple computing nodes, where a first body of execution of the method is each second computing node, and specific processing steps of each second node in one iteration process are shown in fig. 8, and the method includes:
step S801, each second computing node obtains a second model output result of each second sample data of each second computing node based on the respective second model parameter to be determined;
step S802, each second computing node receives an encryption loss value sent by the first computing node, wherein the encryption loss value is determined by the first computing node according to a model total output result determined by the first computing node and a sample label of each sample data, the model total output result is determined by the first computing node according to each first model output result, each second model output result and a safe multiparty summation protocol, and the first model output result is determined by the first computing node based on a first model parameter to be determined and each first sample data;
step S803, each second computing node determines each corresponding encryption gradient value according to the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node, sends each encryption gradient value to the first computing node, and receives the decryption gradient value determined by the first computing node for each encryption gradient value;
step S804, each second computing node updates each second model parameter to be determined in the iterative process according to each corresponding decryption gradient value.
Based on the above, correspondingly, the embodiment of the present application further provides a model training control apparatus 900 based on a plurality of computing nodes, referring to fig. 9, where the plurality of computing nodes include a first computing node and at least one second computing node, the first computing node possesses a first model parameter to be determined and a first sample data set composed of a plurality of first sample data, and the second computing node possesses a respective second model parameter to be determined and a respective second sample data set composed of a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and the second computing node respectively obtains a respective determined second model parameter, the device 900 is deployed at any second computing node, and the model training control device 900 comprises a second model output result determining unit 901, an encryption loss value receiving unit 902, an encryption gradient value determining unit 903 and a second model parameter updating unit 904;
wherein, each time the training process is iterated, the second model output result determining unit 901 is configured to:
obtaining a second model output result of each second sample data of each second computing node based on the respective second model parameter to be determined;
the encryption loss value receiving unit 902 is configured to: receiving an encryption loss value sent by a first computing node, wherein the encryption loss value is determined by the first computing node according to a model total output result determined by the first computing node and a sample label of each sample data, the model total output result is determined by the first computing node according to each first model output result, each second model output result and a safe multiparty summation protocol, and the first model output result is determined by the first computing node based on a first model parameter to be determined and each first sample data;
the encryption gradient value determination unit 903 is configured to: determining each corresponding encryption gradient value according to the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node, sending each encryption gradient value to the first computing node, and receiving the decryption gradient value determined by the first computing node aiming at each encryption gradient value;
the second model parameter updating unit 904 is configured to: and updating each second model parameter to be determined in the iterative process according to each corresponding decryption gradient value.
Based on the same technical concept, the embodiment of the present application provides a computer device, as shown in fig. 10, including at least one processor 1001 and a memory 1002 connected to the at least one processor, where a specific connection medium between the processor 1001 and the memory 1002 is not limited in the embodiment of the present application, and the processor 1001 and the memory 1002 in fig. 10 are connected through a bus as an example. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the embodiment of the present application, the memory 1002 stores instructions executable by the at least one processor 1001, and the at least one processor 1001, by executing the instructions stored in the memory 1002, may perform any of the steps included in the model training control method based on multiple computing nodes.
The processor 1001 is a control center of the computer device, and can connect various parts of the terminal device by using various interfaces and lines, and obtain the client address by executing or executing the instructions stored in the memory 1002 and calling the data stored in the memory 1002. Alternatively, processor 1001 may include one or more processing units, and processor 1001 may integrate an application processor, which first handles operating systems, user interfaces, applications, etc., and a modem processor, which first handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 1001 may be a general-purpose processor, such as a Central Processing Unit (CPU), a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof, and may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present Application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor.
Memory 1002, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 1002 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 1002 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 1002 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
Based on the same technical concept, embodiments of the present application provide a computer-readable storage medium storing a computer program executable by a computer device, wherein the computer program, when executed on the computer device, causes the computer device to perform any one of the aforementioned steps of a model training control method based on multiple computing nodes.
The computer-readable storage medium may be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, nonvolatile memory (NANDF L ASH), Solid State Disks (SSDs)), etc.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (15)

1. A model training control method based on a plurality of computing nodes is characterized in that the computing nodes comprise a first computing node and at least one second computing node, the first computing node is provided with a first model parameter to be determined and a first sample data set formed by a plurality of first sample data, and the second computing node is provided with a respective second model parameter to be determined and a respective second sample data set formed by a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iterative training process until an iterative termination condition is reached, the first computing node obtains a determined first model parameter and each second computing node respectively obtains a respective determined second model parameter, wherein each iterative training process comprises:
the first computing node obtains a first model output result of each first sample data based on the first model parameter to be determined, and determines a model total output result according to each first model output result, each second model output result and a safe multiparty summation protocol, wherein each second model output result is determined by each second computing node based on each second model parameter to be determined and each second sample data of each second computing node;
the first computing node determines a loss value according to the sample label of each sample datum and the total output result of the model, determines an updated gradient value and an encryption loss value of the iterative training process based on the loss value, and sends the encryption loss value to each second computing node;
and the first computing node updates the first model parameter to be determined of the first computing node in the iteration process based on the updated gradient value, decrypts each encrypted gradient value of each second computing node to obtain each decrypted gradient value, and sends each decrypted gradient value to each corresponding second computing node, wherein each decrypted gradient value is used for updating the second model parameter to be determined of each second computing node in the iteration process, and each encrypted gradient value is determined by each second computing node based on the encryption loss value and the Hadamard product of the encrypted random vector corresponding to each second computing node.
2. The method of claim 1, wherein the first computing node and the second computing nodes interact sequentially in a ring order, and wherein the first computing node determines a model total output result according to the first model output results, the second model output results, and a secure multiparty summation protocol, comprising:
the first computing node determines a first model random output result of the first computing node according to a first encrypted random vector corresponding to the first computing node and the first model output result, wherein the first encrypted random vector is determined according to the secure multiparty summation protocol;
the first compute node sending the first model random output result to a second compute node adjacent to the first compute node in a first direction, the first model random output result is used to determine a second model random output result for a second compute node adjacent to the first compute node in the first direction, and receiving a third model random output result sent by a second computing node adjacent to the first computing node in a second direction, the third model random output result is determined by a second computing node adjacent to the first computing node in the second direction according to the second model random output result and each second model output result of each second computing node existing between the second computing node adjacent to the first computing node in the first direction and the second computing node adjacent to the first computing node in the second direction;
and the first computing node determines a model total output result of the training model according to the first encrypted random vector and the third model random output result.
3. The method of claim 1, wherein determining a model total output result by the first computing node based on each first model output result, each second model output result, and a secure multiparty summation protocol comprises:
the first computing node determines a total model output result aiming at the sample identification according to a first model output result, a second model output result and a safe multiparty summation protocol corresponding to the same sample identification;
the first computing node determines a loss value according to the sample label and the model total output result, and the method comprises the following steps:
the first computing node converts the model total output result of each sample identifier into each nonlinear model output result according to the model total output result of each sample identifier and a nonlinear mapping function, and determines a loss value corresponding to each sample identifier according to a sample label corresponding to each sample identifier and each nonlinear model output result, wherein the value range of the nonlinear mapping function corresponds to the value range of the label value;
the first computing node determines an updated gradient value for the iterative training process based on the loss value, including:
for each sample identification, the first computing node determines a sub-update gradient value of the sample identification based on a product of a loss function corresponding to the sample identification and first sample data corresponding to the sample identification;
and the first computing node determines the updating gradient value according to the sum of the sub-updating gradient values of each sample identifier.
4. The method of claim 1, wherein the first computing node determines a ciphering loss value for the iterative training process based on the loss value, comprising:
the first computing node determining the encryption loss value based on a homomorphic encryption key and the loss value;
the first computing node decrypting each encrypted gradient value of each second computing node includes:
the first computing node decrypts each encrypted gradient value based on a homomorphic decryption key, which corresponds to the homomorphic decryption key.
5. The method of claim 1, wherein the first computing node determines an encryption loss value for the iterative training process based on the loss value, further comprising:
the first computing node determining the encryption loss value based on a second encrypted random vector and the loss value;
the first computing node decrypting each encrypted gradient value of each second computing node includes:
the first compute node decrypts each encrypted gradient value based on the second encrypted random vector.
6. A model training control method based on a plurality of computing nodes is characterized in that the computing nodes comprise a first computing node and at least one second computing node, the first computing node is provided with a first model parameter to be determined and a first sample data set formed by a plurality of first sample data, and the second computing node is provided with a respective second model parameter to be determined and a respective second sample data set formed by a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iterative training process until an iterative termination condition is reached, the first computing node obtains a determined first model parameter and each second computing node respectively obtains a respective determined second model parameter, wherein each iterative training process comprises:
each second computing node obtains a second model output result of each second sample data of each second computing node based on the respective second model parameter to be determined;
each second computing node receives an encryption loss value sent by the first computing node, wherein the encryption loss value is determined by the first computing node according to a model total output result determined by the first computing node and a sample label of each sample data, the model total output result is determined by the first computing node according to each first model output result, each second model output result and a safe multiparty summation protocol, and the first model output result is determined by the first computing node based on a first model parameter to be determined and each first sample data;
each second computing node determines corresponding encryption gradient values according to the encryption loss values and the Hadamard product of the encryption random vectors corresponding to the second computing nodes, sends the encryption gradient values to the first computing node, and receives decryption gradient values determined by the first computing node for the encryption gradient values;
and each second computing node updates each second model parameter to be determined in the iteration process according to each corresponding decryption gradient value.
7. A model training control system based on a plurality of computing nodes, the system comprising a first computing node having a first model parameter to be determined and a first sample data set composed of a plurality of first sample data, and at least one second computing node having a respective second model parameter to be determined and a respective second sample data set composed of a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iterative training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and the second computing node respectively obtains a respective determined second model parameter, wherein in each iterative training process, the first computing node performs the steps of the method of any one of claims 1 to 5 to update the first model parameter to be determined of the first computing node in the iterative process, and the second computing node performs the steps of the method of claim 6 to update the second model parameter to be determined of each second computing node in the iterative process.
8. A model training control device based on a plurality of computing nodes is characterized in that the computing nodes comprise a first computing node and at least one second computing node, the first computing node is provided with a first model parameter to be determined and a first sample data set formed by a plurality of first sample data, and the second computing node is provided with a respective second model parameter to be determined and a respective second sample data set formed by a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and each second computing node respectively obtains a respective determined second model parameter, the device is deployed at the first computing node, and the model training control device comprises a model total output result determining unit, a loss value determining unit and a first model parameter updating unit;
wherein, in each iterative training process, the model total output result determining unit is configured to:
obtaining a first model output result of each first sample data based on the first model parameter to be determined, and determining a model total output result according to each first model output result, each second model output result and a safe multiparty summation protocol, wherein each second model output result is determined by each second computing node based on each second model parameter to be determined and each second sample data of each second computing node;
the loss value determination unit is configured to: determining a loss value according to the sample label of each sample data and the total output result of the model, determining an updated gradient value and an encryption loss value of the iterative training process based on the loss value, and sending the encryption loss value to each second computing node;
the first model parameter updating unit is used for: updating the first to-be-determined model parameter of the first computing node in the iteration process based on the updated gradient value, decrypting each encrypted gradient value of each second computing node to obtain each decrypted gradient value, and sending each decrypted gradient value to each corresponding second computing node, wherein each decrypted gradient value is used for updating the second to-be-determined model parameter of each second computing node in the iteration process, and each encrypted gradient value is determined by each second computing node based on the encryption loss value and the Hadamard product of the encrypted random vector corresponding to each second computing node.
9. The apparatus according to claim 8, wherein the first computing node and each second computing node sequentially interact in a circular order, and the model total output result determining unit is specifically configured to:
determining a first model random output result of the first computing node according to a first encrypted random vector corresponding to the first computing node and the first model output result, wherein the first encrypted random vector is determined according to the secure multiparty summation protocol;
sending the first model random output result to a second compute node adjacent to the first compute node in a first direction, the first model random output result is used to determine a second model random output result for a second compute node adjacent to the first compute node in the first direction, and receiving a third model random output result sent by a second computing node adjacent to the first computing node in a second direction, the third model random output result is determined by a second computing node adjacent to the first computing node in the second direction according to the second model random output result and each second model output result of each second computing node existing between the second computing node adjacent to the first computing node in the first direction and the second computing node adjacent to the first computing node in the second direction;
and determining a model total output result of the training model according to the first encrypted random vector and the third model random output result.
10. The apparatus according to claim 8, wherein the model total output result determining unit is specifically configured to:
determining a total model output result aiming at the sample identification according to a first model output result, a second model output result and a safe multiparty summation protocol corresponding to the same sample identification;
the loss value determination unit is specifically configured to:
converting the model total output result of each sample identifier into each nonlinear model output result according to the model total output result of each sample identifier and a nonlinear mapping function, and determining a loss value corresponding to each sample identifier according to a sample label corresponding to each sample identifier and each nonlinear model output result, wherein the value range of the nonlinear mapping function corresponds to the value range of the label value;
for each sample identification, determining a sub-update gradient value of the sample identification based on the product of the loss function corresponding to the sample identification and the first sample data corresponding to the sample identification;
and determining the updating gradient value according to the sum of the sub-updating gradient values of each sample identifier.
11. The apparatus according to claim 8, wherein the loss value determining unit is specifically configured to:
determining the encryption loss value based on a homomorphic encryption key and the loss value;
the first model parameter updating unit is specifically configured to:
decrypting each encrypted gradient value based on a homomorphic decryption key, the homomorphic encryption key corresponding to the homomorphic decryption key.
12. The apparatus of claim 8, wherein the loss value determination unit is further configured to:
determining the encryption loss value based on a second encrypted random vector and the loss value;
decrypting each encrypted gradient value based on the second encrypted random vector.
13. A model training control device based on a plurality of computing nodes is characterized in that the computing nodes comprise a first computing node and at least one second computing node, the first computing node is provided with a first model parameter to be determined and a first sample data set formed by a plurality of first sample data, and the second computing node is provided with a respective second model parameter to be determined and a respective second sample data set formed by a plurality of second sample data;
the first computing node and each second computing node train the model through at least one iteration training process until an iteration termination condition is reached, the first computing node obtains a determined first model parameter and each second computing node respectively obtains a respective determined second model parameter, the device is deployed at any one of the second computing nodes, and the model training control device comprises a second model output result determining unit, an encryption loss value receiving unit, an encryption gradient value determining unit and a second model parameter updating unit;
wherein, each time the training process is iterated, the second model output result determination unit is configured to:
obtaining a second model output result of each second sample data of each second computing node based on the respective second model parameter to be determined;
the encryption loss value receiving unit is configured to: receiving an encryption loss value sent by the first computing node, wherein the encryption loss value is determined by the first computing node according to a model total output result determined by the first computing node and a sample label of each sample data, the model total output result is determined by the first computing node according to each first model output result, each second model output result and a safe multiparty summation protocol, and the first model output result is determined by the first computing node based on a first model parameter to be determined and each first sample data;
the encryption gradient value determination unit is configured to: determining each corresponding encryption gradient value according to the encryption loss value and the Hadamard product of the encryption random vector corresponding to each second computing node, sending each encryption gradient value to the first computing node, and receiving the decryption gradient value determined by the first computing node for each encryption gradient value;
the second model parameter updating unit is used for: and updating each second model parameter to be determined in the iterative process according to each corresponding decryption gradient value.
14. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any one of claims 1 to 5 are performed when the program is executed by the processor, or wherein the steps of the method of claim 6 are performed when the program is executed by the processor.
15. A computer-readable storage medium, characterized in that it stores a computer program executable by a computer device, which program, when run on the computer device, causes the computer device to perform the steps of the method of any one of claims 1 to 5, or causes the computer device to perform the steps of the method of claim 6.
CN202010198359.XA 2020-03-19 2020-03-19 Model training control method, device and system based on multiple computing nodes Active CN111428887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010198359.XA CN111428887B (en) 2020-03-19 2020-03-19 Model training control method, device and system based on multiple computing nodes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010198359.XA CN111428887B (en) 2020-03-19 2020-03-19 Model training control method, device and system based on multiple computing nodes

Publications (2)

Publication Number Publication Date
CN111428887A true CN111428887A (en) 2020-07-17
CN111428887B CN111428887B (en) 2023-05-12

Family

ID=71548108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010198359.XA Active CN111428887B (en) 2020-03-19 2020-03-19 Model training control method, device and system based on multiple computing nodes

Country Status (1)

Country Link
CN (1) CN111428887B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111967910A (en) * 2020-08-18 2020-11-20 中国银行股份有限公司 User passenger group classification method and device
CN112016632A (en) * 2020-09-25 2020-12-01 北京百度网讯科技有限公司 Model joint training method, device, equipment and storage medium
CN112347500A (en) * 2021-01-11 2021-02-09 腾讯科技(深圳)有限公司 Machine learning method, device, system, equipment and storage medium of distributed system
CN112818369A (en) * 2021-02-10 2021-05-18 中国银联股份有限公司 Combined modeling method and device
CN113240127A (en) * 2021-04-07 2021-08-10 睿蜂群(北京)科技有限公司 Federal learning-based training method and device, electronic equipment and storage medium
CN113489543A (en) * 2021-07-07 2021-10-08 北京邮电大学 Nonlinear damage compensation method and system in long-distance optical communication system
WO2023040390A1 (en) * 2021-09-16 2023-03-23 华为技术有限公司 Model protection method and apparatus
CN116362352A (en) * 2023-06-01 2023-06-30 广州思迈特软件有限公司 Model automatic updating method, system, medium and terminal based on machine learning
CN112016632B (en) * 2020-09-25 2024-04-26 北京百度网讯科技有限公司 Model joint training method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189825A (en) * 2018-08-10 2019-01-11 深圳前海微众银行股份有限公司 Lateral data cutting federation learning model building method, server and medium
WO2019072316A2 (en) * 2019-01-11 2019-04-18 Alibaba Group Holding Limited A distributed multi-party security model training framework for privacy protection
CN109886417A (en) * 2019-03-01 2019-06-14 深圳前海微众银行股份有限公司 Model parameter training method, device, equipment and medium based on federation's study
CN110210233A (en) * 2019-04-19 2019-09-06 平安科技(深圳)有限公司 Joint mapping method, apparatus, storage medium and the computer equipment of prediction model
CN110443067A (en) * 2019-07-30 2019-11-12 卓尔智联(武汉)研究院有限公司 Federal model building device, method and readable storage medium storing program for executing based on secret protection
US20200019867A1 (en) * 2018-07-11 2020-01-16 International Business Machines Corporation Learning and inferring insights from encrypted data
WO2020029585A1 (en) * 2018-08-10 2020-02-13 深圳前海微众银行股份有限公司 Neural network federation modeling method and device employing transfer learning, and storage medium
CN110874440A (en) * 2020-01-16 2020-03-10 支付宝(杭州)信息技术有限公司 Information pushing method and device, model training method and device, and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200019867A1 (en) * 2018-07-11 2020-01-16 International Business Machines Corporation Learning and inferring insights from encrypted data
CN109189825A (en) * 2018-08-10 2019-01-11 深圳前海微众银行股份有限公司 Lateral data cutting federation learning model building method, server and medium
WO2020029585A1 (en) * 2018-08-10 2020-02-13 深圳前海微众银行股份有限公司 Neural network federation modeling method and device employing transfer learning, and storage medium
WO2019072316A2 (en) * 2019-01-11 2019-04-18 Alibaba Group Holding Limited A distributed multi-party security model training framework for privacy protection
CN109886417A (en) * 2019-03-01 2019-06-14 深圳前海微众银行股份有限公司 Model parameter training method, device, equipment and medium based on federation's study
CN110210233A (en) * 2019-04-19 2019-09-06 平安科技(深圳)有限公司 Joint mapping method, apparatus, storage medium and the computer equipment of prediction model
CN110443067A (en) * 2019-07-30 2019-11-12 卓尔智联(武汉)研究院有限公司 Federal model building device, method and readable storage medium storing program for executing based on secret protection
CN110874440A (en) * 2020-01-16 2020-03-10 支付宝(杭州)信息技术有限公司 Information pushing method and device, model training method and device, and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王文涛等: "基于密集连接卷积神经网络的链路预测模型", 《计算机应用》 *
贾延延等: "联邦学习模型在涉密数据处理中的应用", 《中国电子科学研究院学报》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111967910A (en) * 2020-08-18 2020-11-20 中国银行股份有限公司 User passenger group classification method and device
CN112016632A (en) * 2020-09-25 2020-12-01 北京百度网讯科技有限公司 Model joint training method, device, equipment and storage medium
CN112016632B (en) * 2020-09-25 2024-04-26 北京百度网讯科技有限公司 Model joint training method, device, equipment and storage medium
CN112347500A (en) * 2021-01-11 2021-02-09 腾讯科技(深圳)有限公司 Machine learning method, device, system, equipment and storage medium of distributed system
CN112818369A (en) * 2021-02-10 2021-05-18 中国银联股份有限公司 Combined modeling method and device
CN112818369B (en) * 2021-02-10 2024-03-29 中国银联股份有限公司 Combined modeling method and device
CN113240127A (en) * 2021-04-07 2021-08-10 睿蜂群(北京)科技有限公司 Federal learning-based training method and device, electronic equipment and storage medium
CN113489543A (en) * 2021-07-07 2021-10-08 北京邮电大学 Nonlinear damage compensation method and system in long-distance optical communication system
CN113489543B (en) * 2021-07-07 2022-07-19 北京邮电大学 Nonlinear damage compensation method and system in long-distance optical communication system
WO2023040390A1 (en) * 2021-09-16 2023-03-23 华为技术有限公司 Model protection method and apparatus
CN116362352A (en) * 2023-06-01 2023-06-30 广州思迈特软件有限公司 Model automatic updating method, system, medium and terminal based on machine learning

Also Published As

Publication number Publication date
CN111428887B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
CN111428887B (en) Model training control method, device and system based on multiple computing nodes
Riazi et al. Chameleon: A hybrid secure computation framework for machine learning applications
US20240113858A1 (en) Systems and Methods for Performing Secure Machine Learning Analytics Using Homomorphic Encryption
US20210279342A1 (en) Neural-network training using secure data processing
CN107704930B (en) Modeling method, device and system based on shared data and electronic equipment
CN110457912B (en) Data processing method and device and electronic equipment
CN111784001B (en) Model training method and device and computer readable storage medium
CN111125727B (en) Confusion circuit generation method, prediction result determination method, device and electronic equipment
CN110427969B (en) Data processing method and device and electronic equipment
CN113505882B (en) Data processing method based on federal neural network model, related equipment and medium
Fritchman et al. Privacy-preserving scoring of tree ensembles: A novel framework for AI in healthcare
CN109687952A (en) Data processing method and its device, electronic device and storage medium
CN114860735A (en) Method and device for inquiring hiding trace
Xie et al. Achieving privacy-preserving online diagnosis with outsourced SVM in internet of medical things environment
CN110569227A (en) Model parameter determination method and device and electronic equipment
CN111563267A (en) Method and device for processing federal characteristic engineering data
CN113239391B (en) Third-party-free logistic regression federal learning model training system and method
Zhao et al. Secure outsourced NB: Accurate and efficient privacy-preserving Naive Bayes classification
CN116094686B (en) Homomorphic encryption method, homomorphic encryption system, homomorphic encryption equipment and homomorphic encryption terminal for quantum convolution calculation
Lenk et al. GeoFPE: Format preserving encryption of geospatial data for the Internet of Things
CN111046408A (en) Judgment result processing method, query method, device, electronic equipment and system
CN110874481A (en) GBDT model-based prediction method and device
He et al. PrivC—A framework for efficient secure two-party computation
Khan et al. Vertical federated learning: A structured literature review
CN113487423A (en) Personal credit risk prediction model training method and device

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