WO2021027598A1 - Method and apparatus for determining model parameter, and electronic device - Google Patents

Method and apparatus for determining model parameter, and electronic device Download PDF

Info

Publication number
WO2021027598A1
WO2021027598A1 PCT/CN2020/106254 CN2020106254W WO2021027598A1 WO 2021027598 A1 WO2021027598 A1 WO 2021027598A1 CN 2020106254 W CN2020106254 W CN 2020106254W WO 2021027598 A1 WO2021027598 A1 WO 2021027598A1
Authority
WO
WIPO (PCT)
Prior art keywords
share
product
new
matrix
partner
Prior art date
Application number
PCT/CN2020/106254
Other languages
French (fr)
Chinese (zh)
Inventor
周亚顺
李漓春
殷山
王华忠
Original Assignee
创新先进技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201910735442.3A external-priority patent/CN110580410B/en
Priority claimed from CN201910735421.1A external-priority patent/CN110472439B/en
Priority claimed from CN201910735439.1A external-priority patent/CN110555525B/en
Priority claimed from CN201910734784.3A external-priority patent/CN110580409B/en
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Publication of WO2021027598A1 publication Critical patent/WO2021027598A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks

Definitions

  • the embodiments of this specification relate to the field of computer technology, and in particular to a method, device and electronic equipment for determining model parameters.
  • the model parameter optimization method can be used to optimize and adjust the model parameters of the data processing model multiple times. Since the data used to train the data processing model is scattered among the parties involved in the cooperative modeling, how to collaboratively determine the model parameters of the data processing model while protecting data privacy is a technical problem that needs to be solved urgently.
  • the purpose of the embodiments of this specification is to provide a method, device and electronic equipment for determining model parameters, so that the model parameters of the data processing model can be determined by multiple parties under the premise of protecting data privacy.
  • a method for determining model parameters is provided, which is applied to a first data party, including: communicating with a partner according to a share of the first product and a confusion circuit corresponding to an incentive function , Get the share of the value of the incentive function, the first product is the product of the feature data and the first model parameter; according to the share of the feature data and the value of the incentive function and the partner secretly share the gradient of the loss function, the value of the loss function is obtained Share; share the Hessian matrix secretly with the partner according to the value of the feature data and the incentive function to get the share of the Hessian matrix; secretly share the first inverse matrix with the partner according to the Hessian matrix share to get the first inverse matrix Share, the first inverse matrix is the inverse matrix of the Hessian matrix; according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient, the new first model parameter is secretly shared with the partner to obtain the new
  • a method for determining model parameters is provided, which is applied to a second data party, including: communicating with a partner according to the share of the first product and the confusion circuit corresponding to the incentive function , Obtain the share of the value of the incentive function, the first product is the product of the feature data and the first model parameter; according to the share of the label and the value of the incentive function and the partner secretly share the gradient of the loss function, the share of the gradient of the loss function is obtained ; According to the share of the incentive function, secretly share the Hessian matrix with the partner to obtain the share of the Hessian matrix; according to the share of the Hessian matrix and secretly share the first inverse matrix with the partner to obtain the share of the first inverse matrix, the The first inverse matrix is the inverse matrix of the Hessian matrix; according to the share of the first model parameters, the share of the first inverse matrix, and the share of the loss function gradient, secretly share the new first model parameters with the partner to obtain
  • a method for determining model parameters is provided, which is applied to a first data party, including: secretly sharing the first product with a partner according to the share of feature data and the first model parameter , Obtain the share of the first product, the first product being the product of the feature data and the first model parameter; according to the share of the first product and the partner secretly share the value of the incentive function, obtain the share of the value of the incentive function; The share of the characteristic data and the value of the incentive function secretly share the gradient of the loss function and the Hessian matrix with the partner, and get the share of the loss function gradient and the Hessian matrix; according to the share of the random orthogonal matrix and the Hessian matrix Share the second product secretly with the partner to obtain the share of the second product.
  • the second product is the product between the random orthogonal matrix and the Hessian matrix; when the condition number of the second product meets the preset condition, The share of the Sen matrix secretly shares the first inverse matrix with the partner to obtain the share of the first inverse matrix, which is the inverse matrix of the Hessian matrix; according to the share of the first inverse matrix, the share of the loss function gradient and The share of the first model parameter secretly shares the new first model parameter with the partner to obtain the share of the new first model parameter; the step of secretly sharing the first product is iteratively performed to obtain the share of the new first product, according to The share of the new first product and the confusion circuit corresponding to the incentive function communicate with the partner to obtain the share of the new incentive function value, and iteratively execute the steps of the secret sharing loss function gradient and the Hessian matrix to obtain a new The share of the loss function gradient and the share of the new Hessian matrix are iteratively performed the step of secretly sharing the second product to obtain the share of the new second product; when the condition number
  • a method for determining model parameters is provided, which is applied to a second data party, including: secretly sharing the first product according to the share of the first model parameter and the partner to obtain the first product A share of a product, the first product being the product of the feature data and the first model parameter; according to the share of the first product and the partner secretly sharing the value of the incentive function, the share of the value of the incentive function is obtained; according to the label and incentive
  • the share of the value of the function secretly shares the gradient of the loss function with the partner to obtain the share of the gradient of the loss function;
  • the share of the value of the incentive function is secretly shared with the partner of the Hessian matrix to obtain the share of the Hessian matrix; according to the random orthogonal matrix
  • the share of and the share of the Hessian matrix secretly share the second product with the partner to obtain the share of the second product.
  • the second product is the product between the random orthogonal matrix and the Hessian matrix; the condition number of the second product When the preset conditions are met, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
  • the first inverse matrix is the inverse of the Hessian matrix; Share, the share of the loss function gradient, and the share of the first model parameter secretly share the new first model parameter with the partner to obtain the new share of the first model parameter; iteratively execute the step of secretly sharing the first product to obtain the new According to the share of the first product of the new first product and the confusion circuit corresponding to the incentive function, communicate with the partner to obtain the share of the new value of the incentive function; iteratively execute the step of secretly sharing the gradient of the loss function , Obtain the share of the new loss function gradient, iteratively execute the step of secretly sharing the Hessian matrix to obtain the share of the new Hessian matrix, and iteratively execute the step of secretly sharing the second product to obtain the new second product Share; when the condition number of the new second product does not meet the preset condition, calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length .
  • a model parameter determination device applied to a first data party, including: an incentive function value share acquisition unit, configured to obtain a share and incentive according to the first product
  • the confusion circuit corresponding to the function communicates with the partner to obtain the share of the value of the excitation function.
  • the first product is the product of the feature data and the first model parameter; the loss function gradient share acquisition unit is used to obtain the value of the excitation function according to the feature data and the excitation function.
  • the valued share secretly shares the gradient of the loss function with the partner to obtain the share of the loss function gradient;
  • the Hessian matrix share acquisition unit is used to secretly share the Hessian matrix with the partner according to the feature data and the share of the incentive function to obtain The share of the Hessian matrix;
  • the first inverse matrix share obtaining unit is used to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix
  • the model parameter share acquisition unit is used to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain a new first model The share of parameters.
  • a model parameter determination device applied to a second data party, including: an incentive function value share acquisition unit, configured to obtain a share and incentive according to the first product
  • the confusion circuit corresponding to the function communicates with the partner to obtain the share of the value of the excitation function.
  • the first product is the product of the feature data and the first model parameter; the loss function gradient share acquisition unit is used to obtain the value of the incentive function according to the label and the excitation function.
  • the share of the value and the partner secretly share the gradient of the loss function to obtain the share of the gradient of the loss function;
  • the Hessian matrix share acquisition unit is used to secretly share the Hessian matrix with the partner according to the share of the incentive function to obtain the Hessian matrix Share;
  • the first inverse matrix share acquisition unit used to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, the first inverse matrix being the inverse of the Hessian matrix;
  • the model parameter share obtaining unit is used to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
  • a model parameter determination device which is applied to a first data party, and includes: a first secret sharing unit, which is used to determine the share of the characteristic data and the first model parameter.
  • the second secret sharing unit is used to share the secret of the first product with the partner Share the value of the incentive function to obtain the share of the value of the incentive function
  • the third secret sharing unit is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the feature data and the share of the value of the incentive function to obtain the loss respectively The share of the function gradient and the share of the Hessian matrix
  • the fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product.
  • the second product is the product between the random orthogonal matrix and the Hessian matrix;
  • the fifth secret sharing unit is used to secretly share the first secret with the partner according to the Hessian matrix when the condition number of the second product meets the preset conditions.
  • An inverse matrix to obtain the share of the first inverse matrix where the first inverse matrix is the inverse matrix of the Hessian matrix;
  • the sixth secret sharing unit is used to obtain the share of the first inverse matrix, the share of the loss function gradient, and the first
  • the share of the model parameter secretly shares the new first model parameter with the partner to obtain the share of the new first model parameter;
  • the iterative unit is used to iteratively execute the step of secretly sharing the first product to obtain the new first product Share, communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the share of the new incentive function, and iteratively execute the steps of the secret sharing loss function gradient and the Hessian matrix, Obtain the share of the new loss function gradient and the
  • a model parameter determination device applied to a second data party, including: a first secret sharing unit for communicating with a partner according to the share of the first model parameter Secretly share the first product to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter; the second secret sharing unit is used to secretly share the incentive function with the partner according to the share of the first product The value of, obtains the share of the value of the incentive function; the third secret sharing unit is used to secretly share the gradient of the loss function with the partner according to the share of the label and the value of the incentive function to obtain the share of the gradient of the loss function; The share of value and the partner secretly share the Hessian matrix to obtain the share of the Hessian matrix; the fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix with the partner to obtain The share of the second product, the second product is the product
  • an electronic device including: a memory, configured to store computer instructions; and a processor, configured to execute the computer instructions to implement aspects such as the first and second aspects. Aspect, the method steps of the third aspect or the fourth aspect.
  • the first data party and the second data party cooperate to determine the model parameters of the data processing model without leaking the data held by themselves.
  • Fig. 1 is a schematic diagram of a logic circuit according to an embodiment of the specification
  • FIG. 2 is a schematic diagram of a model parameter determination system according to an embodiment of the specification
  • FIG. 3 is a flowchart of a method for determining model parameters according to an embodiment of the specification
  • FIG. 5 is a flowchart of a method for determining model parameters according to an embodiment of the specification
  • FIG. 6 is a flowchart of a method for determining model parameters according to an embodiment of the specification
  • FIG. 7 is a schematic diagram of the functional structure of a model parameter determination device according to an embodiment of the specification.
  • FIG. 8 is a schematic diagram of the functional structure of a model parameter determining device according to an embodiment of the specification.
  • FIG. 9 is a flowchart of a method for determining model parameters according to an embodiment of the specification.
  • FIG. 10 is a flowchart of a method for determining model parameters according to an embodiment of the specification
  • FIG. 11 is a flowchart of a method for determining model parameters according to an embodiment of this specification.
  • FIG. 12 is a schematic diagram of the functional structure of a model parameter determining device according to an embodiment of the specification.
  • FIG. 13 is a schematic diagram of the functional structure of a model parameter determination device according to an embodiment of the specification.
  • FIG. 14 is a schematic diagram of the functional structure of an electronic device according to an embodiment of the specification.
  • Multi-party secure computing (Secure Muti-Party Computation, MPC) is an algorithm that protects data privacy and security. Multi-party secure computing allows multiple data parties involved in the calculation to perform collaborative computing without exposing their own data.
  • Secret Sharing is an algorithm that protects data privacy and security, and can be used to implement multi-party secure computing.
  • multiple data parties can use secret sharing algorithms to perform collaborative calculations to obtain secret information without leaking their own data.
  • Each data party can obtain a share of the secret information.
  • a single data party cannot recover the secret information. Only multiple data parties can work together to recover the secret information.
  • the data party P 1 holds the data x 1
  • the data party P 2 holds the data x 2 .
  • the data party P 1 can obtain the share y 1 of the secret information y after the calculation
  • the data party P 2 can obtain the share y 2 of the secret information y after the calculation.
  • Garbled Circuit is a secure computing protocol that protects data privacy and can be used to implement secure multi-party computing.
  • a given calculation task for example, a function
  • the logic circuit may be composed of at least one arithmetic gate, and the arithmetic gate may include an AND gate, an OR gate, an exclusive OR gate, and so on.
  • the logic circuit may include at least two input lines and at least one output line, and an obfuscated circuit can be obtained by encrypting the input lines and/or output lines of the logic circuit. Multiple data parties can use the obfuscation circuit to perform collaborative calculations without leaking their own data to obtain the execution result of the calculation task.
  • Oblivious Transfer also known as oblivious transfer
  • OT is a two-party communication protocol that can protect privacy, enabling both parties to communicate to transfer data in a manner that blurs their choices.
  • the sender can have multiple data.
  • the recipient can obtain one or more of the plurality of data via inadvertent transmission. In this process, the sender does not know what data the receiver receives; and the receiver cannot obtain any data other than the data it receives.
  • the inadvertent transmission protocol is the basic protocol for obfuscating circuits. In the process of using obfuscated circuits for cooperative calculations, inadvertent transmission protocols are usually used.
  • the data party P 1 holds data x 1 and data x 3
  • the data party P 2 holds data x 2
  • the logic circuit is composed of AND gate 1 and AND gate 2.
  • the logic circuit may include an input line a, an input line b, an input line d, an output line c, and an output line s.
  • the truth table corresponding to gate 1 can be as shown in Table 1.
  • Data party P 1 can generate two random numbers with Corresponding to the two input values 0 and 1 of the input line a; two random numbers can be generated with Corresponding to the two input values 0 and 1 of the input line b respectively; two random numbers can be generated with Corresponding to the two output values 0 and 1 of the output line c respectively.
  • Table 2 the randomized truth table shown in Table 2 can be obtained.
  • Data party P 1 can separately assign random numbers with As the key, the random number Encryption, get random number ciphertext Random number with As the key, the random number Encryption, get random number ciphertext Random number with As the key, the random number Encryption, get random number ciphertext Random number with As the key, the random number Encryption, get random number ciphertext From this, the encrypted randomized truth table shown in Table 3 can be obtained.
  • the data party P 1 can disrupt the arrangement order of the rows in Table 3 to obtain the confusion truth table shown in Table 4.
  • the data party P 1 can also generate the confusion truth table of AND gate 2.
  • the specific process is similar to the process of generating the confusion truth table of AND gate 1, and will not be described in detail here.
  • the data party P 1 can respectively send the confusion truth table of AND gate 1 and the confusion truth table of AND gate 2 to the data party P 2 .
  • the data party P 2 can receive the confusion truth table of AND gate 1 and the confusion truth table of AND gate 2.
  • the data party P 1 can send the random number corresponding to each bit of the data x 1 on the input line a to the data party P 2 ; can send each bit of the data x 3 on the random number corresponding to the input line d To the data party P 2 .
  • the data party P 2 can receive the random number corresponding to each bit of the data x 1 and the data x 3 .
  • data x 1 b 0 ⁇ 2 0 +b 1 ⁇ 2 1 +...+b i ⁇ 2 i +....
  • the data cube P 1 b i may be the corresponding input line A random number Send to the data party P 2 ; when the value of b i is 1, the data party P 1 can put the random number of bi on the input line a Sent to the data party P 2 .
  • Data party P 1 can be a random number with As input, the data party P 2 can take each bit of the data x 2 as input, and the two can inadvertently transmit. The data party P 2 can obtain a random number corresponding to each bit of data x 2 . Specifically, the data party P 1 can generate two random numbers with Corresponding to the two input values 0 and 1 of the input line d. So for each bit of data x 2 , the data party P 1 can be a random number with As the secret information input in the inadvertent transmission process, the data party P 2 can use this bit as the selection information input in the inadvertent transmission process for inadvertent transmission.
  • the data party P 2 can obtain the random number corresponding to the bit on the input line d. Specifically, when the value of this bit is 0, the data party P 2 can obtain a random number When the value of this bit is 1, the data party P 2 can obtain a random number According to the characteristics of inadvertent transmission, the data party P 1 does not know which random number the data party P 2 specifically selected, and the data party P 2 cannot know other random numbers other than the selected random number.
  • the data party P 2 obtains the random number corresponding to each bit of the data x 1 , the data x 2 and the data x 3 .
  • the data party P 2 can use the random number corresponding to each bit of the data x 1 on the input line a and the random number corresponding to the corresponding bit of the data x 2 on the input line b to try to confuse the truth table of the AND gate 1.
  • Decrypt the 4 random number ciphertexts the data party P 2 can only successfully decrypt one of the random number ciphertexts, thereby obtaining a random number on the output line c.
  • the data party P 2 can use the random number corresponding to the input line d of the corresponding bit of the data x 3 and the decrypted random number of the output line c to try to confuse the 4 random numbers in the truth table of the AND gate 2.
  • the ciphertext is decrypted; the data party P 2 can only successfully decrypt one of the random ciphertexts, and obtain a random number on the output line s.
  • the data party P 2 can send the decrypted random number of the output line s to the data party P 1 .
  • the data party P 1 can receive the random number of the output line s; the output value of the output line s can be obtained according to the random number of the output line s and the correspondence between the random number and the output value.
  • Loss function can be used to measure the degree of inconsistency between the predicted value of the data processing model and the true value. The smaller the value of the loss function, the better the robustness of the data processing model.
  • the loss function includes but is not limited to a logarithmic loss function (Logarithmic Loss Function), a square loss function (Square Loss), and the like.
  • Hessian matrix also known as Hessian matrix, Hessian matrix or Hessian matrix, etc.
  • Hessian matrix is a square matrix formed by the second-order partial derivative of the loss function, used to express the local curvature of the loss function.
  • Activation function also known as activation function, can be used to build data processing models.
  • the excitation function defines the output at a given input.
  • the excitation function is usually a nonlinear function. Non-linear factors can be added to the data processing model through the excitation function, which improves the expressive ability of the data processing model.
  • the activation function may include Sigmoid function, Tanh function, ReLU function and so on.
  • the data processing model may include a logistic regression model and a neural network model.
  • the data processing model includes but is not limited to logistic regression model and neural network model.
  • the model parameter optimization method can be used to optimize and adjust the model parameters of the data processing model.
  • Model parameter optimization methods may include gradient descent method, Newton method, and so on.
  • the Newton's method may include primitive Newton's method and various deformation methods based on primitive Newton's method (such as damping Newton's method, regularized Newton's method, etc.; regularized Newton's method refers to Newton's method with regularization terms; regularization) Modification can reduce the complexity and instability of the model, thereby reducing the risk of overfitting).
  • the method for optimizing model parameters can be implemented only in a secret sharing manner; or, it can also be implemented in a combination of secret sharing and obfuscating circuits.
  • This specification provides an embodiment of the model parameter determination system.
  • the model parameter determination system may include a first data party, a second data party, and a trusted third party (TTP, Trusted Third Party).
  • TTP Trusted Third Party
  • the third party may be one server; or, it may also be a server cluster including multiple servers.
  • the third party is used to provide random numbers to the first data party and the second data party.
  • the third party may generate a random orthogonal matrix, and each random number in the random orthogonal matrix may be split into two shares, and one of the shares may be used as the first share, and the other share may be used as the first share.
  • the third party may use the matrix formed by the first share of each random number in the random orthogonal matrix as the first share of the random orthogonal matrix, and calculate the second share of each random number in the random orthogonal matrix.
  • the formed matrix is used as the second share of the random orthogonal matrix; the first share of the random orthogonal matrix may be sent to the first data party, and the random orthogonal matrix may be sent to the second data party Second share.
  • the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix.
  • the random orthogonal matrix may be a random number matrix composed of random numbers; on the other hand, the random orthogonal matrix may also be an orthogonal matrix. After a square matrix is multiplied by an orthogonal matrix, a new matrix can be obtained, which has the same condition number as the square matrix.
  • the third party can also generate the first OT random number and the second OT random number;
  • the first data party sends the first OT random number;
  • the second OT random number may be sent to the second data party.
  • the OT random number can be a random number used during inadvertent transmission.
  • the first data party and the second data party are respectively two parties of cooperative security modeling.
  • the first data party may be a data party holding characteristic data
  • the second data party may be a data party holding a tag.
  • the first data party may hold complete feature data
  • the second data party may hold a label of the feature data.
  • the first data party may hold a part of the feature data
  • the second data party may hold another part of the feature data and a label of the feature data.
  • the characteristic data may include the user's savings amount and loan amount.
  • the first data party may hold the user's savings amount
  • the second data party may hold the user's loan amount and the tag of the characteristic data.
  • the tag can be used to distinguish different types of characteristic data, and the specific value can be taken from 0 and 1, for example.
  • the data party here can be an electronic device.
  • the electronic equipment may include a personal computer, a server, a handheld device, a portable device, a tablet device, a multi-processor device; or, it may also include a cluster formed by any of the above devices or devices.
  • the feature data and its corresponding labels together constitute sample data, and the sample data can be used to train the data processing model.
  • the first data party and the second data party may each obtain a share of the first model parameter.
  • the share obtained by the first data party may be used as the first share of the first model parameter
  • the share obtained by the second data party may be used as the second share of the first model parameter.
  • the sum of the first share of the first model parameter and the second share of the first model parameter is equal to the first model parameter.
  • the first data party may receive the first share of the random orthogonal matrix and the first OT random number.
  • the second data party may receive the second share of the random orthogonal matrix and the second OT random number.
  • the first data party may be based on the first share of the first model parameter, characteristic data, the first share of the random orthogonal matrix, and the first OT random number
  • the second data party may be based on the first model parameter
  • the second share, the label value, the second share of the random orthogonal matrix, and the second OT random number cooperate to determine the new first model parameter.
  • the first data party and the second data party may each obtain a share of the new first model parameter.
  • model parameter determination method embodiment please refer to the following model parameter determination method embodiment.
  • Step S11 The first data party performs communication based on the confusion circuit corresponding to the excitation function according to the first share of the first product, and the second data party uses the second share of the first product.
  • the first data party obtains the first share of the value of the excitation function
  • the second data party obtains the second share of the value of the excitation function.
  • Step S13 The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the gradient of the loss function based on the label and the second share of the incentive function.
  • the first data party obtains the first share of the loss function gradient, and the second data party obtains the second share of the loss function gradient.
  • Step S15 The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the Hessian matrix according to the second share of the value obtained by the incentive function.
  • the first data party gets the first share of the Hessian matrix
  • the second data party gets the second share of the Hessian matrix.
  • Step S17 The first data party secretly shares the first inverse matrix according to the first share of the Hessian matrix, and the second data party secretly shares the first inverse matrix according to the second share of the Hessian matrix.
  • the first data party obtains the first share of the first inverse matrix
  • the second data party obtains the second share of the first inverse matrix.
  • the first inverse matrix is the inverse matrix of the Hessian matrix.
  • Step S19 The first data party according to the first share of the first model parameter, the first share of the first inverse matrix and the first share of the loss function gradient, and the second data party according to the second share, first share of the first model parameter
  • the second share of the inverse matrix and the second share of the gradient of the loss function secretly share the new first model parameters.
  • the first data party obtains the first share of the new first model parameter
  • the second data party obtains the second share of the new first model parameter.
  • the first product, the second product, the third product, the fourth product and the fifth product may be a product between the first model parameter and the feature data.
  • the second product may be a product between a random orthogonal matrix and a Hessian matrix.
  • the third product may be the product between the inverse matrix of the Hessian matrix and the gradient of the loss function.
  • the fourth product may be the product of the first share of the gradient of the loss function and the preset step size.
  • the fifth product may be the product of the second share of the gradient of the loss function and the preset step size.
  • the first product may be expressed as XW; where W represents a first model parameter, specifically a vector formed by the first model parameter; X represents feature data, specifically a matrix formed by feature data.
  • the second product may be expressed as HR, where H represents a Hessian matrix, and R represents a random orthogonal matrix.
  • the third product may be expressed as H -1 dW, where H -1 represents the inverse matrix of the Hessian matrix, dW represents the gradient of the loss function, and dW is a vector.
  • the fourth product may be expressed as G ⁇ dW> 0
  • the fifth product may be expressed as G ⁇ dW> 1 .
  • G represents the preset step size
  • ⁇ dW> 0 represents the first share of the loss function gradient
  • ⁇ dW> 1 represents the second share of the loss function gradient
  • ⁇ dW> 0 + ⁇ dW> 1 dW.
  • the first inverse matrix and the second inverse matrix Since the Hessian matrix is a square matrix, the Hessian matrix can be inverted, and the inverse matrix of the Hessian matrix can be used as the first inverse matrix.
  • the second product may be a square matrix, and thus the second product may be inverted, and the inverse matrix of the second product may be used as the second inverse matrix.
  • the first inverse matrix may be expressed as H -1
  • the second inverse matrix may be expressed as (HR) -1 .
  • the first data party may be based on the held feature data and the first share of the first model parameter, and the second data party may be based on the held first model parameter.
  • the second share secretly shares the first product.
  • the first data party and the second data party may each obtain a share of the first product.
  • the share obtained by the first data party may be used as the first share of the first product
  • the share obtained by the second data party may be used as the second share of the first product.
  • the sum of the first share of the first product and the second share of the first product is equal to the first product.
  • the first share of the first model parameter can be expressed as ⁇ W> 0
  • the first data party may secretly share the first product XW according to X and ⁇ W> 0
  • the second data party may secretly share the first product XW according to ⁇ W> 1 .
  • the first data party can obtain the first share of the first product ⁇ XW> 0
  • the second data party can obtain the second share of the first product ⁇ XW> 1 .
  • ⁇ XW> 0 + ⁇ XW> 1 XW.
  • a corresponding logic circuit can be constructed according to the excitation function.
  • the logic circuit can be constructed by the first data party; alternatively, it can also be constructed by the second data party; or alternatively, it can also be constructed by other devices (for example, a trusted third party).
  • the logic circuit may be composed of at least one arithmetic gate, and the arithmetic gate may include an AND gate, an OR gate, an exclusive OR gate, and so on.
  • the logic circuit may include at least two input lines and at least one output line, and an obfuscated circuit can be obtained by encrypting the input lines and/or output lines of the logic circuit.
  • the confusion circuit may include a confusion truth table of each arithmetic gate in the logic circuit.
  • the logic circuit can be constructed directly according to the excitation function; alternatively, various appropriate modifications can be made to the excitation function, and the logical circuit can be constructed according to the deformed excitation function; or, the excitation function can also be used Generate other functions as a basis, and build logic circuits based on other functions.
  • the activation function and the confusion circuit can be understood as: the confusion circuit is generated based on the logic circuit of the activation function, or the confusion circuit is generated based on the confusion circuit of the deformed activation function, or the confusion circuit is Generated according to the logic circuit of other functions.
  • Both the first data party and the second data party may have a confusion circuit corresponding to an excitation function.
  • the obfuscation circuit may be generated by the first data party.
  • the first data party may send the generated obfuscation circuit to the second data party.
  • the second data party may receive the obfuscation circuit.
  • the obfuscation circuit may also be generated by the second data party.
  • the second data party may send the generated obfuscation circuit to the first data party.
  • the first data party may receive the obfuscation circuit.
  • the first data party can communicate based on the first share of the first product, and the second data party can communicate based on the confusion circuit corresponding to the excitation function according to the second share of the first product.
  • the first data party and the second data party may each obtain a share of the value of the incentive function.
  • the share obtained by the first data party may be used as the first share of the value of the incentive function
  • the share obtained by the second data party may be used as the second share of the value of the incentive function.
  • the sum of the first share of the value of the excitation function and the second share of the value of the excitation function is equal to the value of the excitation function.
  • x 1 is used to represent the first share of the first product
  • x 2 is used to represent the second share of the first product
  • x 3 is used to represent a share of the value of the incentive function (hereinafter referred to as the value of the incentive function
  • the second share) the value of f 1 (x 1 , x 2 , x 3 ) is used to represent another share of the value of the excitation function (hereinafter referred to as the first share of the value of the excitation function).
  • the second data party may generate a share of the value of the incentive function as the second share.
  • the first data party can use the first share of the first product as the input to the confusion circuit
  • the second data party can use the second share of the first product and the second share of the value of the incentive function as the confusion circuit.
  • the first data party may calculate another share of the value of the excitation function based on the confusion circuit as the first share. For the specific calculation process, please refer to the previous example of the scene introducing the confusion circuit, which will not be detailed here.
  • a piecewise linear function may also be used to fit the excitation function.
  • a corresponding logic circuit can be constructed according to the piecewise linear function, and the confusion circuit can be obtained by encrypting the input line and/or output line of the logic circuit.
  • Both the first data party and the second data party may possess the obfuscated circuit.
  • the activation function may be a Sigmoid function
  • the piecewise linear function may be k represents the coefficient of the piecewise linear function.
  • the first data party can communicate based on the confusion circuit based on the first share of the first product
  • the second data party can communicate based on the confusion circuit based on the second share of the first product.
  • the first data party and the second data party may respectively obtain a share of the value of the piecewise linear function.
  • the share obtained by the first data party may be used as the first share of the value of the piecewise linear function
  • the share obtained by the second data party may be used as the second share of the value of the piecewise linear function.
  • the sum of the first share of the value of the piecewise linear function and the second share of the value of the piecewise linear function is equal to the value of the piecewise linear function.
  • the first data party may use the first share of the value of the piecewise linear function as the first share of the value of the excitation function.
  • the second data party may use the second share of the value of the piecewise linear function as the second share of the value of the excitation function.
  • the first data party may take the first share of the value based on the characteristic data and the incentive function, and the second data party may also take the second share of the value based on the label and the incentive function.
  • Secretly share the gradient of the loss function The first data party and the second data party may obtain a share of the gradient of the loss function respectively.
  • the share obtained by the first data party may be used as the first share of the loss function gradient
  • the share obtained by the second data party may be used as the second share of the loss function gradient.
  • the sum of the first share of the gradient of the loss function and the second share of the gradient of the loss function is equal to the gradient of the loss function.
  • the first data party can secretly share the gradient dW (specifically a vector) of the loss function based on X and ⁇ a> 0
  • the second data party can secretly share the gradient dW of the loss function based on the label Y and ⁇ a> 1
  • the first data party can obtain the first share of the loss function gradient ⁇ dW> 0
  • the second data party can obtain the second share of the loss function gradient ⁇ dW> 1 .
  • the party may be the first data X
  • the second party data may ⁇ a> 1, secret sharing X T ⁇ a> 1.
  • the first data party can obtain ⁇ [X T ⁇ a> 1 ]> 0
  • the second data party can obtain ⁇ [X T ⁇ a> 1 ]> 1 .
  • ⁇ [X T ⁇ a> 1 ]> 0 + ⁇ [X T ⁇ a> 1 ]> 1 X T ⁇ a> 1 .
  • the first data party may also secretly share X T Y according to X
  • the second data party may also secretly share X T Y according to tag Y (specifically, a vector formed by tags).
  • the first data party can obtain ⁇ X T Y> 0
  • the second data party can obtain ⁇ X T Y> 1 .
  • ⁇ X T Y> 0 + ⁇ X T Y> 1 X T Y.
  • the first data party can calculate X T ⁇ a> 0 ; can calculate X T ⁇ a> 0 + ⁇ [X T ⁇ a> 1 ]> 0 - ⁇ X T Y> 0 as the first of the loss function gradient dW Share ⁇ dW> 0 .
  • the second data party may calculate ⁇ [X T ⁇ a> 1 ]> 1- ⁇ X T Y> 1 as the second share of the loss function gradient dW ⁇ dW> 1 .
  • the first data party may obtain the first share of the value according to the characteristic data and the incentive function, and the second data party may secretly share the value according to the second share of the incentive function.
  • Hessian matrix The first data party and the second data party may obtain a share of the Hessian matrix respectively.
  • the share obtained by the first data party may be used as the first share of the Hessian matrix
  • the share obtained by the second data party may be used as the second share of the Hessian matrix.
  • the sum of the first share of the Hessian matrix and the second share of the Hessian matrix is equal to the Hessian matrix.
  • the first data party may secretly share the diagonal matrix according to the first share of the value of the incentive function
  • the second data party may secretly share the diagonal matrix according to the second share of the value of the incentive function.
  • the first data party and the second data party may obtain a share of the diagonal matrix respectively.
  • the share obtained by the first data party may be used as the first share of the diagonal matrix
  • the share obtained by the second data party may be used as the second share of the diagonal matrix.
  • the sum of the first share of the diagonal matrix and the second share of the diagonal matrix is equal to the diagonal matrix.
  • the first data party can secretly share the Hessian matrix according to the feature data and the first share of the diagonal matrix
  • the second data party can secretly share the Hessian matrix according to the second share of the diagonal matrix.
  • the first data party can obtain the first share of the Hessian matrix
  • the second data party can obtain the second share of the Hessian matrix.
  • the first data party can secretly share the diagonal matrix RNN according to ⁇ a> 0 and the second data party can secretly share the diagonal matrix RNN according to ⁇ a> 1 .
  • the first data party can obtain the first share RNN 0 of the diagonal matrix
  • the second data party can obtain the second share RNN 1 of the diagonal matrix.
  • the first party data may ⁇ a> 0, the second party data may ⁇ a> 1, secret sharing ⁇ a> 0 ⁇ ⁇ a> 1.
  • the first data party can obtain ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 0
  • the second data party can obtain ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 1 .
  • ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 0 + ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 1 ⁇ a> 0 ⁇ a> 1 .
  • represents the bitwise multiplication operation.
  • ⁇ r> 0 ⁇ r> 1
  • the first party data may be ⁇ r> as data element 0 of the data element on the main diagonal RNN 0, thus achieved under ⁇ r> 0 0 RNN generated; may ⁇ r> 1 data element as a data element on the main diagonal RNN 1, thus realized ⁇ r> 1 generated according RNN 1.
  • the first data party can secretly share the Hessian matrix H according to X and RNN 0
  • the second data party can secretly share the Hessian matrix H according to RNN 1
  • the first data party can obtain the first share ⁇ H> 0 of the Hessian matrix
  • the second data party can obtain the second share ⁇ H> 1 of the Hessen matrix.
  • the party may be the first data X
  • the second party data may RNN 1, secret sharing X T RNN 1.
  • the first data party can obtain ⁇ X T RNN 1 > 0
  • the second data party can obtain ⁇ X T RNN 1 > 1 .
  • ⁇ X T RNN 1 > 0 + ⁇ X T RNN 1 > 1 X T RNN 1 .
  • the first party data may also according to X
  • the second party may also be in accordance with data ⁇ X T RNN 1> 1, secret sharing ⁇ X T RNN 1> 1 X.
  • the first data party can obtain ⁇ [ ⁇ X T RNN 1 > 1 X]> 0
  • the second data party can obtain ⁇ [ ⁇ X T RNN 1 > 1 X]> 1 .
  • the first data party can calculate X T RNN 0 X+ ⁇ X T RNN 1 > 0 X+ ⁇ [ ⁇ X T RNN 1 > 1 X]> 0 as the first share of the Hessian matrix H ⁇ H> 0 .
  • the second data party may use ⁇ [ ⁇ X T RNN 1 > 1 X]> 1 as the second share of the Hessian matrix H ⁇ H> 1 .
  • the third party may issue the first share of the random orthogonal matrix to the first data party; may issue the second share of the random orthogonal matrix to the second data party.
  • the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix.
  • the first data party may receive a first share of a random orthogonal matrix
  • the second data party may receive a second share of a random orthogonal matrix.
  • the first data party can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix
  • the second data party can be based on the second share of the random orthogonal matrix and the first share of the Hessian matrix.
  • the second share of the matrix secretly shares the second product.
  • the first data party and the second data party may each obtain a share of the second product.
  • the share obtained by the first data party may be used as the first share of the second product
  • the share obtained by the second data party may be used as the second share of the second product.
  • the sum of the first share of the second product and the second share of the second product is equal to the second product.
  • the second data party may perform inversion processing on the second product.
  • the first data party may send the first share of the second product to the second data party.
  • the second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product. Since the second product is a square matrix, the second data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix;
  • the data party sends the second inverse matrix.
  • the first data party may receive the second inverse matrix.
  • the first data party may also perform inversion processing on the second product.
  • the second data party may send the second share of the second product to the first data party.
  • the first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product. Since the second product is a square matrix, the first data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix.
  • the second data party may receive the second inverse matrix.
  • the first data party may multiply the first share of the random orthogonal matrix by the second inverse matrix to obtain the first share of the first inverse matrix.
  • the second data party may multiply the second share of the random orthogonal matrix by the second inverse matrix to obtain the second share of the first inverse matrix.
  • the sum of the first share of the first inverse matrix and the second share of the first inverse matrix is equal to the first inverse matrix.
  • the first share of the random orthogonal matrix can be expressed as ⁇ R> 0
  • the first data party may secretly share the second product HR according to ⁇ R> 0 and ⁇ H> 0
  • the second data party may secretly share the second product HR according to ⁇ R> 1 and ⁇ H> 1
  • the first data party can obtain the first share of the second product ⁇ HR> 0
  • the second data party can obtain the second product second share ⁇ HR> 1 .
  • the detailed process of the first data party and the second data party secretly sharing the second product HR is described below.
  • the first party data may ⁇ H> 0, the second party data may ⁇ R> 1, secret sharing ⁇ H> 0 ⁇ R> 1 .
  • the first data party can obtain ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 .
  • ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 ⁇ H> 0 ⁇ R> 1 .
  • the first data party may also secretly share ⁇ H> 1 ⁇ R> 0 according to ⁇ R> 0 and the second data party may also secretly share ⁇ H> 1 ⁇ R> 0 according to ⁇ H> 1 .
  • the first data party can obtain ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 .
  • ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 ⁇ H> 1 ⁇ R> 0 .
  • the first data party can calculate ⁇ H> 0 ⁇ R> 0 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0 as the second product of One share ⁇ HR> 0 .
  • the second data party can calculate ⁇ H> 1 ⁇ R> 1 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 as the second product of Second share ⁇ HR> 1 .
  • the second data party performs inversion processing on the second product HR.
  • the first data party may send the first share of the second product ⁇ HR> 0 to the second data party.
  • the second data party may receive the first share of the second product ⁇ HR> 0 ; may compare the first share of the second product ⁇ HR> 0 with the second share of the second product held by itself ⁇ HR> 1 was added to give a second product of the HR; inversion process may be performed on the second product HR, to obtain a second inverse matrix (HR) -1; may send a second inverse matrix (HR) -1 to the first party data.
  • the first data party may receive the second inverse matrix (HR) -1 .
  • the first data party may multiply the second inverse matrix (HR) -1 by the first share of the random orthogonal matrix ⁇ R> 0 to obtain the first share of the first inverse matrix H -1 ⁇ H -1 > 0 .
  • the second data party may multiply the second inverse matrix (HR) -1 by the second share of the random orthogonal matrix ⁇ R> 1 to obtain the first share of the first inverse matrix H -1 ⁇ H -1 > 1 .
  • the first data party may be based on the first share of the first inverse matrix and the first share of the loss function gradient
  • the second data party may be based on the first share of the first inverse matrix.
  • the second share and the second share of the gradient of the loss function secretly share the third product.
  • the first data party and the second data party may each obtain a share of the third product.
  • the share obtained by the first data party may be used as the first share of the third product
  • the share obtained by the second data party may be used as the second share of the third product.
  • the sum of the first share of the third product and the second share of the third product is equal to the third product.
  • the first data party may subtract the first share of the first model parameter from the first share of the third product to obtain the first share of the new first model parameter.
  • the second data party may subtract the second share of the first model parameter from the second share of the third product to obtain the second share of the new first model parameter.
  • the first data party can secretly share the third party according to ⁇ H -1 > 0 and ⁇ dW> 0
  • the second data party can secretly share the third party according to ⁇ H -1 > 1 and ⁇ dW> 1
  • the first data party can obtain the first share of the third product ⁇ H -1 ⁇ dW> 0
  • the second data party can obtain the second share of the third product ⁇ H -1 ⁇ dW> 1 .
  • the following describes the detailed process of the first data party and the second data party secretly sharing the third product H -1 ⁇ dW.
  • the first party data may ⁇ H -1> 0, the second party data may ⁇ dW> 1, secret sharing ⁇ H -1> 0 ⁇ dW> 1.
  • the first data party can obtain ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 .
  • the first data party can also secretly share ⁇ H -1 > 1 ⁇ dW> 0 according to ⁇ dW> 0 and the second data party can also secretly share ⁇ H -1 > 1 ⁇ dW> 0 according to ⁇ H -1 > 1 .
  • the first data party can obtain ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1 .
  • the first data party can calculate ⁇ H -1 > 0 ⁇ dW> 0 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0
  • the first share as the third product ⁇ H -1 ⁇ dW> 0
  • the second data party can calculate ⁇ H -1 > 1 ⁇ dW> 1 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1
  • the second share as the third product ⁇ H -1 ⁇ dW> 1 .
  • H -1 ⁇ dW ⁇ H -1 ⁇ dW> 0 + ⁇ H -1 ⁇ dW> 1
  • Newton's method has a faster convergence rate.
  • the method for determining model parameters in step S11-step S19 due to the use of Newton’s method, can not only protect the data privacy of the parties in the cooperative modeling (the first data party and the second data party), but also reduce the number of model parameter optimization adjustments. Improve the training efficiency of data processing models.
  • the excitation function in the data processing model is usually a non-linear function
  • the operations involved are non-linear operations, so its value cannot be directly calculated using the secret sharing algorithm. Therefore, if only secret sharing is used to determine the model parameters of the data processing model cooperatively using the Newton method, a polynomial needs to be used to fit the excitation function.
  • the use of polynomials to fit the excitation function has the problem of out of bounds (when the input of the polynomial exceeds a certain range, its output will become very large or very small), which may cause the data processing model to fail to complete the training.
  • the complexity of the confusion circuit is relatively high.
  • step S11-step S19 through the combination of secret sharing and obfuscation circuit, can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process.
  • the first data party before step S17, can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party can be based on the second share of the random orthogonal matrix and the sea.
  • the second share of the Sen matrix secretly shares the second product.
  • the first data party can obtain the first share of the second product, and the second data party can obtain the second share of the second product.
  • the second product is a product between a random orthogonal matrix and a Hessian matrix.
  • step S17 when the condition number of the second product satisfies the preset condition, the first data party can secretly share the first share according to the first share of the Hessian matrix, and the second data party can secretly share the first share according to the second share of the Hessian matrix.
  • An inverse matrix The first data party can obtain the first share of the first inverse matrix, and the second data party can obtain the second share of the first inverse matrix.
  • the preset condition may include: the number of conditions is less than or equal to a preset threshold.
  • the preset threshold may be an empirical value, or it may also be obtained by other means (for example, a machine learning method).
  • Both the first data party and the second data party may hold the preset conditions. Furthermore, the first data party and the second data party may respectively determine whether the condition number of the second product satisfies the preset condition.
  • the condition number of the second product may be calculated by the first data party. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be determined whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the second data party.
  • the second data party can receive the condition number of the second product; and can determine whether the condition number of the second product meets the preset condition. In some other embodiments, the second data party may also calculate the condition number of the second product. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be judged whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the first data party. The first data party can receive the condition number of the second product; and can judge whether the condition number of the second product meets the preset condition.
  • the second data party may send the second share of the second product to the first data party.
  • the first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the second data party.
  • the second data party may receive the judgment result information.
  • only the second data party may hold the preset condition, and then only the second data party may determine whether the condition number of the second product meets the preset condition.
  • the first data party may send the first share of the second product to the second data party.
  • the second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the first data party.
  • the first data party may receive the judgment result information.
  • a square matrix can be multiplied by an orthogonal matrix to obtain a new matrix, which has the same condition number as the square matrix. Since the Hessian matrix is a square matrix, the condition number of the second product is equal to the condition number of the Hessian matrix. In this way, the first data party and the second data party can collaboratively calculate the condition number of the Hessian matrix without leaking their share of the Hessian matrix.
  • the condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, that is, it indicates that the Hessian matrix is less ill-conditioned, so the Newton method can be used to determine the model parameters.
  • the condition number of the second product does not meet the preset conditions, indicating that the second product is ill-conditioned, which means that the Hessian matrix is ill-conditioned, and the Newton method cannot be used to determine the model parameters, so the gradient descent method can be used instead
  • the Newton method determines the model parameters.
  • the first data party may calculate the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step size.
  • the second data party may calculate the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step size.
  • the preset step length can be used to control the iteration speed of the gradient descent method.
  • the preset step length can be any suitable positive real number. For example, when the preset step size is too large, the iteration speed will be too fast, resulting in the possibility that the optimal model parameters cannot be obtained. When the preset step size is too small, the iteration speed will be too slow, resulting in a longer time.
  • the preset step length may specifically be an empirical value; alternatively, it may also be obtained by means of machine learning. Of course, the preset step length can also be obtained in other ways. Both the first data party and the second data party may hold the preset step size.
  • the first data party may multiply the first share of the loss function gradient by the preset step size to obtain the fourth product; may subtract the first share of the first model parameter and the fourth product to obtain a new first The first share of model parameters.
  • the second data party may multiply the second share of the loss function gradient by the preset step size to obtain the fifth product; may subtract the second share of the first model parameter and the fifth product to obtain the new first The second share of model parameters.
  • the sum of the first share of the new first model parameter and the second share of the new first model parameter is equal to the new first model parameter.
  • the second data party may multiply the second share of the gradient of the loss function ⁇ dW> 1 (specifically a vector) by the preset step size G (specifically a multiplication of the vector) to obtain the fifth product G ⁇ dW> 1 ;
  • ⁇ W'> 0 + ⁇ W'> 1 W'
  • W' represents the new first model parameter.
  • this embodiment can avoid the problem of non-convergence caused by the ill-conditioned matrix in the process of using the Newton method to determine the model parameters.
  • it may further include a process of iterative optimization and adjustment of the model parameters of the data processing model.
  • the step of secretly sharing the first product can be repeated, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product.
  • the new first product is the product of the feature data and the new first model parameter.
  • Step S11 may be repeatedly executed, the first data party can obtain the first share of the new excitation function value, and the second data party can obtain the second share of the new excitation function value.
  • Step S13 can be repeated, the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient.
  • Step S15 may be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix.
  • the step of secretly sharing the second product may be repeated, the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • Step S17 can be repeated, the first data party can obtain the first share of the new first inverse matrix, and the second data party can obtain the second share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new The second share of the first model parameter, the second share of the new first inverse matrix, and the second share of the new loss function gradient secretly share the second model parameters.
  • the first data party can obtain a first share of the second model parameter
  • the second data party can obtain a second share of the second model parameter.
  • the sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter.
  • the first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size.
  • the specific calculation process is similar to the process of calculating the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step length.
  • the second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size.
  • the specific calculation process is similar to the process of calculating the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step length.
  • the iterative process can be realized through a combination of secret sharing and obfuscation circuits.
  • the combination of secret sharing and obfuscation circuits can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process.
  • the gradient descent method is used.
  • it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
  • the step of secretly sharing the first product can be repeated, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product.
  • the new first product is the product of the feature data and the new first model parameter.
  • the first data party may secretly share the value of the new incentive function based on the first share of the new first product, and the second data party may secretly share the value of the new incentive function based on the second share of the new first product.
  • the first data party can obtain the first share of the value of the new excitation function, and the second data party can obtain the second share of the value of the new excitation function.
  • Step S13 can be repeated, the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient.
  • Step S15 may be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix.
  • the step of secretly sharing the second product may be repeated, the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • Step S17 can be repeated, the first data party can obtain the first share of the new first inverse matrix, and the second data party can obtain the second share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new first share.
  • the second share of a model parameter, the second share of the new first inverse matrix and the second share of the new loss function gradient secretly share the second model parameters.
  • the first data party can obtain a first share of the second model parameter
  • the second data party can obtain a second share of the second model parameter.
  • the sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter.
  • the iterative process can be realized through secret sharing.
  • due to the use of Newton's method not only can the data privacy of the parties in the cooperative modeling (the first data party and the second data party) be protected, but also the number of optimization adjustments of model parameters can be reduced, and the data processing model can be improved Training efficiency.
  • the first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size.
  • the specific calculation process is similar to the process of calculating the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step length.
  • the second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size.
  • the specific calculation process is similar to the process of calculating the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step length. In this way, the iterative process can be realized through secret sharing. In addition, in the iterative process, the gradient descent method is used.
  • the following describes the process in which the first data party secretly shares the value of the new incentive function based on the first share of the new first product, and the second data party secretly shares the value of the new incentive function based on the second share of the new first product.
  • the first data party may secretly share the value of the polynomial according to the first share of the new first product
  • the second data party may secretly share the value of the polynomial according to the second share of the new first product.
  • the first data party and the second data party may respectively obtain a share of the value of the polynomial.
  • the polynomial can be used to fit the activation function of the data processing model. In this way, the share obtained by the first data party may be used as the first share of the value of the new incentive function, and the share obtained by the second data party may be used as the second share of the value of the new incentive function.
  • the sum of the first share of the value of the new excitation function and the second share of the value of the new excitation function is equal to the value of the new excitation function.
  • the first data party and the second data party can cooperate to determine the model parameters of the data processing model without leaking the data held by themselves.
  • FIG. 3 An embodiment of the method for determining model parameters in this specification is described in detail above in conjunction with FIG. 3.
  • the above method steps performed by the first data party can be separately implemented as a model parameter determination method on the first data party's side; the method steps performed by the second data party can be separately implemented as a model parameter determination method on the second data party's side.
  • the following will describe in detail the method for determining model parameters on the side of the first data party and the method for determining model parameters on the side of the second data party in the embodiments of the present specification in conjunction with FIG. 5 and FIG. 6.
  • This specification also provides another embodiment of the method for determining model parameters.
  • the first data party is the execution subject, and the first data party may hold the share of the feature data and the first model parameter. Please refer to Figure 5.
  • This embodiment may include the following steps.
  • Step S21 Communicate with the partner according to the share of the first product and the confusion circuit corresponding to the excitation function to obtain the share of the value of the excitation function.
  • the first product is the product of the feature data and the first model parameter.
  • the cooperating party may be understood as a data party that performs cooperative security modeling with the first data party, and specifically may be the previous second data party.
  • the first data party may secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product; the confusion circuit corresponding to the incentive function may be obtained according to the share of the first product Communicate with the partner to get the share of the value of the incentive function.
  • step S11 please refer to the related description of step S11 above, which will not be repeated here.
  • Step S23 secretly share the gradient of the loss function with the partner according to the feature data and the value of the incentive function to obtain the share of the gradient of the loss function.
  • the first data party may secretly share the gradient of the loss function with the partner according to the share of the characteristic data and the value of the incentive function to obtain the share of the gradient of the loss function.
  • step S13 please refer to the related description of step S13, which will not be repeated here.
  • Step S25 secretly share the Hessian matrix with the partner according to the share of the characteristic data and the value of the incentive function to obtain the share of the Hessian matrix.
  • the first data party may secretly share the diagonal matrix with the partner according to the value of the incentive function to obtain the share of the diagonal matrix; and may secretly share the diagonal matrix with the partner according to the feature data and the share of the diagonal matrix. Share the Hessian matrix and get the share of the Hessian matrix.
  • step S15 please refer to the related description of step S15 above, which will not be repeated here.
  • Step S27 secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix.
  • the first data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product.
  • the second product may be a product between a random orthogonal matrix and a Hessian matrix.
  • the first data party may send the share of the second product to the partner; may receive the second inverse matrix fed back by the partner, the second inverse matrix being the inverse of the second product; the second inverse matrix may be Multiply the share of the random orthogonal matrix to get the share of the first inverse matrix.
  • the first data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the first share of the second product.
  • the second product may be a product between a random orthogonal matrix and a Hessian matrix.
  • the first data party may receive the second share of the second product sent by the partner; may determine the second inverse matrix according to the first share of the second product and the second share of the second product, the second inverse matrix Is the inverse matrix of the second product; the second inverse matrix can be multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix.
  • step S17 please refer to the related description of step S17 above, which will not be repeated here.
  • Step S29 secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
  • the first data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product.
  • the third product may be a product between the first inverse matrix and the gradient of the loss function.
  • the first data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
  • the first data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is a random positive The product between the intersection matrix and the Hessian matrix.
  • the first data party may secretly share the first inverse matrix with the partner according to the share of the Hessian matrix when the condition number of the second product meets the preset condition to obtain the share of the first inverse matrix.
  • the first inverse matrix is the inverse matrix of the Hessian matrix.
  • the condition number of the second product can be calculated by the first data party and/or the partner.
  • the condition number of the second product is equal to the condition number of the Hessian matrix.
  • condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, and the Newton method can be used to determine the model parameters.
  • the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined by the Newton method. Therefore, the gradient descent method can be used instead of the Newton method to determine the model parameters.
  • the first data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. Specifically, the first data party may multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
  • the first data party may repeat the step of secretly sharing the first product to obtain a new share of the first product; may repeat step S21 to obtain a new share of the value of the incentive function; may repeat step S23 , Obtain the share of the new loss function gradient; repeat step S25 to obtain the share of the new Hessian matrix; repeat the step of secretly sharing the second product to obtain the share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • the first data party may repeat step S27 to obtain the share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
  • the first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  • the first data party may repeat the step of secretly sharing the first product to obtain a new share of the first product.
  • the first data party may secretly share the value of the incentive function with the partner according to the share of the new first product to obtain the share of the value of the new incentive function.
  • the first data party may repeat step S23 to obtain a new share of the loss function gradient; repeat step S25 to obtain a new share of the Hessian matrix; may repeat the step of secretly sharing the second product to obtain a new share The share of the second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • the first data party may repeat step S27, and the first data party may obtain the share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
  • the first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  • the first data party can cooperate with the partner to determine the model parameters of the data processing model under the premise of not leaking the data it owns, and obtain the share of the new first model parameters.
  • This specification also provides another embodiment of the method for determining model parameters.
  • the second data party is the execution subject, and the second data party may hold the share of the tag and the first model parameter. Please refer to Figure 6.
  • This embodiment may include the following steps.
  • Step S31 Communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the incentive function.
  • the first product is the product of the feature data and the first model parameter.
  • the cooperating party may be understood as a data party that performs cooperative security modeling with the second data party, and specifically may be the previous first data party.
  • the second data party may secretly share the first product with the partner according to the share of the first model parameter to obtain the share of the first product; the confusion circuit and the partner may be confused according to the share of the first product and the incentive function. Communication to obtain the share of the value of the excitation function.
  • step S11 For the specific process, please refer to the related description of step S11 above, which will not be repeated here.
  • Step S33 secretly share the gradient of the loss function with the partner according to the share of the label and the value of the incentive function to obtain the share of the gradient of the loss function.
  • the second data party may secretly share the gradient of the loss function with the partner according to the share of the tag and the value of the incentive function to obtain the share of the gradient of the loss function.
  • step S13 please refer to the related description of step S13, which will not be repeated here.
  • Step S35 secretly share the Hessian matrix with the partner according to the value of the incentive function to obtain the Hessian matrix.
  • the second data party may secretly share the diagonal matrix with the partner according to the value of the incentive function to obtain the share of the diagonal matrix; and may secretly share the Hesen with the partner according to the share of the diagonal matrix.
  • Matrix get the share of Hessian matrix.
  • Step S37 secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix.
  • the second data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product.
  • the second product may be a product between a random orthogonal matrix and a Hessian matrix.
  • the second data party may send the share of the second product to the partner; may receive the second inverse matrix fed back by the partner, the second inverse matrix being the inverse of the second product; the second inverse matrix may be Multiply the share of the random orthogonal matrix to get the share of the first inverse matrix.
  • the second data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the first share of the second product.
  • the second product may be a product between a random orthogonal matrix and a Hessian matrix.
  • the second data party may receive the second share of the second product sent by the partner; may determine the second inverse matrix according to the first share of the second product and the second share of the second product, the second inverse matrix Is the inverse matrix of the second product; the second inverse matrix can be multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix.
  • step S17 please refer to the related description of step S17 above, which will not be repeated here.
  • Step S39 secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
  • the second data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product.
  • the third product may be a product between the first inverse matrix and the gradient of the loss function.
  • the second data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
  • the second data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is a random positive The product between the intersection matrix and the Hessian matrix.
  • the second data party may secretly share the first inverse matrix with the partner according to the share of the Hessian matrix when the condition number of the second product satisfies the preset condition to obtain the share of the first inverse matrix.
  • the first inverse matrix is the inverse matrix of the Hessian matrix.
  • the condition number of the second product can be calculated by the second data party and/or the partner.
  • the condition number of the second product is equal to the condition number of the Hessian matrix.
  • condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, and the Newton method can be used to determine the model parameters.
  • the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined by the Newton method. Therefore, the gradient descent method can be used instead of the Newton method to determine the model parameters.
  • the second data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length.
  • the second data party may specifically multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
  • the second data party may repeat the step of secretly sharing the first product to obtain a new share of the first product; may repeat step S31 to obtain a share of the new incentive function value; may repeat step S33 , Obtain the share of the new loss function gradient; repeat step S35 to obtain the share of the new Hessian matrix; repeat the step of secretly sharing the second product to obtain the share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • the second data party may repeat step S37 to obtain the share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
  • the second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  • the second data party may repeat the step of secretly sharing the first product to obtain a new share of the first product.
  • the second data party may secretly share the value of the incentive function with the partner according to the share of the new first product to obtain the share of the value of the new incentive function.
  • the second data party may repeat step S33 to obtain a new share of the loss function gradient; repeat step S35 to obtain a new share of the Hessian matrix; repeat the step of secretly sharing the second product to obtain a new share The share of the second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • the second data party may repeat step S37 to obtain the share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
  • the second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  • the second data party can cooperate with the partner to determine the model parameters of the data processing model under the premise of not leaking the data owned by itself, and obtain the share of the new first model parameters.
  • model parameter determination device in the embodiment of this specification will be described in detail below in conjunction with FIG. 7 and FIG. 8.
  • This specification also provides an embodiment of the device for determining model parameters.
  • This embodiment can be applied to the first data party and can include the following units.
  • the incentive function value share acquisition unit 41 is configured to communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the value share of the incentive function, and the first product is the characteristic data and the first model Product of parameters;
  • the loss function gradient share obtaining unit 43 is configured to secretly share the gradient of the loss function with the partner according to the share of the characteristic data and the value of the incentive function, to obtain the share of the loss function gradient;
  • the Hessian matrix share obtaining unit 45 is configured to secretly share the Hessian matrix with the partner according to the share of the characteristic data and the incentive function to obtain the share of the Hessian matrix;
  • the first inverse matrix share obtaining unit 47 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
  • the model parameter share obtaining unit 49 is configured to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter .
  • This specification also provides another embodiment of the device for determining model parameters.
  • This embodiment can be applied to the second data party and can include the following units.
  • the incentive function value share obtaining unit 51 is configured to communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the value share of the incentive function, and the first product is the characteristic data and the first model Product of parameters;
  • the loss function gradient share acquisition unit 53 is used to secretly share the gradient of the loss function with the partner according to the value of the label and the incentive function to obtain the share of the loss function gradient;
  • the Hessian matrix share obtaining unit 55 is used to secretly share the Hessian matrix with the partner according to the share of the incentive function to obtain the Hessian matrix share;
  • the first inverse matrix share obtaining unit 57 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
  • the model parameter share obtaining unit 59 is configured to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter .
  • model parameter determination system may include a first data party, a second data party, and a trusted third party.
  • the third party may be one server; or, it may also be a server cluster including multiple servers.
  • the third party is used to provide random numbers to the first data party and the second data party.
  • the third party may generate a random orthogonal matrix, and each random number in the random orthogonal matrix may be split into two shares, and one of the shares may be used as the first share, and the other share may be used as the first share.
  • the third party may use the matrix formed by the first share of each random number in the random orthogonal matrix as the first share of the random orthogonal matrix, and calculate the second share of each random number in the random orthogonal matrix.
  • the formed matrix is used as the second share of the random orthogonal matrix; the first share of the random orthogonal matrix may be sent to the first data party, and the random orthogonal matrix may be sent to the second data party Second share.
  • the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix.
  • the random orthogonal matrix may be a random number matrix composed of random numbers; on the other hand, the random orthogonal matrix may also be an orthogonal matrix. After a square matrix is multiplied by an orthogonal matrix, a new matrix can be obtained, and the new matrix has the same condition number as the square matrix.
  • the third party can also generate the first OT random number and the second OT random number;
  • the first data party sends the first OT random number;
  • the second OT random number may be sent to the second data party.
  • the OT random number can be a random number used during inadvertent transmission.
  • the first data party and the second data party are respectively two parties of cooperative security modeling.
  • the first data party may be a data party holding characteristic data
  • the second data party may be a data party holding a tag.
  • the first data party may hold complete feature data
  • the second data party may hold a label of the feature data.
  • the first data party may hold a part of the characteristic data
  • the second data party may hold another part of the characteristic data and a label of the characteristic data.
  • the characteristic data may include the user's savings amount and loan amount.
  • the first data party may hold the user's savings amount
  • the second data party may hold the user's loan amount and the tag of the characteristic data.
  • the tag can be used to distinguish different types of characteristic data, and the specific value can be taken from 0 and 1, for example.
  • the data party here can be an electronic device.
  • the electronic equipment may include a personal computer, a server, a handheld device, a portable device, a tablet device, a multi-processor device; or, it may also include a cluster formed by any of the above devices or devices.
  • the feature data and its corresponding labels together constitute sample data, and the sample data can be used to train the data processing model.
  • the first data party and the second data party may each obtain a share of the first model parameter.
  • the share obtained by the first data party may be used as the first share of the first model parameter
  • the share obtained by the second data party may be used as the second share of the first model parameter.
  • the sum of the first share of the first model parameter and the second share of the first model parameter is equal to the first model parameter.
  • the first data party may receive the first share of the random orthogonal matrix and the first OT random number.
  • the second data party may receive the second share of the random orthogonal matrix and the second OT random number.
  • the first data party may be based on the first share of the first model parameter, characteristic data, the first share of the random orthogonal matrix, and the first OT random number
  • the second data party may be based on the first model parameter
  • the second share, the label, the second share of the random orthogonal matrix, and the second OT random number cooperate to determine the second model parameters.
  • the first data party and the second data party may adopt a secret sharing method and use Newton's method to collaboratively determine the new first model parameters; further, a combination of secret sharing and obfuscation circuits may be adopted, and gradients may be used. The descent method cooperates to determine the second model parameters.
  • Step S601 The first data party secretly shares the first product according to the first share of the characteristic data and the first model parameter, and the second data party secretly shares the first product according to the second share of the first model parameter.
  • the first data party gets the first share of the first product
  • the second data party gets the second share of the first product.
  • the first product is the product of the feature data and the first model parameter.
  • Step S603 The first data party secretly shares the value of the incentive function according to the first share of the first product, and the second data party secretly shares the value of the incentive function according to the second share of the first product.
  • the first data party obtains the first share of the value of the excitation function, and the second data party obtains the second share of the value of the excitation function.
  • Step S605 The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the gradient of the loss function based on the label and the second share of the incentive function.
  • the first data party obtains the first share of the loss function gradient, and the second data party obtains the second share of the loss function gradient.
  • Step S607 The first data party takes the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the Hessian matrix based on the second share of the value taken by the incentive function.
  • the first data party gets the first share of the Hessian matrix
  • the second data party gets the second share of the Hessian matrix.
  • Step S609 The first data party secretly shares the first share according to the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party secretly shares the first share according to the second share of the random orthogonal matrix and the second share of the Hessian matrix.
  • Two products The first data party gets the first share of the second product, and the second data party gets the second share of the second product.
  • the second product is a product between a random orthogonal matrix and a Hessian matrix.
  • Step S611 When the condition number of the second product meets the preset condition, the first data party secretly shares the first inverse matrix according to the first share of the Hessian matrix, and the second data party secretly shares the first inverse matrix according to the second share of the Hessian matrix.
  • the first data party obtains the first share of the first inverse matrix, and the second data party obtains the second share of the first inverse matrix.
  • the first inverse matrix is the inverse matrix of the Hessian matrix.
  • Step S613 The first data party uses the first share of the first model parameter, the first share of the first inverse matrix, and the first share of the loss function gradient, and the second data party uses the second share of the first model parameter, the first share of the loss function The second share of the inverse matrix and the second share of the gradient of the loss function secretly share the new first model parameters.
  • the first data party obtains the first share of the new first model parameter, and the second data party obtains the second share of the new first model parameter.
  • the first product, the second product, the third product, the fourth product and the fifth product may be a product between the first model parameter and the feature data.
  • the second product may be a product between a random orthogonal matrix and a Hessian matrix.
  • the third product may be the product between the inverse matrix of the Hessian matrix and the gradient of the loss function.
  • the fourth product may be the product of the first share of the gradient of the loss function and the preset step size.
  • the fifth product may be the product of the second share of the gradient of the loss function and the preset step size.
  • the first product may be expressed as XW; where W represents a first model parameter, specifically a vector formed by the first model parameter; X represents feature data, specifically a matrix formed by feature data.
  • the second product may be expressed as HR, where H represents a Hessian matrix, and R represents a random orthogonal matrix.
  • the third product may be expressed as H -1 dW, where H -1 represents the inverse matrix of the Hessian matrix, dW represents the gradient of the loss function, and dW is a vector.
  • the fourth product may be expressed as G ⁇ dW> 0
  • the fifth product may be expressed as G ⁇ dW> 1 .
  • G represents the preset step size
  • ⁇ dW> 0 represents the first share of the loss function gradient
  • ⁇ dW> 1 represents the second share of the loss function gradient
  • ⁇ dW> 0 + ⁇ dW> 1 dW.
  • the first inverse matrix and the second inverse matrix Since the Hessian matrix is a square matrix, the Hessian matrix can be inversed, and the inverse of the Hessian matrix can be used as the first inverse matrix.
  • the second product may be a square matrix, and thus the second product may be inverted, and the inverse matrix of the second product may be used as the second inverse matrix.
  • the first inverse matrix may be expressed as H -1
  • the second inverse matrix may be expressed as (HR) -1 .
  • the first data party may secretly share the feature data and the first share of the first model parameter, and the second data party may secretly share the second share of the first model parameter.
  • the first data party and the second data party may each obtain a share of the first product.
  • the share obtained by the first data party may be used as the first share of the first product
  • the share obtained by the second data party may be used as the second share of the first product.
  • the sum of the first share of the first product and the second share of the first product is equal to the first product.
  • the first share of the first model parameter can be expressed as ⁇ W> 0
  • the first data party may secretly share the first product XW according to X and ⁇ W> 0
  • the second data party may secretly share the first product XW according to ⁇ W> 1 .
  • the first data party can obtain the first share of the first product ⁇ XW> 0
  • the second data party can obtain the second share of the first product ⁇ XW> 1 .
  • ⁇ XW> 0 + ⁇ XW> 1 XW.
  • the first data party may secretly share the value of the polynomial according to the first share of the first product
  • the second data party may secretly share the value of the polynomial according to the second share of the first product.
  • the first data party and the second data party may respectively obtain a share of the value of the polynomial.
  • the polynomial can be used to fit the activation function of the data processing model. In this way, the share obtained by the first data party may be used as the first share of the value of the incentive function, and the share obtained by the second data party may be used as the second share of the value of the incentive function.
  • the sum of the first share of the value of the excitation function and the second share of the value of the excitation function is equal to the value of the excitation function.
  • the excitation function may be a Sigmoid function.
  • the first share of the value of the excitation function may be expressed as ⁇ a> 0
  • the second share of the value of the excitation function may be expressed as ⁇ a> 1 .
  • ⁇ a> 0 + ⁇ a> 1 a.
  • ⁇ a> 0 , ⁇ a> 1, and a are vectors respectively.
  • the first data party may take the first share of the value according to the characteristic data and the excitation function
  • the second data party may take the second share of the value according to the label and the excitation function, Secretly share the gradient of the loss function.
  • the first data party and the second data party may obtain a share of the gradient of the loss function respectively.
  • the share obtained by the first data party may be used as the first share of the loss function gradient
  • the share obtained by the second data party may be used as the second share of the loss function gradient.
  • the sum of the first share of the gradient of the loss function and the second share of the gradient of the loss function is equal to the gradient of the loss function.
  • the first data party can secretly share the gradient dW (specifically a vector) of the loss function based on X and ⁇ a> 0
  • the second data party can secretly share the gradient dW of the loss function based on the label Y and ⁇ a> 1
  • the first data party can obtain the first share of the loss function gradient ⁇ dW> 0
  • the second data party can obtain the second share of the loss function gradient ⁇ dW> 1 .
  • the party may be the first data X
  • the second party data may ⁇ a> 1, secret sharing X T ⁇ a> 1.
  • the first data party can obtain ⁇ [X T ⁇ a> 1 ]> 0
  • the second data party can obtain ⁇ [X T ⁇ a> 1 ]> 1 .
  • ⁇ [X T ⁇ a> 1 ]> 0 + ⁇ [X T ⁇ a> 1 ]> 1 X T ⁇ a> 1 .
  • the first data party may also secretly share X T Y according to X
  • the second data party may also secretly share X T Y according to tag Y (specifically, a vector formed by tags).
  • the first data party can obtain ⁇ X T Y> 0
  • the second data party can obtain ⁇ X T Y> 1 .
  • ⁇ X T Y> 0 + ⁇ X T Y> 1 X T Y.
  • the first data party can calculate X T ⁇ a> 0 ; can calculate X T ⁇ a> 0 + ⁇ [X T ⁇ a> 1 ]> 0 - ⁇ X T Y> 0 as the first of the loss function gradient dW Share ⁇ dW> 0 .
  • the second data party may calculate ⁇ [X T ⁇ a> 1 ]> 1- ⁇ X T Y> 1 as the second share of the loss function gradient dW ⁇ dW> 1 .
  • the first data party may obtain the first share of the value according to the characteristic data and the incentive function, and the second data party may secretly share the value according to the second share of the incentive function.
  • Hessian matrix The first data party and the second data party may obtain a share of the Hessian matrix respectively.
  • the share obtained by the first data party may be used as the first share of the Hessen matrix
  • the share obtained by the second data party may be used as the second share of the Hessen matrix.
  • the sum of the first share of the Hessian matrix and the second share of the Hessian matrix is equal to the Hessian matrix.
  • the first data party may secretly share the diagonal matrix according to the first share of the value of the incentive function
  • the second data party may secretly share the diagonal matrix according to the second share of the value of the incentive function.
  • the first data party and the second data party may obtain a share of the diagonal matrix respectively.
  • the share obtained by the first data party may be used as the first share of the diagonal matrix
  • the share obtained by the second data party may be used as the second share of the diagonal matrix.
  • the sum of the first share of the diagonal matrix and the second share of the diagonal matrix is equal to the diagonal matrix.
  • the first data party can secretly share the Hessian matrix according to the feature data and the first share of the diagonal matrix
  • the second data party can secretly share the Hessian matrix according to the second share of the diagonal matrix.
  • the first data party can obtain the first share of the Hessian matrix
  • the second data party can obtain the second share of the Hessian matrix.
  • the first data party can secretly share the diagonal matrix RNN according to ⁇ a> 0 and the second data party can secretly share the diagonal matrix RNN according to ⁇ a> 1 .
  • the first data party can obtain the first share RNN 0 of the diagonal matrix, and the second data party can obtain the second share RNN 1 of the diagonal matrix.
  • the first party data may ⁇ a> 0, the second party data may ⁇ a> 1, secret sharing ⁇ a> 0 ⁇ ⁇ a> 1.
  • the first data party can obtain ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 0
  • the second data party can obtain ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 1 .
  • ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 0 + ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 1 ⁇ a> 0 ⁇ a> 1 .
  • represents the bitwise multiplication operation.
  • ⁇ r> 0 ⁇ r> 1
  • the first party data may be ⁇ r> as data element 0 of the data element on the main diagonal RNN 0, thus achieved under ⁇ r> 0 0 RNN generated; may ⁇ r> 1 data element as a data element on the main diagonal RNN 1, thus realized ⁇ r> 1 generated according RNN 1.
  • the first data party can secretly share the Hessian matrix H according to X and RNN 0
  • the second data party can secretly share the Hessian matrix H according to RNN 1 .
  • the first data party can obtain the first share ⁇ H> 0 of the Hessian matrix
  • the second data party can obtain the second share ⁇ H> 1 of the Hessen matrix.
  • the party may be the first data X
  • the second party data may RNN 1, secret sharing X T RNN 1.
  • the first data party can obtain ⁇ X T RNN 1 > 0
  • the second data party can obtain ⁇ X T RNN 1 > 1 .
  • ⁇ X T RNN 1 > 0 + ⁇ X T RNN 1 > 1 X T RNN 1 .
  • the first party data may also according to X
  • the second party may also be in accordance with data ⁇ X T RNN 1> 1, secret sharing ⁇ X T RNN 1> 1 X.
  • the first data party can obtain ⁇ [ ⁇ X T RNN 1 > 1 X]> 0
  • the second data party can obtain ⁇ [ ⁇ X T RNN 1 > 1 X]> 1 .
  • the first data party can calculate X T RNN 0 X+ ⁇ X T RNN 1 > 0 X+ ⁇ [ ⁇ X T RNN 1 > 1 X]> 0 as the first share of the Hessian matrix H ⁇ H> 0 .
  • the second data party may use ⁇ [ ⁇ X T RNN 1 > 1 X]> 1 as the second share of the Hessian matrix H ⁇ H> 0 .
  • the third party may issue the first share of the random orthogonal matrix to the first data party; may issue the second share of the random orthogonal matrix to the second data party.
  • the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix.
  • the first data party may receive the first share of the random orthogonal matrix
  • the second data party may receive the second share of the random orthogonal matrix.
  • the first data party can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix
  • the second data party can be based on the second share of the random orthogonal matrix and the first share of the Hessian matrix.
  • the second share of the matrix secretly shares the second product.
  • the first data party and the second data party may each obtain a share of the second product.
  • the share obtained by the first data party may be used as the first share of the second product
  • the share obtained by the second data party may be used as the second share of the second product.
  • the sum of the first share of the second product and the second share of the second product is equal to the second product.
  • the first share of the random orthogonal matrix can be expressed as ⁇ R> 0
  • the first data party may secretly share the second product HR according to ⁇ R> 0 and ⁇ H> 0
  • the second data party may secretly share the second product HR according to ⁇ R> 1 and ⁇ H> 1
  • the first data party can obtain the first share of the second product ⁇ HR> 0
  • the second data party can obtain the second product second share ⁇ HR> 1 .
  • the first party data may ⁇ H> 0, the second party data may ⁇ R> 1, secret sharing ⁇ H> 0 ⁇ R> 1 .
  • the first data party can obtain ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 .
  • ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 ⁇ H> 0 ⁇ R> 1 .
  • the first data party may also secretly share ⁇ H> 1 ⁇ R> 0 according to ⁇ R> 0 and the second data party may also secretly share ⁇ H> 1 ⁇ R> 0 according to ⁇ H> 1 .
  • the first data party can obtain ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 .
  • ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 ⁇ H> 1 ⁇ R> 0 .
  • the first data party can calculate ⁇ H> 0 ⁇ R> 0 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0 as the second product of One share ⁇ HR> 0 .
  • the second data party can calculate ⁇ H> 1 ⁇ R> 1 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 as the second product of Second share ⁇ HR> 1 .
  • the preset condition may include: the number of conditions is less than or equal to a preset threshold.
  • the preset threshold may be an empirical value, or it may also be obtained in other ways (for example, machine learning).
  • Both the first data party and the second data party may hold the preset conditions. Furthermore, the first data party and the second data party may respectively determine whether the condition number of the second product satisfies the preset condition.
  • the condition number of the second product may be calculated by the first data party. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be determined whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the second data party.
  • the second data party can receive the condition number of the second product; and can determine whether the condition number of the second product meets the preset condition. In some other embodiments, the second data party may also calculate the condition number of the second product. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be judged whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the first data party. The first data party can receive the condition number of the second product; and can judge whether the condition number of the second product meets the preset condition.
  • the second data party may send the second share of the second product to the first data party.
  • the first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the second data party.
  • the second data party may receive the judgment result information.
  • only the second data party may hold the preset condition, and then only the second data party may determine whether the condition number of the second product meets the preset condition.
  • the first data party may send the first share of the second product to the second data party.
  • the second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the first data party.
  • the first data party may receive the judgment result information.
  • a square matrix can be multiplied by an orthogonal matrix to obtain a new matrix, which has the same condition number as the square matrix. Since the Hessian matrix is a square matrix, the condition number of the second product is equal to the condition number of the Hessian matrix. In this way, the first data party and the second data party can collaboratively calculate the condition number of the Hessian matrix without leaking their share of the Hessian matrix.
  • the condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, that is, it indicates that the Hessian matrix is less ill-conditioned, so the Newton method can be used to determine the model parameters.
  • the first data party may secretly share the first inverse matrix according to the first share of the Hessian matrix
  • the second data party may secretly share the first inverse matrix according to the second share of the Hessian matrix.
  • the first data party can obtain a first share of the first inverse matrix
  • the second data party can obtain a second share of the first inverse matrix.
  • the second product may be inverted by the second data party.
  • the first data party may send the first share of the second product to the second data party.
  • the second data party may receive the first share of the second product; may add the first share of the second product to the second share of its own second product to obtain the second product. Since the second product is a square matrix, the second data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix.
  • the first data party may receive the second inverse matrix.
  • the first data party may also invert the second product. Specifically, the second data party may send the second share of the second product to the first data party.
  • the first data party may receive the second share of the second product; may add the second share of the second product to the first share of its own second product to obtain the second product. Since the second product is a square matrix, the first data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix. The second data party may receive the second inverse matrix.
  • the first data party may multiply the first share of the random orthogonal matrix by the second inverse matrix to obtain the first share of the first inverse matrix.
  • the second data party may multiply the second share of the random orthogonal matrix by the second inverse matrix to obtain the second share of the first inverse matrix.
  • the sum of the first share of the first inverse matrix and the second share of the first inverse matrix is equal to the first inverse matrix.
  • the second data party inverts the second product HR.
  • the first data party may send the first share of the second product ⁇ HR> 0 to the second data party.
  • the second data party may receive the first share of the second product ⁇ HR> 0 ; may add the first share of the second product ⁇ HR> 0 to its second share of the second product ⁇ HR> 1 , second product to give the HR; inversion process may be performed on the second product HR, to obtain a second inverse matrix (HR) -1; may send a second inverse matrix (HR) -1 to the first party data.
  • the first data party may receive the second inverse matrix (HR) -1 .
  • the first data party may multiply the second inverse matrix (HR) -1 by the first share of the random orthogonal matrix ⁇ R> 0 to obtain the first share of the first inverse matrix H -1 ⁇ H -1 > 0 .
  • the second data party may multiply the second inverse matrix (HR) -1 by the second share of the random orthogonal matrix ⁇ R> 1 to obtain the first share of the first inverse matrix H -1 ⁇ H -1 > 1 .
  • the first data party may be based on the first share of the first inverse matrix and the first share of the loss function gradient
  • the second data party may be based on the first share of the first inverse matrix.
  • the second share and the second share of the gradient of the loss function secretly share the third product.
  • the first data party and the second data party may each obtain a share of the third product.
  • the share obtained by the first data party may be used as the first share of the third product
  • the share obtained by the second data party may be used as the second share of the third product.
  • the sum of the first share of the third product and the second share of the third product is equal to the third product.
  • the first data party may subtract the first share of the first model parameter from the first share of the third product to obtain the first share of the new first model parameter.
  • the second data party may subtract the second share of the first model parameter from the second share of the third product to obtain the second share of the new first model parameter.
  • the first data party can secretly share the third party according to ⁇ H -1 > 0 and ⁇ dW> 0
  • the second data party can secretly share the third party according to ⁇ H -1 > 1 and ⁇ dW> 1
  • the first data party can obtain the first share of the third product ⁇ H -1 ⁇ dW> 0
  • the second data party can obtain the second share of the third product ⁇ H -1 ⁇ dW> 1 .
  • the first party data may ⁇ H -1> 0, the second party data may ⁇ dW> 1, secret sharing ⁇ H -1> 0 ⁇ dW> 1.
  • the first data party can obtain ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 .
  • the first data party can also secretly share ⁇ H -1 > 1 ⁇ dW> 0 according to ⁇ dW> 0 and the second data party can also secretly share ⁇ H -1 > 1 ⁇ dW> 0 according to ⁇ H -1 > 1 .
  • the first data party can obtain ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0
  • the second data party can obtain ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1 .
  • the first data party can calculate ⁇ H -1 > 0 ⁇ dW> 0 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0
  • the first share as the third product ⁇ H -1 ⁇ dW> 0
  • the second data party can calculate ⁇ H -1 > 1 ⁇ dW> 1 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1
  • the second share as the third product ⁇ H -1 ⁇ dW> 1 .
  • H -1 ⁇ dW ⁇ H -1 ⁇ dW> 0 + ⁇ H -1 ⁇ dW> 1
  • the condition number of the second product does not satisfy the preset condition, which indicates that the second product is ill-conditioned, which means that the Hessian matrix is ill-conditioned, and the Newton method cannot be used to determine the model parameters.
  • the gradient descent method can be used instead of Newton's method to determine the model parameters.
  • the first data party may calculate the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step size.
  • the second data party may calculate the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step size.
  • the preset step length can be used to control the iteration speed of the gradient descent method.
  • the preset step length can be any suitable positive real number. For example, when the preset step size is too large, the iteration speed will be too fast, resulting in the possibility that the optimal model parameters cannot be obtained. When the preset step size is too small, the iteration speed will be too slow, resulting in a longer time.
  • the preset step length may specifically be an empirical value; or, it may also be obtained by means of machine learning. Of course, the preset step length can also be obtained in other ways. Both the first data party and the second data party may hold the preset step size.
  • the first data party may multiply the first share of the loss function gradient by the preset step size to obtain the fourth product; may subtract the first share of the first model parameter and the fourth product to obtain a new first The first share of model parameters.
  • the second data party may multiply the second share of the loss function gradient by the preset step size to obtain the fifth product; may subtract the second share of the first model parameter and the fifth product to obtain the new first The second share of model parameters.
  • the sum of the first share of the new first model parameter and the second share of the new first model parameter is equal to the new first model parameter.
  • the second data party may multiply the second share of the gradient of the loss function ⁇ dW> 1 (specifically a vector) by the preset step size G (specifically a multiplication of the vector) to obtain the fifth product G ⁇ dW> 1 ;
  • ⁇ W'> 0 + ⁇ W'> 1 W'
  • W' represents the new first model parameter.
  • this embodiment can avoid the problem of non-convergence caused by the ill-conditioned matrix in the process of using the Newton method to determine the model parameters.
  • the method for determining model parameters from step S601 to step S613 is realized by way of secret sharing.
  • Newton's method has a faster convergence rate.
  • the method for determining model parameters from step S601 to step S613, due to the use of Newton’s method, can not only protect the data privacy of the parties in the cooperative modeling (the first data party and the second data party), but also reduce the number of optimization adjustments of model parameters. Improve the training efficiency of data processing models.
  • it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
  • Step S601 may be repeatedly executed, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product.
  • the new first product is the product of the feature data and the new first model parameter.
  • the first data party can communicate based on the first share of the new first product, and the second data party can communicate based on the confusion circuit corresponding to the excitation function according to the second share of the new first product.
  • the first data party can obtain the first share of the value of the new excitation function, and the second data party can obtain the second share of the value of the new excitation function.
  • Step S605 may be repeatedly executed, the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient.
  • Step S607 can be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix.
  • Step S609 may be repeated, and the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • Step S611 can be repeated.
  • the first data party can obtain the first share of the new first inverse matrix
  • the second data party can obtain the second share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new first share.
  • the second share of a model parameter, the second share of the new first inverse matrix and the second share of the new loss function gradient secretly share the second model parameters.
  • the first data party can obtain a first share of the second model parameter
  • the second data party can obtain a second share of the second model parameter.
  • the sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter.
  • the first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size.
  • the second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size. The sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter.
  • the iterative process can be realized through a combination of secret sharing and obfuscation circuits.
  • the combination of secret sharing and obfuscation circuits can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process.
  • the gradient descent method is used.
  • the following describes a process in which the first data party performs communication based on the first share of the new first product, and the second data party performs communication based on the confusion circuit corresponding to the excitation function according to the second share of the new first product.
  • the corresponding logic circuit can be constructed according to the excitation function.
  • the logic circuit can be constructed by the first data party; alternatively, it can also be constructed by the second data party; or alternatively, it can also be constructed by other devices (for example, a trusted third party).
  • the logic circuit may be composed of at least one arithmetic gate, and the arithmetic gate may include an AND gate, an OR gate, an exclusive OR gate, and so on.
  • the logic circuit may include at least two input lines and at least one output line, and an obfuscated circuit can be obtained by encrypting the input lines and/or output lines of the logic circuit.
  • the confusion circuit may include a confusion truth table of each arithmetic gate in the logic circuit.
  • the logic circuit can be constructed directly according to the excitation function; alternatively, various appropriate modifications can be made to the excitation function, and the logical circuit can be constructed according to the deformed excitation function; or, the excitation function can also be used Generate other functions as a basis, and build logic circuits based on other functions.
  • the activation function and the confusion circuit can be understood as: the confusion circuit is generated based on the logic circuit of the activation function, or the confusion circuit is generated based on the confusion circuit of the deformed activation function, or the confusion circuit is Generated according to the logic circuit of other functions.
  • Both the first data party and the second data party may have a confusion circuit corresponding to an excitation function.
  • the obfuscation circuit may be generated by the first data party.
  • the first data party may send the generated obfuscation circuit to the second data party.
  • the second data party may receive the obfuscation circuit.
  • the obfuscation circuit may also be generated by the second data party.
  • the second data party may send the generated obfuscation circuit to the first data party.
  • the first data party may receive the obfuscation circuit.
  • the first data party can communicate based on the first share of the new first product
  • the second data party can communicate based on the confusion circuit corresponding to the excitation function according to the second share of the new first product.
  • the first data party and the second data party may respectively obtain a share of the value of the new incentive function.
  • the share obtained by the first data party may be used as the first share of the value of the new incentive function
  • the share obtained by the second data party may be used as the second share of the value of the new incentive function.
  • the sum of the first share of the value of the new excitation function and the second share of the value of the new excitation function is equal to the value of the new excitation function.
  • x 1 is used to represent the first share of the new first product
  • x 2 is used to represent the second share of the new first product
  • x 3 is used to represent a share of the new incentive function value (hereinafter referred to as Is the second share of the value of the new incentive function)
  • the value of f 1 (x 1 , x 2 , x 3 ) is used to represent another share of the value of the new incentive function (hereinafter referred to as the new incentive function
  • the first share of the value ).
  • the second data party may generate a share of the value of the new incentive function as the second share.
  • the first data party can use the first share of the new first product as the input of the confusion circuit, and the second data party can use the second share of the new first product and the new excitation function to obtain the value.
  • the second share is used as the input of the confusion circuit for communication.
  • the first data party may calculate another share of the value of the new excitation function based on the confusion circuit as the first share. For the specific calculation process, please refer to the previous example of the scene introducing the confusion circuit, which will not be detailed here.
  • a piecewise linear function may also be used to fit the excitation function.
  • a corresponding logic circuit can be constructed according to the piecewise linear function, and the confusion circuit can be obtained by encrypting the input line and/or output line of the logic circuit.
  • Both the first data party and the second data party may possess the obfuscated circuit.
  • the activation function may be a Sigmoid function
  • the piecewise linear function may be k represents the coefficient of the piecewise linear function.
  • the first data party may perform communication based on the confusion circuit based on the first share of the new first product
  • the second data party may perform communication based on the confusion circuit based on the second share of the new first product.
  • the first data party and the second data party respectively obtain a share of the value of the piecewise linear function.
  • the share obtained by the first data party may be used as the first share of the value of the piecewise linear function
  • the share obtained by the second data party may be used as the second share of the value of the piecewise linear function.
  • the sum of the first share of the value of the piecewise linear function and the second share of the value of the piecewise linear function is equal to the value of the piecewise linear function.
  • the first data party may use the first share of the value of the piecewise linear function as the first share of the value of the new excitation function.
  • the second data party may use the second share of the value of the piecewise linear function as the second share of the value of the new excitation function.
  • the first data party and the second data party can cooperate to determine the model parameters of the data processing model without leaking the data held by themselves.
  • This specification also provides another embodiment of the method for determining model parameters.
  • the first data party is the execution subject, and the first data party may hold the share of the feature data and the first model parameter.
  • This embodiment may include the following steps.
  • Step S701 secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, and the first product is the product of the feature data and the first model parameter.
  • the cooperating party may be understood as a data party that performs cooperative security modeling with the first data party, and specifically may be the previous second data party.
  • Step S703 According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained.
  • the first data party may secretly share the value of the polynomial with the partner according to the share of the first product, and obtain the share of the polynomial value as the share of the value of the incentive function, and the polynomial is used for fitting The activation function.
  • Step S705 secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the gradient of the loss function and the Hessian matrix respectively.
  • Step S707 secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the product of the random orthogonal matrix and the Hessian matrix .
  • Step S709 When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The inverse matrix.
  • the preset condition may include: the number of conditions is less than or equal to a preset threshold.
  • the condition number of the second product can be calculated by the first data party and/or the partner.
  • the condition number of the second product is equal to the condition number of the Hessian matrix.
  • condition number of the second product satisfies the preset condition, indicating that the degree of ill-condition of the second product is small, and Newton's method can be used to determine the model parameters.
  • the first data party can secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
  • Step S711 secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter.
  • the first data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product.
  • the third product may be a product between the first inverse matrix and the gradient of the loss function.
  • the first data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
  • the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined using Newton's method. Therefore, gradient descent method can be used instead of Newton's method to determine model parameters. .
  • the first data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. Specifically, the first data party may multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
  • it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
  • the first data party may repeat step S701 to obtain a new share of the first product.
  • the first data party may communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the new incentive function.
  • the first data party may repeat step S705 to obtain the share of the new loss function gradient and the share of the new Hessian matrix; may repeat step S707 to obtain the share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • the first data party may repeat step S709 to obtain the share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
  • the first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  • the first data party can cooperate with the partner to determine the model parameters of the data processing model without revealing the data held by itself.
  • This specification also provides an embodiment of another method for determining model parameters.
  • the second data party is the execution subject, and the second data party may hold the share of the tag and the first model parameter.
  • This embodiment may include the following steps.
  • Step S801 According to the share of the first model parameter and the partner secretly share the first product to obtain the share of the first product, the first product is the product of the feature data and the first model parameter.
  • the cooperating party may be understood as a data party that performs cooperative security modeling with the second data party, and specifically may be the previous first data party.
  • Step S803 According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained.
  • the second data party may secretly share the value of the polynomial with the partner according to the share of the first product, and obtain the share of the polynomial value as the share of the value of the incentive function, and the polynomial is used for fitting The activation function.
  • Step S805 secretly share the gradient of the loss function with the partner according to the value of the label and the incentive function to obtain the share of the gradient of the loss function; according to the share of the incentive function, secretly share the Hessian matrix with the partner to obtain the Hessian matrix Share.
  • Step S807 secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the product between the random orthogonal matrix and the Hessian matrix .
  • Step S809 When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The inverse matrix.
  • the preset condition may include: the number of conditions is less than or equal to a preset threshold.
  • the condition number of the second product can be calculated by the second data party and/or the partner.
  • the condition number of the second product is equal to the condition number of the Hessian matrix.
  • condition number of the second product satisfies the preset condition, indicating that the degree of ill-condition of the second product is small, and Newton's method can be used to determine the model parameters.
  • the second data party can secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
  • Step S811 secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter.
  • the second data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product.
  • the third product may be a product between the first inverse matrix and the gradient of the loss function.
  • the second data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
  • the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined using Newton's method. Therefore, gradient descent method can be used instead of Newton's method to determine model parameters. .
  • the second data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. The second data party may specifically multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
  • it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
  • the second data party may repeat step S801 to obtain a new share of the first product.
  • the second data party may communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the new incentive function.
  • the second data party may repeat step S805 to obtain the share of the new loss function gradient and the share of the new Hessian matrix; step S807 may be repeated to obtain the share of the new second product.
  • the new second product is the product of the random orthogonal matrix and the new Hessian matrix.
  • the second data party may repeat step S809 to obtain the share of the new first inverse matrix.
  • the new first inverse matrix is the inverse of the new Hessian matrix.
  • the second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
  • the second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  • the second data party can cooperate with the partner to determine the model parameters of the data processing model without leaking the data held by itself.
  • model parameter determination device in the embodiment of this specification will be described in detail below in conjunction with FIG. 12 and FIG. 13.
  • This specification also provides an embodiment of the device for determining model parameters.
  • This embodiment can be applied to the first data party and can include the following units.
  • the first secret sharing unit 901 is configured to secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, and the first product is the product of the feature data and the first model parameter ;
  • the second secret sharing unit 903 is configured to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
  • the third secret sharing unit 905 is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the gradient of the loss function and the Hessian matrix respectively;
  • the fourth secret sharing unit 907 is configured to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the random orthogonal matrix and the sea.
  • the fifth secret sharing unit 909 is configured to, when the condition number of the second product meets the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
  • the inverse matrix is the inverse matrix of the Hessian matrix;
  • the sixth secret sharing unit 911 is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter ;
  • the obfuscation circuit unit 913 is configured to repeatedly execute the step of secretly sharing the first product; communicate with the partner according to the share of the new first product and the obfuscation circuit corresponding to the incentive function to obtain the share of the new incentive function; Repeating the step of secretly sharing the gradient of the loss function and the Hessian matrix and the step of secretly sharing the second product;
  • the calculation unit 915 is configured to calculate the second product according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length when the condition number of the new second product does not meet the preset condition.
  • the share of model parameters are configured to calculate the second product according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length when the condition number of the new second product does not meet the preset condition. The share of model parameters.
  • This specification also provides another embodiment of the device for determining model parameters. Refer to Figure 13. This embodiment can be applied to the second data party and can include the following units.
  • the first secret sharing unit 1001 is configured to secretly share the first product with the partner according to the share of the first model parameter to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter;
  • the second secret sharing unit 1003 is configured to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
  • the third secret sharing unit 1005 is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the value of the incentive function to obtain the share of the gradient of the loss function and the Hessian matrix respectively;
  • the fourth secret sharing unit 1007 is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the random orthogonal matrix and the sea.
  • the fifth secret sharing unit 1009 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix when the condition number of the second product meets the preset condition to obtain the share of the first inverse matrix.
  • the inverse matrix is the inverse matrix of the Hessian matrix;
  • the sixth secret sharing unit 1011 is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter ;
  • the obfuscation circuit unit 1013 is configured to repeatedly execute the step of secretly sharing the first product; communicate with the partner according to the share of the new first product and the obfuscation circuit corresponding to the incentive function to obtain the share of the new incentive function; Repeating the step of secretly sharing the gradient of the loss function, the step of secretly sharing the Hessian matrix, and the step of secretly sharing the second product;
  • the calculation unit 1015 is configured to calculate the second product according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length when the condition number of the new second product does not meet the preset condition.
  • the share of model parameters are configured to calculate the second product according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length when the condition number of the new second product does not meet the preset condition.
  • FIG. 14 is a schematic diagram of the hardware structure of an electronic device in this embodiment.
  • the electronic device may include one or more (only one is shown in the figure) processor, memory, and transmission module.
  • processor any electronic device that can be included in the electronic device.
  • memory any type of memory
  • transmission module any type of transmission module.
  • the hardware structure shown in FIG. 14 is only for illustration, and it does not limit the hardware structure of the above electronic device.
  • the electronic device may also include more or less component units than shown in FIG. 14; or, have a different configuration from that shown in FIG. 14.
  • the memory may include a high-speed random access memory; or, it may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the storage may also include a remotely set network storage.
  • the remotely set network storage can be connected to the electronic device through a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
  • the memory may be used to store program instructions or modules of application software, such as the program instructions or modules of the embodiment corresponding to FIG. 5 of this specification; and/or, the program instructions or modules of the embodiment corresponding to FIG. 6 of this specification; and/ Or, the program instructions or modules of the embodiment corresponding to FIG. 10 of this specification; and/or, the program instructions or modules of the embodiment corresponding to FIG. 11 of this specification.
  • the processor can be implemented in any suitable way.
  • the processor may take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (for example, software or firmware) executable by the (micro)processor, logic gates, switches, special-purpose integrated Circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc.
  • the processor can read and execute program instructions or modules in the memory.
  • the transmission module can be used for data transmission via a network, for example, data transmission via a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
  • a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
  • a programmable logic device Programmable Logic Device, PLD
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
  • This manual can be used in many general or special computer system environments or configurations.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • This specification can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network.
  • program modules can be located in local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A method and apparatus for determining a model parameter, and an electronic device. The method comprises: communicating with a cooperation party according to a share of a first product and a garbled circuit corresponding to an activation function to obtain a share of a value of the activation function; secretly sharing a gradient of a loss function with the cooperation party according to feature data and the share of the value of the activation function to obtain a share of the gradient of the loss function; secretly sharing a Hessian matrix with the cooperation party according to the feature data and the share of the value of the activation function to obtain a share of the Hessian matrix; secretly sharing a first inverse matrix with the cooperation party according to the share of the Hessian matrix to obtain a share of the first inverse matrix; and secretly sharing a new first model parameter with the cooperation party according to a share of a first model parameter, the share of the first inverse matrix, and the share of the gradient of the loss function to obtain a share of the new first model parameter. A model parameter of a data processing model can be determined by the collaboration of multiple parties on the premise of protecting data privacy.

Description

模型参数确定方法、装置和电子设备Model parameter determination method, device and electronic equipment
本申请要求2019年08月09日递交的申请号为201910735439.1、发明名称为“模型参数确定方法、装置和电子设备”的中国专利申请的优先权,2019年08月09日递交的申请号为201910734784.3、发明名称为“模型参数确定方法、装置和电子设备”的中国专利申请的优先权,2019年08月09日递交的申请号为201910735442.3、发明名称为“模型参数确定方法、装置和电子设备”的中国专利申请的优先权,以及2019年08月09日递交的申请号为201910735421.1、发明名称为“模型参数确定方法、装置和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on August 9, 2019 with the application number 201910735439.1, the invention title is "Model parameter determination method, device and electronic equipment", the application number filed on August 9, 2019 is 201910734784.3 , The priority of the Chinese patent application with the title of "Model parameter determination method, device and electronic equipment", the application number submitted on August 9, 2019 is 201910735442.3, and the title of the invention is "Model parameter determination method, device and electronic device" The priority of the Chinese patent application and the application number of 201910735421.1 filed on August 9, 2019, the priority of the Chinese patent application with the title of "Model parameter determination method, device and electronic equipment", the entire contents of which are incorporated by reference In this application.
技术领域Technical field
本说明书实施例涉及计算机技术领域,特别涉及一种模型参数确定方法、装置和电子设备。The embodiments of this specification relate to the field of computer technology, and in particular to a method, device and electronic equipment for determining model parameters.
背景技术Background technique
大数据时代,存在非常多的数据孤岛。数据通常分散存于不同的企业中,企业与企业之间由于竞争关系和隐私保护的考虑,并不是完全的互相信任。在一些情况下,企业与企业之间需要进行合作安全建模,以便在充分保护企业数据隐私的前提下,使用各方的数据对数据处理模型进行协作训练。In the era of big data, there are many data islands. Data is usually scattered in different companies. Due to competition and privacy considerations, companies do not completely trust each other. In some cases, cooperative security modeling is required between enterprises and enterprises, so that the data of all parties can be used for collaborative training of data processing models under the premise of fully protecting the privacy of enterprise data.
在对数据处理模型进行协作训练的过程中,可以使用模型参数优化方法对数据处理模型的模型参数进行多次优化调整。由于用于对数据处理模型进行训练的数据是分散在合作建模的各方的,因此如何在保护数据隐私的条件下,协作确定数据处理模型的模型参数,是当前亟需解决的技术问题。In the process of collaborative training of the data processing model, the model parameter optimization method can be used to optimize and adjust the model parameters of the data processing model multiple times. Since the data used to train the data processing model is scattered among the parties involved in the cooperative modeling, how to collaboratively determine the model parameters of the data processing model while protecting data privacy is a technical problem that needs to be solved urgently.
发明内容Summary of the invention
本说明书实施例的目的是提供一种模型参数确定方法、装置和电子设备,以在保护数据隐私的前提下,由多方协作确定数据处理模型的模型参数。The purpose of the embodiments of this specification is to provide a method, device and electronic equipment for determining model parameters, so that the model parameters of the data processing model can be determined by multiple parties under the premise of protecting data privacy.
为实现上述目的,本说明书中一个或多个实施例提供的技术方案如下。In order to achieve the foregoing objectives, the technical solutions provided by one or more embodiments in this specification are as follows.
根据本说明书一个或多个实施例的第一方面,提供了一种模型参数确定方法,应用于第一数据方,包括:根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据 特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据特征数据和激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。According to the first aspect of one or more embodiments of the present specification, a method for determining model parameters is provided, which is applied to a first data party, including: communicating with a partner according to a share of the first product and a confusion circuit corresponding to an incentive function , Get the share of the value of the incentive function, the first product is the product of the feature data and the first model parameter; according to the share of the feature data and the value of the incentive function and the partner secretly share the gradient of the loss function, the value of the loss function is obtained Share; share the Hessian matrix secretly with the partner according to the value of the feature data and the incentive function to get the share of the Hessian matrix; secretly share the first inverse matrix with the partner according to the Hessian matrix share to get the first inverse matrix Share, the first inverse matrix is the inverse matrix of the Hessian matrix; according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient, the new first model parameter is secretly shared with the partner to obtain the new The share of the first model parameter.
根据本说明书一个或多个实施例的第二方面,提供了一种模型参数确定方法,应用于第二数据方,包括:根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。According to a second aspect of one or more embodiments of this specification, a method for determining model parameters is provided, which is applied to a second data party, including: communicating with a partner according to the share of the first product and the confusion circuit corresponding to the incentive function , Obtain the share of the value of the incentive function, the first product is the product of the feature data and the first model parameter; according to the share of the label and the value of the incentive function and the partner secretly share the gradient of the loss function, the share of the gradient of the loss function is obtained ; According to the share of the incentive function, secretly share the Hessian matrix with the partner to obtain the share of the Hessian matrix; according to the share of the Hessian matrix and secretly share the first inverse matrix with the partner to obtain the share of the first inverse matrix, the The first inverse matrix is the inverse matrix of the Hessian matrix; according to the share of the first model parameters, the share of the first inverse matrix, and the share of the loss function gradient, secretly share the new first model parameters with the partner to obtain the new first model The share of parameters.
根据本说明书一个或多个实施例的第三方面,提供了一种模型参数确定方法,应用于第一数据方,包括:根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;根据特征数据和激励函数取值的份额与合作方分别秘密分享损失函数的梯度和海森矩阵,得到损失函数梯度的份额和海森矩阵的份额;根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长, 计算第二模型参数的份额。According to a third aspect of one or more embodiments of this specification, a method for determining model parameters is provided, which is applied to a first data party, including: secretly sharing the first product with a partner according to the share of feature data and the first model parameter , Obtain the share of the first product, the first product being the product of the feature data and the first model parameter; according to the share of the first product and the partner secretly share the value of the incentive function, obtain the share of the value of the incentive function; The share of the characteristic data and the value of the incentive function secretly share the gradient of the loss function and the Hessian matrix with the partner, and get the share of the loss function gradient and the Hessian matrix; according to the share of the random orthogonal matrix and the Hessian matrix Share the second product secretly with the partner to obtain the share of the second product. The second product is the product between the random orthogonal matrix and the Hessian matrix; when the condition number of the second product meets the preset condition, The share of the Sen matrix secretly shares the first inverse matrix with the partner to obtain the share of the first inverse matrix, which is the inverse matrix of the Hessian matrix; according to the share of the first inverse matrix, the share of the loss function gradient and The share of the first model parameter secretly shares the new first model parameter with the partner to obtain the share of the new first model parameter; the step of secretly sharing the first product is iteratively performed to obtain the share of the new first product, according to The share of the new first product and the confusion circuit corresponding to the incentive function communicate with the partner to obtain the share of the new incentive function value, and iteratively execute the steps of the secret sharing loss function gradient and the Hessian matrix to obtain a new The share of the loss function gradient and the share of the new Hessian matrix are iteratively performed the step of secretly sharing the second product to obtain the share of the new second product; when the condition number of the new second product does not meet the preset When conditions are met, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
根据本说明书一个或多个实施例的第四方面,提供了一种模型参数确定方法,应用于第二数据方,包括:根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额;迭代执行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。According to the fourth aspect of one or more embodiments of this specification, a method for determining model parameters is provided, which is applied to a second data party, including: secretly sharing the first product according to the share of the first model parameter and the partner to obtain the first product A share of a product, the first product being the product of the feature data and the first model parameter; according to the share of the first product and the partner secretly sharing the value of the incentive function, the share of the value of the incentive function is obtained; according to the label and incentive The share of the value of the function secretly shares the gradient of the loss function with the partner to obtain the share of the gradient of the loss function; the share of the value of the incentive function is secretly shared with the partner of the Hessian matrix to obtain the share of the Hessian matrix; according to the random orthogonal matrix The share of and the share of the Hessian matrix secretly share the second product with the partner to obtain the share of the second product. The second product is the product between the random orthogonal matrix and the Hessian matrix; the condition number of the second product When the preset conditions are met, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix. The first inverse matrix is the inverse of the Hessian matrix; Share, the share of the loss function gradient, and the share of the first model parameter secretly share the new first model parameter with the partner to obtain the new share of the first model parameter; iteratively execute the step of secretly sharing the first product to obtain the new According to the share of the first product of the new first product and the confusion circuit corresponding to the incentive function, communicate with the partner to obtain the share of the new value of the incentive function; iteratively execute the step of secretly sharing the gradient of the loss function , Obtain the share of the new loss function gradient, iteratively execute the step of secretly sharing the Hessian matrix to obtain the share of the new Hessian matrix, and iteratively execute the step of secretly sharing the second product to obtain the new second product Share; when the condition number of the new second product does not meet the preset condition, calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length .
根据本说明书一个或多个实施例的第五方面,提供了一种模型参数确定装置,应用于第一数据方,包括:激励函数取值份额获取单元,用于根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;损失函数梯度份额获取单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;海森矩阵份额获取单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;第一逆矩阵份额获取单元,用于根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;模型参数份额获取单元,用于根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。According to a fifth aspect of one or more embodiments of this specification, there is provided a model parameter determination device, applied to a first data party, including: an incentive function value share acquisition unit, configured to obtain a share and incentive according to the first product The confusion circuit corresponding to the function communicates with the partner to obtain the share of the value of the excitation function. The first product is the product of the feature data and the first model parameter; the loss function gradient share acquisition unit is used to obtain the value of the excitation function according to the feature data and the excitation function. The valued share secretly shares the gradient of the loss function with the partner to obtain the share of the loss function gradient; the Hessian matrix share acquisition unit is used to secretly share the Hessian matrix with the partner according to the feature data and the share of the incentive function to obtain The share of the Hessian matrix; the first inverse matrix share obtaining unit is used to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The model parameter share acquisition unit is used to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain a new first model The share of parameters.
根据本说明书一个或多个实施例的第六方面,提供了一种模型参数确定装置,应用于第二数据方,包括:激励函数取值份额获取单元,用于根据第一乘积的份额和激励函 数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;损失函数梯度份额获取单元,用于根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;海森矩阵份额获取单元,用于根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;第一逆矩阵份额获取单元,用于根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;模型参数份额获取单元,用于根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。According to a sixth aspect of one or more embodiments of the present specification, there is provided a model parameter determination device applied to a second data party, including: an incentive function value share acquisition unit, configured to obtain a share and incentive according to the first product The confusion circuit corresponding to the function communicates with the partner to obtain the share of the value of the excitation function. The first product is the product of the feature data and the first model parameter; the loss function gradient share acquisition unit is used to obtain the value of the incentive function according to the label and the excitation function. The share of the value and the partner secretly share the gradient of the loss function to obtain the share of the gradient of the loss function; the Hessian matrix share acquisition unit is used to secretly share the Hessian matrix with the partner according to the share of the incentive function to obtain the Hessian matrix Share; the first inverse matrix share acquisition unit, used to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, the first inverse matrix being the inverse of the Hessian matrix; The model parameter share obtaining unit is used to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
根据本说明书一个或多个实施例的第七方面,提供了一种模型参数确定装置,应用于第一数据方,包括:第一秘密分享单元,用于根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;第三秘密分享单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;迭代单元,用于迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。According to a seventh aspect of one or more embodiments of the present specification, there is provided a model parameter determination device, which is applied to a first data party, and includes: a first secret sharing unit, which is used to determine the share of the characteristic data and the first model parameter. Share the first product secretly with the partner to obtain the share of the first product, the first product being the product of the feature data and the first model parameter; the second secret sharing unit is used to share the secret of the first product with the partner Share the value of the incentive function to obtain the share of the value of the incentive function; the third secret sharing unit is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the feature data and the share of the value of the incentive function to obtain the loss respectively The share of the function gradient and the share of the Hessian matrix; the fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product. The second product is the product between the random orthogonal matrix and the Hessian matrix; the fifth secret sharing unit is used to secretly share the first secret with the partner according to the Hessian matrix when the condition number of the second product meets the preset conditions. An inverse matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse matrix of the Hessian matrix; the sixth secret sharing unit is used to obtain the share of the first inverse matrix, the share of the loss function gradient, and the first The share of the model parameter secretly shares the new first model parameter with the partner to obtain the share of the new first model parameter; the iterative unit is used to iteratively execute the step of secretly sharing the first product to obtain the new first product Share, communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the share of the new incentive function, and iteratively execute the steps of the secret sharing loss function gradient and the Hessian matrix, Obtain the share of the new loss function gradient and the share of the new Hessian matrix, and iteratively execute the step of secretly sharing the second product to obtain the share of the new second product; when the condition number of the new second product does not satisfy all When the preset conditions are described, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
根据本说明书一个或多个实施例的第八方面,提供了一种模型参数确定装置,应用于第二数据方,包括:第一秘密分享单元,用于根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积; 第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;第三秘密分享单元,用于根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;迭代单元,用于迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额;迭代执行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。According to an eighth aspect of one or more embodiments of this specification, there is provided a model parameter determination device applied to a second data party, including: a first secret sharing unit for communicating with a partner according to the share of the first model parameter Secretly share the first product to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter; the second secret sharing unit is used to secretly share the incentive function with the partner according to the share of the first product The value of, obtains the share of the value of the incentive function; the third secret sharing unit is used to secretly share the gradient of the loss function with the partner according to the share of the label and the value of the incentive function to obtain the share of the gradient of the loss function; The share of value and the partner secretly share the Hessian matrix to obtain the share of the Hessian matrix; the fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix with the partner to obtain The share of the second product, the second product is the product between the random orthogonal matrix and the Hessian matrix; the fifth secret sharing unit is used for when the condition number of the second product meets the preset condition, according to the Hessian matrix Share the first inverse matrix secretly with the partner to obtain the share of the first inverse matrix, and the first inverse matrix is the inverse matrix of the Hessian matrix; the sixth secret sharing unit is used to share, The share of the loss function gradient and the share of the first model parameter secretly share the new first model parameter with the partner to obtain the share of the new first model parameter; an iterative unit for iteratively executing the step of secretly sharing the first product , Obtain the share of the new first product, communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function, and obtain the share of the new incentive function; iteratively execute the secret sharing loss function In the step of gradient, a new share of the gradient of the loss function is obtained, the steps of the secret sharing of the Hessian matrix are iteratively executed to obtain the shares of the new Hessian matrix, and the step of the second product of the secret sharing is iteratively executed to obtain the new first The share of the second product; when the condition number of the new second product does not meet the preset condition, the second model is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length The share of parameters.
根据本说明书一个或多个实施例的第九方面,提供了一种电子设备,包括:存储器,用于存储计算机指令;处理器,用于执行所述计算机指令以实现如第一方面、第二方面、第三方面或第四方面所述的方法步骤。According to a ninth aspect of one or more embodiments of this specification, there is provided an electronic device, including: a memory, configured to store computer instructions; and a processor, configured to execute the computer instructions to implement aspects such as the first and second aspects. Aspect, the method steps of the third aspect or the fourth aspect.
由以上本说明书实施例提供的技术方案可见,本说明书实施例中,第一数据方和第二数据方在不泄漏自身所持有数据的前提下,协作确定数据处理模型的模型参数。It can be seen from the technical solutions provided by the above embodiments of this specification that in the embodiments of this specification, the first data party and the second data party cooperate to determine the model parameters of the data processing model without leaking the data held by themselves.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. The drawings in the following description are only for this specification. For some of the embodiments described in, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
图1为本说明书实施例一种逻辑电路的示意图;Fig. 1 is a schematic diagram of a logic circuit according to an embodiment of the specification;
图2为本说明书实施例一种模型参数确定系统的示意图;2 is a schematic diagram of a model parameter determination system according to an embodiment of the specification;
图3为本说明书实施例一种模型参数确定方法的流程图;FIG. 3 is a flowchart of a method for determining model parameters according to an embodiment of the specification;
图4为本说明书实施例一种基于混淆电路进行计算的示意图;4 is a schematic diagram of calculation based on an obfuscated circuit according to an embodiment of the specification;
图5为本说明书实施例一种模型参数确定方法的流程图;FIG. 5 is a flowchart of a method for determining model parameters according to an embodiment of the specification;
图6为本说明书实施例一种模型参数确定方法的流程图;6 is a flowchart of a method for determining model parameters according to an embodiment of the specification;
图7为本说明书实施例一种模型参数确定装置的功能结构示意图;FIG. 7 is a schematic diagram of the functional structure of a model parameter determination device according to an embodiment of the specification;
图8为本说明书实施例一种模型参数确定装置的功能结构示意图;FIG. 8 is a schematic diagram of the functional structure of a model parameter determining device according to an embodiment of the specification;
图9为本说明书实施例一种模型参数确定方法的流程图;FIG. 9 is a flowchart of a method for determining model parameters according to an embodiment of the specification;
图10为本说明书实施例一种模型参数确定方法的流程图;10 is a flowchart of a method for determining model parameters according to an embodiment of the specification;
图11为本说明书实施例一种模型参数确定方法的流程图;FIG. 11 is a flowchart of a method for determining model parameters according to an embodiment of this specification;
图12为本说明书实施例一种模型参数确定装置的功能结构示意图;12 is a schematic diagram of the functional structure of a model parameter determining device according to an embodiment of the specification;
图13为本说明书实施例一种模型参数确定装置的功能结构示意图;13 is a schematic diagram of the functional structure of a model parameter determination device according to an embodiment of the specification;
图14为本说明书实施例一种电子设备的功能结构示意图。FIG. 14 is a schematic diagram of the functional structure of an electronic device according to an embodiment of the specification.
具体实施方式detailed description
下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。The technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this specification.
多方安全计算(Secure Muti-Party Computation,MPC)是一种保护数据隐私安全的算法。多方安全计算能让参与计算的多个数据方在不暴露自身数据的前提下进行协作计算。Multi-party secure computing (Secure Muti-Party Computation, MPC) is an algorithm that protects data privacy and security. Multi-party secure computing allows multiple data parties involved in the calculation to perform collaborative computing without exposing their own data.
秘密分享(SS,Secret Sharing)是一种保护数据隐私安全的算法,可以用于实现多方安全计算。具体地,多个数据方可以在不泄漏自身数据的前提下,使用秘密分享算法进行协作计算,得到秘密信息。每个数据方可以获得该秘密信息的一份份额。单个数据方无法恢复该秘密信息。只有多个数据方一同协作才能恢复该秘密信息。例如数据方P 1持有数据x 1,数据方P 2持有数据x 2。采用秘密分享算法,数据方P 1和数据方P 2可以进行协作计算,得到秘密信息y=y 1+y 2=x 1x 2。数据方P 1在计算后可以获得秘密信息y的份额y 1,数据方P 2在计算后可以获得秘密信息y的份额y 2Secret Sharing (SS, Secret Sharing) is an algorithm that protects data privacy and security, and can be used to implement multi-party secure computing. Specifically, multiple data parties can use secret sharing algorithms to perform collaborative calculations to obtain secret information without leaking their own data. Each data party can obtain a share of the secret information. A single data party cannot recover the secret information. Only multiple data parties can work together to recover the secret information. For example, the data party P 1 holds the data x 1 , and the data party P 2 holds the data x 2 . Using the secret sharing algorithm, the data party P 1 and the data party P 2 can perform collaborative calculations to obtain secret information y=y 1 +y 2 =x 1 x 2 . The data party P 1 can obtain the share y 1 of the secret information y after the calculation, and the data party P 2 can obtain the share y 2 of the secret information y after the calculation.
混淆电路(Garbled Circuit)是一种保护数据隐私的安全计算协议,可以用于实现多方安全计算。具体地,可以将给定的计算任务(例如函数)转换为逻辑电路,所述逻辑电路可以由至少一个运算门构成,所述运算门可以包括与门、或门、异或门等等。所述 逻辑电路可以包括至少两个输入线和至少一个输出线,通过对所述逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。多个数据方可以在不泄漏自身数据的前提下,使用所述混淆电路进行协作计算,得到所述计算任务的执行结果。Garbled Circuit is a secure computing protocol that protects data privacy and can be used to implement secure multi-party computing. Specifically, a given calculation task (for example, a function) may be converted into a logic circuit, and the logic circuit may be composed of at least one arithmetic gate, and the arithmetic gate may include an AND gate, an OR gate, an exclusive OR gate, and so on. The logic circuit may include at least two input lines and at least one output line, and an obfuscated circuit can be obtained by encrypting the input lines and/or output lines of the logic circuit. Multiple data parties can use the obfuscation circuit to perform collaborative calculations without leaking their own data to obtain the execution result of the calculation task.
不经意传输(Oblivious Transfer,OT),又称为茫然传输,是一种可以保护隐私的双方通信协议,能够使通信双方以一种选择模糊化的方式传递数据。发送方可以具有多个数据。经由不经意传输接收方能够获得所述多个数据中的一个或多个数据。在此过程中,发送方不知晓接收方接收的是哪些数据;而接收方不能够获得其所接收数据之外的其它任何数据。不经意传输协议是混淆电路的基础协议。在使用混淆电路进行协作计算的过程中,通常会使用到不经意传输协议。Oblivious Transfer (Oblivious Transfer, OT), also known as oblivious transfer, is a two-party communication protocol that can protect privacy, enabling both parties to communicate to transfer data in a manner that blurs their choices. The sender can have multiple data. The recipient can obtain one or more of the plurality of data via inadvertent transmission. In this process, the sender does not know what data the receiver receives; and the receiver cannot obtain any data other than the data it receives. The inadvertent transmission protocol is the basic protocol for obfuscating circuits. In the process of using obfuscated circuits for cooperative calculations, inadvertent transmission protocols are usually used.
以下介绍混淆电路的一个应用场景示例。The following describes an example of an application scenario of the confusion circuit.
数据方P 1持有数据x 1和数据x 3,数据方P 2持有数据x 2。函数y=f(x 1,x 2,x 3)=x 1x 2x 3可以表示为如图1所示的逻辑电路。所述逻辑电路由与门1和与门2构成。所述逻辑电路可以包括输入线a、输入线b、输入线d、输出线c和输出线s。 The data party P 1 holds data x 1 and data x 3 , and the data party P 2 holds data x 2 . The function y=f(x 1 , x 2 , x 3 )=x 1 x 2 x 3 can be expressed as a logic circuit as shown in FIG. 1. The logic circuit is composed of AND gate 1 and AND gate 2. The logic circuit may include an input line a, an input line b, an input line d, an output line c, and an output line s.
以下介绍数据方P 1生成与门1的混淆真值表的过程。 The following describes the process of generating the confusion truth table of AND gate 1 by data party P 1 .
与门1对应的真值表可以如表1所示。The truth table corresponding to gate 1 can be as shown in Table 1.
表1Table 1
aa bb cc
00 00 00
00 11 00
11 00 00
11 11 11
数据方P 1可以生成两个随机数
Figure PCTCN2020106254-appb-000001
Figure PCTCN2020106254-appb-000002
分别对应输入线a的两个输入值0和1;可以生成两个随机数
Figure PCTCN2020106254-appb-000003
Figure PCTCN2020106254-appb-000004
分别对应输入线b的两个输入值0和1;可以生成两个随机数
Figure PCTCN2020106254-appb-000005
Figure PCTCN2020106254-appb-000006
分别对应输出线c的两个输出值0和1。由此可以得到如表2所示的随机化真值表。
Data party P 1 can generate two random numbers
Figure PCTCN2020106254-appb-000001
with
Figure PCTCN2020106254-appb-000002
Corresponding to the two input values 0 and 1 of the input line a; two random numbers can be generated
Figure PCTCN2020106254-appb-000003
with
Figure PCTCN2020106254-appb-000004
Corresponding to the two input values 0 and 1 of the input line b respectively; two random numbers can be generated
Figure PCTCN2020106254-appb-000005
with
Figure PCTCN2020106254-appb-000006
Corresponding to the two output values 0 and 1 of the output line c respectively. Thus, the randomized truth table shown in Table 2 can be obtained.
表2Table 2
Figure PCTCN2020106254-appb-000007
Figure PCTCN2020106254-appb-000007
Figure PCTCN2020106254-appb-000008
Figure PCTCN2020106254-appb-000008
数据方P 1可以分别将随机数
Figure PCTCN2020106254-appb-000009
Figure PCTCN2020106254-appb-000010
作为密钥,对随机数
Figure PCTCN2020106254-appb-000011
进行加密,得到随机数密文
Figure PCTCN2020106254-appb-000012
可以分别将随机数
Figure PCTCN2020106254-appb-000013
Figure PCTCN2020106254-appb-000014
作为密钥,对随机数
Figure PCTCN2020106254-appb-000015
进行加密,得到随机数密文
Figure PCTCN2020106254-appb-000016
可以分别将随机数
Figure PCTCN2020106254-appb-000017
Figure PCTCN2020106254-appb-000018
作为密钥,对随机数
Figure PCTCN2020106254-appb-000019
进行加密,得到随机数密文
Figure PCTCN2020106254-appb-000020
可以分别将随机数
Figure PCTCN2020106254-appb-000021
Figure PCTCN2020106254-appb-000022
作为密钥,对随机数
Figure PCTCN2020106254-appb-000023
进行加密,得到随机数密文
Figure PCTCN2020106254-appb-000024
由此可以得到如表3所示的加密的随机化真值表。
Data party P 1 can separately assign random numbers
Figure PCTCN2020106254-appb-000009
with
Figure PCTCN2020106254-appb-000010
As the key, the random number
Figure PCTCN2020106254-appb-000011
Encryption, get random number ciphertext
Figure PCTCN2020106254-appb-000012
Random number
Figure PCTCN2020106254-appb-000013
with
Figure PCTCN2020106254-appb-000014
As the key, the random number
Figure PCTCN2020106254-appb-000015
Encryption, get random number ciphertext
Figure PCTCN2020106254-appb-000016
Random number
Figure PCTCN2020106254-appb-000017
with
Figure PCTCN2020106254-appb-000018
As the key, the random number
Figure PCTCN2020106254-appb-000019
Encryption, get random number ciphertext
Figure PCTCN2020106254-appb-000020
Random number
Figure PCTCN2020106254-appb-000021
with
Figure PCTCN2020106254-appb-000022
As the key, the random number
Figure PCTCN2020106254-appb-000023
Encryption, get random number ciphertext
Figure PCTCN2020106254-appb-000024
From this, the encrypted randomized truth table shown in Table 3 can be obtained.
表3table 3
Figure PCTCN2020106254-appb-000025
Figure PCTCN2020106254-appb-000025
数据方P 1可以打乱表3中各行的排列顺序,得到如表4所示的混淆真值表。 The data party P 1 can disrupt the arrangement order of the rows in Table 3 to obtain the confusion truth table shown in Table 4.
表4Table 4
Figure PCTCN2020106254-appb-000026
Figure PCTCN2020106254-appb-000026
数据方P 1还可以生成与门2的混淆真值表,具体过程与生成与门1的混淆真值表的过程相类似,在此不再详述。 The data party P 1 can also generate the confusion truth table of AND gate 2. The specific process is similar to the process of generating the confusion truth table of AND gate 1, and will not be described in detail here.
数据方P 1可以分别将与门1的混淆真值表和与门2的混淆真值表发送给数据方P 2。数据方P 2可以接收与门1的混淆真值表和与门2的混淆真值表。 The data party P 1 can respectively send the confusion truth table of AND gate 1 and the confusion truth table of AND gate 2 to the data party P 2 . The data party P 2 can receive the confusion truth table of AND gate 1 and the confusion truth table of AND gate 2.
数据方P 1可以将数据x 1的各个比特(bit)在输入线a对应的随机数发送给数据方P 2;可以将数据x 3的各个比特(bit)在输入线d对应的随机数发送给数据方P 2。数据方P 2可以接收数据x 1和数据x 3的各个比特对应的随机数。例如,数据 x 1=b 0×2 0+b 1×2 1+...+b i×2 i+...。对于数据x 1的第i个比特b i,当b i的值为0时,数据方P 1可以将b i在输入线a对应的随机数
Figure PCTCN2020106254-appb-000027
发送给数据方P 2;当b i的值为1时,数据方P 1可以将b i在输入线a对应的随机数
Figure PCTCN2020106254-appb-000028
发送给数据方P 2
The data party P 1 can send the random number corresponding to each bit of the data x 1 on the input line a to the data party P 2 ; can send each bit of the data x 3 on the random number corresponding to the input line d To the data party P 2 . The data party P 2 can receive the random number corresponding to each bit of the data x 1 and the data x 3 . For example, data x 1 =b 0 ×2 0 +b 1 ×2 1 +...+b i ×2 i +.... Data for the i-th bit b i x 1 when b i is 0, the data cube P 1 b i may be the corresponding input line A random number
Figure PCTCN2020106254-appb-000027
Send to the data party P 2 ; when the value of b i is 1, the data party P 1 can put the random number of bi on the input line a
Figure PCTCN2020106254-appb-000028
Sent to the data party P 2 .
数据方P 1可以以随机数
Figure PCTCN2020106254-appb-000029
Figure PCTCN2020106254-appb-000030
作为输入,数据方P 2可以以数据x 2的各个比特作为输入,二者进行不经意传输。数据方P 2可以获得数据x 2的各个比特对应的随机数。具体地,数据方P 1可以生成两个随机数
Figure PCTCN2020106254-appb-000031
Figure PCTCN2020106254-appb-000032
分别对应输入线d的两个输入值0和1。如此针对数据x 2的每个比特,数据方P 1可以以随机数
Figure PCTCN2020106254-appb-000033
Figure PCTCN2020106254-appb-000034
作为在不经意传输过程中输入的秘密信息,数据方P 2可以以该比特作为在不经意传输过程中输入的选择信息,进行不经意传输。通过不经意传输,数据方P 2可以获得该比特在输入线d对应的随机数。具体地,当该比特的值为0时,数据方P 2可以获得随机数
Figure PCTCN2020106254-appb-000035
当该比特的值为1时,数据方P 2可以获得随机数
Figure PCTCN2020106254-appb-000036
根据不经意传输的特性,数据方P 1并不知晓数据方P 2具体选择的是哪个随机数,数据方P 2也不能够知晓除了所选择的随机数以外的其它随机数。
Data party P 1 can be a random number
Figure PCTCN2020106254-appb-000029
with
Figure PCTCN2020106254-appb-000030
As input, the data party P 2 can take each bit of the data x 2 as input, and the two can inadvertently transmit. The data party P 2 can obtain a random number corresponding to each bit of data x 2 . Specifically, the data party P 1 can generate two random numbers
Figure PCTCN2020106254-appb-000031
with
Figure PCTCN2020106254-appb-000032
Corresponding to the two input values 0 and 1 of the input line d. So for each bit of data x 2 , the data party P 1 can be a random number
Figure PCTCN2020106254-appb-000033
with
Figure PCTCN2020106254-appb-000034
As the secret information input in the inadvertent transmission process, the data party P 2 can use this bit as the selection information input in the inadvertent transmission process for inadvertent transmission. Through inadvertent transmission, the data party P 2 can obtain the random number corresponding to the bit on the input line d. Specifically, when the value of this bit is 0, the data party P 2 can obtain a random number
Figure PCTCN2020106254-appb-000035
When the value of this bit is 1, the data party P 2 can obtain a random number
Figure PCTCN2020106254-appb-000036
According to the characteristics of inadvertent transmission, the data party P 1 does not know which random number the data party P 2 specifically selected, and the data party P 2 cannot know other random numbers other than the selected random number.
通过以上过程,数据方P 2获得了数据x 1、数据x 2和数据x 3的各个比特对应的随机数。如此数据方P 2可以使用数据x 1的每个比特在输入线a对应的随机数、以及数据x 2的相应比特在输入线b对应的随机数,尝试对与门1的混淆真值表中的4个随机数密文进行解密;数据方P 2仅能够成功解密其中的一个随机数密文,从而得到输出线c的一个随机数。接下来,数据方P 2可以使用数据x 3的相应比特在输入线d对应的随机数、以及解密出的输出线c的随机数,尝试对与门2的混淆真值表中的4个随机数密文进行解密;数据方P 2仅能够成功解密其中的一个随机数密文,得到输出线s的一个随机数。数据方P 2可以将解密出的输出线s的随机数发送给数据方P 1。数据方P 1可以接收输出线s的随机数;可以根据输出线s的随机数、以及随机数和输出值的对应关系,获得输出线s的输出值。 Through the above process, the data party P 2 obtains the random number corresponding to each bit of the data x 1 , the data x 2 and the data x 3 . In this way, the data party P 2 can use the random number corresponding to each bit of the data x 1 on the input line a and the random number corresponding to the corresponding bit of the data x 2 on the input line b to try to confuse the truth table of the AND gate 1. Decrypt the 4 random number ciphertexts; the data party P 2 can only successfully decrypt one of the random number ciphertexts, thereby obtaining a random number on the output line c. Next, the data party P 2 can use the random number corresponding to the input line d of the corresponding bit of the data x 3 and the decrypted random number of the output line c to try to confuse the 4 random numbers in the truth table of the AND gate 2. The ciphertext is decrypted; the data party P 2 can only successfully decrypt one of the random ciphertexts, and obtain a random number on the output line s. The data party P 2 can send the decrypted random number of the output line s to the data party P 1 . The data party P 1 can receive the random number of the output line s; the output value of the output line s can be obtained according to the random number of the output line s and the correspondence between the random number and the output value.
输出线s的每个输出值可以视作函数y=f(x 1,x 2,x 3)=x 1x 2x 3取值的一个比特。如此数据方P 1可以根据输出线s的多个输出值,确定出函数y=f(x 1,x 2,x 3)=x 1x 2x 3的取值。 Each output value of the output line s can be regarded as one bit of the value of the function y=f(x 1 , x 2 , x 3 )=x 1 x 2 x 3 . In this way, the data party P 1 can determine the value of the function y=f(x 1 , x 2 , x 3 )=x 1 x 2 x 3 according to the multiple output values of the output line s.
损失函数(Loss Function)可以用于衡量数据处理模型的预测值与真实值之间不一致的程度。损失函数的值越小,表示数据处理模型的鲁棒性越好。所述损失函数包括但不限于对数损失函数(Logarithmic Loss Function)、平方损失函数(Square Loss)等。Loss function (Loss Function) can be used to measure the degree of inconsistency between the predicted value of the data processing model and the true value. The smaller the value of the loss function, the better the robustness of the data processing model. The loss function includes but is not limited to a logarithmic loss function (Logarithmic Loss Function), a square loss function (Square Loss), and the like.
海森矩阵(Hessian Matrix),又称为黑塞矩阵、海瑟矩阵或海塞矩阵等,是损失函 数的二阶偏导数所构成的方阵,用于表示损失函数的局部曲率。Hessian matrix, also known as Hessian matrix, Hessian matrix or Hessian matrix, etc., is a square matrix formed by the second-order partial derivative of the loss function, used to express the local curvature of the loss function.
激励函数(Activation Function),又称为激活函数,可以用于构建数据处理模型。激励函数定义了在给定输入下的输出。激励函数通常为非线性函数。通过激励函数可以在所述数据处理模型中加入非线性因素,提高所述数据处理模型的表达能力。所述激励函数可以包括Sigmoid函数、Tanh函数和ReLU函数等。所述数据处理模型可以包括逻辑回归模型和神经网络模型等。Activation function, also known as activation function, can be used to build data processing models. The excitation function defines the output at a given input. The excitation function is usually a nonlinear function. Non-linear factors can be added to the data processing model through the excitation function, which improves the expressive ability of the data processing model. The activation function may include Sigmoid function, Tanh function, ReLU function and so on. The data processing model may include a logistic regression model and a neural network model.
在合作安全建模的场景中,出于保护数据隐私的考虑,多个数据方可以在不泄漏自身所持有的数据的前提下,基于自身持有的数据,对数据处理模型进行协作训练。所述数据处理模型包括但不限于逻辑回归模型和神经网络模型等。在对数据处理模型进行训练的过程中,可以使用模型参数优化方法对数据处理模型的模型参数进行优化调整。模型参数优化方法可以包括梯度下降法、牛顿法等等。其中,所述牛顿法可以包括原始牛顿法以及基于原始牛顿法的各种变形方法(诸如阻尼牛顿法、正则化牛顿法等等;正则化牛顿法是指附带了正则化项的牛顿法;正则化可以降低模型的复杂度和不稳定程度,从而降低过拟合的危险)。所述模型参数优化方法可以仅采用秘密分享的方式来实现;或者,还可以采用秘密分享和混淆电路相结合的方式来实现。In the scenario of cooperative security modeling, in order to protect data privacy, multiple data parties can conduct collaborative training on data processing models based on their own data without leaking their own data. The data processing model includes but is not limited to logistic regression model and neural network model. In the process of training the data processing model, the model parameter optimization method can be used to optimize and adjust the model parameters of the data processing model. Model parameter optimization methods may include gradient descent method, Newton method, and so on. Wherein, the Newton's method may include primitive Newton's method and various deformation methods based on primitive Newton's method (such as damping Newton's method, regularized Newton's method, etc.; regularized Newton's method refers to Newton's method with regularization terms; regularization) Modification can reduce the complexity and instability of the model, thereby reducing the risk of overfitting). The method for optimizing model parameters can be implemented only in a secret sharing manner; or, it can also be implemented in a combination of secret sharing and obfuscating circuits.
本说明书提供模型参数确定系统的一个实施例。This specification provides an embodiment of the model parameter determination system.
请参阅图2。在该实施例中,所述模型参数确定系统可以包括第一数据方、第二数据方和可信任的第三方(TTP,Trusted Third Party)。Please refer to Figure 2. In this embodiment, the model parameter determination system may include a first data party, a second data party, and a trusted third party (TTP, Trusted Third Party).
所述第三方可以为一个服务器;或者,还可以为包括多个服务器的服务器集群。所述第三方用于向所述第一数据方和所述第二数据方提供随机数。具体地,所述第三方可以生成随机正交矩阵,可以将所述随机正交矩阵中的各个随机数拆分为两个份额,可以将其中一个份额作为第一份额,将其中另一个份额作为第二份额。所述第三方可以将所述随机正交矩阵中各个随机数的第一份额形成的矩阵作为所述随机正交矩阵的第一份额,将所述随机正交矩阵中各个随机数的第二份额形成的矩阵作为所述随机正交矩阵的第二份额;可以向所述第一数据方发送所述随机正交矩阵的第一份额,可以向所述第二数据方发送所述随机正交矩阵的第二份额。其中,所述随机正交矩阵的第一份额和所述随机正交矩阵的第二份额的和等于所述随机正交矩阵。另外,一方面所述随机正交矩阵可以为由随机数构成的随机数矩阵;另一方面所述随机正交矩阵还可以为正交矩阵。一 个方阵与一个正交矩阵相乘后可以得到一个新的矩阵,该新的矩阵与该方阵具有相同的条件数。这样便于第一数据方和第二数据方在不泄漏自身持有的海森矩阵的份额的条件下,协作计算得到海森矩阵的条件数;进而便于根据条件数来度量海森矩阵的病态程度。具体过程详见后面的实施例。The third party may be one server; or, it may also be a server cluster including multiple servers. The third party is used to provide random numbers to the first data party and the second data party. Specifically, the third party may generate a random orthogonal matrix, and each random number in the random orthogonal matrix may be split into two shares, and one of the shares may be used as the first share, and the other share may be used as the first share. The second share. The third party may use the matrix formed by the first share of each random number in the random orthogonal matrix as the first share of the random orthogonal matrix, and calculate the second share of each random number in the random orthogonal matrix. The formed matrix is used as the second share of the random orthogonal matrix; the first share of the random orthogonal matrix may be sent to the first data party, and the random orthogonal matrix may be sent to the second data party Second share. Wherein, the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix. In addition, on the one hand, the random orthogonal matrix may be a random number matrix composed of random numbers; on the other hand, the random orthogonal matrix may also be an orthogonal matrix. After a square matrix is multiplied by an orthogonal matrix, a new matrix can be obtained, which has the same condition number as the square matrix. In this way, it is convenient for the first data party and the second data party to collaboratively calculate the condition number of the Hessian matrix without leaking their own shares of the Hessian matrix; thus, it is convenient to measure the ill-conditioned degree of the Hessian matrix according to the condition number . The specific process is detailed in the following embodiment.
鉴于所述第一数据方和所述第二数据方在基于混淆电路进行计算的过程中涉及到不经意传输,所述第三方还可以生成第一OT随机数和第二OT随机数;可以向所述第一数据方发送所述第一OT随机数;可以向所述第二数据方发送所述第二OT随机数。OT随机数可以为在不经意传输过程中所使用到的随机数。In view of the fact that the first data party and the second data party involved inadvertent transmission in the calculation process based on the obfuscation circuit, the third party can also generate the first OT random number and the second OT random number; The first data party sends the first OT random number; the second OT random number may be sent to the second data party. The OT random number can be a random number used during inadvertent transmission.
所述第一数据方和所述第二数据方分别为合作安全建模的双方。所述第一数据方可以为持有特征数据的数据方,所述第二数据方可以为持有标签的数据方。例如,所述第一数据方可以持有完整的特征数据,所述第二数据方可以持有特征数据的标签。或者,所述第一数据方可以持有特征数据的一部分数据项,所述第二数据方可以持有特征数据的另一部分数据项和特征数据的标签。具体地,例如,特征数据可以包括用户的储蓄金额和借贷金额。所述第一数据方可以持有用户的储蓄金额,所述第二数据方可以持有用户的借贷金额和特征数据的标签。所述标签可以用于区分不同类型的特征数据,具体数值例如可以取自0和1。值得说明的是,这里的数据方可以为电子设备。所述电子设备可以包括个人计算机、服务器、手持设备、便携式设备、平板型设备、多处理器装置;或者,还可以包括由以上任何多个装置或设备所构成的集群等。另外,特征数据及其对应的标签共同构成了样本数据,样本数据可以用于对数据处理模型进行训练。The first data party and the second data party are respectively two parties of cooperative security modeling. The first data party may be a data party holding characteristic data, and the second data party may be a data party holding a tag. For example, the first data party may hold complete feature data, and the second data party may hold a label of the feature data. Alternatively, the first data party may hold a part of the feature data, and the second data party may hold another part of the feature data and a label of the feature data. Specifically, for example, the characteristic data may include the user's savings amount and loan amount. The first data party may hold the user's savings amount, and the second data party may hold the user's loan amount and the tag of the characteristic data. The tag can be used to distinguish different types of characteristic data, and the specific value can be taken from 0 and 1, for example. It is worth noting that the data party here can be an electronic device. The electronic equipment may include a personal computer, a server, a handheld device, a portable device, a tablet device, a multi-processor device; or, it may also include a cluster formed by any of the above devices or devices. In addition, the feature data and its corresponding labels together constitute sample data, and the sample data can be used to train the data processing model.
在合作安全建模的场景中,所述第一数据方和所述第二数据方可以分别获得第一模型参数的一份份额。这里可以将所述第一数据方获得份额作为第一模型参数的第一份额,可以将所述第二数据方获得份额作为第一模型参数的第二份额。第一模型参数的第一份额和第一模型参数的第二份额的和等于第一模型参数。In the scenario of cooperative security modeling, the first data party and the second data party may each obtain a share of the first model parameter. Here, the share obtained by the first data party may be used as the first share of the first model parameter, and the share obtained by the second data party may be used as the second share of the first model parameter. The sum of the first share of the first model parameter and the second share of the first model parameter is equal to the first model parameter.
所述第一数据方可以接收随机正交矩阵的第一份额和第一OT随机数。所述第二数据方可以接收随机正交矩阵的第二份额和第二OT随机数。如此所述第一数据方可以基于第一模型参数的第一份额、特征数据、随机正交矩阵的第一份额和第一OT随机数,所述第二数据方可以基于第一模型参数的第二份额、标签值、随机正交矩阵的第二份额和第二OT随机数,协作确定新的第一模型参数。所述第一数据方和所述第二数据方可以分别获得新的第一模型参数的一份份额。具体过程可以参见后面的模型参数确定方法实施例。The first data party may receive the first share of the random orthogonal matrix and the first OT random number. The second data party may receive the second share of the random orthogonal matrix and the second OT random number. In this way, the first data party may be based on the first share of the first model parameter, characteristic data, the first share of the random orthogonal matrix, and the first OT random number, and the second data party may be based on the first model parameter The second share, the label value, the second share of the random orthogonal matrix, and the second OT random number, cooperate to determine the new first model parameter. The first data party and the second data party may each obtain a share of the new first model parameter. For the specific process, please refer to the following model parameter determination method embodiment.
基于上述模型参数确定系统实施例,下面将结合图3,详细描述本说明书模型参数确 定方法的一个实施例。该实施例可以包括以下步骤。Based on the foregoing embodiment of the model parameter determination system, an embodiment of the model parameter determination method in this specification will be described in detail below in conjunction with FIG. 3. This embodiment may include the following steps.
步骤S11:第一数据方根据第一乘积的第一份额,第二数据方根据第一乘积的第二份额,基于激励函数对应的混淆电路进行通信。第一数据方获得激励函数取值的第一份额,第二数据方获得激励函数取值的第二份额。Step S11: The first data party performs communication based on the confusion circuit corresponding to the excitation function according to the first share of the first product, and the second data party uses the second share of the first product. The first data party obtains the first share of the value of the excitation function, and the second data party obtains the second share of the value of the excitation function.
步骤S13:第一数据方根据特征数据和激励函数取值的第一份额,第二数据方根据标签和激励函数取值的第二份额,秘密分享损失函数的梯度。第一数据方获得损失函数梯度的第一份额,第二数据方获得损失函数梯度的第二份额。Step S13: The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the gradient of the loss function based on the label and the second share of the incentive function. The first data party obtains the first share of the loss function gradient, and the second data party obtains the second share of the loss function gradient.
步骤S15:第一数据方根据特征数据和激励函数取值的第一份额,第二数据方根据激励函数取值的第二份额,秘密分享海森矩阵。第一数据方获得海森矩阵的第一份额,第二数据方获得海森矩阵的第二份额。Step S15: The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the Hessian matrix according to the second share of the value obtained by the incentive function. The first data party gets the first share of the Hessian matrix, and the second data party gets the second share of the Hessian matrix.
步骤S17:第一数据方根据海森矩阵的第一份额,第二数据方根据海森矩阵的第二份额,秘密分享第一逆矩阵。第一数据方获得第一逆矩阵的第一份额,第二数据方获得第一逆矩阵的第二份额。第一逆矩阵为海森矩阵的逆矩阵。Step S17: The first data party secretly shares the first inverse matrix according to the first share of the Hessian matrix, and the second data party secretly shares the first inverse matrix according to the second share of the Hessian matrix. The first data party obtains the first share of the first inverse matrix, and the second data party obtains the second share of the first inverse matrix. The first inverse matrix is the inverse matrix of the Hessian matrix.
步骤S19:第一数据方根据第一模型参数的第一份额、第一逆矩阵的第一份额和损失函数梯度的第一份额,第二数据方根据第一模型参数的第二份额、第一逆矩阵的第二份额和损失函数梯度的第二份额,秘密分享新的第一模型参数。第一数据方获得新的第一模型参数的第一份额,第二数据方获得新的第一模型参数的第二份额。Step S19: The first data party according to the first share of the first model parameter, the first share of the first inverse matrix and the first share of the loss function gradient, and the second data party according to the second share, first share of the first model parameter The second share of the inverse matrix and the second share of the gradient of the loss function secretly share the new first model parameters. The first data party obtains the first share of the new first model parameter, and the second data party obtains the second share of the new first model parameter.
下面介绍在实施例中涉及的一些术语。Some terms involved in the embodiments are introduced below.
(一)、第一乘积、第二乘积、第三乘积、第四乘积和第五乘积。所述第一乘积可以为第一模型参数和特征数据之间的乘积。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第三乘积可以为海森矩阵的逆矩阵和损失函数梯度之间的乘积。所述第四乘积可以为损失函数梯度的第一份额与预设步长的乘积。所述第五乘积可以为损失函数梯度的第二份额与预设步长的乘积。(1) The first product, the second product, the third product, the fourth product and the fifth product. The first product may be a product between the first model parameter and the feature data. The second product may be a product between a random orthogonal matrix and a Hessian matrix. The third product may be the product between the inverse matrix of the Hessian matrix and the gradient of the loss function. The fourth product may be the product of the first share of the gradient of the loss function and the preset step size. The fifth product may be the product of the second share of the gradient of the loss function and the preset step size.
在一些场景示例中,所述第一乘积可以表示为XW;其中,W表示第一模型参数,具体为第一模型参数构成的向量;X表示特征数据,具体为特征数据构成的矩阵。In some scene examples, the first product may be expressed as XW; where W represents a first model parameter, specifically a vector formed by the first model parameter; X represents feature data, specifically a matrix formed by feature data.
所述第二乘积可以表示为HR,其中,H表示海森矩阵,R表示随机正交矩阵。The second product may be expressed as HR, where H represents a Hessian matrix, and R represents a random orthogonal matrix.
所述第三乘积可以表示为H -1dW,其中,H -1表示海森矩阵的逆矩阵,dW表示损失函数的梯度,dW为向量。 The third product may be expressed as H -1 dW, where H -1 represents the inverse matrix of the Hessian matrix, dW represents the gradient of the loss function, and dW is a vector.
所述第四乘积可以表示为G<dW> 0,所述第五乘积可以表示为G<dW> 1。其中,G 表示预设步长,<dW> 0表示损失函数梯度的第一份额,<dW> 1表示损失函数梯度的第二份额,<dW> 0+<dW> 1=dW。 The fourth product may be expressed as G<dW> 0 , and the fifth product may be expressed as G<dW> 1 . Among them, G represents the preset step size, <dW> 0 represents the first share of the loss function gradient, <dW> 1 represents the second share of the loss function gradient, and <dW> 0 + <dW> 1 = dW.
(二)、第一逆矩阵和第二逆矩阵。鉴于海森矩阵为方阵,因而可以对海森矩阵进行求逆处理,可以将海森矩阵的逆矩阵作为第一逆矩阵。所述第二乘积可以为方阵,因而可以对所述第二乘积进行求逆处理,可以将所述第二乘积的逆矩阵作为第二逆矩阵。(2) The first inverse matrix and the second inverse matrix. Since the Hessian matrix is a square matrix, the Hessian matrix can be inverted, and the inverse matrix of the Hessian matrix can be used as the first inverse matrix. The second product may be a square matrix, and thus the second product may be inverted, and the inverse matrix of the second product may be used as the second inverse matrix.
延续前面的场景示例,所述第一逆矩阵可以表示为H -1,所述第二逆矩阵可以表示为(HR) -1Continuing the previous scenario example, the first inverse matrix may be expressed as H -1 , and the second inverse matrix may be expressed as (HR) -1 .
在一些实施例中,在步骤S11之前,所述第一数据方可以根据持有的特征数据和第一模型参数的第一份额,所述第二数据方可以根据持有的第一模型参数的第二份额,秘密分享第一乘积。所述第一数据方和所述第二数据方可以分别获得所述第一乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第一乘积的第一份额,可以将所述第二数据方获得的份额作为第一乘积的第二份额。第一乘积的第一份额和第一乘积的第二份额的和等于第一乘积。In some embodiments, before step S11, the first data party may be based on the held feature data and the first share of the first model parameter, and the second data party may be based on the held first model parameter. The second share, secretly shares the first product. The first data party and the second data party may each obtain a share of the first product. For ease of description, the share obtained by the first data party may be used as the first share of the first product, and the share obtained by the second data party may be used as the second share of the first product. The sum of the first share of the first product and the second share of the first product is equal to the first product.
延续前面的场景示例,第一模型参数的第一份额可以表示为<W> 0,第一模型参数的第二份额可以表示为<W> 1,<W> 0+<W> 1=W。所述第一数据方可以根据X和<W> 0,所述第二数据方可以根据<W> 1,秘密分享第一乘积XW。所述第一数据方可以获得第一乘积的第一份额<XW> 0,所述第二数据方可以获得第一乘积的第二份额<XW> 1。<XW> 0+<XW> 1=XW。 Continuing the previous scenario example, the first share of the first model parameter can be expressed as <W> 0 , and the second share of the first model parameter can be expressed as <W> 1 , <W> 0 +<W> 1 =W. The first data party may secretly share the first product XW according to X and <W> 0 , and the second data party may secretly share the first product XW according to <W> 1 . The first data party can obtain the first share of the first product<XW> 0 , and the second data party can obtain the second share of the first product<XW> 1 . <XW> 0 + <XW> 1 = XW.
在一些实施例中,可以根据所述激励函数构建相应的逻辑电路。所述逻辑电路可以由所述第一数据方构建;或者,也可以由所述第二数据方构建;又或者,还可以由其它设备(例如可信任的第三方)构建。所述逻辑电路可以由至少一个运算门构成,所述运算门可以包括与门、或门、异或门等等。所述逻辑电路可以包括至少两个输入线和至少一个输出线,通过对所述逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。所述混淆电路可以包括所述逻辑电路中各个运算门的混淆真值表。值得说明的是,这里可以直接根据激励函数构建逻辑电路;或者,也可以对激励函数进行各种适当的变形,可以根据变形后的激励函数构建逻辑电路;又或者,还可以以所述激励函数为基础生成其它函数,可以根据其它函数构建逻辑电路。相应地,这里激励函数与混淆电路相对应 可以理解为:混淆电路是根据激励函数的逻辑电路生成的,或者,混淆电路是根据变形后的激励函数的混淆电路生成的,又或者,混淆电路是根据其它函数的逻辑电路生成的。In some embodiments, a corresponding logic circuit can be constructed according to the excitation function. The logic circuit can be constructed by the first data party; alternatively, it can also be constructed by the second data party; or alternatively, it can also be constructed by other devices (for example, a trusted third party). The logic circuit may be composed of at least one arithmetic gate, and the arithmetic gate may include an AND gate, an OR gate, an exclusive OR gate, and so on. The logic circuit may include at least two input lines and at least one output line, and an obfuscated circuit can be obtained by encrypting the input lines and/or output lines of the logic circuit. The confusion circuit may include a confusion truth table of each arithmetic gate in the logic circuit. It is worth noting that the logic circuit can be constructed directly according to the excitation function; alternatively, various appropriate modifications can be made to the excitation function, and the logical circuit can be constructed according to the deformed excitation function; or, the excitation function can also be used Generate other functions as a basis, and build logic circuits based on other functions. Correspondingly, the activation function and the confusion circuit can be understood as: the confusion circuit is generated based on the logic circuit of the activation function, or the confusion circuit is generated based on the confusion circuit of the deformed activation function, or the confusion circuit is Generated according to the logic circuit of other functions.
所述第一数据方和所述第二数据方均可以持有激励函数对应的混淆电路。在一些实施方式中,所述混淆电路可以由所述第一数据方生成。所述第一数据方可以将生成的混淆电路发送给所述第二数据方。所述第二数据方可以接收所述混淆电路。在另一些实施方式中,所述混淆电路也可以由所述第二数据方生成。所述第二数据方可以将生成的混淆电路发送给所述第一数据方。所述第一数据方可以接收所述混淆电路。Both the first data party and the second data party may have a confusion circuit corresponding to an excitation function. In some embodiments, the obfuscation circuit may be generated by the first data party. The first data party may send the generated obfuscation circuit to the second data party. The second data party may receive the obfuscation circuit. In other implementation manners, the obfuscation circuit may also be generated by the second data party. The second data party may send the generated obfuscation circuit to the first data party. The first data party may receive the obfuscation circuit.
在步骤S11中,第一数据方可以根据第一乘积的第一份额,第二数据方可以根据第一乘积的第二份额,基于激励函数对应的混淆电路进行通信。所述第一数据方和所述第二数据方可以分别获得激励函数取值的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为激励函数取值的第一份额,可以将所述第二数据方获得的份额作为激励函数取值的第二份额。激励函数取值的第一份额和激励函数取值的第二份额的和等于激励函数的取值。In step S11, the first data party can communicate based on the first share of the first product, and the second data party can communicate based on the confusion circuit corresponding to the excitation function according to the second share of the first product. The first data party and the second data party may each obtain a share of the value of the incentive function. For ease of description, the share obtained by the first data party may be used as the first share of the value of the incentive function, and the share obtained by the second data party may be used as the second share of the value of the incentive function. The sum of the first share of the value of the excitation function and the second share of the value of the excitation function is equal to the value of the excitation function.
请参阅图4。以下介绍第一数据方和第二数据方基于混淆电路进行计算的一个场景示例。Please refer to Figure 4. The following describes an example of a scenario where the first data party and the second data party perform calculations based on the obfuscated circuit.
可以根据激励函数f(x 1,x 2)构建函数y=f 1(x 1,x 2,x 3)=f(x 1,x 2)-x 3。其中,x 1用于表示第一乘积的第一份额,x 2用于表示第一乘积的第二份额,x 3用于表示激励函数取值的一份份额(以下称为激励函数取值的第二份额),f 1(x 1,x 2,x 3)的取值用于表示激励函数取值的另一份份额(以下称为激励函数取值的第一份额)。 The function y=f 1 (x 1 , x 2 , x 3 )=f(x 1 , x 2 )-x 3 can be constructed according to the excitation function f(x 1 , x 2 ). Among them, x 1 is used to represent the first share of the first product, x 2 is used to represent the second share of the first product, and x 3 is used to represent a share of the value of the incentive function (hereinafter referred to as the value of the incentive function The second share), the value of f 1 (x 1 , x 2 , x 3 ) is used to represent another share of the value of the excitation function (hereinafter referred to as the first share of the value of the excitation function).
可以构建与函数f 1(x 1,x 2,x 3)=f(x 1,x 2)-x 3相对应的逻辑电路,通过对该逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。所述第一数据方和所述第二数据方均可以持有该混淆电路。值得说明的是,函数y=f 1(x 1,x 2,x 3)=f(x 1,x 2)-x 3及其对应的逻辑电路可以由所述第一数据方构建;或者,也可以由所述第二数据方构建;又或者,还可以由其它设备(例如可信任的第三方)构建。 A logic circuit corresponding to the function f 1 (x 1 , x 2 , x 3 ) = f(x 1 , x 2 )-x 3 can be constructed, and the input line and/or output line of the logic circuit can be encrypted. You can get the confusion circuit. Both the first data party and the second data party may possess the obfuscated circuit. It is worth noting that the function y=f 1 (x 1 , x 2 , x 3 )=f(x 1 , x 2 )-x 3 and its corresponding logic circuit can be constructed by the first data party; or, It can also be constructed by the second data party; or, it can also be constructed by other devices (for example, a trusted third party).
所述第二数据方可以生成激励函数取值的一份份额作为第二份额。如此所述第一数据方可以以第一乘积的第一份额作为该混淆电路的输入,所述第二数据方可以以第一乘积的第二份额以及激励函数取值的第二份额作为该混淆电路的输入,进行通信。所述第一数据方可以基于该混淆电路计算得到激励函数取值的另一份份额作为第一份额。具体的计算过程可以参见前面有关介绍混淆电路的场景示例,在此不再详述。The second data party may generate a share of the value of the incentive function as the second share. In this way, the first data party can use the first share of the first product as the input to the confusion circuit, and the second data party can use the second share of the first product and the second share of the value of the incentive function as the confusion circuit. The input of the circuit for communication. The first data party may calculate another share of the value of the excitation function based on the confusion circuit as the first share. For the specific calculation process, please refer to the previous example of the scene introducing the confusion circuit, which will not be detailed here.
在一些实施方式中,为了降低混淆电路的复杂程度,还可以使用分段线性函数拟合所述激励函数。这样便可以根据所述分段线性函数构建相应的逻辑电路,通过对该逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。所述第一数据方和所述第二数据方均可以持有该混淆电路。例如,所述激励函数可以为Sigmoid函数,所述分段线性函数可以为
Figure PCTCN2020106254-appb-000037
k表示分段线性函数的系数。
In some embodiments, in order to reduce the complexity of the confusion circuit, a piecewise linear function may also be used to fit the excitation function. In this way, a corresponding logic circuit can be constructed according to the piecewise linear function, and the confusion circuit can be obtained by encrypting the input line and/or output line of the logic circuit. Both the first data party and the second data party may possess the obfuscated circuit. For example, the activation function may be a Sigmoid function, and the piecewise linear function may be
Figure PCTCN2020106254-appb-000037
k represents the coefficient of the piecewise linear function.
第一数据方可以根据第一乘积的第一份额,第二数据方可以根据第一乘积的第二份额,基于该混淆电路进行通信。所述第一数据方和所述第二数据方可以分别获得分段线性函数取值的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为分段线性函数取值的第一份额,可以将所述第二数据方获得的份额作为分段线性函数取值的第二份额。分段线性函数取值的第一份额和分段线性函数取值的第二份额的和等于分段线性函数的取值。如此所述第一数据方可以将分段线性函数取值的第一份额作为激励函数取值的第一份额。所述第二数据方可以将分段线性函数取值的第二份额作为激励函数取值的第二份额。The first data party can communicate based on the confusion circuit based on the first share of the first product, and the second data party can communicate based on the confusion circuit based on the second share of the first product. The first data party and the second data party may respectively obtain a share of the value of the piecewise linear function. For ease of description, the share obtained by the first data party may be used as the first share of the value of the piecewise linear function, and the share obtained by the second data party may be used as the second share of the value of the piecewise linear function. The sum of the first share of the value of the piecewise linear function and the second share of the value of the piecewise linear function is equal to the value of the piecewise linear function. In this way, the first data party may use the first share of the value of the piecewise linear function as the first share of the value of the excitation function. The second data party may use the second share of the value of the piecewise linear function as the second share of the value of the excitation function.
在一些实施例中,在步骤S13中,所述第一数据方可以根据特征数据和激励函数取值的第一份额,所述第二数据方还可以根据标签和激励函数取值的第二份额,秘密分享损失函数的梯度。所述第一数据方和所述第二数据方可以分别获得所述损失函数梯度的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为损失函数梯度的第一份额,可以将所述第二数据方获得的份额作为损失函数梯度的第二份额。损失函数梯度的第一份额和损失函数梯度的第二份额的和等于损失函数的梯度。In some embodiments, in step S13, the first data party may take the first share of the value based on the characteristic data and the incentive function, and the second data party may also take the second share of the value based on the label and the incentive function. , Secretly share the gradient of the loss function. The first data party and the second data party may obtain a share of the gradient of the loss function respectively. For ease of description, the share obtained by the first data party may be used as the first share of the loss function gradient, and the share obtained by the second data party may be used as the second share of the loss function gradient. The sum of the first share of the gradient of the loss function and the second share of the gradient of the loss function is equal to the gradient of the loss function.
延续前面的场景示例,所述第一数据方可以根据X和<a> 0,所述第二数据方可以根据标签Y和<a> 1,秘密分享损失函数的梯度dW(具体为向量)。所述第一数据方可以获得损失函数梯度的第一份额<dW> 0,所述第二数据方可以获得损失函数梯度的第二份额<dW> 1。下面介绍所述第一数据方和所述第二数据方秘密分享损失函数dW的详细过程。 Continuing the previous scenario example, the first data party can secretly share the gradient dW (specifically a vector) of the loss function based on X and <a> 0 , and the second data party can secretly share the gradient dW of the loss function based on the label Y and <a> 1 . The first data party can obtain the first share of the loss function gradient<dW> 0 , and the second data party can obtain the second share of the loss function gradient<dW> 1 . The detailed process of the first data party and the second data party secretly sharing the loss function dW is described below.
所述第一数据方可以根据X,所述第二数据方可以根据<a> 1,秘密分享X T<a> 1。 所述第一数据方可以获得<[X T<a> 1]> 0,所述第二数据方可以获得<[X T<a> 1]> 1。<[X T<a> 1]> 0+<[X T<a> 1]> 1=X T<a> 1The party may be the first data X, the second party data may <a> 1, secret sharing X T <a> 1. The first data party can obtain <[X T <a> 1 ]> 0 , and the second data party can obtain <[X T <a> 1 ]> 1 . <[X T <a> 1 ]> 0 +<[X T <a> 1 ]> 1 = X T <a> 1 .
所述第一数据方还可以根据X,所述第二数据方还可以根据标签Y(具体为标签构成的向量),秘密分享X TY。所述第一数据方可以获得<X TY> 0,所述第二数据方可以获得<X TY> 1。<X TY> 0+<X TY> 1=X TY。 The first data party may also secretly share X T Y according to X, and the second data party may also secretly share X T Y according to tag Y (specifically, a vector formed by tags). The first data party can obtain <X T Y> 0 , and the second data party can obtain <X T Y> 1 . <X T Y> 0 +<X T Y> 1 = X T Y.
所述第一数据方可以计算X T<a> 0;可以计算X T<a> 0+<[X T<a> 1]> 0-<X TY> 0作为损失函数梯度dW的第一份额<dW> 0。所述第二数据方可以计算<[X T<a> 1]> 1-<X TY> 1作为损失函数梯度dW的第二份额<dW> 1The first data party can calculate X T <a> 0 ; can calculate X T <a> 0 +<[X T <a> 1 ]> 0 -<X T Y> 0 as the first of the loss function gradient dW Share <dW> 0 . The second data party may calculate <[X T <a> 1 ]> 1- <X T Y> 1 as the second share of the loss function gradient dW <dW> 1 .
Figure PCTCN2020106254-appb-000038
Figure PCTCN2020106254-appb-000038
在一些实施例中,在步骤S15中,所述第一数据方可以根据特征数据和激励函数取值的第一份额,所述第二数据方可以根据激励函数取值的第二份额,秘密分享海森矩阵。所述第一数据方和所述第二数据方可以分别获得所述海森矩阵的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为所述海森矩阵的第一份额,可以将所述第二数据方获得的份额作为所述海森矩阵的第二份额。海森矩阵的第一份额和海森矩阵的第二份额的和等于海森矩阵。In some embodiments, in step S15, the first data party may obtain the first share of the value according to the characteristic data and the incentive function, and the second data party may secretly share the value according to the second share of the incentive function. Hessian matrix. The first data party and the second data party may obtain a share of the Hessian matrix respectively. For ease of description, the share obtained by the first data party may be used as the first share of the Hessian matrix, and the share obtained by the second data party may be used as the second share of the Hessian matrix. The sum of the first share of the Hessian matrix and the second share of the Hessian matrix is equal to the Hessian matrix.
具体地,所述第一数据方可以根据激励函数取值的第一份额,所述第二数据方可以根据激励函数取值的第二份额,秘密分享对角矩阵。所述第一数据方和所述第二数据方可以分别获得所述对角矩阵的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为所述对角矩阵的第一份额,可以将所述第二数据方获得的份额作为所述对角矩阵的第二份额。对角矩阵的第一份额和对角矩阵的第二份额的和等于对角矩阵。如此所述第一数据方可以根据特征数据和所述对角矩阵的第一份额,所述第二数据方可以根据所述对角矩阵的第二份额,秘密分享海森矩阵。所述第一数据方可以获得所述海森矩阵的第一份额,所述第二数据方可以获得所述海森矩阵的第二份额。Specifically, the first data party may secretly share the diagonal matrix according to the first share of the value of the incentive function, and the second data party may secretly share the diagonal matrix according to the second share of the value of the incentive function. The first data party and the second data party may obtain a share of the diagonal matrix respectively. For ease of description, the share obtained by the first data party may be used as the first share of the diagonal matrix, and the share obtained by the second data party may be used as the second share of the diagonal matrix. The sum of the first share of the diagonal matrix and the second share of the diagonal matrix is equal to the diagonal matrix. In this way, the first data party can secretly share the Hessian matrix according to the feature data and the first share of the diagonal matrix, and the second data party can secretly share the Hessian matrix according to the second share of the diagonal matrix. The first data party can obtain the first share of the Hessian matrix, and the second data party can obtain the second share of the Hessian matrix.
延续前面的场景示例,所述第一数据方可以根据<a> 0,所述第二数据方可以根据<a> 1,秘密分享对角矩阵RNN。所述第一数据方可以获得对角矩阵的第一份额RNN 0,所述第二数据方可以获得对角矩阵的第二份额RNN 1。下面介绍所述第一数据方和所述第二数据方秘密分享对角矩阵RNN的详细过程。 Continuing the previous scenario example, the first data party can secretly share the diagonal matrix RNN according to <a> 0 and the second data party can secretly share the diagonal matrix RNN according to <a> 1 . The first data party can obtain the first share RNN 0 of the diagonal matrix, and the second data party can obtain the second share RNN 1 of the diagonal matrix. The detailed process of the first data party and the second data party secretly sharing the diagonal matrix RNN is described below.
所述第一数据方可以根据<a> 0,所述第二数据方可以根据<a> 1,秘密分享<a> 0·<a> 1。所述第一数据方可以获得<[<a> 0·<a> 1]> 0,所述第二数据方可以获得<[<a> 0·<a> 1]> 1。<[<a> 0·<a> 1]> 0+<[<a> 0·<a> 1]> 1=<a> 0·<a> 1。其中,·表示按位相乘运算。例如,向量m=(m 1,m 2,m 3),向量n=(n 1,n 2,n 3)。那么,m·n=(m 1n 1,m 2n 2,m 3n 3)。 The first party data may <a> 0, the second party data may <a> 1, secret sharing <a> 0 · <a> 1. The first data party can obtain <[<a> 0 ·<a> 1 ]> 0 , and the second data party can obtain <[<a> 0 ·<a> 1 ]> 1 . <[<a> 0 ·<a> 1 ]> 0 +<[<a> 0 ·<a> 1 ]> 1 =<a> 0 ·<a> 1 . Among them, · represents the bitwise multiplication operation. For example, the vector m=(m 1 , m 2 , m 3 ), and the vector n=(n 1 , n 2 , n 3 ). Then, m·n=(m 1 n 1 , m 2 n 2 , m 3 n 3 ).
所述第一数据方可以计算<r> 0=<a> 0-<[<a> 0·<a> 1]> 0-<a> 0·<a> 0,所述第二数据方可以计算<r> 1=<a> 1-<[<a> 0·<a> 1]> 0-<a> 1·<a> 1The first data party can calculate <r> 0 =<a> 0 -<[<a> 0 ·<a> 1 ]> 0 -<a> 0 ·<a> 0 , and the second data party can Calculate <r> 1 =<a> 1 -<[<a> 0 ·<a> 1 ]> 0 -<a> 1 ·<a> 1 .
r=<r> 0+<r> 1 r=<r> 0 +<r> 1
=<a> 0-<[<a> 0·<a> 1]> 0-<a> 0·<a> 0+<a> 1-<[<a> 0·<a> 1]> 0-<a> 1·<a> 1 =<a> 0 -<[<a> 0 ·<a> 1 ]> 0 -<a> 0 ·<a> 0 +<a> 1 -<[<a> 0 ·<a> 1 ]> 0 -<a> 1 ·<a> 1
={<a> 0+<a> 1}{1-<a> 0-<a> 1} ={<a> 0 +<a> 1 }{1-<a> 0 -<a> 1 }
=a(1-a)=a(1-a)
.
<r> 0、<r> 1和r分别为向量。因而所述第一数据方可以根据<r> 0生成对角矩阵RNN=diag(r)的第一份额RNN 0=diag(<r> 0),所述第二数据方可以根据<r> 1生成对角矩阵RNN=diag(r)的第二份额RNN 1=diag(<r> 1)。RNN 0+RNN 1=RNN。其中,对角矩阵RNN的第一份额RNN 0和第二份额RNN 1均可以为一个对角矩阵。在实际处理过程中,所述第一数据方可以将<r> 0中的数据元素作为RNN 0主对角线上的数据元素,这样便实现了根据<r> 0生成RNN 0;可以将<r> 1中的数据元素作为RNN 1主对角线上的数据元素,这样便实现了根据<r> 1生成RNN 1<r> 0 , <r> 1, and r are vectors respectively. Therefore, the first data party can generate the first share RNN of the diagonal matrix RNN=diag(r) according to <r> 0, and the second data party can generate the first share RNN 0 = diag (<r> 0 ) according to <r> 0. Generate the second share RNN 1 = diag (<r> 1 ) of the diagonal matrix RNN=diag(r). RNN 0 + RNN 1 = RNN. Wherein, the first share RNN 0 and the second share RNN 1 of the diagonal matrix RNN can both be a diagonal matrix. In the actual process, the first party data may be <r> as data element 0 of the data element on the main diagonal RNN 0, thus achieved under <r> 0 0 RNN generated; may <r> 1 data element as a data element on the main diagonal RNN 1, thus realized <r> 1 generated according RNN 1.
所述第一数据方可以根据X和RNN 0,所述第二数据方可以根据RNN 1,秘密分享海森矩阵H。所述第一数据方可以获得海森矩阵的第一份额<H> 0,所述第二数据方可以获得海森矩阵的第二份额<H> 1。下面介绍所述第一数据方和所述第二数据方秘密分享海森矩阵H的详细过程。 The first data party can secretly share the Hessian matrix H according to X and RNN 0 , and the second data party can secretly share the Hessian matrix H according to RNN 1 . The first data party can obtain the first share<H> 0 of the Hessian matrix, and the second data party can obtain the second share<H> 1 of the Hessen matrix. The detailed process of the first data party and the second data party sharing the Hessian matrix H secretly is described below.
所述第一数据方可以根据X,所述第二数据方可以根据RNN 1,秘密分享X TRNN 1。 所述第一数据方可以获得<X TRNN 10,所述第二数据方可以获得<X TRNN 11。<X TRNN 10+<X TRNN 11=X TRNN 1The party may be the first data X, the second party data may RNN 1, secret sharing X T RNN 1. The first data party can obtain <X T RNN 1 > 0 , and the second data party can obtain <X T RNN 1 > 1 . <X T RNN 1 > 0 +<X T RNN 1 > 1 = X T RNN 1 .
所述第一数据方还可以根据X,所述第二数据方还可以根据<X TRNN 11,秘密分享<X TRNN 11X。所述第一数据方可以获得<[<X TRNN 11X]> 0,所述第二数据方可以获得<[<X TRNN 11X]> 1The first party data may also according to X, the second party may also be in accordance with data <X T RNN 1> 1, secret sharing <X T RNN 1> 1 X. The first data party can obtain <[<X T RNN 1 > 1 X]> 0 , and the second data party can obtain <[<X T RNN 1 > 1 X]> 1 .
<[<X TRNN 11X]> 0+<[<X TRNN 11X]> 1=<X TRNN 11X。 <[<X T RNN 11 X]> 0 +<[<X T RNN 11 X]> 1 =<X T RNN 11 X.
所述第一数据方可以计算X TRNN 0X+<X TRNN 10X+<[<X TRNN 11X]> 0作为海森矩阵H的第一份额<H> 0。所述第二数据方可以将<[<X TRNN 11X]> 1作为海森矩阵H的第二份额<H> 1The first data party can calculate X T RNN 0 X+<X T RNN 1 > 0 X+<[<X T RNN 1 > 1 X]> 0 as the first share of the Hessian matrix H<H> 0 . The second data party may use <[<X T RNN 1 > 1 X]> 1 as the second share of the Hessian matrix H<H> 1 .
Figure PCTCN2020106254-appb-000039
Figure PCTCN2020106254-appb-000039
在一些实施例中,第三方可以向第一数据方下发随机正交矩阵的第一份额;可以向第二数据方下发随机正交矩阵的第二份额。随机正交矩阵的第一份额和随机正交矩阵的第二份额的和等于随机正交矩阵。所述第一数据方可以接收随机正交矩阵的第一份额,所述第二数据方可以接收随机正交矩阵的第二份额。如此在步骤S17中,所述第一数据方可以根据随机正交矩阵的第一份额和海森矩阵的第一份额,所述第二数据方可以根据随机正交矩阵的第二份额和海森矩阵的第二份额,秘密分享第二乘积。所述第一数据方和所述第二数据方可以分别获得所述第二乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第二乘积的第一份额,可以将所述第二数据方获得的份额作为第二乘积的第二份额。第二乘积的第一份额和第二乘积的第二份额的和等于第二乘积。In some embodiments, the third party may issue the first share of the random orthogonal matrix to the first data party; may issue the second share of the random orthogonal matrix to the second data party. The sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix. The first data party may receive a first share of a random orthogonal matrix, and the second data party may receive a second share of a random orthogonal matrix. In this way, in step S17, the first data party can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party can be based on the second share of the random orthogonal matrix and the first share of the Hessian matrix. The second share of the matrix secretly shares the second product. The first data party and the second data party may each obtain a share of the second product. For ease of description, the share obtained by the first data party may be used as the first share of the second product, and the share obtained by the second data party may be used as the second share of the second product. The sum of the first share of the second product and the second share of the second product is equal to the second product.
在本实施例的一些实施方式中,可以由所述第二数据方对所述第二乘积进行求逆处理。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积。鉴于所述第二乘积为方阵,因而所述第二数据方可以对所述第二乘积进行求逆处理,得到所述第二乘积的逆矩阵作为第二逆矩阵;可以 向所述第一数据方发送所述第二逆矩阵。所述第一数据方可以接收所述第二逆矩阵。或者,在本实施例的另一些实施方式中,还可以由所述第一数据方对所述第二乘积进行求逆处理。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积。鉴于所述第二乘积为方阵,因而所述第一数据方可以对所述第二乘积进行求逆处理,得到所述第二乘积的逆矩阵作为第二逆矩阵;可以向所述第二数据方发送所述第二逆矩阵。所述第二数据方可以接收所述第二逆矩阵。In some implementations of this embodiment, the second data party may perform inversion processing on the second product. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product. Since the second product is a square matrix, the second data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix. The first data party may receive the second inverse matrix. Alternatively, in other implementations of this embodiment, the first data party may also perform inversion processing on the second product. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product. Since the second product is a square matrix, the first data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix. The second data party may receive the second inverse matrix.
所述第一数据方可以将随机正交矩阵的第一份额与所述第二逆矩阵相乘,得到第一逆矩阵的第一份额。所述第二数据方可以将随机正交矩阵的第二份额与所述第二逆矩阵相乘,得到第一逆矩阵的第二份额。第一逆矩阵的第一份额和第一逆矩阵的第二份额的和等于第一逆矩阵。The first data party may multiply the first share of the random orthogonal matrix by the second inverse matrix to obtain the first share of the first inverse matrix. The second data party may multiply the second share of the random orthogonal matrix by the second inverse matrix to obtain the second share of the first inverse matrix. The sum of the first share of the first inverse matrix and the second share of the first inverse matrix is equal to the first inverse matrix.
延续前面的场景示例,随机正交矩阵的第一份额可以表示为<R> 0,随机正交矩阵的第二份额可以表示为<R> 1,<R> 0+<R> 1=R。所述第一数据方可以根据<R> 0和<H> 0,所述第二数据方可以根据<R> 1和<H> 1,秘密分享第二乘积HR。所述第一数据方可以获得第二乘积的第一份额<HR> 0,所述第二数据方可以获得第二乘积第二份额<HR> 1。下面介绍所述第一数据方和所述第二数据方秘密分享第二乘积HR的详细过程。 Continuing the previous scenario example, the first share of the random orthogonal matrix can be expressed as <R> 0 , and the second share of the random orthogonal matrix can be expressed as <R> 1 , <R> 0 +<R> 1 =R. The first data party may secretly share the second product HR according to <R> 0 and <H> 0 , and the second data party may secretly share the second product HR according to <R> 1 and <H> 1 . The first data party can obtain the first share of the second product<HR> 0 , and the second data party can obtain the second product second share<HR> 1 . The detailed process of the first data party and the second data party secretly sharing the second product HR is described below.
所述第一数据方可以根据<H> 0,所述第二数据方可以根据<R> 1,秘密分享<H> 0<R> 1。所述第一数据方可以获得<[<H> 0<R> 1]> 0,所述第二数据方可以获得<[<H> 0<R> 1]> 1。<[<H> 0<R> 1]> 0+<[<H> 0<R> 1]> 1=<H> 0<R> 1The first party data may <H> 0, the second party data may <R> 1, secret sharing <H> 0 <R> 1 . The first data party can obtain <[<H> 0 <R> 1 ]> 0 , and the second data party can obtain <[<H> 0 <R> 1 ]> 1 . <[<H> 0 <R> 1 ]> 0 +<[<H> 0 <R> 1 ]> 1 =<H> 0 <R> 1 .
所述第一数据方还可以根据<R> 0,所述第二数据方还可以根据<H> 1,秘密分享<H> 1<R> 0。所述第一数据方可以获得<[<H> 1<R> 0]> 0,所述第二数据方可以获得<[<H> 1<R> 0]> 1。<[<H> 1<R> 0]> 0+<[<H> 1<R> 0]> 1=<H> 1<R> 0The first data party may also secretly share <H> 1 <R> 0 according to <R> 0 and the second data party may also secretly share <H> 1 <R> 0 according to <H> 1 . The first data party can obtain <[<H> 1 <R> 0 ]> 0 , and the second data party can obtain <[<H> 1 <R> 0 ]> 1 . <[<H> 1 <R> 0 ]> 0 +<[<H> 1 <R> 0 ]> 1 =<H> 1 <R> 0 .
所述第一数据方可以计算<H> 0<R> 0+<[<H> 0<R> 1]> 0+<[<H> 1<R> 0]> 0作为第二乘积的第一份额<HR> 0。所述第二数据方可以计算<H> 1<R> 1+<[<H> 0<R> 1]> 1+<[<H> 1<R> 0]> 1作为第二乘积的第二份额<HR> 1The first data party can calculate <H> 0 <R> 0 +<[<H> 0 <R> 1 ]> 0 +<[<H> 1 <R> 0 ]> 0 as the second product of One share <HR> 0 . The second data party can calculate <H> 1 <R> 1 +<[<H> 0 <R> 1 ]> 1 +<[<H> 1 <R> 0 ]> 1 as the second product of Second share <HR> 1 .
Figure PCTCN2020106254-appb-000040
Figure PCTCN2020106254-appb-000040
这里由所述第二数据方对第二乘积HR进行求逆处理。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额<HR> 0。所述第二数据方可以接收第二乘积的第一份额<HR> 0;可以将第二乘积的第一份额<HR> 0与自身持有的第二乘积的第二份额<HR> 1相加,得到第二乘积HR;可以对第二乘积HR进行求逆处理,得到第二逆矩阵(HR) -1;可以向所述第一数据方发送第二逆矩阵(HR) -1。所述第一数据方可以接收第二逆矩阵(HR) -1Here, the second data party performs inversion processing on the second product HR. Specifically, the first data party may send the first share of the second product<HR> 0 to the second data party. The second data party may receive the first share of the second product <HR>0; may compare the first share of the second product <HR> 0 with the second share of the second product held by itself <HR> 1 was added to give a second product of the HR; inversion process may be performed on the second product HR, to obtain a second inverse matrix (HR) -1; may send a second inverse matrix (HR) -1 to the first party data. The first data party may receive the second inverse matrix (HR) -1 .
所述第一数据方可以将第二逆矩阵(HR) -1与随机正交矩阵的第一份额<R> 0相乘,得到第一逆矩阵H -1的第一份额<H -10。所述第二数据方可以将第二逆矩阵(HR) -1与随机正交矩阵的第二份额<R> 1相乘,得到第一逆矩阵H -1的第一份额<H -11。H -1=<H -10+<H -11=<R> 0(HR) -1+<R> 1(HR) -1=R×(HR) -1The first data party may multiply the second inverse matrix (HR) -1 by the first share of the random orthogonal matrix <R> 0 to obtain the first share of the first inverse matrix H -1 <H -1 > 0 . The second data party may multiply the second inverse matrix (HR) -1 by the second share of the random orthogonal matrix <R> 1 to obtain the first share of the first inverse matrix H -1 <H -1 > 1 . H -1 =<H -1 > 0 +<H -1 > 1 =<R> 0 (HR) -1 +<R> 1 (HR) -1 = R×(HR) -1 .
在一些实施例中,在步骤S19中,所述第一数据方可以根据第一逆矩阵的第一份额和损失函数梯度的第一份额,所述第二数据方可以根据第一逆矩阵的第二份额和损失函数梯度的第二份额,秘密分享第三乘积。所述第一数据方和所述第二数据方可以分别获得所述第三乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第三乘积的第一份额,可以将所述第二数据方获得的份额作为第三乘积的第二份额。第三乘积的第一份额和第三乘积的第二份额的和等于第三乘积。In some embodiments, in step S19, the first data party may be based on the first share of the first inverse matrix and the first share of the loss function gradient, and the second data party may be based on the first share of the first inverse matrix. The second share and the second share of the gradient of the loss function secretly share the third product. The first data party and the second data party may each obtain a share of the third product. For ease of description, the share obtained by the first data party may be used as the first share of the third product, and the share obtained by the second data party may be used as the second share of the third product. The sum of the first share of the third product and the second share of the third product is equal to the third product.
所述第一数据方可以将第一模型参数的第一份额与第三乘积的第一份额相减,得到新的第一模型参数的第一份额。所述第二数据方可以将第一模型参数的第二份额与第三乘积的第二份额相减,得到新的第一模型参数的第二份额。The first data party may subtract the first share of the first model parameter from the first share of the third product to obtain the first share of the new first model parameter. The second data party may subtract the second share of the first model parameter from the second share of the third product to obtain the second share of the new first model parameter.
延续前面的场景示例,所述第一数据方可以根据<H -10和<dW> 0,所述第二数据方可以根据<H -11和<dW> 1,秘密分享第三乘积H -1×dW。所述第一数据方可以获得第三乘积的第一份额<H -1×dW> 0,所述第二数据方可以获得第三乘积的第二份额<H -1×dW> 1。下面介绍所述第一数据方和所述第二数据方秘密分享第三乘积H -1×dW 的详细过程。 Continuing the previous scenario example, the first data party can secretly share the third party according to <H -1 > 0 and <dW> 0 , and the second data party can secretly share the third party according to <H -1 > 1 and <dW> 1 The product H -1 ×dW. The first data party can obtain the first share of the third product <H -1 ×dW> 0 , and the second data party can obtain the second share of the third product <H -1 × dW> 1 . The following describes the detailed process of the first data party and the second data party secretly sharing the third product H -1 ×dW.
所述第一数据方可以根据<H -10,所述第二数据方可以根据<dW> 1,秘密分享<H -10<dW> 1。所述第一数据方可以获得<[<H -10<dW> 1]> 0,所述第二数据方可以获得<[<H -10<dW> 1]> 1The first party data may <H -1> 0, the second party data may <dW> 1, secret sharing <H -1> 0 <dW> 1. The first data party can obtain <[<H -1 > 0 <dW> 1 ]> 0 , and the second data party can obtain <[<H -10 <dW> 1 ]> 1 .
<[<H -10<dW> 1]> 0+<[<H -10<dW> 1]> 1=<H -10<dW> 1<[<H -10 <dW> 1 ]> 0 +<[<H -10 <dW> 1 ]> 1 =<H -10 <dW> 1 .
所述第一数据方还可以根据<dW> 0,所述第二数据方还可以根据<H -11,秘密分享<H -11<dW> 0。所述第一数据方可以获得<[<H -11<dW> 0]> 0,所述第二数据方可以获得<[<H -11<dW> 0]> 1The first data party can also secretly share <H -1 > 1 <dW> 0 according to <dW> 0 and the second data party can also secretly share <H -1 > 1 <dW> 0 according to <H -1 > 1 . The first data party can obtain <[<H -1 > 1 <dW> 0 ]> 0 , and the second data party can obtain <[<H -1 > 1 <dW> 0 ]> 1 .
<[<H -11<dW> 0]> 0+<[<H -11<dW> 0]> 1=<H -11<dW> 0<[<H -11 <dW> 0 ]> 0 +<[<H -11 <dW> 0 ]> 1 =<H -11 <dW> 0 .
所述第一数据方可以计算<H -10<dW> 0+<[<H -10<dW> 1]> 0+<[<H -11<dW> 0]> 0作为第三乘积的第一份额<H -1×dW> 0。所述第二数据方可以计算<H -11<dW> 1+<[<H -10<dW> 1]> 1+<[<H -11<dW> 0]> 1作为第三乘积的第二份额<H -1×dW> 1The first data party can calculate <H -10 <dW> 0 +<[<H -10 <dW> 1 ]> 0 +<[<H -11 <dW> 0 ]> 0 The first share as the third product<H -1 ×dW> 0 . The second data party can calculate <H -11 <dW> 1 +<[<H -10 <dW> 1 ]> 1 +<[<H -11 <dW> 0 ]> 1 The second share as the third product <H -1 ×dW> 1 .
H -1×dW=<H -1×dW> 0+<H -1×dW> 1 H -1 ×dW=<H -1 ×dW> 0 +<H -1 ×dW> 1
=<H -10<dW> 0+<[<H -10<dW> 1]> 0+<[<H -11<dW> 0]> 0+<H -11<dW> 1+<[<H -10<dW> 1]> 1+<[<H -11<dW> 0]> 1 =<H -10 <dW> 0 +<[<H -10 <dW> 1 ]> 0 +<[<H -11 <dW> 0 ]> 0 +<H -11 <dW> 1 +<[<H -10 <dW> 1 ]> 1 +<[<H -11 <dW> 0 ]> 1
=<H -10<dW> 0+<H -10<dW> 1+<H -11<dW> 0+<H -11<dW> 1 =<H -10 <dW> 0 +<H -10 <dW> 1 +<H -11 <dW> 0 +<H -11 <dW> 1
=(<H -10+<H -11)(<dW> 0+<dW> 1) =(<H -10 +<H -11 )(<dW> 0 +<dW> 1 )
所述第一数据方可以计算<W'> 0=<W> 0-<H -1×dW> 0,所述第二数据方可以计算<W'> 1=<W> 1-<H -1×dW> 1,<W'> 0表示新的第一模型参数的第一份额,<W'> 1表示新的第一模型参数的第二份额,W'表示新的第一模型参数。 The first party can calculate the data <W '> 0 = <W > 0 - <H -1 × dW> 0, the second party can compute data <W'> 1 = <W > 1 - <H - 1 ×dW> 1 , <W'> 0 represents the first share of the new first model parameter, <W'> 1 represents the second share of the new first model parameter, and W'represents the new first model parameter.
W'=<W'> 0+<W'> 1=<W> 0-<H -1×dW> 0+<W> 1-<H -1×dW> 1=W-H -1×dW。 W'=<W'> 0 +<W'> 1 =<W> 0 -<H -1 ×dW> 0 +<W> 1 -<H -1 ×dW> 1 = WH -1 ×dW.
牛顿法有着较快的收敛速度。步骤S11-步骤S19的模型参数确定方法,由于使用了牛顿法,不仅可以保护合作建模各方(第一数据方和第二数据方)的数据隐私,还可以减少模型参数优化调整的次数,提高数据处理模型的训练效率。Newton's method has a faster convergence rate. The method for determining model parameters in step S11-step S19, due to the use of Newton’s method, can not only protect the data privacy of the parties in the cooperative modeling (the first data party and the second data party), but also reduce the number of model parameter optimization adjustments. Improve the training efficiency of data processing models.
另外,由于数据处理模型中的激励函数通常为非线性函数,涉及的运算为非线性运 算,导致其取值无法直接使用秘密分享算法进行计算。因此若仅通过秘密分享,使用牛顿法协作确定数据处理模型的模型参数,则需要使用多项式来拟合所述激励函数。使用多项式来拟合激励函数存在越界的问题(多项式的输入超过一定范围时,其输出会变得很大或者很小),有可能造成数据处理模型无法完成训练。而混淆电路的复杂程度较高,因此若仅通过混淆电路,使用牛顿法协作确定数据处理模型的模型参数,会造成数据处理模型的训练过程变得复杂。步骤S11-步骤S19的模型参数确定方法,通过秘密分享和混淆电路相结合的方式,不仅可以避免越界的问题,还可以降低数据处理模型训练过程的复杂程度。In addition, since the excitation function in the data processing model is usually a non-linear function, the operations involved are non-linear operations, so its value cannot be directly calculated using the secret sharing algorithm. Therefore, if only secret sharing is used to determine the model parameters of the data processing model cooperatively using the Newton method, a polynomial needs to be used to fit the excitation function. The use of polynomials to fit the excitation function has the problem of out of bounds (when the input of the polynomial exceeds a certain range, its output will become very large or very small), which may cause the data processing model to fail to complete the training. The complexity of the confusion circuit is relatively high. Therefore, if only the confusion circuit is used to determine the model parameters of the data processing model using Newton's method, the training process of the data processing model will become complicated. The method for determining model parameters in step S11-step S19, through the combination of secret sharing and obfuscation circuit, can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process.
在一些实施例中,在步骤S17之前,第一数据方可以根据随机正交矩阵的第一份额和海森矩阵的第一份额,第二数据方可以根据随机正交矩阵的第二份额和海森矩阵的第二份额,秘密分享第二乘积。第一数据方可以获得第二乘积的第一份额,第二数据方可以获得第二乘积的第二份额。所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。关于秘密分享第二乘积的具体过程可以参见上文中的有关描述。In some embodiments, before step S17, the first data party can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party can be based on the second share of the random orthogonal matrix and the sea. The second share of the Sen matrix secretly shares the second product. The first data party can obtain the first share of the second product, and the second data party can obtain the second share of the second product. The second product is a product between a random orthogonal matrix and a Hessian matrix. For the specific process of secretly sharing the second product, please refer to the relevant description above.
如此在步骤S17中,在第二乘积的条件数满足预设条件时,第一数据方可以根据海森矩阵的第一份额,第二数据方可以根据海森矩阵的第二份额,秘密分享第一逆矩阵。第一数据方可以获得第一逆矩阵的第一份额,第二数据方可以获得第一逆矩阵的第二份额。In this way, in step S17, when the condition number of the second product satisfies the preset condition, the first data party can secretly share the first share according to the first share of the Hessian matrix, and the second data party can secretly share the first share according to the second share of the Hessian matrix. An inverse matrix. The first data party can obtain the first share of the first inverse matrix, and the second data party can obtain the second share of the first inverse matrix.
所述预设条件可以包括:条件数小于或等于预设阈值。所述预设阈值可以为经验值,或者,还可以采用其它方式(例如机器学习的方式)获得。The preset condition may include: the number of conditions is less than or equal to a preset threshold. The preset threshold may be an empirical value, or it may also be obtained by other means (for example, a machine learning method).
所述第一数据方和所述第二数据方均可以持有所述预设条件。进而,所述第一数据方和所述第二数据方可以分别判断第二乘积的条件数是否满足所述预设条件。在一些实施方式中,可以由第一数据方计算第二乘积的条件数。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第二数据方发送第二乘积的条件数。所述第二数据方可以接收第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件。在另一些实施方式中,还可以由第二数据方计算第二乘积的条件数。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积;可以计算第二乘积 的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第一数据方发送第二乘积的条件数。所述第一数据方可以接收第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件。Both the first data party and the second data party may hold the preset conditions. Furthermore, the first data party and the second data party may respectively determine whether the condition number of the second product satisfies the preset condition. In some embodiments, the condition number of the second product may be calculated by the first data party. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be determined whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the second data party. The second data party can receive the condition number of the second product; and can determine whether the condition number of the second product meets the preset condition. In some other embodiments, the second data party may also calculate the condition number of the second product. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be judged whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the first data party. The first data party can receive the condition number of the second product; and can judge whether the condition number of the second product meets the preset condition.
或者,可以仅由第一数据方持有所述预设条件,进而仅由第一数据方判断第二乘积的条件数是否满足所述预设条件。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第二数据方发送判断结果信息。所述第二数据方可以接收判断结果信息。Alternatively, only the first data party may hold the preset condition, and then only the first data party may determine whether the condition number of the second product meets the preset condition. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the second data party. The second data party may receive the judgment result information.
又或者,可以仅由第二数据方持有所述预设条件,进而仅由第二数据方判断第二乘积的条件数是否满足所述预设条件。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第一数据方发送判断结果信息。所述第一数据方可以接收判断结果信息。Alternatively, only the second data party may hold the preset condition, and then only the second data party may determine whether the condition number of the second product meets the preset condition. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the first data party. The first data party may receive the judgment result information.
如前面所述,一个方阵与一个正交矩阵相乘后可以得到一个新的矩阵,该新的矩阵与该方阵具有相同的条件数。鉴于海森矩阵为方阵,因而第二乘积的条件数等于海森矩阵的条件数。这样便实现了第一数据方和第二数据方在不泄漏自身持有的海森矩阵的份额的条件下,协作计算得到海森矩阵的条件数。As mentioned earlier, a square matrix can be multiplied by an orthogonal matrix to obtain a new matrix, which has the same condition number as the square matrix. Since the Hessian matrix is a square matrix, the condition number of the second product is equal to the condition number of the Hessian matrix. In this way, the first data party and the second data party can collaboratively calculate the condition number of the Hessian matrix without leaking their share of the Hessian matrix.
第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,即表明海森矩阵的病态程度较小,因而可以使用牛顿法确定模型参数。The condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, that is, it indicates that the Hessian matrix is less ill-conditioned, so the Newton method can be used to determine the model parameters.
第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,即表明海森矩阵的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。具体地,所述第一数据方可以根据第一模型参数的第一份额、损失函数梯度的第一份额和预设步长,计算新的第一模型参数的第一份额。所述第二数据方可以根据第一模型参数的第二份额、损失函数梯度的第二份额和预设步长,计算新的第一模型参数的第二份额。The condition number of the second product does not meet the preset conditions, indicating that the second product is ill-conditioned, which means that the Hessian matrix is ill-conditioned, and the Newton method cannot be used to determine the model parameters, so the gradient descent method can be used instead The Newton method determines the model parameters. Specifically, the first data party may calculate the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step size. The second data party may calculate the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step size.
所述预设步长可以用于控制梯度下降法的迭代速度。所述预设步长可以为任意适当正实数。例如,当预设步长过大时,迭代速度会过快,导致有可能无法获得最优模型参数。当预设步长过小时,导致迭代速度会过慢,导致花费的时间较长。所述预设步长具 体可以为经验值;或者,也可以采用机器学习的方式得到。当然,所述预设步长还可以采用其它方式得到。所述第一数据方和所述第二数据方均可以持有所述预设步长。The preset step length can be used to control the iteration speed of the gradient descent method. The preset step length can be any suitable positive real number. For example, when the preset step size is too large, the iteration speed will be too fast, resulting in the possibility that the optimal model parameters cannot be obtained. When the preset step size is too small, the iteration speed will be too slow, resulting in a longer time. The preset step length may specifically be an empirical value; alternatively, it may also be obtained by means of machine learning. Of course, the preset step length can also be obtained in other ways. Both the first data party and the second data party may hold the preset step size.
所述第一数据方可以将损失函数梯度的第一份额与预设步长相乘,得到第四乘积;可以将第一模型参数的第一份额与第四乘积相减,得到新的第一模型参数的第一份额。所述第二数据方可以将损失函数梯度的第二份额与预设步长相乘,得到第五乘积;可以将第一模型参数的第二份额与第五乘积相减,得到新的第一模型参数的第二份额。新的第一模型参数的第一份额和新的第一模型参数的第二份额的和等于新的第一模型参数。The first data party may multiply the first share of the loss function gradient by the preset step size to obtain the fourth product; may subtract the first share of the first model parameter and the fourth product to obtain a new first The first share of model parameters. The second data party may multiply the second share of the loss function gradient by the preset step size to obtain the fifth product; may subtract the second share of the first model parameter and the fifth product to obtain the new first The second share of model parameters. The sum of the first share of the new first model parameter and the second share of the new first model parameter is equal to the new first model parameter.
延续前面的场景示例,所述第一数据方可以将损失函数梯度的第一份额<dW> 0(具体为向量)与预设步长G相乘(具体为向量的数乘),得到第四乘积G<dW> 0;可以将第一模型参数的第一份额<W> 0与第四乘积G<dW> 0相减,得到新的第一模型参数的第一份额<W'> 0=<W> 0-G<dW> 0Continuing the previous scenario example, the first data party may multiply the first share of the gradient of the loss function <dW> 0 (specifically a vector) by the preset step size G (specifically a vector multiplication) to obtain the fourth The product G<dW>0; the first share of the first model parameter <W> 0 can be subtracted from the fourth product G<dW> 0 to obtain the first share of the new first model parameter <W'> 0 = <W> 0 -G<dW> 0 .
所述第二数据方可以将损失函数梯度的第二份额<dW> 1(具体为向量)与预设步长G相乘(具体为向量的数乘),得到第五乘积G<dW> 1;可以将第一模型参数的第二份额<W> 1与第五乘积G<dW> 1相减,得到新的第一模型参数的第二份额<W'> 1=<W> 1-G<dW> 1。其中,<W'> 0+<W'> 1=W',W'表示新的第一模型参数。 The second data party may multiply the second share of the gradient of the loss function <dW> 1 (specifically a vector) by the preset step size G (specifically a multiplication of the vector) to obtain the fifth product G<dW>1; The second share of the first model parameter <W> 1 can be subtracted from the fifth product G <dW> 1 to obtain the second share of the new first model parameter <W'> 1 = <W> 1 -G <dW> 1 . Wherein, <W'> 0 +<W'> 1 = W', and W'represents the new first model parameter.
这样通过条件数和预设条件,本实施例可以避免在使用牛顿法确定模型参数的过程中由于出现病态矩阵所导致的不收敛问题。In this way, through the condition number and the preset condition, this embodiment can avoid the problem of non-convergence caused by the ill-conditioned matrix in the process of using the Newton method to determine the model parameters.
在本实施例的一些实施方式中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。具体地,可以重复执行秘密分享第一乘积的步骤,所述第一数据方可以获得新的第一乘积的第一份额,所述第二数据方可以获得新的第一乘积的第二份额。新的第一乘积为特征数据和新的第一模型参数的乘积。可以重复执行步骤S11,所述第一数据方可以获得新的激励函数取值的第一份额,所述第二数据方可以获得新的激励函数取值的第二份额。可以重复执行步骤S13,所述第一数据方可以获得新的损失函数梯度的第一份额,所述第二数据方可以获得新的损失函数梯度的第二份额。可以重复执行步骤S15,所述第一数据方可以获得新的海森矩阵的第一份额,所述第二数据方可以获得新的海森矩阵的第二份额。可以重复执行秘密分享第二乘积的步骤,所述第一数据方可以获得新的第二乘积的第一份额,所述第二数据方可以获得新的第二乘积的第二份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。In some implementations of this embodiment, it may further include a process of iterative optimization and adjustment of the model parameters of the data processing model. Specifically, the step of secretly sharing the first product can be repeated, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product. The new first product is the product of the feature data and the new first model parameter. Step S11 may be repeatedly executed, the first data party can obtain the first share of the new excitation function value, and the second data party can obtain the second share of the new excitation function value. Step S13 can be repeated, the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient. Step S15 may be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix. The step of secretly sharing the second product may be repeated, the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明在该轮迭代过程中可以继续使用牛顿法确定模型参数。可以重复执行步骤S17,所述第一数据方可以获得新的第一逆矩阵的第一份额,所述第二数据方可以获得新的第一逆矩阵的第二份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方可以根据新的第一模型参数的第一份额、新的第一逆矩阵的第一份额和新的损失函数梯度的第一份额,所述第二数据方可以根据新的第一模型参数的第二份额、新的第一逆矩阵的第二份额和新的损失函数梯度的第二份额,秘密分享第二模型参数。所述第一数据方可以获得第二模型参数的第一份额,所述第二数据方可以获得第二模型参数的第二份额。第二模型参数的第一份额和第二模型参数的第二份额的和等于第二模型参数。这样可以通过秘密分享和混淆电路相结合的方式实现迭代过程。通过秘密分享和混淆电路相结合的方式,不仅可以避免越界的问题,还可以降低数据处理模型训练过程的复杂程度。另外在迭代的过程中,由于使用了牛顿法,不仅可以保护合作建模各方(第一数据方和第二数据方)的数据隐私,还可以减少模型参数优化调整的次数,提高数据处理模型的训练效率。When the condition number of the new second product satisfies the preset condition, it indicates that the Newton method can be used to determine the model parameters during this round of iteration. Step S17 can be repeated, the first data party can obtain the first share of the new first inverse matrix, and the second data party can obtain the second share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new The second share of the first model parameter, the second share of the new first inverse matrix, and the second share of the new loss function gradient secretly share the second model parameters. The first data party can obtain a first share of the second model parameter, and the second data party can obtain a second share of the second model parameter. The sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter. In this way, the iterative process can be realized through a combination of secret sharing and obfuscation circuits. The combination of secret sharing and obfuscation circuits can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process. In addition, in the iterative process, due to the use of Newton's method, not only can the data privacy of the parties in the cooperative modeling (the first data party and the second data party) be protected, but also the number of optimization adjustments of model parameters can be reduced, and the data processing model can be improved Training efficiency.
在新的第二乘积的条件数不满足预设条件时,表明在该轮迭代过程中无法继续使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的第一份额、新的损失函数梯度的第一份额和预设步长,计算第二模型参数的第一份额。具体计算过程与根据第一模型参数的第一份额、损失函数梯度的第一份额和预设步长,计算新的第一模型参数的第一份额的过程相类似。所述第二数据方可以根据新的第一模型参数的第二份额、新的损失函数梯度的第二份额和预设步长,计算第二模型参数的第二份额。具体计算过程与根据第一模型参数的第二份额、损失函数梯度的第二份额和预设步长,计算新的第一模型参数的第二份额的过程相类似。这样可以通过秘密分享和混淆电路相结合的方式实现迭代过程。通过秘密分享和混淆电路相结合的方式,不仅可以避免越界的问题,还可以降低数据处理模型训练过程的复杂程度。另外在迭代的过程中,使用了梯度下降法。When the condition number of the new second product does not meet the preset condition, it indicates that the Newton method cannot be used to determine the model parameters during this round of iteration, so the gradient descent method can be used instead of the Newton method to determine the model parameters. The first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size. The specific calculation process is similar to the process of calculating the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step length. The second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size. The specific calculation process is similar to the process of calculating the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step length. In this way, the iterative process can be realized through a combination of secret sharing and obfuscation circuits. The combination of secret sharing and obfuscation circuits can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process. In addition, in the iterative process, the gradient descent method is used.
在本实施例的另一些实施方式中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。具体地,可以重复执行秘密分享第一乘积的步骤,所述第一数据方可以获得新的第一乘积的第一份额,所述第二数据方可以获得新的第一乘积的第二份额。新的第一乘积为特征数据和新的第一模型参数的乘积。所述第一数据方可以根据新的第一乘积的第一份额,所述第二数据方可以根据新的第一乘积的第二份额,秘密分享新的 激励函数的取值。所述第一数据方可以获得新的激励函数取值的第一份额,所述第二数据方可以获得新的激励函数取值的第二份额。可以重复执行步骤S13,所述第一数据方可以获得新的损失函数梯度的第一份额,所述第二数据方可以获得新的损失函数梯度的第二份额。可以重复执行步骤S15,所述第一数据方可以获得新的海森矩阵的第一份额,所述第二数据方可以获得新的海森矩阵的第二份额。可以重复执行秘密分享第二乘积的步骤,所述第一数据方可以获得新的第二乘积的第一份额,所述第二数据方可以获得新的第二乘积的第二份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。In some other implementations of this embodiment, it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model. Specifically, the step of secretly sharing the first product can be repeated, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product. The new first product is the product of the feature data and the new first model parameter. The first data party may secretly share the value of the new incentive function based on the first share of the new first product, and the second data party may secretly share the value of the new incentive function based on the second share of the new first product. The first data party can obtain the first share of the value of the new excitation function, and the second data party can obtain the second share of the value of the new excitation function. Step S13 can be repeated, the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient. Step S15 may be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix. The step of secretly sharing the second product may be repeated, the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明在该轮迭代过程中可以继续使用牛顿法确定模型参数。可以重复执行步骤S17,所述第一数据方可以获得新的第一逆矩阵的第一份额,所述第二数据方可以获得新的第一逆矩阵的第二份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方可以根据新的第一模型参数的第一份额、新的第一逆矩阵的第一份额和新的损失函数梯度的第一份额,所述第二数据方根据新的第一模型参数的第二份额、新的第一逆矩阵的第二份额和新的损失函数梯度的第二份额,秘密分享第二模型参数。所述第一数据方可以获得第二模型参数的第一份额,所述第二数据方可以获得第二模型参数的第二份额。第二模型参数的第一份额和第二模型参数的第二份额的和等于第二模型参数。这样可以通过秘密分享的方式实现迭代过程。另外在迭代的过程中,由于使用了牛顿法,不仅可以保护合作建模各方(第一数据方和第二数据方)的数据隐私,还可以减少模型参数优化调整的次数,提高数据处理模型的训练效率。When the condition number of the new second product satisfies the preset condition, it indicates that the Newton method can be used to determine the model parameters during this round of iteration. Step S17 can be repeated, the first data party can obtain the first share of the new first inverse matrix, and the second data party can obtain the second share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new first share. The second share of a model parameter, the second share of the new first inverse matrix and the second share of the new loss function gradient secretly share the second model parameters. The first data party can obtain a first share of the second model parameter, and the second data party can obtain a second share of the second model parameter. The sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter. In this way, the iterative process can be realized through secret sharing. In addition, in the iterative process, due to the use of Newton's method, not only can the data privacy of the parties in the cooperative modeling (the first data party and the second data party) be protected, but also the number of optimization adjustments of model parameters can be reduced, and the data processing model can be improved Training efficiency.
在新的第二乘积的条件数不满足预设条件时,表明在该轮迭代过程中无法继续使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的第一份额、新的损失函数梯度的第一份额和预设步长,计算第二模型参数的第一份额。具体计算过程与根据第一模型参数的第一份额、损失函数梯度的第一份额和预设步长,计算新的第一模型参数的第一份额的过程相类似。所述第二数据方可以根据新的第一模型参数的第二份额、新的损失函数梯度的第二份额和预设步长,计算第二模型参数的第二份额。具体计算过程与根据第一模型参数的第二份额、损失函数梯度的第二份额和预设步长,计算新的第一模型参数的第二份额的过程相类似。这样可以通过秘密分享的方式实现迭代过程。另外在迭代的过程中,使用了梯度下降法。When the condition number of the new second product does not meet the preset condition, it indicates that the Newton method cannot be used to determine the model parameters during this round of iteration, so the gradient descent method can be used instead of the Newton method to determine the model parameters. The first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size. The specific calculation process is similar to the process of calculating the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step length. The second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size. The specific calculation process is similar to the process of calculating the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step length. In this way, the iterative process can be realized through secret sharing. In addition, in the iterative process, the gradient descent method is used.
以下介绍所述第一数据方根据新的第一乘积的第一份额,所述第二数据方根据新的第一乘积的第二份额,秘密分享新的激励函数的取值的过程。The following describes the process in which the first data party secretly shares the value of the new incentive function based on the first share of the new first product, and the second data party secretly shares the value of the new incentive function based on the second share of the new first product.
所述第一数据方可以根据新的第一乘积的第一份额,所述第二数据方可以根据新的 第一乘积的第二份额,秘密分享多项式的取值。所述第一数据方和所述第二数据方可以分别获得所述多项式取值的一份份额。所述多项式可以用于拟合所述数据处理模型的激励函数。如此可以将所述第一数据方获得的份额作为新的激励函数取值的第一份额,可以将所述第二数据方获得的份额作为新的激励函数取值的第二份额。新的激励函数取值的第一份额和新的激励函数取值的第二份额的和等于新的激励函数的取值。The first data party may secretly share the value of the polynomial according to the first share of the new first product, and the second data party may secretly share the value of the polynomial according to the second share of the new first product. The first data party and the second data party may respectively obtain a share of the value of the polynomial. The polynomial can be used to fit the activation function of the data processing model. In this way, the share obtained by the first data party may be used as the first share of the value of the new incentive function, and the share obtained by the second data party may be used as the second share of the value of the new incentive function. The sum of the first share of the value of the new excitation function and the second share of the value of the new excitation function is equal to the value of the new excitation function.
本实施例的模型参数确定方法,第一数据方和第二数据方可以在不泄漏自身所持有的数据的前提下,协作确定数据处理模型的模型参数。In the method for determining model parameters of this embodiment, the first data party and the second data party can cooperate to determine the model parameters of the data processing model without leaking the data held by themselves.
上文中结合图3,详细描述本说明书模型参数确定方法的一个实施例。上文中第一数据方执行的方法步骤,可以单独实现为第一数据方侧的模型参数确定方法;第二数据方执行的方法步骤,可以单独实现为第二数据方侧的模型参数确定方法。下面将结合图5和图6,详细描述本说明书实施例中第一数据方侧的模型参数确定方法、以及第二数据方侧的模型参数确定方法。An embodiment of the method for determining model parameters in this specification is described in detail above in conjunction with FIG. 3. The above method steps performed by the first data party can be separately implemented as a model parameter determination method on the first data party's side; the method steps performed by the second data party can be separately implemented as a model parameter determination method on the second data party's side. The following will describe in detail the method for determining model parameters on the side of the first data party and the method for determining model parameters on the side of the second data party in the embodiments of the present specification in conjunction with FIG. 5 and FIG. 6.
本说明书还提供模型参数确定方法的另一个实施例。该实施例以第一数据方为执行主体,所述第一数据方可以持有特征数据和第一模型参数的份额。请参阅图5。该实施例可以包括以下步骤。This specification also provides another embodiment of the method for determining model parameters. In this embodiment, the first data party is the execution subject, and the first data party may hold the share of the feature data and the first model parameter. Please refer to Figure 5. This embodiment may include the following steps.
步骤S21:根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积。Step S21: Communicate with the partner according to the share of the first product and the confusion circuit corresponding to the excitation function to obtain the share of the value of the excitation function. The first product is the product of the feature data and the first model parameter.
在一些实施例中,所述合作方可以理解为与所述第一数据方进行合作安全建模的数据方,具体可以为前面的第二数据方。具体地,所述第一数据方可以根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额;可以根据第一乘积的份额和激励函数对应的混淆电路与合作方通信,得到激励函数取值的份额。具体过程可以参见前面步骤S11的相关描述,在此不再赘述。In some embodiments, the cooperating party may be understood as a data party that performs cooperative security modeling with the first data party, and specifically may be the previous second data party. Specifically, the first data party may secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product; the confusion circuit corresponding to the incentive function may be obtained according to the share of the first product Communicate with the partner to get the share of the value of the incentive function. For the specific process, please refer to the related description of step S11 above, which will not be repeated here.
步骤S23:根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额。Step S23: secretly share the gradient of the loss function with the partner according to the feature data and the value of the incentive function to obtain the share of the gradient of the loss function.
在一些实施例中,所述第一数据方可以根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额。具体过程可以参见前面步骤S13的相关描述,在此不再赘述。In some embodiments, the first data party may secretly share the gradient of the loss function with the partner according to the share of the characteristic data and the value of the incentive function to obtain the share of the gradient of the loss function. For the specific process, please refer to the related description of step S13, which will not be repeated here.
步骤S25:根据特征数据和激励函数取值的份额与合作方秘密分享海森矩阵,得到 海森矩阵的份额。Step S25: secretly share the Hessian matrix with the partner according to the share of the characteristic data and the value of the incentive function to obtain the share of the Hessian matrix.
在一些实施例中,所述第一数据方可以根据激励函数取值的份额与合作方秘密分享对角矩阵,得到对角矩阵的份额;可以根据特征数据和对角矩阵的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额。具体过程可以参见前面步骤S15的相关描述,在此不再赘述。In some embodiments, the first data party may secretly share the diagonal matrix with the partner according to the value of the incentive function to obtain the share of the diagonal matrix; and may secretly share the diagonal matrix with the partner according to the feature data and the share of the diagonal matrix. Share the Hessian matrix and get the share of the Hessian matrix. For the specific process, please refer to the related description of step S15 above, which will not be repeated here.
步骤S27:根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。Step S27: secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix.
在一些实施例中,所述第一数据方可以根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第一数据方可以向合作方发送第二乘积的份额;可以接收合作方反馈的第二逆矩阵,所述第二逆矩阵为所述第二乘积的逆矩阵;可以将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。具体过程可以参见前面步骤S17的相关描述,在此不再赘述。In some embodiments, the first data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product. The second product may be a product between a random orthogonal matrix and a Hessian matrix. The first data party may send the share of the second product to the partner; may receive the second inverse matrix fed back by the partner, the second inverse matrix being the inverse of the second product; the second inverse matrix may be Multiply the share of the random orthogonal matrix to get the share of the first inverse matrix. For the specific process, please refer to the related description of step S17 above, which will not be repeated here.
或者,在另一些实施例中,所述第一数据方可以根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的第一份额。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第一数据方可以接收合作方发来的第二乘积的第二份额;可以根据第二乘积的第一份额和第二乘积的第二份额确定第二逆矩阵,所述第二逆矩阵为所述第二乘积的逆矩阵;可以将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。具体过程可以参见前面步骤S17的相关描述,在此不再赘述。Or, in other embodiments, the first data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the first share of the second product. The second product may be a product between a random orthogonal matrix and a Hessian matrix. The first data party may receive the second share of the second product sent by the partner; may determine the second inverse matrix according to the first share of the second product and the second share of the second product, the second inverse matrix Is the inverse matrix of the second product; the second inverse matrix can be multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix. For the specific process, please refer to the related description of step S17 above, which will not be repeated here.
步骤S29:根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。Step S29: secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
在一些实施例中,所述第一数据方可以根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额。所述第三乘积可以为第一逆矩阵和损失函数梯度之间的乘积。所述第一数据方可以将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。具体过程可以参见前面步骤S19的相关描述,在此不再赘述。In some embodiments, the first data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product. The third product may be a product between the first inverse matrix and the gradient of the loss function. The first data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter. For the specific process, please refer to the related description of step S19 above, which will not be repeated here.
在一些实施例中,所述第一数据方可以根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。In some embodiments, the first data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is a random positive The product between the intersection matrix and the Hessian matrix.
如此在步骤S27中,所述第一数据方可以在第二乘积的条件数满足预设条件时,根据 海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。其中,第二乘积的条件数可以由第一数据方和/或合作方来计算。第二乘积的条件数等于海森矩阵的条件数。In this way, in step S27, the first data party may secretly share the first inverse matrix with the partner according to the share of the Hessian matrix when the condition number of the second product meets the preset condition to obtain the share of the first inverse matrix. The first inverse matrix is the inverse matrix of the Hessian matrix. Wherein, the condition number of the second product can be calculated by the first data party and/or the partner. The condition number of the second product is equal to the condition number of the Hessian matrix.
第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,可以使用牛顿法确定模型参数。The condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, and the Newton method can be used to determine the model parameters.
第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。所述第一数据方具体可以将损失函数梯度的份额与预设步长相乘,得到第四乘积;可以将第一模型参数的份额与第四乘积相减,得到新的第一模型参数的份额。The condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined by the Newton method. Therefore, the gradient descent method can be used instead of the Newton method to determine the model parameters. The first data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. Specifically, the first data party may multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
在本实施例的一些实施方式中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。具体地,所述第一数据方可以重复执行秘密分享第一乘积的步骤,得到新的第一乘积的份额;可以重复执行步骤S21,得到新的激励函数取值的份额;可以重复执行步骤S23,得到新的损失函数梯度的份额;可以重复执行步骤S25,得到新的海森矩阵的份额;可以重复执行秘密分享第二乘积的步骤,得到新的第二乘积的份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。In some implementations of this embodiment, it may further include a process of iterative optimization and adjustment of the model parameters of the data processing model. Specifically, the first data party may repeat the step of secretly sharing the first product to obtain a new share of the first product; may repeat step S21 to obtain a new share of the value of the incentive function; may repeat step S23 , Obtain the share of the new loss function gradient; repeat step S25 to obtain the share of the new Hessian matrix; repeat the step of secretly sharing the second product to obtain the share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第一数据方可以重复执行步骤S27,得到新的第一逆矩阵的份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product meets the preset condition, it indicates that the Newton method can continue to be used to determine the model parameters. The first data party may repeat step S27 to obtain the share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not meet the preset condition, it indicates that it is necessary to use the gradient descent method instead of the Newton method to determine the model parameters. The first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
在本实施例的另一些实施方式中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。具体地,所述第一数据方可以重复执行秘密分享第一乘积的步骤,得到新的第一乘积的份额。所述第一数据方可以根据新的第一乘积的份额与合作方秘密分享激励函数的取值,得到新的激励函数取值的份额。所述第一数据方可以重复执行步骤S23,得到新的损失函数梯度的份额;可以重复执行步骤S25,得到新的海森矩阵的份额;可以重复执行秘密分享第二乘积的步骤,得到新的第二乘积的份额。新的第二乘积为随 机正交矩阵和新的海森矩阵之间的乘积。In some other implementations of this embodiment, it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model. Specifically, the first data party may repeat the step of secretly sharing the first product to obtain a new share of the first product. The first data party may secretly share the value of the incentive function with the partner according to the share of the new first product to obtain the share of the value of the new incentive function. The first data party may repeat step S23 to obtain a new share of the loss function gradient; repeat step S25 to obtain a new share of the Hessian matrix; may repeat the step of secretly sharing the second product to obtain a new share The share of the second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第一数据方可以重复执行步骤S27,所述第一数据方可以获得新的第一逆矩阵的份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product meets the preset condition, it indicates that the Newton method can continue to be used to determine the model parameters. The first data party may repeat step S27, and the first data party may obtain the share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not meet the preset condition, it indicates that it is necessary to use the gradient descent method instead of the Newton method to determine the model parameters. The first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
本实施例的模型参数确定方法,第一数据方可以在不泄漏自身所拥有的数据的前提下,与合作方协作确定数据处理模型的模型参数,得到新的第一模型参数的份额。In the method for determining model parameters of this embodiment, the first data party can cooperate with the partner to determine the model parameters of the data processing model under the premise of not leaking the data it owns, and obtain the share of the new first model parameters.
本说明书还提供模型参数确定方法的另一个实施例。该实施例以第二数据方为执行主体,所述第二数据方可以持有标签和第一模型参数的份额。请参阅图6。该实施例可以包括以下步骤。This specification also provides another embodiment of the method for determining model parameters. In this embodiment, the second data party is the execution subject, and the second data party may hold the share of the tag and the first model parameter. Please refer to Figure 6. This embodiment may include the following steps.
步骤S31:根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积。Step S31: Communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the incentive function. The first product is the product of the feature data and the first model parameter.
在一些实施例中,所述合作方可以理解为与所述第二数据方进行合作安全建模的数据方,具体可以为前面的第一数据方。具体地,所述第二数据方可以根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额;可以根据第一乘积的份额和激励函数对应的混淆电路与合作方通信,得到激励函数取值的份额。具体过程可以参见前面步骤S11的相关描述,在此不再赘述。In some embodiments, the cooperating party may be understood as a data party that performs cooperative security modeling with the second data party, and specifically may be the previous first data party. Specifically, the second data party may secretly share the first product with the partner according to the share of the first model parameter to obtain the share of the first product; the confusion circuit and the partner may be confused according to the share of the first product and the incentive function. Communication to obtain the share of the value of the excitation function. For the specific process, please refer to the related description of step S11 above, which will not be repeated here.
步骤S33:根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额。Step S33: secretly share the gradient of the loss function with the partner according to the share of the label and the value of the incentive function to obtain the share of the gradient of the loss function.
在一些实施例中,所述第二数据方可以根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额。具体过程可以参见前面步骤S13的相关描述,在此不再赘述。In some embodiments, the second data party may secretly share the gradient of the loss function with the partner according to the share of the tag and the value of the incentive function to obtain the share of the gradient of the loss function. For the specific process, please refer to the related description of step S13, which will not be repeated here.
步骤S35:根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额。Step S35: secretly share the Hessian matrix with the partner according to the value of the incentive function to obtain the Hessian matrix.
在一些实施例中,所述第二数据方可以根据激励函数取值的份额与合作方秘密分享对角矩阵,得到对角矩阵的份额;可以根据对角矩阵的份额与合作方秘密分享海森矩阵, 得到海森矩阵的份额。具体过程可以参见前面步骤S15的相关描述,在此不再赘述。In some embodiments, the second data party may secretly share the diagonal matrix with the partner according to the value of the incentive function to obtain the share of the diagonal matrix; and may secretly share the Hesen with the partner according to the share of the diagonal matrix. Matrix, get the share of Hessian matrix. For the specific process, please refer to the related description of step S15 above, which will not be repeated here.
步骤S37:根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。Step S37: secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix.
在一些实施例中,所述第二数据方可以根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第二数据方可以向合作方发送第二乘积的份额;可以接收合作方反馈的第二逆矩阵,所述第二逆矩阵为所述第二乘积的逆矩阵;可以将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。具体过程可以参见前面步骤S17的相关描述,在此不再赘述。In some embodiments, the second data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product. The second product may be a product between a random orthogonal matrix and a Hessian matrix. The second data party may send the share of the second product to the partner; may receive the second inverse matrix fed back by the partner, the second inverse matrix being the inverse of the second product; the second inverse matrix may be Multiply the share of the random orthogonal matrix to get the share of the first inverse matrix. For the specific process, please refer to the related description of step S17 above, which will not be repeated here.
或者,在另一些实施例中,所述第二数据方可以根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的第一份额。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第二数据方可以接收合作方发来的第二乘积的第二份额;可以根据第二乘积的第一份额和第二乘积的第二份额确定第二逆矩阵,所述第二逆矩阵为所述第二乘积的逆矩阵;可以将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。具体过程可以参见前面步骤S17的相关描述,在此不再赘述。Or, in other embodiments, the second data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the first share of the second product. The second product may be a product between a random orthogonal matrix and a Hessian matrix. The second data party may receive the second share of the second product sent by the partner; may determine the second inverse matrix according to the first share of the second product and the second share of the second product, the second inverse matrix Is the inverse matrix of the second product; the second inverse matrix can be multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix. For the specific process, please refer to the related description of step S17 above, which will not be repeated here.
步骤S39:根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。Step S39: secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
在一些实施例中,所述第二数据方可以根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额。所述第三乘积可以为第一逆矩阵和损失函数梯度之间的乘积。所述第二数据方可以将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。具体过程可以参见前面步骤S19的相关描述,在此不再赘述。In some embodiments, the second data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product. The third product may be a product between the first inverse matrix and the gradient of the loss function. The second data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter. For the specific process, please refer to the related description of step S19 above, which will not be repeated here.
在一些实施例中,所述第二数据方可以根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。In some embodiments, the second data party may secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is a random positive The product between the intersection matrix and the Hessian matrix.
如此在步骤S37中,所述第二数据方可以在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。其中,第二乘积的条件数可以由第二数据方和/或合作方来计算。第二乘积的条件数等于海森矩阵的条件数。In this way, in step S37, the second data party may secretly share the first inverse matrix with the partner according to the share of the Hessian matrix when the condition number of the second product satisfies the preset condition to obtain the share of the first inverse matrix. The first inverse matrix is the inverse matrix of the Hessian matrix. Wherein, the condition number of the second product can be calculated by the second data party and/or the partner. The condition number of the second product is equal to the condition number of the Hessian matrix.
第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,可以使用牛 顿法确定模型参数。The condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, and the Newton method can be used to determine the model parameters.
第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。所述第二数据方具体可以将损失函数梯度的份额与预设步长相乘,得到第四乘积;可以将第一模型参数的份额与第四乘积相减,得到新的第一模型参数的份额。The condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined by the Newton method. Therefore, the gradient descent method can be used instead of the Newton method to determine the model parameters. The second data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. The second data party may specifically multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
在本实施例的一些实施方式中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。具体地,所述第二数据方可以重复执行秘密分享第一乘积的步骤,得到新的第一乘积的份额;可以重复执行步骤S31,得到新的激励函数取值的份额;可以重复执行步骤S33,得到新的损失函数梯度的份额;可以重复执行步骤S35,得到新的海森矩阵的份额;可以重复执行秘密分享第二乘积的步骤,得到新的第二乘积的份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。In some implementations of this embodiment, it may further include a process of iterative optimization and adjustment of the model parameters of the data processing model. Specifically, the second data party may repeat the step of secretly sharing the first product to obtain a new share of the first product; may repeat step S31 to obtain a share of the new incentive function value; may repeat step S33 , Obtain the share of the new loss function gradient; repeat step S35 to obtain the share of the new Hessian matrix; repeat the step of secretly sharing the second product to obtain the share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第二数据方可以重复执行步骤S37,得到新的第一逆矩阵的份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第二数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product meets the preset condition, it indicates that the Newton method can continue to be used to determine the model parameters. The second data party may repeat step S37 to obtain the share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not meet the preset condition, it indicates that it is necessary to use the gradient descent method instead of the Newton method to determine the model parameters. The second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
在本实施例的另一些实施方式中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。具体地,所述第二数据方可以重复执行秘密分享第一乘积的步骤,得到新的第一乘积的份额。所述第二数据方可以根据新的第一乘积的份额与合作方秘密分享激励函数的取值,得到新的激励函数取值的份额。所述第二数据方可以重复执行步骤S33,得到新的损失函数梯度的份额;可以重复执行步骤S35,得到新的海森矩阵的份额;可以重复执行秘密分享第二乘积的步骤,得到新的第二乘积的份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。In some other implementations of this embodiment, it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model. Specifically, the second data party may repeat the step of secretly sharing the first product to obtain a new share of the first product. The second data party may secretly share the value of the incentive function with the partner according to the share of the new first product to obtain the share of the value of the new incentive function. The second data party may repeat step S33 to obtain a new share of the loss function gradient; repeat step S35 to obtain a new share of the Hessian matrix; repeat the step of secretly sharing the second product to obtain a new share The share of the second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第二数据方可以重复执行步骤S37,得到新的第一逆矩阵的份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第二数据方进而可以根据新的第一逆矩阵的份额、新的损 失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product meets the preset condition, it indicates that the Newton method can continue to be used to determine the model parameters. The second data party may repeat step S37 to obtain the share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not meet the preset condition, it indicates that it is necessary to use the gradient descent method instead of the Newton method to determine the model parameters. The second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
本实施例的模型参数确定方法,第二数据方可以在不泄漏自身所拥有的数据的前提下,与合作方协作确定数据处理模型的模型参数,得到新的第一模型参数的份额。In the method for determining model parameters of this embodiment, the second data party can cooperate with the partner to determine the model parameters of the data processing model under the premise of not leaking the data owned by itself, and obtain the share of the new first model parameters.
下面将结合图7和图8,详细描述本说明书实施例中的模型参数确定装置。The model parameter determination device in the embodiment of this specification will be described in detail below in conjunction with FIG. 7 and FIG. 8.
本说明书还提供模型参数确定装置的一个实施例。请参阅图7。该实施例可以应用于第一数据方,可以包括以下单元。This specification also provides an embodiment of the device for determining model parameters. Refer to Figure 7. This embodiment can be applied to the first data party and can include the following units.
激励函数取值份额获取单元41,用于根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;The incentive function value share acquisition unit 41 is configured to communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the value share of the incentive function, and the first product is the characteristic data and the first model Product of parameters;
损失函数梯度份额获取单元43,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;The loss function gradient share obtaining unit 43 is configured to secretly share the gradient of the loss function with the partner according to the share of the characteristic data and the value of the incentive function, to obtain the share of the loss function gradient;
海森矩阵份额获取单元45,用于根据特征数据和激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;The Hessian matrix share obtaining unit 45 is configured to secretly share the Hessian matrix with the partner according to the share of the characteristic data and the incentive function to obtain the share of the Hessian matrix;
第一逆矩阵份额获取单元47,用于根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The first inverse matrix share obtaining unit 47 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
模型参数份额获取单元49,用于根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。The model parameter share obtaining unit 49 is configured to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter .
本说明书还提供模型参数确定装置的另一个实施例。请参阅图8。该实施例可以应用于第二数据方,可以包括以下单元。This specification also provides another embodiment of the device for determining model parameters. Refer to Figure 8. This embodiment can be applied to the second data party and can include the following units.
激励函数取值份额获取单元51,用于根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;The incentive function value share obtaining unit 51 is configured to communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the value share of the incentive function, and the first product is the characteristic data and the first model Product of parameters;
损失函数梯度份额获取单元53,用于根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;The loss function gradient share acquisition unit 53 is used to secretly share the gradient of the loss function with the partner according to the value of the label and the incentive function to obtain the share of the loss function gradient;
海森矩阵份额获取单元55,用于根据激励函数取值的份额与合作方秘密分享海森矩 阵,得到海森矩阵的份额;The Hessian matrix share obtaining unit 55 is used to secretly share the Hessian matrix with the partner according to the share of the incentive function to obtain the Hessian matrix share;
第一逆矩阵份额获取单元57,用于根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The first inverse matrix share obtaining unit 57 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
模型参数份额获取单元59,用于根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。The model parameter share obtaining unit 59 is configured to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter .
请参阅图2,本说明书还提供模型参数确定系统的另一个实施例。在该实施例中,所述模型参数确定系统可以包括第一数据方、第二数据方和可信任的第三方。Please refer to FIG. 2. This specification also provides another embodiment of the model parameter determination system. In this embodiment, the model parameter determination system may include a first data party, a second data party, and a trusted third party.
所述第三方可以为一个服务器;或者,还可以为包括多个服务器的服务器集群。所述第三方用于向所述第一数据方和所述第二数据方提供随机数。具体地,所述第三方可以生成随机正交矩阵,可以将所述随机正交矩阵中的各个随机数拆分为两个份额,可以将其中一个份额作为第一份额,将其中另一个份额作为第二份额。所述第三方可以将所述随机正交矩阵中各个随机数的第一份额形成的矩阵作为所述随机正交矩阵的第一份额,将所述随机正交矩阵中各个随机数的第二份额形成的矩阵作为所述随机正交矩阵的第二份额;可以向所述第一数据方发送所述随机正交矩阵的第一份额,可以向所述第二数据方发送所述随机正交矩阵的第二份额。其中,所述随机正交矩阵的第一份额和所述随机正交矩阵的第二份额的和等于所述随机正交矩阵。另外,一方面所述随机正交矩阵可以为由随机数构成的随机数矩阵;另一方面所述随机正交矩阵还可以为正交矩阵。一个方阵与一个正交矩阵相乘后可以得到一个新的矩阵,该新的矩阵与该方阵具有相同的条件数。这样便于第一数据方和第二数据方在不泄漏自身持有的海森矩阵的份额的条件下,协作计算得到海森矩阵的条件数;进而便于根据条件数来度量海森矩阵的病态程度。具体过程详见后面的实施例。The third party may be one server; or, it may also be a server cluster including multiple servers. The third party is used to provide random numbers to the first data party and the second data party. Specifically, the third party may generate a random orthogonal matrix, and each random number in the random orthogonal matrix may be split into two shares, and one of the shares may be used as the first share, and the other share may be used as the first share. The second share. The third party may use the matrix formed by the first share of each random number in the random orthogonal matrix as the first share of the random orthogonal matrix, and calculate the second share of each random number in the random orthogonal matrix. The formed matrix is used as the second share of the random orthogonal matrix; the first share of the random orthogonal matrix may be sent to the first data party, and the random orthogonal matrix may be sent to the second data party Second share. Wherein, the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix. In addition, on the one hand, the random orthogonal matrix may be a random number matrix composed of random numbers; on the other hand, the random orthogonal matrix may also be an orthogonal matrix. After a square matrix is multiplied by an orthogonal matrix, a new matrix can be obtained, and the new matrix has the same condition number as the square matrix. In this way, it is convenient for the first data party and the second data party to collaboratively calculate the condition number of the Hessian matrix without leaking their own shares of the Hessian matrix; thus, it is convenient to measure the ill-conditioned degree of the Hessian matrix according to the condition number . The specific process is detailed in the following embodiment.
鉴于所述第一数据方和所述第二数据方在基于混淆电路进行计算的过程中涉及到不经意传输,所述第三方还可以生成第一OT随机数和第二OT随机数;可以向所述第一数据方发送所述第一OT随机数;可以向所述第二数据方发送所述第二OT随机数。OT随机数可以为在不经意传输过程中所使用到的随机数。In view of the fact that the first data party and the second data party involved inadvertent transmission in the calculation process based on the obfuscation circuit, the third party can also generate the first OT random number and the second OT random number; The first data party sends the first OT random number; the second OT random number may be sent to the second data party. The OT random number can be a random number used during inadvertent transmission.
所述第一数据方和所述第二数据方分别为合作安全建模的双方。所述第一数据方可以为持有特征数据的数据方,所述第二数据方可以为持有标签的数据方。例如,所述第一数据方可以持有完整的特征数据,所述第二数据方可以持有特征数据的标签。或者,所述第一数据方可以持有特征数据的一部分数据项,所述第二数据方可以持有特征数据 的另一部分数据项和特征数据的标签。具体地,例如,特征数据可以包括用户的储蓄金额和借贷金额。所述第一数据方可以持有用户的储蓄金额,所述第二数据方可以持有用户的借贷金额和特征数据的标签。所述标签可以用于区分不同类型的特征数据,具体数值例如可以取自0和1。值得说明的是,这里的数据方可以为电子设备。所述电子设备可以包括个人计算机、服务器、手持设备、便携式设备、平板型设备、多处理器装置;或者,还可以包括由以上任何多个装置或设备所构成的集群等。另外,特征数据及其对应的标签共同构成了样本数据,样本数据可以用于对数据处理模型进行训练。The first data party and the second data party are respectively two parties of cooperative security modeling. The first data party may be a data party holding characteristic data, and the second data party may be a data party holding a tag. For example, the first data party may hold complete feature data, and the second data party may hold a label of the feature data. Alternatively, the first data party may hold a part of the characteristic data, and the second data party may hold another part of the characteristic data and a label of the characteristic data. Specifically, for example, the characteristic data may include the user's savings amount and loan amount. The first data party may hold the user's savings amount, and the second data party may hold the user's loan amount and the tag of the characteristic data. The tag can be used to distinguish different types of characteristic data, and the specific value can be taken from 0 and 1, for example. It is worth noting that the data party here can be an electronic device. The electronic equipment may include a personal computer, a server, a handheld device, a portable device, a tablet device, a multi-processor device; or, it may also include a cluster formed by any of the above devices or devices. In addition, the feature data and its corresponding labels together constitute sample data, and the sample data can be used to train the data processing model.
在合作安全建模的场景中,所述第一数据方和所述第二数据方可以分别获得第一模型参数的一份份额。这里可以将所述第一数据方获得份额作为第一模型参数的第一份额,可以将所述第二数据方获得份额作为第一模型参数的第二份额。第一模型参数的第一份额和第一模型参数的第二份额的和等于第一模型参数。In the scenario of cooperative security modeling, the first data party and the second data party may each obtain a share of the first model parameter. Here, the share obtained by the first data party may be used as the first share of the first model parameter, and the share obtained by the second data party may be used as the second share of the first model parameter. The sum of the first share of the first model parameter and the second share of the first model parameter is equal to the first model parameter.
所述第一数据方可以接收随机正交矩阵的第一份额和第一OT随机数。所述第二数据方可以接收随机正交矩阵的第二份额和第二OT随机数。如此所述第一数据方可以基于第一模型参数的第一份额、特征数据、随机正交矩阵的第一份额和第一OT随机数,所述第二数据方可以基于第一模型参数的第二份额、标签、随机正交矩阵的第二份额和第二OT随机数,协作确定第二模型参数。例如,所述第一数据方和所述第二数据方可以采用秘密分享的方式,使用牛顿法协作确定新的第一模型参数;进而,可以采用秘密分享和混淆电路相结合的方式,使用梯度下降法协作确定第二模型参数。The first data party may receive the first share of the random orthogonal matrix and the first OT random number. The second data party may receive the second share of the random orthogonal matrix and the second OT random number. In this way, the first data party may be based on the first share of the first model parameter, characteristic data, the first share of the random orthogonal matrix, and the first OT random number, and the second data party may be based on the first model parameter The second share, the label, the second share of the random orthogonal matrix, and the second OT random number cooperate to determine the second model parameters. For example, the first data party and the second data party may adopt a secret sharing method and use Newton's method to collaboratively determine the new first model parameters; further, a combination of secret sharing and obfuscation circuits may be adopted, and gradients may be used. The descent method cooperates to determine the second model parameters.
基于上述模型参数确定系统实施例,下面将结合图9,详细描述本说明书模型参数确定方法的另一个实施例。该实施例可以包括以下步骤。Based on the foregoing embodiment of the model parameter determination system, another embodiment of the model parameter determination method in this specification will be described in detail below in conjunction with FIG. 9. This embodiment may include the following steps.
步骤S601:第一数据方根据特征数据和第一模型参数的第一份额,第二数据方根据第一模型参数的第二份额,秘密分享第一乘积。第一数据方获得第一乘积的第一份额,第二数据方获得第一乘积的第二份额。所述第一乘积为特征数据和第一模型参数的乘积。Step S601: The first data party secretly shares the first product according to the first share of the characteristic data and the first model parameter, and the second data party secretly shares the first product according to the second share of the first model parameter. The first data party gets the first share of the first product, and the second data party gets the second share of the first product. The first product is the product of the feature data and the first model parameter.
步骤S603:第一数据方根据第一乘积的第一份额,第二数据方根据第一乘积的第二份额,秘密分享激励函数的取值。第一数据方获得激励函数取值的第一份额,第二数据方获得激励函数取值的第二份额。Step S603: The first data party secretly shares the value of the incentive function according to the first share of the first product, and the second data party secretly shares the value of the incentive function according to the second share of the first product. The first data party obtains the first share of the value of the excitation function, and the second data party obtains the second share of the value of the excitation function.
步骤S605:第一数据方根据特征数据和激励函数取值的第一份额,第二数据方根据标签和激励函数取值的第二份额,秘密分享损失函数的梯度。第一数据方获得损失函数梯度的第一份额,第二数据方获得损失函数梯度的第二份额。Step S605: The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the gradient of the loss function based on the label and the second share of the incentive function. The first data party obtains the first share of the loss function gradient, and the second data party obtains the second share of the loss function gradient.
步骤S607:第一数据方根据特征数据和激励函数取值的第一份额,第二数据方根据 激励函数取值的第二份额,秘密分享海森矩阵。第一数据方获得海森矩阵的第一份额,第二数据方获得海森矩阵的第二份额。Step S607: The first data party takes the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the Hessian matrix based on the second share of the value taken by the incentive function. The first data party gets the first share of the Hessian matrix, and the second data party gets the second share of the Hessian matrix.
步骤S609:第一数据方根据随机正交矩阵的第一份额和海森矩阵的第一份额,第二数据方根据随机正交矩阵的第二份额和海森矩阵的第二份额,秘密分享第二乘积。第一数据方获得第二乘积的第一份额,第二数据方获得第二乘积的第二份额。所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。Step S609: The first data party secretly shares the first share according to the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party secretly shares the first share according to the second share of the random orthogonal matrix and the second share of the Hessian matrix. Two products. The first data party gets the first share of the second product, and the second data party gets the second share of the second product. The second product is a product between a random orthogonal matrix and a Hessian matrix.
步骤S611:在第二乘积的条件数满足预设条件时,第一数据方根据海森矩阵的第一份额,第二数据方根据海森矩阵的第二份额,秘密分享第一逆矩阵。第一数据方获得第一逆矩阵的第一份额,第二数据方获得第一逆矩阵的第二份额。第一逆矩阵为海森矩阵的逆矩阵。Step S611: When the condition number of the second product meets the preset condition, the first data party secretly shares the first inverse matrix according to the first share of the Hessian matrix, and the second data party secretly shares the first inverse matrix according to the second share of the Hessian matrix. The first data party obtains the first share of the first inverse matrix, and the second data party obtains the second share of the first inverse matrix. The first inverse matrix is the inverse matrix of the Hessian matrix.
步骤S613:第一数据方根据第一模型参数的第一份额、第一逆矩阵的第一份额和损失函数梯度的第一份额,第二数据方根据第一模型参数的第二份额、第一逆矩阵的第二份额和损失函数梯度的第二份额,秘密分享新的第一模型参数。第一数据方获得新的第一模型参数的第一份额,第二数据方获得新的第一模型参数的第二份额。Step S613: The first data party uses the first share of the first model parameter, the first share of the first inverse matrix, and the first share of the loss function gradient, and the second data party uses the second share of the first model parameter, the first share of the loss function The second share of the inverse matrix and the second share of the gradient of the loss function secretly share the new first model parameters. The first data party obtains the first share of the new first model parameter, and the second data party obtains the second share of the new first model parameter.
下面介绍在实施例中涉及的一些术语。Some terms involved in the embodiments are introduced below.
(一)、第一乘积、第二乘积、第三乘积、第四乘积和第五乘积。所述第一乘积可以为第一模型参数和特征数据之间的乘积。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第三乘积可以为海森矩阵的逆矩阵和损失函数梯度之间的乘积。所述第四乘积可以为损失函数梯度的第一份额与预设步长的乘积。所述第五乘积可以为损失函数梯度的第二份额与预设步长的乘积。(1) The first product, the second product, the third product, the fourth product and the fifth product. The first product may be a product between the first model parameter and the feature data. The second product may be a product between a random orthogonal matrix and a Hessian matrix. The third product may be the product between the inverse matrix of the Hessian matrix and the gradient of the loss function. The fourth product may be the product of the first share of the gradient of the loss function and the preset step size. The fifth product may be the product of the second share of the gradient of the loss function and the preset step size.
在一些场景示例中,所述第一乘积可以表示为XW;其中,W表示第一模型参数,具体为第一模型参数构成的向量;X表示特征数据,具体为特征数据构成的矩阵。In some scene examples, the first product may be expressed as XW; where W represents a first model parameter, specifically a vector formed by the first model parameter; X represents feature data, specifically a matrix formed by feature data.
所述第二乘积可以表示为HR,其中,H表示海森矩阵,R表示随机正交矩阵。The second product may be expressed as HR, where H represents a Hessian matrix, and R represents a random orthogonal matrix.
所述第三乘积可以表示为H -1dW,其中,H -1表示海森矩阵的逆矩阵,dW表示损失函数的梯度,dW为向量。 The third product may be expressed as H -1 dW, where H -1 represents the inverse matrix of the Hessian matrix, dW represents the gradient of the loss function, and dW is a vector.
所述第四乘积可以表示为G<dW> 0,所述第五乘积可以表示为G<dW> 1。其中,G表示预设步长,<dW> 0表示损失函数梯度的第一份额,<dW> 1表示损失函数梯度的第二份额,<dW> 0+<dW> 1=dW。 The fourth product may be expressed as G<dW> 0 , and the fifth product may be expressed as G<dW> 1 . Among them, G represents the preset step size, <dW> 0 represents the first share of the loss function gradient, <dW> 1 represents the second share of the loss function gradient, and <dW> 0 + <dW> 1 = dW.
(二)、第一逆矩阵和第二逆矩阵。鉴于海森矩阵为方阵,因而可以对海森矩阵进 行求逆处理,可以将海森矩阵的逆矩阵作为第一逆矩阵。所述第二乘积可以为方阵,因而可以对所述第二乘积进行求逆处理,可以将所述第二乘积的逆矩阵作为第二逆矩阵。(2) The first inverse matrix and the second inverse matrix. Since the Hessian matrix is a square matrix, the Hessian matrix can be inversed, and the inverse of the Hessian matrix can be used as the first inverse matrix. The second product may be a square matrix, and thus the second product may be inverted, and the inverse matrix of the second product may be used as the second inverse matrix.
延续前面的场景示例,所述第一逆矩阵可以表示为H -1,所述第二逆矩阵可以表示为(HR) -1Continuing the previous scenario example, the first inverse matrix may be expressed as H -1 , and the second inverse matrix may be expressed as (HR) -1 .
在一些实施例中,在步骤S601中,所述第一数据方可以根据特征数据和第一模型参数的第一份额,所述第二数据方可以根据第一模型参数的第二份额,秘密分享第一乘积。所述第一数据方和所述第二数据方可以分别获得所述第一乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第一乘积的第一份额,可以将所述第二数据方获得的份额作为第一乘积的第二份额。第一乘积的第一份额和第一乘积的第二份额的和等于第一乘积。In some embodiments, in step S601, the first data party may secretly share the feature data and the first share of the first model parameter, and the second data party may secretly share the second share of the first model parameter. The first product. The first data party and the second data party may each obtain a share of the first product. For ease of description, the share obtained by the first data party may be used as the first share of the first product, and the share obtained by the second data party may be used as the second share of the first product. The sum of the first share of the first product and the second share of the first product is equal to the first product.
延续前面的场景示例,第一模型参数的第一份额可以表示为<W> 0,第一模型参数的第二份额可以表示为<W> 1,<W> 0+<W> 1=W。所述第一数据方可以根据X和<W> 0,所述第二数据方可以根据<W> 1,秘密分享第一乘积XW。所述第一数据方可以获得第一乘积的第一份额<XW> 0,所述第二数据方可以获得第一乘积的第二份额<XW> 1。<XW> 0+<XW> 1=XW。 Continuing the previous scenario example, the first share of the first model parameter can be expressed as <W> 0 , and the second share of the first model parameter can be expressed as <W> 1 , <W> 0 +<W> 1 =W. The first data party may secretly share the first product XW according to X and <W> 0 , and the second data party may secretly share the first product XW according to <W> 1 . The first data party can obtain the first share of the first product<XW> 0 , and the second data party can obtain the second share of the first product<XW> 1 . <XW> 0 + <XW> 1 = XW.
在一些实施例中,在步骤S603中,所述第一数据方可以根据第一乘积的第一份额,所述第二数据方可以根据第一乘积的第二份额,秘密分享多项式的取值。所述第一数据方和所述第二数据方可以分别获得所述多项式取值的一份份额。所述多项式可以用于拟合所述数据处理模型的激励函数。如此可以将所述第一数据方获得的份额作为激励函数取值的第一份额,可以将所述第二数据方获得的份额作为激励函数取值的第二份额。激励函数取值的第一份额和激励函数取值的第二份额的和等于激励函数的取值。In some embodiments, in step S603, the first data party may secretly share the value of the polynomial according to the first share of the first product, and the second data party may secretly share the value of the polynomial according to the second share of the first product. The first data party and the second data party may respectively obtain a share of the value of the polynomial. The polynomial can be used to fit the activation function of the data processing model. In this way, the share obtained by the first data party may be used as the first share of the value of the incentive function, and the share obtained by the second data party may be used as the second share of the value of the incentive function. The sum of the first share of the value of the excitation function and the second share of the value of the excitation function is equal to the value of the excitation function.
延续前面的场景示例,所述激励函数可以为Sigmoid函数。所述激励函数的取值可以表示为a=sigmoid(XW)。所述激励函数取值的第一份额可以表示为<a> 0,所述激励函数取值的第二份额可以表示为<a> 1。其中,<a> 0+<a> 1=a。<a> 0、<a> 1和a分别为向量。 Continuing the previous scenario example, the excitation function may be a Sigmoid function. The value of the excitation function can be expressed as a=sigmoid(XW). The first share of the value of the excitation function may be expressed as <a> 0 , and the second share of the value of the excitation function may be expressed as <a> 1 . Wherein, <a> 0 + <a> 1 = a. <a> 0 , <a> 1, and a are vectors respectively.
在一些实施例中,在步骤S605中,所述第一数据方可以根据特征数据和激励函数取 值的第一份额,所述第二数据方可以根据标签和激励函数取值的第二份额,秘密分享损失函数的梯度。所述第一数据方和所述第二数据方可以分别获得所述损失函数梯度的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为损失函数梯度的第一份额,可以将所述第二数据方获得的份额作为损失函数梯度的第二份额。损失函数梯度的第一份额和损失函数梯度的第二份额的和等于损失函数的梯度。In some embodiments, in step S605, the first data party may take the first share of the value according to the characteristic data and the excitation function, and the second data party may take the second share of the value according to the label and the excitation function, Secretly share the gradient of the loss function. The first data party and the second data party may obtain a share of the gradient of the loss function respectively. For ease of description, the share obtained by the first data party may be used as the first share of the loss function gradient, and the share obtained by the second data party may be used as the second share of the loss function gradient. The sum of the first share of the gradient of the loss function and the second share of the gradient of the loss function is equal to the gradient of the loss function.
延续前面的场景示例,所述第一数据方可以根据X和<a> 0,所述第二数据方可以根据标签Y和<a> 1,秘密分享损失函数的梯度dW(具体为向量)。所述第一数据方可以获得损失函数梯度的第一份额<dW> 0,所述第二数据方可以获得损失函数梯度的第二份额<dW> 1Continuing the previous scenario example, the first data party can secretly share the gradient dW (specifically a vector) of the loss function based on X and <a> 0 , and the second data party can secretly share the gradient dW of the loss function based on the label Y and <a> 1 . The first data party can obtain the first share of the loss function gradient<dW> 0 , and the second data party can obtain the second share of the loss function gradient<dW> 1 .
下面介绍所述第一数据方和所述第二数据方秘密分享损失函数dW的详细过程。The detailed process of the first data party and the second data party secretly sharing the loss function dW is described below.
所述第一数据方可以根据X,所述第二数据方可以根据<a> 1,秘密分享X T<a> 1。所述第一数据方可以获得<[X T<a> 1]> 0,所述第二数据方可以获得<[X T<a> 1]> 1。<[X T<a> 1]> 0+<[X T<a> 1]> 1=X T<a> 1The party may be the first data X, the second party data may <a> 1, secret sharing X T <a> 1. The first data party can obtain <[X T <a> 1 ]> 0 , and the second data party can obtain <[X T <a> 1 ]> 1 . <[X T <a> 1 ]> 0 +<[X T <a> 1 ]> 1 = X T <a> 1 .
所述第一数据方还可以根据X,所述第二数据方还可以根据标签Y(具体为标签构成的向量),秘密分享X TY。所述第一数据方可以获得<X TY> 0,所述第二数据方可以获得<X TY> 1。<X TY> 0+<X TY> 1=X TY。 The first data party may also secretly share X T Y according to X, and the second data party may also secretly share X T Y according to tag Y (specifically, a vector formed by tags). The first data party can obtain <X T Y> 0 , and the second data party can obtain <X T Y> 1 . <X T Y> 0 +<X T Y> 1 = X T Y.
所述第一数据方可以计算X T<a> 0;可以计算X T<a> 0+<[X T<a> 1]> 0-<X TY> 0作为损失函数梯度dW的第一份额<dW> 0。所述第二数据方可以计算<[X T<a> 1]> 1-<X TY> 1作为损失函数梯度dW的第二份额<dW> 1The first data party can calculate X T <a> 0 ; can calculate X T <a> 0 +<[X T <a> 1 ]> 0 -<X T Y> 0 as the first of the loss function gradient dW Share <dW> 0 . The second data party may calculate <[X T <a> 1 ]> 1- <X T Y> 1 as the second share of the loss function gradient dW <dW> 1 .
Figure PCTCN2020106254-appb-000041
Figure PCTCN2020106254-appb-000041
在一些实施例中,在步骤S607中,所述第一数据方可以根据特征数据和激励函数取值的第一份额,所述第二数据方可以根据激励函数取值的第二份额,秘密分享海森矩阵。所述第一数据方和所述第二数据方可以分别获得所述海森矩阵的一份份额。为了便于描 述,可以将所述第一数据方获得的份额作为所述海森矩阵的第一份额,可以将所述第二数据方获得的份额作为所述海森矩阵的第二份额。海森矩阵的第一份额和海森矩阵的第二份额的和等于海森矩阵。In some embodiments, in step S607, the first data party may obtain the first share of the value according to the characteristic data and the incentive function, and the second data party may secretly share the value according to the second share of the incentive function. Hessian matrix. The first data party and the second data party may obtain a share of the Hessian matrix respectively. For ease of description, the share obtained by the first data party may be used as the first share of the Hessen matrix, and the share obtained by the second data party may be used as the second share of the Hessen matrix. The sum of the first share of the Hessian matrix and the second share of the Hessian matrix is equal to the Hessian matrix.
具体地,所述第一数据方可以根据激励函数取值的第一份额,所述第二数据方可以根据激励函数取值的第二份额,秘密分享对角矩阵。所述第一数据方和所述第二数据方可以分别获得所述对角矩阵的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为所述对角矩阵的第一份额,可以将所述第二数据方获得的份额作为所述对角矩阵的第二份额。对角矩阵的第一份额和对角矩阵的第二份额的和等于对角矩阵。如此所述第一数据方可以根据特征数据和所述对角矩阵的第一份额,所述第二数据方可以根据所述对角矩阵的第二份额,秘密分享海森矩阵。所述第一数据方可以获得所述海森矩阵的第一份额,所述第二数据方可以获得所述海森矩阵的第二份额。Specifically, the first data party may secretly share the diagonal matrix according to the first share of the value of the incentive function, and the second data party may secretly share the diagonal matrix according to the second share of the value of the incentive function. The first data party and the second data party may obtain a share of the diagonal matrix respectively. For ease of description, the share obtained by the first data party may be used as the first share of the diagonal matrix, and the share obtained by the second data party may be used as the second share of the diagonal matrix. The sum of the first share of the diagonal matrix and the second share of the diagonal matrix is equal to the diagonal matrix. In this way, the first data party can secretly share the Hessian matrix according to the feature data and the first share of the diagonal matrix, and the second data party can secretly share the Hessian matrix according to the second share of the diagonal matrix. The first data party can obtain the first share of the Hessian matrix, and the second data party can obtain the second share of the Hessian matrix.
延续前面的场景示例,所述第一数据方可以根据<a> 0,所述第二数据方可以根据<a> 1,秘密分享对角矩阵RNN。所述第一数据方可以获得对角矩阵的第一份额RNN 0,所述第二数据方可以获得对角矩阵的第二份额RNN 1Continuing the previous scenario example, the first data party can secretly share the diagonal matrix RNN according to <a> 0 and the second data party can secretly share the diagonal matrix RNN according to <a> 1 . The first data party can obtain the first share RNN 0 of the diagonal matrix, and the second data party can obtain the second share RNN 1 of the diagonal matrix.
下面介绍所述第一数据方和所述第二数据方秘密分享对角矩阵RNN的详细过程。The detailed process of the first data party and the second data party secretly sharing the diagonal matrix RNN is described below.
所述第一数据方可以根据<a> 0,所述第二数据方可以根据<a> 1,秘密分享<a> 0·<a> 1。所述第一数据方可以获得<[<a> 0·<a> 1]> 0,所述第二数据方可以获得<[<a> 0·<a> 1]> 1。<[<a> 0·<a> 1]> 0+<[<a> 0·<a> 1]> 1=<a> 0·<a> 1。其中,·表示按位相乘运算。例如,向量m=(m 1,m 2,m 3),向量n=(n 1,n 2,n 3)。那么,m·n=(m 1n 1,m 2n 2,m 3n 3)。 The first party data may <a> 0, the second party data may <a> 1, secret sharing <a> 0 · <a> 1. The first data party can obtain <[<a> 0 ·<a> 1 ]> 0 , and the second data party can obtain <[<a> 0 ·<a> 1 ]> 1 . <[<a> 0 ·<a> 1 ]> 0 +<[<a> 0 ·<a> 1 ]> 1 =<a> 0 ·<a> 1 . Among them, · represents the bitwise multiplication operation. For example, the vector m=(m 1 , m 2 , m 3 ), and the vector n=(n 1 , n 2 , n 3 ). Then, m·n=(m 1 n 1 , m 2 n 2 , m 3 n 3 ).
所述第一数据方可以计算<r> 0=<a> 0-<[<a> 0·<a> 1]> 0-<a> 0·<a> 0,所述第二数据方可以计算<r> 1=<a> 1-<[<a> 0·<a> 1]> 0-<a> 1·<a> 1The first data party can calculate <r> 0 =<a> 0 -<[<a> 0 ·<a> 1 ]> 0 -<a> 0 ·<a> 0 , and the second data party can Calculate <r> 1 =<a> 1 -<[<a> 0 ·<a> 1 ]> 0 -<a> 1 ·<a> 1 .
r=<r> 0+<r> 1 r=<r> 0 +<r> 1
=<a> 0-<[<a> 0·<a> 1]> 0-<a> 0·<a> 0+<a> 1-<[<a> 0·<a> 1]> 0-<a> 1·<a> 1 =<a> 0 -<[<a> 0 ·<a> 1 ]> 0 -<a> 0 ·<a> 0 +<a> 1 -<[<a> 0 ·<a> 1 ]> 0 -<a> 1 ·<a> 1
={<a> 0+<a> 1}{1-<a> 0-<a> 1} ={<a> 0 +<a> 1 }{1-<a> 0 -<a> 1 }
=a(1-a)=a(1-a)
.
<r> 0、<r> 1和r分别为向量。因而所述第一数据方可以根据<r> 0生成对角矩阵RNN=diag(r)的第一份额RNN 0=diag(<r> 0),所述第二数据方可以根据<r> 1生成对 角矩阵RNN=diag(r)的第二份额RNN 1=diag(<r> 1)。RNN 0+RNN 1=RNN。其中,对角矩阵RNN的第一份额RNN 0和第二份额RNN 1均可以为一个对角矩阵。在实际处理过程中,所述第一数据方可以将<r> 0中的数据元素作为RNN 0主对角线上的数据元素,这样便实现了根据<r> 0生成RNN 0;可以将<r> 1中的数据元素作为RNN 1主对角线上的数据元素,这样便实现了根据<r> 1生成RNN 1<r> 0 , <r> 1, and r are vectors respectively. Therefore, the first data party can generate the first share RNN of the diagonal matrix RNN=diag(r) according to <r> 0, and the second data party can generate the first share RNN 0 = diag (<r> 0 ) according to <r> 0. Generate the second share RNN 1 = diag (<r> 1 ) of the diagonal matrix RNN=diag(r). RNN 0 + RNN 1 = RNN. Wherein, the first share RNN 0 and the second share RNN 1 of the diagonal matrix RNN can both be a diagonal matrix. In the actual process, the first party data may be <r> as data element 0 of the data element on the main diagonal RNN 0, thus achieved under <r> 0 0 RNN generated; may <r> 1 data element as a data element on the main diagonal RNN 1, thus realized <r> 1 generated according RNN 1.
所述第一数据方可以根据X和RNN 0,所述第二数据方可以根据RNN 1,秘密分享海森矩阵H。所述第一数据方可以获得海森矩阵的第一份额<H> 0,所述第二数据方可以获得海森矩阵的第二份额<H> 1The first data party can secretly share the Hessian matrix H according to X and RNN 0 , and the second data party can secretly share the Hessian matrix H according to RNN 1 . The first data party can obtain the first share<H> 0 of the Hessian matrix, and the second data party can obtain the second share<H> 1 of the Hessen matrix.
下面介绍所述第一数据方和所述第二数据方秘密分享海森矩阵H的详细过程。The following describes the detailed process of the first data party and the second data party secretly sharing the Hessian matrix H.
所述第一数据方可以根据X,所述第二数据方可以根据RNN 1,秘密分享X TRNN 1。所述第一数据方可以获得<X TRNN 10,所述第二数据方可以获得<X TRNN 11。<X TRNN 10+<X TRNN 11=X TRNN 1The party may be the first data X, the second party data may RNN 1, secret sharing X T RNN 1. The first data party can obtain <X T RNN 1 > 0 , and the second data party can obtain <X T RNN 1 > 1 . <X T RNN 1 > 0 +<X T RNN 1 > 1 = X T RNN 1 .
所述第一数据方还可以根据X,所述第二数据方还可以根据<X TRNN 11,秘密分享<X TRNN 11X。所述第一数据方可以获得<[<X TRNN 11X]> 0,所述第二数据方可以获得<[<X TRNN 11X]> 1The first party data may also according to X, the second party may also be in accordance with data <X T RNN 1> 1, secret sharing <X T RNN 1> 1 X. The first data party can obtain <[<X T RNN 1 > 1 X]> 0 , and the second data party can obtain <[<X T RNN 1 > 1 X]> 1 .
<[<X TRNN 11X]> 0+<[<X TRNN 11X]> 1=<X TRNN 11X。 <[<X T RNN 11 X]> 0 +<[<X T RNN 11 X]> 1 =<X T RNN 11 X.
所述第一数据方可以计算X TRNN 0X+<X TRNN 10X+<[<X TRNN 11X]> 0作为海森矩阵H的第一份额<H> 0。所述第二数据方可以将<[<X TRNN 11X]> 1作为海森矩阵H的第二份额<H> 0The first data party can calculate X T RNN 0 X+<X T RNN 1 > 0 X+<[<X T RNN 1 > 1 X]> 0 as the first share of the Hessian matrix H<H> 0 . The second data party may use <[<X T RNN 1 > 1 X]> 1 as the second share of the Hessian matrix H<H> 0 .
Figure PCTCN2020106254-appb-000042
Figure PCTCN2020106254-appb-000042
在一些实施例中,第三方可以向第一数据方下发随机正交矩阵的第一份额;可以向第二数据方下发随机正交矩阵的第二份额。随机正交矩阵的第一份额和随机正交矩阵的第二份额的和等于随机正交矩阵。所述第一数据方可以接收随机正交矩阵的第一份额, 所述第二数据方可以接收随机正交矩阵的第二份额。如此在步骤S609中,所述第一数据方可以根据随机正交矩阵的第一份额和海森矩阵的第一份额,所述第二数据方可以根据随机正交矩阵的第二份额和海森矩阵的第二份额,秘密分享第二乘积。所述第一数据方和所述第二数据方可以分别获得所述第二乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第二乘积的第一份额,可以将所述第二数据方获得的份额作为第二乘积的第二份额。第二乘积的第一份额和第二乘积的第二份额的和等于第二乘积。In some embodiments, the third party may issue the first share of the random orthogonal matrix to the first data party; may issue the second share of the random orthogonal matrix to the second data party. The sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix. The first data party may receive the first share of the random orthogonal matrix, and the second data party may receive the second share of the random orthogonal matrix. In this way, in step S609, the first data party can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party can be based on the second share of the random orthogonal matrix and the first share of the Hessian matrix. The second share of the matrix secretly shares the second product. The first data party and the second data party may each obtain a share of the second product. For ease of description, the share obtained by the first data party may be used as the first share of the second product, and the share obtained by the second data party may be used as the second share of the second product. The sum of the first share of the second product and the second share of the second product is equal to the second product.
延续前面的场景示例,随机正交矩阵的第一份额可以表示为<R> 0,随机正交矩阵的第二份额可以表示为<R> 1,<R> 0+<R> 1=R。所述第一数据方可以根据<R> 0和<H> 0,所述第二数据方可以根据<R> 1和<H> 1,秘密分享第二乘积HR。所述第一数据方可以获得第二乘积的第一份额<HR> 0,所述第二数据方可以获得第二乘积第二份额<HR> 1Continuing the previous scenario example, the first share of the random orthogonal matrix can be expressed as <R> 0 , and the second share of the random orthogonal matrix can be expressed as <R> 1 , <R> 0 +<R> 1 =R. The first data party may secretly share the second product HR according to <R> 0 and <H> 0 , and the second data party may secretly share the second product HR according to <R> 1 and <H> 1 . The first data party can obtain the first share of the second product<HR> 0 , and the second data party can obtain the second product second share<HR> 1 .
下面介绍所述第一数据方和所述第二数据方秘密分享第二乘积HR的详细过程。The detailed process of the first data party and the second data party secretly sharing the second product HR is described below.
所述第一数据方可以根据<H> 0,所述第二数据方可以根据<R> 1,秘密分享<H> 0<R> 1。所述第一数据方可以获得<[<H> 0<R> 1]> 0,所述第二数据方可以获得<[<H> 0<R> 1]> 1。<[<H> 0<R> 1]> 0+<[<H> 0<R> 1]> 1=<H> 0<R> 1The first party data may <H> 0, the second party data may <R> 1, secret sharing <H> 0 <R> 1 . The first data party can obtain <[<H> 0 <R> 1 ]> 0 , and the second data party can obtain <[<H> 0 <R> 1 ]> 1 . <[<H> 0 <R> 1 ]> 0 +<[<H> 0 <R> 1 ]> 1 =<H> 0 <R> 1 .
所述第一数据方还可以根据<R> 0,所述第二数据方还可以根据<H> 1,秘密分享<H> 1<R> 0。所述第一数据方可以获得<[<H> 1<R> 0]> 0,所述第二数据方可以获得<[<H> 1<R> 0]> 1。<[<H> 1<R> 0]> 0+<[<H> 1<R> 0]> 1=<H> 1<R> 0The first data party may also secretly share <H> 1 <R> 0 according to <R> 0 and the second data party may also secretly share <H> 1 <R> 0 according to <H> 1 . The first data party can obtain <[<H> 1 <R> 0 ]> 0 , and the second data party can obtain <[<H> 1 <R> 0 ]> 1 . <[<H> 1 <R> 0 ]> 0 +<[<H> 1 <R> 0 ]> 1 =<H> 1 <R> 0 .
所述第一数据方可以计算<H> 0<R> 0+<[<H> 0<R> 1]> 0+<[<H> 1<R> 0]> 0作为第二乘积的第一份额<HR> 0。所述第二数据方可以计算<H> 1<R> 1+<[<H> 0<R> 1]> 1+<[<H> 1<R> 0]> 1作为第二乘积的第二份额<HR> 1The first data party can calculate <H> 0 <R> 0 +<[<H> 0 <R> 1 ]> 0 +<[<H> 1 <R> 0 ]> 0 as the second product of One share <HR> 0 . The second data party can calculate <H> 1 <R> 1 +<[<H> 0 <R> 1 ]> 1 +<[<H> 1 <R> 0 ]> 1 as the second product of Second share <HR> 1 .
Figure PCTCN2020106254-appb-000043
Figure PCTCN2020106254-appb-000043
在一些实施例中,所述预设条件可以包括:条件数小于或等于预设阈值。所述预设 阈值可以为经验值,或者,还可以采用其它方式(例如机器学习的方式)获得。In some embodiments, the preset condition may include: the number of conditions is less than or equal to a preset threshold. The preset threshold may be an empirical value, or it may also be obtained in other ways (for example, machine learning).
所述第一数据方和所述第二数据方均可以持有所述预设条件。进而,所述第一数据方和所述第二数据方可以分别判断第二乘积的条件数是否满足所述预设条件。在一些实施方式中,可以由第一数据方计算第二乘积的条件数。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第二数据方发送第二乘积的条件数。所述第二数据方可以接收第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件。在另一些实施方式中,还可以由第二数据方计算第二乘积的条件数。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第一数据方发送第二乘积的条件数。所述第一数据方可以接收第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件。Both the first data party and the second data party may hold the preset conditions. Furthermore, the first data party and the second data party may respectively determine whether the condition number of the second product satisfies the preset condition. In some embodiments, the condition number of the second product may be calculated by the first data party. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be determined whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the second data party. The second data party can receive the condition number of the second product; and can determine whether the condition number of the second product meets the preset condition. In some other embodiments, the second data party may also calculate the condition number of the second product. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be judged whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the first data party. The first data party can receive the condition number of the second product; and can judge whether the condition number of the second product meets the preset condition.
或者,可以仅由第一数据方持有所述预设条件,进而仅由第一数据方判断第二乘积的条件数是否满足所述预设条件。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第二数据方发送判断结果信息。所述第二数据方可以接收判断结果信息。Alternatively, only the first data party may hold the preset condition, and then only the first data party may determine whether the condition number of the second product meets the preset condition. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the second data party. The second data party may receive the judgment result information.
又或者,可以仅由第二数据方持有所述预设条件,进而仅由第二数据方判断第二乘积的条件数是否满足所述预设条件。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第一数据方发送判断结果信息。所述第一数据方可以接收判断结果信息。Alternatively, only the second data party may hold the preset condition, and then only the second data party may determine whether the condition number of the second product meets the preset condition. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the first data party. The first data party may receive the judgment result information.
如前面所述,一个方阵与一个正交矩阵相乘后可以得到一个新的矩阵,该新的矩阵与该方阵具有相同的条件数。鉴于海森矩阵为方阵,因而第二乘积的条件数等于海森矩阵的条件数。这样便实现了第一数据方和第二数据方在不泄漏自身持有的海森矩阵的份 额的条件下,协作计算得到海森矩阵的条件数。As mentioned earlier, a square matrix can be multiplied by an orthogonal matrix to obtain a new matrix, which has the same condition number as the square matrix. Since the Hessian matrix is a square matrix, the condition number of the second product is equal to the condition number of the Hessian matrix. In this way, the first data party and the second data party can collaboratively calculate the condition number of the Hessian matrix without leaking their share of the Hessian matrix.
在一些实施例中,第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,即表明海森矩阵的病态程度较小,因而可以使用牛顿法确定模型参数。如此在步骤S611中,所述第一数据方可以根据海森矩阵的第一份额,所述第二数据方可以根据海森矩阵的第二份额,秘密分享第一逆矩阵。所述第一数据方可以获得第一逆矩阵的第一份额,所述第二数据方可以获得第一逆矩阵的第二份额。In some embodiments, the condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, that is, it indicates that the Hessian matrix is less ill-conditioned, so the Newton method can be used to determine the model parameters. In this way, in step S611, the first data party may secretly share the first inverse matrix according to the first share of the Hessian matrix, and the second data party may secretly share the first inverse matrix according to the second share of the Hessian matrix. The first data party can obtain a first share of the first inverse matrix, and the second data party can obtain a second share of the first inverse matrix.
在一些实施方式中,可以由所述第二数据方对所述第二乘积进行求逆。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身的第二乘积的第二份额相加,得到第二乘积。鉴于所述第二乘积为方阵,因而所述第二数据方可以对所述第二乘积进行求逆处理,得到所述第二乘积的逆矩阵作为第二逆矩阵;可以向所述第一数据方发送所述第二逆矩阵。所述第一数据方可以接收所述第二逆矩阵。或者,在另一些实施方式中,还可以由所述第一数据方对所述第二乘积进行求逆。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身的第二乘积的第一份额相加,得到第二乘积。鉴于所述第二乘积为方阵,因而所述第一数据方可以对所述第二乘积进行求逆处理,得到所述第二乘积的逆矩阵作为第二逆矩阵;可以向所述第二数据方发送所述第二逆矩阵。所述第二数据方可以接收所述第二逆矩阵。In some embodiments, the second product may be inverted by the second data party. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of its own second product to obtain the second product. Since the second product is a square matrix, the second data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix. The first data party may receive the second inverse matrix. Or, in some other implementation manners, the first data party may also invert the second product. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of its own second product to obtain the second product. Since the second product is a square matrix, the first data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix. The second data party may receive the second inverse matrix.
所述第一数据方可以将随机正交矩阵的第一份额与第二逆矩阵相乘,得到第一逆矩阵的第一份额。所述第二数据方可以将随机正交矩阵的第二份额与第二逆矩阵相乘,得到第一逆矩阵的第二份额。第一逆矩阵的第一份额和第一逆矩阵的第二份额的和等于第一逆矩阵。The first data party may multiply the first share of the random orthogonal matrix by the second inverse matrix to obtain the first share of the first inverse matrix. The second data party may multiply the second share of the random orthogonal matrix by the second inverse matrix to obtain the second share of the first inverse matrix. The sum of the first share of the first inverse matrix and the second share of the first inverse matrix is equal to the first inverse matrix.
延续前面的场景示例,这里由第二数据方对第二乘积HR进行求逆。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额<HR> 0。所述第二数据方可以接收第二乘积的第一份额<HR> 0;可以将第二乘积的第一份额<HR> 0与自身的第二乘积的第二份额<HR> 1相加,得到第二乘积HR;可以对第二乘积HR进行求逆处理,得到第二逆矩阵(HR) -1;可以向所述第一数据方发送第二逆矩阵(HR) -1。所述第一数据方可以接收第二逆矩阵(HR) -1Continuing the previous scenario example, here the second data party inverts the second product HR. Specifically, the first data party may send the first share of the second product<HR> 0 to the second data party. The second data party may receive the first share of the second product <HR>0; may add the first share of the second product <HR> 0 to its second share of the second product <HR> 1 , second product to give the HR; inversion process may be performed on the second product HR, to obtain a second inverse matrix (HR) -1; may send a second inverse matrix (HR) -1 to the first party data. The first data party may receive the second inverse matrix (HR) -1 .
所述第一数据方可以将第二逆矩阵(HR) -1与随机正交矩阵的第一份额<R> 0相乘, 得到第一逆矩阵H -1的第一份额<H -10。所述第二数据方可以将第二逆矩阵(HR) -1与随机正交矩阵的第二份额<R> 1相乘,得到第一逆矩阵H -1的第一份额<H -11The first data party may multiply the second inverse matrix (HR) -1 by the first share of the random orthogonal matrix <R> 0 to obtain the first share of the first inverse matrix H -1 <H -1 > 0 . The second data party may multiply the second inverse matrix (HR) -1 by the second share of the random orthogonal matrix <R> 1 to obtain the first share of the first inverse matrix H -1 <H -1 > 1 .
H -1=<H -10+<H -11=<R> 0(HR) -1+<R> 1(HR) -1=R×(HR) -1H -1 =<H -1 > 0 +<H -1 > 1 =<R> 0 (HR) -1 +<R> 1 (HR) -1 = R×(HR) -1 .
在一些实施例中,在步骤S613中,所述第一数据方可以根据第一逆矩阵的第一份额和损失函数梯度的第一份额,所述第二数据方可以根据第一逆矩阵的第二份额和损失函数梯度的第二份额,秘密分享第三乘积。所述第一数据方和所述第二数据方可以分别获得所述第三乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第三乘积的第一份额,可以将所述第二数据方获得的份额作为第三乘积的第二份额。第三乘积的第一份额和第三乘积的第二份额的和等于第三乘积。In some embodiments, in step S613, the first data party may be based on the first share of the first inverse matrix and the first share of the loss function gradient, and the second data party may be based on the first share of the first inverse matrix. The second share and the second share of the gradient of the loss function secretly share the third product. The first data party and the second data party may each obtain a share of the third product. For ease of description, the share obtained by the first data party may be used as the first share of the third product, and the share obtained by the second data party may be used as the second share of the third product. The sum of the first share of the third product and the second share of the third product is equal to the third product.
所述第一数据方可以将第一模型参数的第一份额与第三乘积的第一份额相减,得到新的第一模型参数的第一份额。所述第二数据方可以将第一模型参数的第二份额与第三乘积的第二份额相减,得到新的第一模型参数的第二份额。The first data party may subtract the first share of the first model parameter from the first share of the third product to obtain the first share of the new first model parameter. The second data party may subtract the second share of the first model parameter from the second share of the third product to obtain the second share of the new first model parameter.
延续前面的场景示例,所述第一数据方可以根据<H -10和<dW> 0,所述第二数据方可以根据<H -11和<dW> 1,秘密分享第三乘积H -1×dW。所述第一数据方可以获得第三乘积的第一份额<H -1×dW> 0,所述第二数据方可以获得第三乘积的第二份额<H -1×dW> 1Continuing the previous scenario example, the first data party can secretly share the third party according to <H -1 > 0 and <dW> 0 , and the second data party can secretly share the third party according to <H -1 > 1 and <dW> 1 The product H -1 ×dW. The first data party can obtain the first share of the third product <H -1 ×dW> 0 , and the second data party can obtain the second share of the third product <H -1 × dW> 1 .
下面介绍所述第一数据方和所述第二数据方秘密分享第三乘积H -1×dW的详细过程。 The detailed process of the third product H -1 ×dW secretly shared by the first data party and the second data party is described below.
所述第一数据方可以根据<H -10,所述第二数据方可以根据<dW> 1,秘密分享<H -10<dW> 1。所述第一数据方可以获得<[<H -10<dW> 1]> 0,所述第二数据方可以获得<[<H -10<dW> 1]> 1The first party data may <H -1> 0, the second party data may <dW> 1, secret sharing <H -1> 0 <dW> 1. The first data party can obtain <[<H -1 > 0 <dW> 1 ]> 0 , and the second data party can obtain <[<H -10 <dW> 1 ]> 1 .
<[<H -10<dW> 1]> 0+<[<H -10<dW> 1]> 1=<H -10<dW> 1<[<H -10 <dW> 1 ]> 0 +<[<H -10 <dW> 1 ]> 1 =<H -10 <dW> 1 .
所述第一数据方还可以根据<dW> 0,所述第二数据方还可以根据<H -11,秘密分享<H -11<dW> 0。所述第一数据方可以获得<[<H -11<dW> 0]> 0,所述第二数据方可以获得<[<H -11<dW> 0]> 1The first data party can also secretly share <H -1 > 1 <dW> 0 according to <dW> 0 and the second data party can also secretly share <H -1 > 1 <dW> 0 according to <H -1 > 1 . The first data party can obtain <[<H -1 > 1 <dW> 0 ]> 0 , and the second data party can obtain <[<H -1 > 1 <dW> 0 ]> 1 .
<[<H -11<dW> 0]> 0+<[<H -11<dW> 0]> 1=<H -11<dW> 0<[<H -11 <dW> 0 ]> 0 +<[<H -11 <dW> 0 ]> 1 =<H -11 <dW> 0 .
所述第一数据方可以计算 <H -10<dW> 0+<[<H -10<dW> 1]> 0+<[<H -11<dW> 0]> 0作为第三乘积的第一份额<H -1×dW> 0。所述第二数据方可以计算<H -11<dW> 1+<[<H -10<dW> 1]> 1+<[<H -11<dW> 0]> 1作为第三乘积的第二份额<H -1×dW> 1The first data party can calculate <H -10 <dW> 0 +<[<H -10 <dW> 1 ]> 0 +<[<H -11 <dW> 0 ]> 0 The first share as the third product<H -1 ×dW> 0 . The second data party can calculate <H -11 <dW> 1 +<[<H -10 <dW> 1 ]> 1 +<[<H -11 <dW> 0 ]> 1 The second share as the third product <H -1 ×dW> 1 .
H -1×dW=<H -1×dW> 0+<H -1×dW> 1 H -1 ×dW=<H -1 ×dW> 0 +<H -1 ×dW> 1
=<H -10<dW> 0+<[<H -10<dW> 1]> 0+<[<H -11<dW> 0]> 0+<H -11<dW> 1+<[<H -10<dW> 1]> 1+<[<H -11<dW> 0]> 1 =<H -10 <dW> 0 +<[<H -10 <dW> 1 ]> 0 +<[<H -11 <dW> 0 ]> 0 +<H -11 <dW> 1 +<[<H -10 <dW> 1 ]> 1 +<[<H -11 <dW> 0 ]> 1
=<H -10<dW> 0+<H -10<dW> 1+<H -11<dW> 0+<H -11<dW> 1 =<H -10 <dW> 0 +<H -10 <dW> 1 +<H -11 <dW> 0 +<H -11 <dW> 1
=(<H -10+<H -11)(<dW> 0+<dW> 1) =(<H -10 +<H -11 )(<dW> 0 +<dW> 1 )
所述第一数据方可以计算<W'> 0=<W> 0-<H -1×dW> 0,所述第二数据方可以计算<W'> 1=<W> 1-<H -1×dW> 1,<W'> 0表示新的第一模型参数的第一份额,<W'> 1表示新的第一模型参数的第二份额,W'表示新的第一模型参数。 The first party can calculate the data <W '> 0 = <W > 0 - <H -1 × dW> 0, the second party can compute data <W'> 1 = <W > 1 - <H - 1 ×dW> 1 , <W'> 0 represents the first share of the new first model parameter, <W'> 1 represents the second share of the new first model parameter, and W'represents the new first model parameter.
W'=<W'> 0+<W'> 1=<W> 0-<H -1×dW> 0+<W> 1-<H -1×dW> 1=W-H -1×dW。 W'=<W'> 0 +<W'> 1 =<W> 0 -<H -1 ×dW> 0 +<W> 1 -<H -1 ×dW> 1 = WH -1 ×dW.
在一些实施例中,第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,即表明海森矩阵的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。具体地,所述第一数据方可以根据第一模型参数的第一份额、损失函数梯度的第一份额和预设步长,计算新的第一模型参数的第一份额。所述第二数据方可以根据第一模型参数的第二份额、损失函数梯度的第二份额和预设步长,计算新的第一模型参数的第二份额。In some embodiments, the condition number of the second product does not satisfy the preset condition, which indicates that the second product is ill-conditioned, which means that the Hessian matrix is ill-conditioned, and the Newton method cannot be used to determine the model parameters. The gradient descent method can be used instead of Newton's method to determine the model parameters. Specifically, the first data party may calculate the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step size. The second data party may calculate the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step size.
所述预设步长可以用于控制梯度下降法的迭代速度。所述预设步长可以为任意适当正实数。例如,当预设步长过大时,迭代速度会过快,导致有可能无法获得最优模型参数。当预设步长过小时,导致迭代速度会过慢,导致花费的时间较长。所述预设步长具体可以为经验值;或者,也可以采用机器学习的方式得到。当然,所述预设步长还可以采用其它方式得到。所述第一数据方和所述第二数据方均可以持有所述预设步长。The preset step length can be used to control the iteration speed of the gradient descent method. The preset step length can be any suitable positive real number. For example, when the preset step size is too large, the iteration speed will be too fast, resulting in the possibility that the optimal model parameters cannot be obtained. When the preset step size is too small, the iteration speed will be too slow, resulting in a longer time. The preset step length may specifically be an empirical value; or, it may also be obtained by means of machine learning. Of course, the preset step length can also be obtained in other ways. Both the first data party and the second data party may hold the preset step size.
所述第一数据方可以将损失函数梯度的第一份额与预设步长相乘,得到第四乘积;可以将第一模型参数的第一份额与第四乘积相减,得到新的第一模型参数的第一份额。所述第二数据方可以将损失函数梯度的第二份额与预设步长相乘,得到第五乘积;可以将第一模型参数的第二份额与第五乘积相减,得到新的第一模型参数的第二份额。新的 第一模型参数的第一份额和新的第一模型参数的第二份额的和等于新的第一模型参数。The first data party may multiply the first share of the loss function gradient by the preset step size to obtain the fourth product; may subtract the first share of the first model parameter and the fourth product to obtain a new first The first share of model parameters. The second data party may multiply the second share of the loss function gradient by the preset step size to obtain the fifth product; may subtract the second share of the first model parameter and the fifth product to obtain the new first The second share of model parameters. The sum of the first share of the new first model parameter and the second share of the new first model parameter is equal to the new first model parameter.
延续前面的场景示例,所述第一数据方可以将损失函数梯度的第一份额<dW> 0(具体为向量)与预设步长G相乘(具体为向量的数乘),得到第四乘积G<dW> 0;可以将第一模型参数的第一份额<W> 0与第四乘积G<dW> 0相减,得到新的第一模型参数的第一份额<W'> 0=<W> 0-G<dW> 0Continuing the previous scenario example, the first data party may multiply the first share of the gradient of the loss function <dW> 0 (specifically a vector) by the preset step size G (specifically a vector multiplication) to obtain the fourth The product G<dW>0; the first share of the first model parameter <W> 0 can be subtracted from the fourth product G<dW> 0 to obtain the first share of the new first model parameter <W'> 0 = <W> 0 -G<dW> 0 .
所述第二数据方可以将损失函数梯度的第二份额<dW> 1(具体为向量)与预设步长G相乘(具体为向量的数乘),得到第五乘积G<dW> 1;可以将第一模型参数的第二份额<W> 1与第五乘积G<dW> 1相减,得到新的第一模型参数的第二份额<W'> 1=<W> 1-G<dW> 1。其中,<W'> 0+<W'> 1=W',W'表示新的第一模型参数。 The second data party may multiply the second share of the gradient of the loss function <dW> 1 (specifically a vector) by the preset step size G (specifically a multiplication of the vector) to obtain the fifth product G<dW>1; The second share of the first model parameter <W> 1 can be subtracted from the fifth product G <dW> 1 to obtain the second share of the new first model parameter <W'> 1 = <W> 1 -G <dW> 1 . Wherein, <W'> 0 +<W'> 1 = W', and W'represents the new first model parameter.
这样通过条件数和预设条件,本实施例可以避免在使用牛顿法确定模型参数的过程中由于出现病态矩阵所导致的不收敛问题。In this way, through the condition number and the preset condition, this embodiment can avoid the problem of non-convergence caused by the ill-conditioned matrix in the process of using the Newton method to determine the model parameters.
步骤S601-步骤S613的模型参数确定方法,通过秘密分享的方式实现。另外,牛顿法有着较快的收敛速度。步骤S601-步骤S613的模型参数确定方法,由于使用了牛顿法,不仅可以保护合作建模各方(第一数据方和第二数据方)的数据隐私,还可以减少模型参数优化调整的次数,提高数据处理模型的训练效率。The method for determining model parameters from step S601 to step S613 is realized by way of secret sharing. In addition, Newton's method has a faster convergence rate. The method for determining model parameters from step S601 to step S613, due to the use of Newton’s method, can not only protect the data privacy of the parties in the cooperative modeling (the first data party and the second data party), but also reduce the number of optimization adjustments of model parameters. Improve the training efficiency of data processing models.
在一些实施例中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。In some embodiments, it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
可以重复执行步骤S601,所述第一数据方可以获得新的第一乘积的第一份额,所述第二数据方可以获得新的第一乘积的第二份额。新的第一乘积为特征数据和新的第一模型参数的乘积。所述第一数据方可以根据新的第一乘积的第一份额,所述第二数据方可以根据新的第一乘积的第二份额,基于激励函数对应的混淆电路进行通信。第一数据方可以获得新的激励函数取值的第一份额,第二数据方可以获得新的激励函数取值的第二份额。可以重复执行步骤S605,所述第一数据方可以获得新的损失函数梯度的第一份额,所述第二数据方可以获得新的损失函数梯度的第二份额。可以重复执行步骤S607,所述第一数据方可以获得新的海森矩阵的第一份额,所述第二数据方可以获得新的海森矩阵的第二份额。可以重复执行步骤S609,所述第一数据方可以获得新的第二乘积的第一份额,所述第二数据方可以获得新的第二乘积的第二份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。Step S601 may be repeatedly executed, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product. The new first product is the product of the feature data and the new first model parameter. The first data party can communicate based on the first share of the new first product, and the second data party can communicate based on the confusion circuit corresponding to the excitation function according to the second share of the new first product. The first data party can obtain the first share of the value of the new excitation function, and the second data party can obtain the second share of the value of the new excitation function. Step S605 may be repeatedly executed, the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient. Step S607 can be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix. Step S609 may be repeated, and the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明在该轮迭代过程中可以继续使用牛 顿法确定模型参数。可以重复执行步骤S611。所述第一数据方可以获得新的第一逆矩阵的第一份额,所述第二数据方可以获得新的第一逆矩阵的第二份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方可以根据新的第一模型参数的第一份额、新的第一逆矩阵的第一份额和新的损失函数梯度的第一份额,所述第二数据方根据新的第一模型参数的第二份额、新的第一逆矩阵的第二份额和新的损失函数梯度的第二份额,秘密分享第二模型参数。所述第一数据方可以获得第二模型参数的第一份额,所述第二数据方可以获得第二模型参数的第二份额。第二模型参数的第一份额和第二模型参数的第二份额的和等于第二模型参数。这样可以通过秘密分享和混淆电路相结合的方式实现迭代过程。通过秘密分享和混淆电路相结合的方式,不仅可以避免越界的问题,还可以降低数据处理模型训练过程的复杂程度。另外在迭代的过程中,由于使用了牛顿法,不仅可以保护合作建模各方(第一数据方和第二数据方)的数据隐私,还可以减少模型参数优化调整的次数,提高数据处理模型的训练效率。When the condition number of the new second product satisfies the preset condition, it indicates that the Newton method can be used to determine the model parameters during this round of iteration. Step S611 can be repeated. The first data party can obtain the first share of the new first inverse matrix, and the second data party can obtain the second share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new first share. The second share of a model parameter, the second share of the new first inverse matrix and the second share of the new loss function gradient secretly share the second model parameters. The first data party can obtain a first share of the second model parameter, and the second data party can obtain a second share of the second model parameter. The sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter. In this way, the iterative process can be realized through a combination of secret sharing and obfuscation circuits. The combination of secret sharing and obfuscation circuits can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process. In addition, in the iterative process, due to the use of Newton's method, not only can the data privacy of the parties in the cooperative modeling (the first data party and the second data party) be protected, but also the number of optimization adjustments of model parameters can be reduced, and the data processing model can be improved Training efficiency.
在新的第二乘积的条件数不满足预设条件时,表明在该轮迭代过程中无法继续使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的第一份额、新的损失函数梯度的第一份额和预设步长,计算第二模型参数的第一份额。所述第二数据方可以根据新的第一模型参数的第二份额、新的损失函数梯度的第二份额和预设步长,计算第二模型参数的第二份额。第二模型参数的第一份额和第二模型参数的第二份额的和等于第二模型参数。这样可以通过秘密分享和混淆电路相结合的方式实现迭代过程。通过秘密分享和混淆电路相结合的方式,不仅可以避免越界的问题,还可以降低数据处理模型训练过程的复杂程度。另外在迭代的过程中,使用了梯度下降法。When the condition number of the new second product does not meet the preset condition, it indicates that the Newton method cannot be used to determine the model parameters during this round of iteration, so the gradient descent method can be used instead of the Newton method to determine the model parameters. The first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size. The second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size. The sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter. In this way, the iterative process can be realized through a combination of secret sharing and obfuscation circuits. The combination of secret sharing and obfuscation circuits can not only avoid the problem of cross-border, but also reduce the complexity of the data processing model training process. In addition, in the iterative process, the gradient descent method is used.
以下介绍所述第一数据方根据新的第一乘积的第一份额,所述第二数据方根据新的第一乘积的第二份额,基于激励函数对应的混淆电路进行通信的过程。The following describes a process in which the first data party performs communication based on the first share of the new first product, and the second data party performs communication based on the confusion circuit corresponding to the excitation function according to the second share of the new first product.
可以根据所述激励函数构建相应的逻辑电路。所述逻辑电路可以由所述第一数据方构建;或者,也可以由所述第二数据方构建;又或者,还可以由其它设备(例如可信任的第三方)构建。所述逻辑电路可以由至少一个运算门构成,所述运算门可以包括与门、或门、异或门等等。所述逻辑电路可以包括至少两个输入线和至少一个输出线,通过对所述逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。所述混淆电路可以包括所述逻辑电路中各个运算门的混淆真值表。值得说明的是,这里可以直接根据激励函数构建逻辑电路;或者,也可以对激励函数进行各种适当的变形,可以根据变形后的激 励函数构建逻辑电路;又或者,还可以以所述激励函数为基础生成其它函数,可以根据其它函数构建逻辑电路。相应地,这里激励函数与混淆电路相对应可以理解为:混淆电路是根据激励函数的逻辑电路生成的,或者,混淆电路是根据变形后的激励函数的混淆电路生成的,又或者,混淆电路是根据其它函数的逻辑电路生成的。The corresponding logic circuit can be constructed according to the excitation function. The logic circuit can be constructed by the first data party; alternatively, it can also be constructed by the second data party; or alternatively, it can also be constructed by other devices (for example, a trusted third party). The logic circuit may be composed of at least one arithmetic gate, and the arithmetic gate may include an AND gate, an OR gate, an exclusive OR gate, and so on. The logic circuit may include at least two input lines and at least one output line, and an obfuscated circuit can be obtained by encrypting the input lines and/or output lines of the logic circuit. The confusion circuit may include a confusion truth table of each arithmetic gate in the logic circuit. It is worth noting that the logic circuit can be constructed directly according to the excitation function; alternatively, various appropriate modifications can be made to the excitation function, and the logical circuit can be constructed according to the deformed excitation function; or, the excitation function can also be used Generate other functions as a basis, and build logic circuits based on other functions. Correspondingly, the activation function and the confusion circuit can be understood as: the confusion circuit is generated based on the logic circuit of the activation function, or the confusion circuit is generated based on the confusion circuit of the deformed activation function, or the confusion circuit is Generated according to the logic circuit of other functions.
所述第一数据方和所述第二数据方均可以持有激励函数对应的混淆电路。在一些实施方式中,所述混淆电路可以由所述第一数据方生成。所述第一数据方可以将生成的混淆电路发送给所述第二数据方。所述第二数据方可以接收所述混淆电路。在另一些实施方式中,所述混淆电路也可以由所述第二数据方生成。所述第二数据方可以将生成的混淆电路发送给所述第一数据方。所述第一数据方可以接收所述混淆电路。Both the first data party and the second data party may have a confusion circuit corresponding to an excitation function. In some embodiments, the obfuscation circuit may be generated by the first data party. The first data party may send the generated obfuscation circuit to the second data party. The second data party may receive the obfuscation circuit. In other implementation manners, the obfuscation circuit may also be generated by the second data party. The second data party may send the generated obfuscation circuit to the first data party. The first data party may receive the obfuscation circuit.
如此,第一数据方可以根据新的第一乘积的第一份额,第二数据方可以根据新的第一乘积的第二份额,基于激励函数对应的混淆电路进行通信。所述第一数据方和所述第二数据方可以分别获得新的激励函数取值的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为新的激励函数取值的第一份额,可以将所述第二数据方获得的份额作为新的激励函数取值的第二份额。新的激励函数取值的第一份额和新的激励函数取值的第二份额的和等于新的激励函数的取值。In this way, the first data party can communicate based on the first share of the new first product, and the second data party can communicate based on the confusion circuit corresponding to the excitation function according to the second share of the new first product. The first data party and the second data party may respectively obtain a share of the value of the new incentive function. For ease of description, the share obtained by the first data party may be used as the first share of the value of the new incentive function, and the share obtained by the second data party may be used as the second share of the value of the new incentive function. The sum of the first share of the value of the new excitation function and the second share of the value of the new excitation function is equal to the value of the new excitation function.
请参阅图4。以下介绍第一数据方和第二数据方基于混淆电路进行计算的一个场景示例。Please refer to Figure 4. The following describes an example of a scenario where the first data party and the second data party perform calculations based on the obfuscated circuit.
可以根据激励函数f(x 1,x 2)构建函数y=f 1(x 1,x 2,x 3)=f(x 1,x 2)-x 3。其中,x 1用于表示新的第一乘积的第一份额,x 2用于表示新的第一乘积的第二份额,x 3用于表示新的激励函数取值的一份份额(以下称为新的激励函数取值的第二份额),f 1(x 1,x 2,x 3)的取值用于表示新的激励函数取值的另一份份额(以下称为新的激励函数取值的第一份额)。 The function y=f 1 (x 1 , x 2 , x 3 )=f(x 1 , x 2 )-x 3 can be constructed according to the excitation function f(x 1 , x 2 ). Among them, x 1 is used to represent the first share of the new first product, x 2 is used to represent the second share of the new first product, and x 3 is used to represent a share of the new incentive function value (hereinafter referred to as Is the second share of the value of the new incentive function), the value of f 1 (x 1 , x 2 , x 3 ) is used to represent another share of the value of the new incentive function (hereinafter referred to as the new incentive function The first share of the value).
可以构建与函数f 1(x 1,x 2,x 3)=f(x 1,x 2)-x 3相对应的逻辑电路,通过对该逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。所述第一数据方和所述第二数据方均可以持有该混淆电路。值得说明的是,函数y=f 1(x 1,x 2,x 3)=f(x 1,x 2)-x 3及其对应的逻辑电路可以由所述第一数据方构建;或者,也可以由所述第二数据方构建;又或者,还可以由其它设备(例如可信任的第三方)构建。 A logic circuit corresponding to the function f 1 (x 1 , x 2 , x 3 ) = f(x 1 , x 2 )-x 3 can be constructed, and the input line and/or output line of the logic circuit can be encrypted. You can get the confusion circuit. Both the first data party and the second data party may possess the obfuscated circuit. It is worth noting that the function y=f 1 (x 1 , x 2 , x 3 )=f(x 1 , x 2 )-x 3 and its corresponding logic circuit can be constructed by the first data party; or, It can also be constructed by the second data party; or, it can also be constructed by other devices (for example, a trusted third party).
所述第二数据方可以生成新的激励函数取值的一份份额作为第二份额。如此所述第一数据方可以以新的第一乘积的第一份额作为该混淆电路的输入,所述第二数据方可以以新的第一乘积的第二份额以及新的激励函数取值的第二份额作为该混淆电路的输入, 进行通信。所述第一数据方可以基于该混淆电路计算得到新的激励函数取值的另一份份额作为第一份额。具体的计算过程可以参见前面有关介绍混淆电路的场景示例,在此不再详述。The second data party may generate a share of the value of the new incentive function as the second share. In this way, the first data party can use the first share of the new first product as the input of the confusion circuit, and the second data party can use the second share of the new first product and the new excitation function to obtain the value. The second share is used as the input of the confusion circuit for communication. The first data party may calculate another share of the value of the new excitation function based on the confusion circuit as the first share. For the specific calculation process, please refer to the previous example of the scene introducing the confusion circuit, which will not be detailed here.
在一些实施方式中,为了降低混淆电路的复杂程度,还可以使用分段线性函数拟合所述激励函数。这样便可以根据所述分段线性函数构建相应的逻辑电路,通过对该逻辑电路的输入线和/或输出线进行加密便可以得到混淆电路。所述第一数据方和所述第二数据方均可以持有该混淆电路。例如,所述激励函数可以为Sigmoid函数,所述分段线性函数可以为
Figure PCTCN2020106254-appb-000044
k表示分段线性函数的系数。
In some embodiments, in order to reduce the complexity of the confusion circuit, a piecewise linear function may also be used to fit the excitation function. In this way, a corresponding logic circuit can be constructed according to the piecewise linear function, and the confusion circuit can be obtained by encrypting the input line and/or output line of the logic circuit. Both the first data party and the second data party may possess the obfuscated circuit. For example, the activation function may be a Sigmoid function, and the piecewise linear function may be
Figure PCTCN2020106254-appb-000044
k represents the coefficient of the piecewise linear function.
第一数据方可以根据新的第一乘积的第一份额,第二数据方可以根据新的第一乘积的第二份额,基于该混淆电路进行通信。所述第一数据方和所述第二数据方分别获得分段线性函数取值的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为分段线性函数取值的第一份额,可以将所述第二数据方获得的份额作为分段线性函数取值的第二份额。分段线性函数取值的第一份额和分段线性函数取值的第二份额的和等于分段线性函数的取值。所述第一数据方可以将分段线性函数取值的第一份额作为新的激励函数取值的第一份额。所述第二数据方可以将分段线性函数取值的第二份额作为新的激励函数取值的第二份额。The first data party may perform communication based on the confusion circuit based on the first share of the new first product, and the second data party may perform communication based on the confusion circuit based on the second share of the new first product. The first data party and the second data party respectively obtain a share of the value of the piecewise linear function. For ease of description, the share obtained by the first data party may be used as the first share of the value of the piecewise linear function, and the share obtained by the second data party may be used as the second share of the value of the piecewise linear function. The sum of the first share of the value of the piecewise linear function and the second share of the value of the piecewise linear function is equal to the value of the piecewise linear function. The first data party may use the first share of the value of the piecewise linear function as the first share of the value of the new excitation function. The second data party may use the second share of the value of the piecewise linear function as the second share of the value of the new excitation function.
本实施例的模型参数确定方法,第一数据方和第二数据方可以在不泄漏自身所持有的数据的前提下,协作确定数据处理模型的模型参数。In the method for determining model parameters of this embodiment, the first data party and the second data party can cooperate to determine the model parameters of the data processing model without leaking the data held by themselves.
上文中结合图9,详细描述本说明书模型参数确定方法的另一个实施例。上文中第一数据方执行的方法步骤,可以单独实现为第一数据方侧的模型参数确定方法;第二数据方执行的方法步骤,可以单独实现为第二数据方侧的模型参数确定方法。下面将结合图10和图11,详细描述本说明书实施例中第一数据方侧的模型参数确定方法、以及第二数据方侧的模型参数确定方法。In the above, in conjunction with FIG. 9, another embodiment of the method for determining model parameters in this specification is described in detail. The above method steps performed by the first data party can be separately implemented as a model parameter determination method on the first data party's side; the method steps performed by the second data party can be separately implemented as a model parameter determination method on the second data party's side. The following will describe in detail the method for determining model parameters on the side of the first data party and the method for determining model parameters on the side of the second data party in the embodiments of this specification in conjunction with FIG. 10 and FIG. 11.
本说明书还提供模型参数确定方法的另一个实施例。该实施例以第一数据方为执行 主体,所述第一数据方可以持有特征数据和第一模型参数的份额。请参阅图10。该实施例可以包括以下步骤。This specification also provides another embodiment of the method for determining model parameters. In this embodiment, the first data party is the execution subject, and the first data party may hold the share of the feature data and the first model parameter. Refer to Figure 10. This embodiment may include the following steps.
步骤S701:根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积。Step S701: secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, and the first product is the product of the feature data and the first model parameter.
在一些实施例中,所述合作方可以理解为与所述第一数据方进行合作安全建模的数据方,具体可以为前面的第二数据方。In some embodiments, the cooperating party may be understood as a data party that performs cooperative security modeling with the first data party, and specifically may be the previous second data party.
步骤S703:根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额。Step S703: According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained.
在一些实施例中,所述第一数据方可以根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。In some embodiments, the first data party may secretly share the value of the polynomial with the partner according to the share of the first product, and obtain the share of the polynomial value as the share of the value of the incentive function, and the polynomial is used for fitting The activation function.
步骤S705:根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额。Step S705: secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the gradient of the loss function and the Hessian matrix respectively.
步骤S707:根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。Step S707: secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the product of the random orthogonal matrix and the Hessian matrix .
步骤S709:在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。Step S709: When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The inverse matrix.
在一些实施例中,所述预设条件可以包括:条件数小于或等于预设阈值。第二乘积的条件数可以由第一数据方和/或合作方来计算。第二乘积的条件数等于海森矩阵的条件数。In some embodiments, the preset condition may include: the number of conditions is less than or equal to a preset threshold. The condition number of the second product can be calculated by the first data party and/or the partner. The condition number of the second product is equal to the condition number of the Hessian matrix.
在一些实施例中,第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,可以使用牛顿法确定模型参数。如此所述第一数据方可以根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额。In some embodiments, the condition number of the second product satisfies the preset condition, indicating that the degree of ill-condition of the second product is small, and Newton's method can be used to determine the model parameters. In this way, the first data party can secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
步骤S711:根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。Step S711: secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter.
在一些实施例中,所述第一数据方可以根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额。所述第三乘积可以为第一逆矩阵和损失函数梯度之间的乘积。所述第一数据方可以将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。In some embodiments, the first data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product. The third product may be a product between the first inverse matrix and the gradient of the loss function. The first data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
在一些实施例中,第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程 度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。所述第一数据方具体可以将损失函数梯度的份额与预设步长相乘,得到第四乘积;可以将第一模型参数的份额与第四乘积相减,得到新的第一模型参数的份额。In some embodiments, the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined using Newton's method. Therefore, gradient descent method can be used instead of Newton's method to determine model parameters. . The first data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. Specifically, the first data party may multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
在一些实施例中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。In some embodiments, it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
所述第一数据方可以重复执行步骤S701,得到新的第一乘积的份额。所述第一数据方可以根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额。所述第一数据方可以重复执行步骤S705,得到新的损失函数梯度的份额和新的海森矩阵的份额;可以重复执行步骤S707,得到新的第二乘积的份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。The first data party may repeat step S701 to obtain a new share of the first product. The first data party may communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the new incentive function. The first data party may repeat step S705 to obtain the share of the new loss function gradient and the share of the new Hessian matrix; may repeat step S707 to obtain the share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第一数据方可以重复执行步骤S709,得到新的第一逆矩阵的份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product meets the preset condition, it indicates that the Newton method can continue to be used to determine the model parameters. The first data party may repeat step S709 to obtain the share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not meet the preset condition, it indicates that it is necessary to use the gradient descent method instead of the Newton method to determine the model parameters. The first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
本实施例的模型参数确定方法,第一数据方可以在不泄漏自身所持有的数据的前提下,与合作方协作确定数据处理模型的模型参数。In the method for determining model parameters of this embodiment, the first data party can cooperate with the partner to determine the model parameters of the data processing model without revealing the data held by itself.
本说明书还提供另一种模型参数确定方法的实施例。该实施例以第二数据方为执行主体,所述第二数据方可以持有标签和第一模型参数的份额。请参阅图11。该实施例可以包括以下步骤。This specification also provides an embodiment of another method for determining model parameters. In this embodiment, the second data party is the execution subject, and the second data party may hold the share of the tag and the first model parameter. Refer to Figure 11. This embodiment may include the following steps.
步骤S801:根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积。Step S801: According to the share of the first model parameter and the partner secretly share the first product to obtain the share of the first product, the first product is the product of the feature data and the first model parameter.
在一些实施例中,所述合作方可以理解为与所述第二数据方进行合作安全建模的数据方,具体可以为前面的第一数据方。In some embodiments, the cooperating party may be understood as a data party that performs cooperative security modeling with the second data party, and specifically may be the previous first data party.
步骤S803:根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额。Step S803: According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained.
在一些实施例中,所述第二数据方可以根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。In some embodiments, the second data party may secretly share the value of the polynomial with the partner according to the share of the first product, and obtain the share of the polynomial value as the share of the value of the incentive function, and the polynomial is used for fitting The activation function.
步骤S805:根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额。Step S805: secretly share the gradient of the loss function with the partner according to the value of the label and the incentive function to obtain the share of the gradient of the loss function; according to the share of the incentive function, secretly share the Hessian matrix with the partner to obtain the Hessian matrix Share.
步骤S807:根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。Step S807: secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the product between the random orthogonal matrix and the Hessian matrix .
步骤S809:在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。Step S809: When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The inverse matrix.
在一些实施例中,所述预设条件可以包括:条件数小于或等于预设阈值。第二乘积的条件数可以由第二数据方和/或合作方来计算。第二乘积的条件数等于海森矩阵的条件数。In some embodiments, the preset condition may include: the number of conditions is less than or equal to a preset threshold. The condition number of the second product can be calculated by the second data party and/or the partner. The condition number of the second product is equal to the condition number of the Hessian matrix.
在一些实施例中,第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,可以使用牛顿法确定模型参数。如此所述第二数据方可以根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额。In some embodiments, the condition number of the second product satisfies the preset condition, indicating that the degree of ill-condition of the second product is small, and Newton's method can be used to determine the model parameters. In this way, the second data party can secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
步骤S811:根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。Step S811: secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter.
在一些实施例中,所述第二数据方可以根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额。所述第三乘积可以为第一逆矩阵和损失函数梯度之间的乘积。所述第二数据方可以将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。In some embodiments, the second data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product. The third product may be a product between the first inverse matrix and the gradient of the loss function. The second data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
在一些实施例中,第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。所述第二数据方具体可以将损失函数梯度的份额与预设步长相乘,得到第四乘积;可以将第一模型参数的份额与第四乘积相减,得到新的第一模型参数的份额。In some embodiments, the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined using Newton's method. Therefore, gradient descent method can be used instead of Newton's method to determine model parameters. . The second data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. The second data party may specifically multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
在一些实施例中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。In some embodiments, it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
所述第二数据方可以重复执行步骤S801,得到新的第一乘积的份额。所述第二数据 方可以根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额。所述第二数据方可以重复执行步骤S805,得到新的损失函数梯度的份额和新的海森矩阵的份额;可以重复执行步骤S807,得到新的第二乘积的份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。The second data party may repeat step S801 to obtain a new share of the first product. The second data party may communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the new incentive function. The second data party may repeat step S805 to obtain the share of the new loss function gradient and the share of the new Hessian matrix; step S807 may be repeated to obtain the share of the new second product. The new second product is the product of the random orthogonal matrix and the new Hessian matrix.
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第二数据方可以重复执行步骤S809,得到新的第一逆矩阵的份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第二数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product meets the preset condition, it indicates that the Newton method can continue to be used to determine the model parameters. The second data party may repeat step S809 to obtain the share of the new first inverse matrix. The new first inverse matrix is the inverse of the new Hessian matrix. The second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not meet the preset condition, it indicates that it is necessary to use the gradient descent method instead of the Newton method to determine the model parameters. The second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
本实施例的模型参数确定方法,第二数据方可以在不泄漏自身所持有的数据的前提下,与合作方协作确定数据处理模型的模型参数。In the method for determining model parameters of this embodiment, the second data party can cooperate with the partner to determine the model parameters of the data processing model without leaking the data held by itself.
下面将结合图12和图13,详细描述本说明书实施例中的模型参数确定装置。The model parameter determination device in the embodiment of this specification will be described in detail below in conjunction with FIG. 12 and FIG. 13.
本说明书还提供模型参数确定装置的一个实施例。请参阅图12。该实施例可以应用于第一数据方,可以包括以下单元。This specification also provides an embodiment of the device for determining model parameters. Refer to Figure 12. This embodiment can be applied to the first data party and can include the following units.
第一秘密分享单元901,用于根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;The first secret sharing unit 901 is configured to secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, and the first product is the product of the feature data and the first model parameter ;
第二秘密分享单元903,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;The second secret sharing unit 903 is configured to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
第三秘密分享单元905,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;The third secret sharing unit 905 is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the gradient of the loss function and the Hessian matrix respectively;
第四秘密分享单元907,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;The fourth secret sharing unit 907 is configured to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the random orthogonal matrix and the sea. The product between Sen matrices;
第五秘密分享单元909,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The fifth secret sharing unit 909 is configured to, when the condition number of the second product meets the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix. The inverse matrix is the inverse matrix of the Hessian matrix;
第六秘密分享单元911,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;The sixth secret sharing unit 911 is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter ;
混淆电路单元913,用于重复执行所述秘密分享第一乘积的步骤;根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额;重复执行所述秘密分享损失函数的梯度和海森矩阵的步骤、以及所述秘密分享第二乘积的步骤;The obfuscation circuit unit 913 is configured to repeatedly execute the step of secretly sharing the first product; communicate with the partner according to the share of the new first product and the obfuscation circuit corresponding to the incentive function to obtain the share of the new incentive function; Repeating the step of secretly sharing the gradient of the loss function and the Hessian matrix and the step of secretly sharing the second product;
计算单元915,用于在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。The calculation unit 915 is configured to calculate the second product according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length when the condition number of the new second product does not meet the preset condition. The share of model parameters.
本说明书还提供模型参数确定装置的另一个实施例。请参阅图13。该实施例可以应用于第二数据方,可以包括以下单元。This specification also provides another embodiment of the device for determining model parameters. Refer to Figure 13. This embodiment can be applied to the second data party and can include the following units.
第一秘密分享单元1001,用于根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;The first secret sharing unit 1001 is configured to secretly share the first product with the partner according to the share of the first model parameter to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter;
第二秘密分享单元1003,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;The second secret sharing unit 1003 is configured to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
第三秘密分享单元1005,用于根据激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;The third secret sharing unit 1005 is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the value of the incentive function to obtain the share of the gradient of the loss function and the Hessian matrix respectively;
第四秘密分享单元1007,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;The fourth secret sharing unit 1007 is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the random orthogonal matrix and the sea. The product between Sen matrices;
第五秘密分享单元1009,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The fifth secret sharing unit 1009 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix when the condition number of the second product meets the preset condition to obtain the share of the first inverse matrix. The inverse matrix is the inverse matrix of the Hessian matrix;
第六秘密分享单元1011,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;The sixth secret sharing unit 1011 is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter ;
混淆电路单元1013,用于重复执行所述秘密分享第一乘积的步骤;根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额;重复执行所述秘密分享损失函数的梯度的步骤、所述秘密分享海森矩阵的步骤、以及所述秘密分享第二乘积的步骤;The obfuscation circuit unit 1013 is configured to repeatedly execute the step of secretly sharing the first product; communicate with the partner according to the share of the new first product and the obfuscation circuit corresponding to the incentive function to obtain the share of the new incentive function; Repeating the step of secretly sharing the gradient of the loss function, the step of secretly sharing the Hessian matrix, and the step of secretly sharing the second product;
计算单元1015,用于在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。The calculation unit 1015 is configured to calculate the second product according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length when the condition number of the new second product does not meet the preset condition. The share of model parameters.
下面介绍本说明书电子设备的一个实施例。图14是该实施例中一种电子设备的硬件结构示意图。如图14所示,所述电子设备可以包括一个或多个(图中仅示出一个)处理器、存储器和传输模块。当然,本领域普通技术人员可以理解,图14所示的硬件结构仅为示意,其并不对上述电子设备的硬件结构造成限定。在实际中所述电子设备还可以包括比图14所示更多或者更少的组件单元;或者,具有与图14所示不同的配置。An embodiment of the electronic device of this specification is described below. FIG. 14 is a schematic diagram of the hardware structure of an electronic device in this embodiment. As shown in FIG. 14, the electronic device may include one or more (only one is shown in the figure) processor, memory, and transmission module. Of course, those of ordinary skill in the art can understand that the hardware structure shown in FIG. 14 is only for illustration, and it does not limit the hardware structure of the above electronic device. In practice, the electronic device may also include more or less component units than shown in FIG. 14; or, have a different configuration from that shown in FIG. 14.
所述存储器可以包括高速随机存储器;或者,还可以包括非易失性存储器,例如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。当然,所述存储器还可以包括远程设置的网络存储器。所述远程设置的网络存储器可以通过诸如互联网、企业内部网、局域网、移动通信网等网络连接至所述电子设备。所述存储器可以用于存储应用软件的程序指令或模块,例如本说明书图5所对应实施例的程序指令或模块;和/或,本说明书图6所对应实施例的程序指令或模块;和/或,本说明书图10所对应实施例的程序指令或模块;和/或,本说明书图11所对应实施例的程序指令或模块。The memory may include a high-speed random access memory; or, it may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. Of course, the storage may also include a remotely set network storage. The remotely set network storage can be connected to the electronic device through a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like. The memory may be used to store program instructions or modules of application software, such as the program instructions or modules of the embodiment corresponding to FIG. 5 of this specification; and/or, the program instructions or modules of the embodiment corresponding to FIG. 6 of this specification; and/ Or, the program instructions or modules of the embodiment corresponding to FIG. 10 of this specification; and/or, the program instructions or modules of the embodiment corresponding to FIG. 11 of this specification.
所述处理器可以按任何适当的方式实现。例如,所述处理器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式等等。所述处理器可以读取并执行所述存储器中的程序指令或模块。The processor can be implemented in any suitable way. For example, the processor may take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (for example, software or firmware) executable by the (micro)processor, logic gates, switches, special-purpose integrated Circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc. The processor can read and execute program instructions or modules in the memory.
所述传输模块可以用于经由网络进行数据传输,例如经由诸如互联网、企业内部网、局域网、移动通信网等网络进行数据传输。The transmission module can be used for data transmission via a network, for example, data transmission via a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同或相似的部分互相参见即可,每个实施例重点说明的都是与其它实施例的不同之处。尤其,对于装置实施例和电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。另外,可以理解的是,本领域技术人员在阅读本说明书文件之后,可以无需创造性劳动想到将本说明书列举的部分或全部实施例进行任意组合,这些组合也在本说明书公开和保护的范围内。It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. Place. In particular, for the device embodiment and the electronic device embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiment. In addition, it can be understood that after reading the documents of this specification, those skilled in the art can think of any combination of some or all of the embodiments listed in this specification without creative efforts, and these combinations are also within the scope of the disclosure and protection of this specification.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。 然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished between hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method flow). However, with the development of technology, the improvement of many methods and procedures of today can be regarded as a direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware entity modules. For example, a programmable logic device (Programmable Logic Device, PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device. It is programmed by the designer to "integrate" a digital system on a PLD without requiring the chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly realized by using "logic compiler" software, which is similar to the software compiler used in program development and writing, but before compilation The original code must also be written in a specific programming language, which is called Hardware Description Language (HDL), and there is not only one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description), etc., currently most commonly used The ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog2. It should also be clear to those skilled in the art that only a little logic programming of the method flow in the above hardware description languages and programming into an integrated circuit can easily obtain the hardware circuit that implements the logic method flow.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书各个实施例或者实施例的某些部分所述的方法。From the description of the foregoing implementation manners, it can be known that those skilled in the art can clearly understand that this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the essence of the technical solution of this specification or the part that contributes to the existing technology can be embodied in the form of a software product, the computer software product can be stored in a storage medium, such as ROM/RAM, magnetic disk , CD-ROM, etc., including a number of instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in each embodiment of this specification or some parts of the embodiment.
本说明书可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的 系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。This manual can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc.
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
虽然通过实施例描绘了本说明书,本领域普通技术人员知道,本说明书有许多变形和变化而不脱离本说明书的精神,希望所附的权利要求包括这些变形和变化而不脱离本说明书的精神。Although the description has been described through the embodiments, those of ordinary skill in the art know that there are many variations and changes in the specification without departing from the spirit of the specification, and it is hoped that the appended claims include these variations and changes without departing from the spirit of the specification.

Claims (45)

  1. 一种模型参数确定方法,应用于第一数据方,包括:A method for determining model parameters, applied to the first data party, includes:
    根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;Communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the incentive function, where the first product is the product of the feature data and the first model parameter;
    根据特征数据和激励函数取值的份额与合作方分别秘密分享损失函数的梯度和海森矩阵,得到损失函数梯度的份额和海森矩阵的份额;According to the share of feature data and the value of the incentive function, secretly share the gradient of the loss function and the Hessian matrix with the partner to obtain the share of the gradient of the loss function and the Hessian matrix;
    根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;Secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
    根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。According to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient, secretly share the new first model parameter with the partner to obtain the share of the new first model parameter.
  2. 如权利要求1所述的方法,所述根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,包括:The method according to claim 1, wherein the communication with the partner according to the confusion circuit corresponding to the share of the first product and the incentive function comprises:
    根据第一乘积的份额和分段线性函数对应的混淆电路与合作方进行通信,得到分段线性函数取值的份额作为激励函数取值的份额,所述分段线性函数用于拟合所述激励函数。According to the share of the first product and the confusion circuit corresponding to the piecewise linear function, communicate with the partner to obtain the share of the piecewise linear function as the share of the excitation function, and the piecewise linear function is used to fit the Motivation function.
  3. 如权利要求1所述的方法,所述根据特征数据和激励函数取值的份额与合作方秘密分享海森矩阵,包括:The method according to claim 1, wherein the sharing of the Hessian matrix secretly with the partner according to the share of the characteristic data and the incentive function value comprises:
    根据激励函数取值的份额与合作方秘密分享对角矩阵,得到对角矩阵的份额;According to the value of the incentive function, share the diagonal matrix secretly with the partner to obtain the share of the diagonal matrix;
    根据特征数据和对角矩阵的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额。According to the feature data and the share of the diagonal matrix, secretly share the Hessian matrix with the partner to obtain the share of the Hessian matrix.
  4. 如权利要求1所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,包括:The method according to claim 1, wherein the secret sharing of the first inverse matrix with the partner according to the share of the Hessian matrix comprises:
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,向合作方发送第二乘积的份额,接收合作方反馈的第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额;其中,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积,所述第二逆矩阵为所述第二乘积的逆矩阵;或者,According to the share of the random orthogonal matrix and the share of the Hessian matrix, secretly share the second product with the partner to obtain the share of the second product, send the share of the second product to the partner, and receive the second inverse matrix fed back by the partner. The second inverse matrix is multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix; wherein, the second product is the product between the random orthogonal matrix and the Hessian matrix, and the second inverse matrix is The inverse matrix of the second product; or,
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,接收合作方发来的第二乘积的份额,将通过秘密分享所得到的第二乘积的份额与通过接收所得到的第二乘积的份额相加,得到第二乘积,将第二乘积的逆矩阵作为第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额;其 中,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。According to the share of the random orthogonal matrix and the share of the Hessian matrix, the share of the second product is secretly shared with the partner to obtain the share of the second product, and the share of the second product sent by the partner is received, and the second product obtained by secret sharing will be obtained. The share of the product is added to the share of the second product obtained by receiving to obtain the second product, the inverse matrix of the second product is used as the second inverse matrix, and the share of the second inverse matrix is multiplied by the random orthogonal matrix, Obtain the share of the first inverse matrix; wherein the second product is the product between the random orthogonal matrix and the Hessian matrix.
  5. 如权利要求1所述的方法,所述根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,包括:The method of claim 1, wherein the secret sharing of the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient includes:
    根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额,所述第三乘积为第一逆矩阵和损失函数梯度之间的乘积;According to the share of the first inverse matrix and the share of the loss function gradient and the partner secretly share the third product to obtain the share of the third product, the third product is the product between the first inverse matrix and the loss function gradient;
    将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。The share of the first model parameter is subtracted from the share of the third product to obtain the new share of the first model parameter.
  6. 如权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额。According to the share of the feature data and the first model parameter, the first product is secretly shared with the partner to obtain the share of the first product.
  7. 如权利要求6所述的方法,还包括:The method of claim 6, further comprising:
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;According to the share of the random orthogonal matrix and the share of the Hessian matrix and the partner secretly share the second product to obtain the share of the second product, the second product is the product between the random orthogonal matrix and the Hessian matrix;
    相应地,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,包括:Correspondingly, the secret sharing of the first inverse matrix with the partner according to the share of the Hessian matrix includes:
    在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额。When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
  8. 如权利要求7所述的方法,还包括:The method of claim 7, further comprising:
    在第二乘积的条件数不满足预设条件时,根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。When the condition number of the second product does not satisfy the preset condition, the share of the new first model parameter is calculated according to the share of the first model parameter, the share of the loss function gradient, and the preset step length.
  9. 如权利要求7或8所述的方法,还包括:The method according to claim 7 or 8, further comprising:
    接收合作方发来的第二乘积的份额,将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积,计算第二乘积的条件数;或者,Receive the share of the second product sent by the partner, add its share of the second product to the share of the received second product to obtain the second product, and calculate the condition number of the second product; or,
    向合作方发送第二乘积的份额,以便合作方计算第二乘积的条件数。Send the share of the second product to the partner so that the partner can calculate the condition number of the second product.
  10. 如权利要求7所述的方法,还包括:The method of claim 7, further comprising:
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,迭代执行所述与合作方进行通信的步骤,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secret sharing the first product to obtain a new share of the first product, iteratively execute the step of communicating with the partner to obtain a share of the new incentive function value, and iteratively execute the secret sharing loss The steps of the gradient of the function and the Hessian matrix to obtain the share of the new loss function gradient and the share of the new Hessian matrix, and iteratively execute the step of secretly sharing the second product to obtain the share of the new second product;
    在新的第二乘积的条件数满足预设条件时,迭代执行所述秘密分享第一逆矩阵的步骤,得到新的第一逆矩阵的份额,根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份 额。When the condition number of the new second product satisfies the preset condition, the step of secretly sharing the first inverse matrix is performed iteratively to obtain the share of the new first inverse matrix. According to the share of the new first inverse matrix, the new The share of the loss function gradient and the share of the new first model parameter secretly share the second model parameter with the partner to obtain the share of the second model parameter.
  11. 如权利要求7所述的方法,还包括:The method of claim 7, further comprising:
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,迭代执行所述与合作方进行通信的步骤,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secret sharing the first product to obtain a new share of the first product, iteratively execute the step of communicating with the partner to obtain a share of the new incentive function value, and iteratively execute the secret sharing loss The steps of the gradient of the function and the Hessian matrix to obtain the share of the new loss function gradient and the share of the new Hessian matrix, and iteratively execute the step of secretly sharing the second product to obtain the share of the new second product;
    在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not satisfy the preset condition, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  12. 如权利要求7所述的方法,还包括:The method of claim 7, further comprising:
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额与合作方秘密分享激励函数的取值,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secretly sharing the first product to obtain the share of the new first product, and obtain the share of the new incentive function value according to the share of the new first product and the value of the partner secretly sharing the incentive function, Iteratively execute the steps of the secret sharing loss function gradient and the Hessian matrix to obtain a new loss function gradient share and a new Hessian matrix share, and iteratively execute the steps of the secret sharing second product to obtain a new first The share of two products;
    在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not satisfy the preset condition, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  13. 如权利要求12所述的方法,所述根据新的第一乘积的份额与合作方秘密分享激励函数的取值,包括:The method according to claim 12, said secretly sharing the value of the incentive function with the partner according to the share of the new first product, comprising:
    根据新的第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为新的激励函数取值的份额,所述多项式用于拟合所述激励函数。According to the share of the new first product and the partner secretly share the value of the polynomial, the share of the polynomial value is obtained as the share of the new excitation function value, and the polynomial is used to fit the excitation function.
  14. 一种模型参数确定方法,应用于第二数据方,包括:A method for determining model parameters, applied to the second data party, includes:
    根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;Communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the share of the value of the incentive function, where the first product is the product of the feature data and the first model parameter;
    根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;Secretly share the gradient of the loss function with the partner according to the share of the label and the value of the incentive function to obtain the share of the gradient of the loss function;
    根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;According to the value of the incentive function, share the Hessian matrix secretly with the partner to obtain the Hessian matrix share;
    根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;Secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
    根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。According to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient, secretly share the new first model parameter with the partner to obtain the share of the new first model parameter.
  15. 如权利要求14所述的方法,所述根据第一乘积的份额和激励函数对应的混淆电 路与合作方进行通信,包括:The method according to claim 14, wherein the communication with the partner according to the confusion circuit corresponding to the share of the first product and the incentive function comprises:
    根据第一乘积的份额和分段线性函数对应的混淆电路与合作方进行通信,得到分段线性函数取值的份额作为激励函数取值的份额,所述分段线性函数用于拟合所述激励函数。According to the share of the first product and the confusion circuit corresponding to the piecewise linear function, communicate with the partner to obtain the share of the piecewise linear function as the share of the excitation function, and the piecewise linear function is used to fit the Motivation function.
  16. 如权利要求14所述的方法,所述根据激励函数取值的份额与合作方秘密分享海森矩阵,包括:The method according to claim 14, wherein the sharing of the Hessian matrix secretly with the partner according to the value of the incentive function includes:
    根据激励函数取值的份额与合作方秘密分享对角矩阵,得到对角矩阵的份额;According to the value of the incentive function, share the diagonal matrix secretly with the partner to obtain the share of the diagonal matrix;
    根据对角矩阵的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额。According to the share of the diagonal matrix, secretly share the Hessian matrix with the partner to obtain the share of the Hessian matrix.
  17. 如权利要求14所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,包括:The method according to claim 14, said secretly sharing the first inverse matrix with a partner according to the share of the Hessian matrix, comprising:
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,向合作方发送第二乘积的份额,接收合作方反馈的第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额;其中,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积,所述第二逆矩阵为所述第二乘积的逆矩阵;或者,According to the share of the random orthogonal matrix and the share of the Hessian matrix, secretly share the second product with the partner to obtain the share of the second product, send the share of the second product to the partner, and receive the second inverse matrix fed back by the partner. The second inverse matrix is multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix; wherein, the second product is the product between the random orthogonal matrix and the Hessian matrix, and the second inverse matrix is The inverse matrix of the second product; or,
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,接收合作方发来的第二乘积的份额,将通过秘密分享所得到的第二乘积的份额与通过接收所得到的第二乘积的份额相加,得到第二乘积,将第二乘积的逆矩阵作为第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额;其中,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。According to the share of the random orthogonal matrix and the share of the Hessian matrix, the share of the second product is secretly shared with the partner to obtain the share of the second product, and the share of the second product sent by the partner is received, and the second product obtained by secret sharing will be obtained. The share of the product is added to the share of the second product obtained by receiving to obtain the second product, the inverse matrix of the second product is used as the second inverse matrix, and the share of the second inverse matrix is multiplied by the random orthogonal matrix, Obtain the share of the first inverse matrix; wherein the second product is the product between the random orthogonal matrix and the Hessian matrix.
  18. 如权利要求14所述的方法,所述根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,包括:The method according to claim 14, wherein the secret sharing of the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient includes:
    根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额,所述第三乘积为第一逆矩阵和损失函数梯度之间的乘积;According to the share of the first inverse matrix and the share of the loss function gradient and the partner secretly share the third product to obtain the share of the third product, the third product is the product between the first inverse matrix and the loss function gradient;
    将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。The share of the first model parameter is subtracted from the share of the third product to obtain the new share of the first model parameter.
  19. 如权利要求14所述的方法,还包括:The method of claim 14, further comprising:
    根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额。According to the share of the first model parameter and the partner secretly share the first product, the share of the first product is obtained.
  20. 如权利要求19所述的方法,还包括:The method of claim 19, further comprising:
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;According to the share of the random orthogonal matrix and the share of the Hessian matrix and the partner secretly share the second product to obtain the share of the second product, the second product is the product between the random orthogonal matrix and the Hessian matrix;
    相应地,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,包括:Correspondingly, the secret sharing of the first inverse matrix with the partner according to the share of the Hessian matrix includes:
    在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额。When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
  21. 如权利要求20所述的方法,还包括:The method of claim 20, further comprising:
    在第二乘积的条件数不满足预设条件时,根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。When the condition number of the second product does not satisfy the preset condition, the share of the new first model parameter is calculated according to the share of the first model parameter, the share of the loss function gradient, and the preset step length.
  22. 如权利要求20或21所述的方法,还包括:The method of claim 20 or 21, further comprising:
    接收合作方发来的第二乘积的份额,将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积,计算第二乘积的条件数;或者,Receive the share of the second product sent by the partner, add its share of the second product to the share of the received second product to obtain the second product, and calculate the condition number of the second product; or,
    向合作方发送第二乘积的份额,以便合作方计算第二乘积的条件数。Send the share of the second product to the partner so that the partner can calculate the condition number of the second product.
  23. 如权利要求20所述的方法,还包括:The method of claim 20, further comprising:
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,迭代执行所述与合作方进行通信的步骤,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secret sharing the first product to obtain a new share of the first product, iteratively execute the step of communicating with the partner to obtain a share of the new incentive function value, and iteratively execute the secret sharing loss The step of the gradient of the function is to obtain the share of the new loss function gradient, the steps of the secret sharing of the Hessian matrix are iteratively executed to obtain the shares of the new Hessian matrix, and the step of the second product of the secret sharing is iteratively executed to obtain the new The share of the second product;
    在新的第二乘积的条件数满足预设条件时,迭代执行所述秘密分享第一逆矩阵的步骤,得到新的第一逆矩阵的份额,根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。When the condition number of the new second product satisfies the preset condition, the step of secretly sharing the first inverse matrix is performed iteratively to obtain the share of the new first inverse matrix. According to the share of the new first inverse matrix, the new The share of the loss function gradient and the share of the new first model parameter secretly share the second model parameter with the partner to obtain the share of the second model parameter.
  24. 如权利要求20所述的方法,还包括:The method of claim 20, further comprising:
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,迭代执行所述与合作方进行通信的步骤,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secret sharing the first product to obtain a new share of the first product, iteratively execute the step of communicating with the partner to obtain a share of the new incentive function value, and iteratively execute the secret sharing loss The step of function gradient is to obtain the share of the new loss function gradient, the steps of the secret sharing of the Hessian matrix are iteratively executed to obtain the shares of the new Hessian matrix, and the step of the second product of the secret sharing is iteratively executed to obtain the new The share of the second product;
    在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not satisfy the preset condition, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  25. 如权利要求20所述的方法,还包括:The method of claim 20, further comprising:
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额与合作方秘密分享激励函数的取值,得到新的激励函数取值的份额,迭代执 行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secretly sharing the first product to obtain the share of the new first product, and obtain the share of the new incentive function value according to the share of the new first product and the value of the partner secretly sharing the incentive function, Iteratively execute the step of secret sharing the gradient of the loss function to obtain a new share of the loss function gradient, iteratively execute the step of the secret sharing Hessian matrix to obtain the share of the new Hessian matrix, and iteratively execute the secret sharing first Step of the second product, get the share of the new second product;
    在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not satisfy the preset condition, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  26. 如权利要求25所述的方法,所述根据新的第一乘积的份额与合作方秘密分享激励函数的取值,包括:The method according to claim 25, said secretly sharing the value of the incentive function with the partner according to the share of the new first product, comprising:
    根据新的第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为新的激励函数取值的份额,所述多项式用于拟合所述激励函数。According to the share of the new first product and the partner secretly share the value of the polynomial, the share of the polynomial value is obtained as the share of the new excitation function value, and the polynomial is used to fit the excitation function.
  27. 一种模型参数确定方法,应用于第一数据方,包括:A method for determining model parameters, applied to the first data party, includes:
    根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;According to the share of the feature data and the first model parameter, secretly share the first product with the partner to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter;
    根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained;
    根据特征数据和激励函数取值的份额与合作方分别秘密分享损失函数的梯度和海森矩阵,得到损失函数梯度的份额和海森矩阵的份额;According to the share of feature data and the value of the incentive function, secretly share the gradient of the loss function and the Hessian matrix with the partner to obtain the share of the gradient of the loss function and the Hessian matrix;
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;According to the share of the random orthogonal matrix and the share of the Hessian matrix and the partner secretly share the second product to obtain the share of the second product, the second product is the product between the random orthogonal matrix and the Hessian matrix;
    在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, the first inverse matrix being the inverse of the Hessian matrix ;
    根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;According to the share of the first inverse matrix, the share of the loss function gradient and the share of the first model parameter, secretly share the new first model parameter with the partner to obtain the share of the new first model parameter;
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secretly sharing the first product to obtain the share of the new first product, and communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the value of the new incentive function Share, iteratively execute the steps of the gradient of the secret sharing loss function and the Hessian matrix to obtain the share of the new loss function gradient and the share of the new Hessian matrix, and iteratively execute the step of the second product of the secret sharing to obtain the new The share of the second product;
    在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not satisfy the preset condition, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  28. 如权利要求27所述的方法,所述根据第一乘积的份额与合作方秘密分享激励 函数的取值,包括:The method according to claim 27, said secretly sharing the value of the incentive function with the partner according to the share of the first product, comprising:
    根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。According to the share of the first product and the partner secretly share the value of the polynomial, the share of the polynomial value is obtained as the share of the excitation function value, and the polynomial is used to fit the excitation function.
  29. 如权利要求27所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,包括:The method according to claim 27, said secretly sharing the first inverse matrix with a partner according to the share of the Hessian matrix, comprising:
    向合作方发送第二乘积的份额,接收合作方发来的第二乘积的逆矩阵作为第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额;或者,Send the share of the second product to the partner, receive the inverse matrix of the second product from the partner as the second inverse matrix, multiply the share of the second inverse matrix by the random orthogonal matrix, and get the share of the first inverse matrix ;or,
    接收合作方发来的第二乘积的份额,将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积,将第二乘积的逆矩阵作为第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。Receive the share of the second product sent by the partner, add its share of the second product to the share of the received second product to obtain the second product, and use the inverse matrix of the second product as the second inverse matrix. The second inverse matrix is multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix.
  30. 如权利要求27所述的方法,所述根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,包括:The method according to claim 27, wherein the secret sharing of the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter includes:
    根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额,所述第三乘积为第一逆矩阵和损失函数梯度之间的乘积;According to the share of the first inverse matrix and the share of the loss function gradient and the partner secretly share the third product to obtain the share of the third product, the third product is the product between the first inverse matrix and the loss function gradient;
    将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。The share of the first model parameter is subtracted from the share of the third product to obtain the new share of the first model parameter.
  31. 如权利要求27所述的方法,所述根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,包括:The method according to claim 27, wherein the communication with the partner according to the confusion circuit corresponding to the share of the new first product and the incentive function comprises:
    根据新的第一乘积的份额和分段线性函数对应的混淆电路与合作方进行通信,得到分段线性函数取值的份额作为新的激励函数取值的份额,所述分段线性函数用于拟合所述激励函数。According to the share of the new first product and the confusion circuit corresponding to the piecewise linear function to communicate with the partner, the share of the piecewise linear function is obtained as the share of the new excitation function, and the piecewise linear function is used for Fit the excitation function.
  32. 如权利要求27所述的方法,还包括:The method of claim 27, further comprising:
    接收合作方发来的第二乘积的份额,将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积,计算第二乘积的条件数;或者,Receive the share of the second product sent by the partner, add its share of the second product to the share of the received second product to obtain the second product, and calculate the condition number of the second product; or,
    向合作方发送第二乘积的份额,以便合作方计算第二乘积的条件数。Send the share of the second product to the partner so that the partner can calculate the condition number of the second product.
  33. 如权利要求27所述的方法,还包括:The method of claim 27, further comprising:
    在第二乘积的条件数不满足预设条件时,根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。When the condition number of the second product does not satisfy the preset condition, the share of the new first model parameter is calculated according to the share of the first model parameter, the share of the loss function gradient, and the preset step length.
  34. 一种模型参数确定方法,应用于第二数据方,包括:A method for determining model parameters, applied to the second data party, includes:
    根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;According to the share of the first model parameter and the partner secretly share the first product to obtain the share of the first product, the first product is the product of the feature data and the first model parameter;
    根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained;
    根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;According to the label and the value of the incentive function, share the gradient of the loss function secretly with the partner to obtain the share of the loss function gradient; according to the share of the incentive function, share the Hessian matrix secretly with the partner to obtain the share of the Hessen matrix;
    根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;According to the share of the random orthogonal matrix and the share of the Hessian matrix and the partner secretly share the second product to obtain the share of the second product, the second product is the product between the random orthogonal matrix and the Hessian matrix;
    在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, the first inverse matrix being the inverse of the Hessian matrix ;
    根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;According to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter, secretly share the new first model parameter with the partner to obtain the share of the new first model parameter;
    迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额;迭代执行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;Iteratively execute the step of secretly sharing the first product to obtain the share of the new first product, and communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain the value of the new incentive function Share; iteratively execute the step of secretly sharing the gradient of the loss function to obtain a new share of the loss function gradient, iteratively execute the step of secretly sharing the Hessian matrix to obtain the share of the new Hessian matrix, and iteratively execute the secret The step of sharing the second product to get the share of the new second product;
    在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。When the condition number of the new second product does not satisfy the preset condition, the share of the second model parameter is calculated according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
  35. 如权利要求34所述的方法,所述根据第一乘积的份额与合作方秘密分享激励函数的取值,包括:The method according to claim 34, said secretly sharing the value of the incentive function with the partner according to the share of the first product, comprising:
    根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。According to the share of the first product and the partner secretly share the value of the polynomial, the share of the polynomial value is obtained as the share of the excitation function value, and the polynomial is used to fit the excitation function.
  36. 如权利要求34所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,包括:The method according to claim 34, said secretly sharing the first inverse matrix with a partner according to the share of the Hessian matrix, comprising:
    向合作方发送第二乘积的份额,接收合作方发来的第二乘积的逆矩阵作为第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额;或者,Send the share of the second product to the partner, receive the inverse matrix of the second product from the partner as the second inverse matrix, multiply the share of the second inverse matrix by the random orthogonal matrix, and get the share of the first inverse matrix ;or,
    接收合作方发来的第二乘积的份额,将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积,将第二乘积的逆矩阵作为第二逆矩阵,将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。Receive the share of the second product sent by the partner, add its share of the second product to the share of the received second product to obtain the second product, and use the inverse matrix of the second product as the second inverse matrix. The second inverse matrix is multiplied by the share of the random orthogonal matrix to obtain the share of the first inverse matrix.
  37. 如权利要求34所述的方法,所述根据第一逆矩阵的份额、损失函数梯度的份 额和第一模型参数的份额与合作方秘密分享新的第一模型参数,包括:The method according to claim 34, wherein the secret sharing of the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter includes:
    根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额,所述第三乘积为第一逆矩阵和损失函数梯度之间的乘积;According to the share of the first inverse matrix and the share of the loss function gradient and the partner secretly share the third product to obtain the share of the third product, the third product is the product between the first inverse matrix and the loss function gradient;
    将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。The share of the first model parameter is subtracted from the share of the third product to obtain the new share of the first model parameter.
  38. 如权利要求34所述的方法,所述根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,包括:The method according to claim 34, wherein the communication with the partner according to the confusion circuit corresponding to the share of the new first product and the incentive function comprises:
    根据新的第一乘积的份额和分段线性函数对应的混淆电路与合作方进行通信,得到分段线性函数取值的份额作为新的激励函数取值的份额,所述分段线性函数用于拟合所述激励函数。According to the share of the new first product and the confusion circuit corresponding to the piecewise linear function to communicate with the partner, the share of the piecewise linear function is obtained as the share of the new excitation function, and the piecewise linear function is used for Fit the excitation function.
  39. 如权利要求34所述的方法,还包括:The method of claim 34, further comprising:
    接收合作方发来的第二乘积的份额,将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积,计算第二乘积的条件数;或者,Receive the share of the second product sent by the partner, add its share of the second product to the share of the received second product to obtain the second product, and calculate the condition number of the second product; or,
    向合作方发送第二乘积的份额,以便合作方计算第二乘积的条件数。Send the share of the second product to the partner so that the partner can calculate the condition number of the second product.
  40. 如权利要求34所述的方法,还包括:The method of claim 34, further comprising:
    在第二乘积的条件数不满足预设条件时,根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。When the condition number of the second product does not satisfy the preset condition, the share of the new first model parameter is calculated according to the share of the first model parameter, the share of the loss function gradient, and the preset step length.
  41. 一种模型参数确定装置,应用于第一数据方,包括:A device for determining model parameters, applied to a first data party, includes:
    激励函数取值份额获取单元,用于根据第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;The incentive function value share acquisition unit is configured to communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the value share of the incentive function, and the first product is the characteristic data and the first model parameter Product of
    损失函数梯度份额获取单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;The loss function gradient share acquisition unit is used to secretly share the gradient of the loss function with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the loss function gradient;
    海森矩阵份额获取单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;The Hessian matrix share acquisition unit is used to secretly share the Hessian matrix with the partner according to the share of the feature data and the incentive function to obtain the share of the Hessian matrix;
    第一逆矩阵份额获取单元,用于根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The first inverse matrix share obtaining unit is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
    模型参数份额获取单元,用于根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。The model parameter share obtaining unit is used to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
  42. 一种模型参数确定装置,应用于第二数据方,包括:A device for determining model parameters, applied to a second data party, includes:
    激励函数取值份额获取单元,用于根据第一乘积的份额和激励函数对应的混淆电路 与合作方进行通信,得到激励函数取值的份额,所述第一乘积为特征数据和第一模型参数的乘积;The incentive function value share acquisition unit is configured to communicate with the partner according to the share of the first product and the confusion circuit corresponding to the incentive function to obtain the value share of the incentive function, and the first product is the characteristic data and the first model parameter Product of
    损失函数梯度份额获取单元,用于根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;The loss function gradient share acquisition unit is used to secretly share the gradient of the loss function with the partner according to the value of the label and the incentive function to obtain the share of the loss function gradient;
    海森矩阵份额获取单元,用于根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;The Hessian matrix share acquisition unit is used to secretly share the Hessian matrix with the partner according to the value of the incentive function to obtain the Hessian matrix share;
    第一逆矩阵份额获取单元,用于根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The first inverse matrix share obtaining unit is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, where the first inverse matrix is the inverse of the Hessian matrix;
    模型参数份额获取单元,用于根据第一模型参数的份额、第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。The model parameter share obtaining unit is used to secretly share the new first model parameter with the partner according to the share of the first model parameter, the share of the first inverse matrix, and the share of the loss function gradient to obtain the share of the new first model parameter.
  43. 一种模型参数确定装置,应用于第一数据方,包括:A device for determining model parameters, applied to a first data party, includes:
    第一秘密分享单元,用于根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;The first secret sharing unit is configured to secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter;
    第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;The second secret sharing unit is used to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
    第三秘密分享单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;The third secret sharing unit is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the loss function gradient and the Hessian matrix respectively;
    第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;The fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product. The second product is the random orthogonal matrix and the Hessian matrix. Product between matrices;
    第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The fifth secret sharing unit is used to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix when the condition number of the second product satisfies the preset condition. The matrix is the inverse of the Hessian matrix;
    第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;The sixth secret sharing unit is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter;
    迭代单元,用于迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额,迭代执行所述秘密分享损失函数的梯度和海森矩阵的步骤,得到新的损失函数梯度的份额和新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;在新的第二乘积的条件数不满足所述预设条件时,根据新的 第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。The iterative unit is used to iteratively execute the step of secretly sharing the first product to obtain the share of the new first product, and communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain a new The share of the value of the incentive function is iteratively performed the steps of the gradient of the secret sharing loss function and the Hessian matrix to obtain the share of the new loss function gradient and the share of the new Hessian matrix, and the second product of the secret sharing is iteratively executed The step of obtaining the share of the new second product; when the condition number of the new second product does not meet the preset condition, according to the share of the new first model parameter, the share of the new loss function gradient and the preset Step size, calculate the share of the second model parameter.
  44. 一种模型参数确定装置,应用于第二数据方,包括:A device for determining model parameters, applied to a second data party, includes:
    第一秘密分享单元,用于根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;The first secret sharing unit is configured to secretly share the first product with the partner according to the share of the first model parameter to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter;
    第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;The second secret sharing unit is used to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
    第三秘密分享单元,用于根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;The third secret sharing unit is used to secretly share the gradient of the loss function with the partner according to the share of the label and the value of the incentive function to obtain the share of the gradient of the loss function; according to the share of the value of the incentive function, secretly share the Hessian matrix with the partner, Get the share of Hessian matrix;
    第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;The fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product. The second product is the random orthogonal matrix and the Hessian matrix. Product between matrices;
    第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;The fifth secret sharing unit is used to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix when the condition number of the second product satisfies the preset condition. The matrix is the inverse of the Hessian matrix;
    第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额;The sixth secret sharing unit is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter;
    迭代单元,用于迭代执行所述秘密分享第一乘积的步骤,得到新的第一乘积的份额,根据新的第一乘积的份额和激励函数对应的混淆电路与合作方进行通信,得到新的激励函数取值的份额;迭代执行所述秘密分享损失函数的梯度的步骤,得到新的损失函数梯度的份额,迭代执行所述秘密分享海森矩阵的步骤,得到新的海森矩阵的份额,迭代执行所述秘密分享第二乘积的步骤,得到新的第二乘积的份额;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。The iterative unit is used to iteratively execute the step of secretly sharing the first product to obtain the share of the new first product, and communicate with the partner according to the share of the new first product and the confusion circuit corresponding to the incentive function to obtain a new The share of the value of the incentive function; iteratively execute the step of secret sharing the gradient of the loss function to obtain a new share of the loss function gradient, and iteratively execute the step of the secret sharing Hessian matrix to obtain the share of the new Hessian matrix, Iteratively execute the step of secretly sharing the second product to obtain the share of the new second product; when the condition number of the new second product does not meet the preset condition, according to the share of the new first model parameter, the new share The share of the gradient of the loss function and the preset step size are calculated to calculate the share of the second model parameter.
  45. 一种电子设备,包括:An electronic device including:
    存储器,用于存储计算机指令;Memory, used to store computer instructions;
    处理器,用于执行所述计算机指令以实现如权利要求1-40中任一项所述的方法步骤。The processor is configured to execute the computer instructions to implement the method steps according to any one of claims 1-40.
PCT/CN2020/106254 2019-08-09 2020-07-31 Method and apparatus for determining model parameter, and electronic device WO2021027598A1 (en)

Applications Claiming Priority (8)

Application Number Priority Date Filing Date Title
CN201910735442.3 2019-08-09
CN201910735442.3A CN110580410B (en) 2019-08-09 2019-08-09 Model parameter determining method and device and electronic equipment
CN201910734784.3 2019-08-09
CN201910735439.1 2019-08-09
CN201910735421.1 2019-08-09
CN201910735421.1A CN110472439B (en) 2019-08-09 2019-08-09 Model parameter determining method and device and electronic equipment
CN201910735439.1A CN110555525B (en) 2019-08-09 2019-08-09 Model parameter determination method and device and electronic equipment
CN201910734784.3A CN110580409B (en) 2019-08-09 2019-08-09 Model parameter determining method and device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2021027598A1 true WO2021027598A1 (en) 2021-02-18

Family

ID=74570512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/106254 WO2021027598A1 (en) 2019-08-09 2020-07-31 Method and apparatus for determining model parameter, and electronic device

Country Status (1)

Country Link
WO (1) WO2021027598A1 (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9449177B1 (en) * 2013-03-13 2016-09-20 Hrl Laboratories, Llc General protocol for proactively secure computation
CN109274492A (en) * 2018-09-30 2019-01-25 中国科学技术大学 From the close coupling privacy sharing method of safety
US20190149333A1 (en) * 2017-11-15 2019-05-16 International Business Machines Corporation Methods and systems for supporting fairness in secure computations
CN110472439A (en) * 2019-08-09 2019-11-19 阿里巴巴集团控股有限公司 Model parameter determines method, apparatus and electronic equipment
CN110555525A (en) * 2019-08-09 2019-12-10 阿里巴巴集团控股有限公司 Model parameter determination method and device and electronic equipment
CN110555315A (en) * 2019-08-09 2019-12-10 阿里巴巴集团控股有限公司 model parameter determination method and device and electronic equipment
CN110569228A (en) * 2019-08-09 2019-12-13 阿里巴巴集团控股有限公司 model parameter determination method and device and electronic equipment
CN110580410A (en) * 2019-08-09 2019-12-17 阿里巴巴集团控股有限公司 Model parameter determination method and device and electronic equipment
CN110580409A (en) * 2019-08-09 2019-12-17 阿里巴巴集团控股有限公司 model parameter determination method and device and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9449177B1 (en) * 2013-03-13 2016-09-20 Hrl Laboratories, Llc General protocol for proactively secure computation
US20190149333A1 (en) * 2017-11-15 2019-05-16 International Business Machines Corporation Methods and systems for supporting fairness in secure computations
CN109274492A (en) * 2018-09-30 2019-01-25 中国科学技术大学 From the close coupling privacy sharing method of safety
CN110472439A (en) * 2019-08-09 2019-11-19 阿里巴巴集团控股有限公司 Model parameter determines method, apparatus and electronic equipment
CN110555525A (en) * 2019-08-09 2019-12-10 阿里巴巴集团控股有限公司 Model parameter determination method and device and electronic equipment
CN110555315A (en) * 2019-08-09 2019-12-10 阿里巴巴集团控股有限公司 model parameter determination method and device and electronic equipment
CN110569228A (en) * 2019-08-09 2019-12-13 阿里巴巴集团控股有限公司 model parameter determination method and device and electronic equipment
CN110580410A (en) * 2019-08-09 2019-12-17 阿里巴巴集团控股有限公司 Model parameter determination method and device and electronic equipment
CN110580409A (en) * 2019-08-09 2019-12-17 阿里巴巴集团控股有限公司 model parameter determination method and device and electronic equipment

Similar Documents

Publication Publication Date Title
WO2021027258A1 (en) Model parameter determination method and apparatus, and electronic device
CN110555525B (en) Model parameter determination method and device and electronic equipment
WO2021027254A1 (en) Model parameter determination method and apparatus, and electronic device
CN110580409B (en) Model parameter determining method and device and electronic equipment
WO2021027259A1 (en) Method and apparatus for determining model parameters, and electronic device
TWI730622B (en) Data processing method, device and electronic equipment
US20200177364A1 (en) Determining data processing model parameters through multiparty cooperation
CN110472439B (en) Model parameter determining method and device and electronic equipment
TWI728639B (en) Data processing method, device and electronic equipment
CN110580410A (en) Model parameter determination method and device and electronic equipment
CN112070222B (en) Processing device, accelerator and method for federal learning
WO2021000572A1 (en) Data processing method and apparatus, and electronic device
US10936960B1 (en) Determining model parameters using secret sharing
WO2021000575A1 (en) Data interaction method and apparatus, and electronic device
CN111967035B (en) Model training method and device and electronic equipment
US11496295B2 (en) Non-transitory computer-readable medium storing program code, decryption device, and communication system including encryption device and decryption device
TWI710981B (en) Method, device and electronic equipment for determining value of loss function
WO2021000574A1 (en) Data interaction method and apparatus, server, and electronic device
WO2019242562A1 (en) Elliptic curve point multiplication operation method and apparatus
CN112507323A (en) Model training method and device based on unidirectional network and computing equipment
WO2021027598A1 (en) Method and apparatus for determining model parameter, and electronic device
CN114338024B (en) Image decryption method, system, device and computer readable storage medium
CN112511361B (en) Model training method and device and computing equipment
TW202103151A (en) Data processing method and device, and electronic device
CN112085206A (en) Joint logistic regression modeling method and device and terminal

Legal Events

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

Ref document number: 20852488

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20852488

Country of ref document: EP

Kind code of ref document: A1