A secure multi-party computing method based on neural network model

Through a secure multi-party calculation method that fits the objective function based on neural network model, the problem of narrow application scope and inefficiency in the existing technology is solved, and wider application and efficient privacy protection are achieved, allowing a single input number to participate in the calculation.

CN113792338BActive Publication Date: 2024-11-12ZHEJIANG DIGITAL QIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111052934.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-09
Publication Date
2024-11-12
Estimated Expiration
2041-09-09

AI Technical Summary

Technical Problem

The existing secure multi-party computing technology has a narrow application range, low efficiency, and is difficult to promote and use, especially in industries involving sensitive privacy data. Data privacy cannot be effectively maintained.

Method used

Using a secure multi-party calculation method based on the neural network model, the host constructs and trains the neural network model by fitting the objective function, the participants verify their accuracy, and the weighted sum of the input numbers of neurons in the layer 1 of the neural network model is to Calculate based on the offset value to achieve safe multi-party calculation.

Benefits of technology

The application scope of secure multi-party computing has been expanded, computing efficiency has been improved, data leakage problems caused by accurate calculations have been eliminated, and participants with a single input number have been allowed to participate in the calculation while ensuring privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113792338B_ABST
    Figure CN113792338B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of blockchain technology, and specifically to a secure multi-party computing method based on a neural network model, including: establishing a host, the host constructs a neural network model; the host generates several groups of input numbers by itself; the function result is used as a label to form sample data; the sample data is used to train and test the neural network model; the host publishes the neural network model; the participants substitute their respective privacy numbers into the weighted sum calculation formula to obtain an intermediate value, and send the intermediate value to the host; after the host receives all the intermediate values, the intermediate values ​​are summed and then added to the offset value to obtain the input number of the first layer of neurons; after obtaining the input number of all neurons in the first layer, the output of the neural network model is calculated, which is the result of secure multi-party computing. The substantial effect of the present invention is: using the neural network model to fit any objective function, a secure multi-party computing solution is obtained, and the application scope of secure multi-party computing is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a secure multi-party computing method based on a neural network model. Background Art

[0002] Blockchain is a distributed shared ledger and database with the characteristics of decentralization, immutability, full traceability, traceability, collective maintenance, openness and transparency. These characteristics ensure the "honesty" and "transparency" of blockchain and lay the foundation for creating trust in blockchain. Blockchain can solve the problem of information asymmetry and realize collaborative trust and concerted action among multiple subjects. Blockchain improves data security and provides a trust basis with the help of distributed storage, but it also means that data on blockchain is open and transparent. With the continuous expansion and extension of blockchain applications, industries involving sensitive privacy data have encountered the problem of being unable to maintain data privacy when applying blockchain. Therefore, the concept of privacy computing was proposed. Privacy computing refers to a technology and system in which two or more participants jointly calculate an agreed function. The participants collaborate to conduct joint machine learning and joint analysis on their data without leaking their own data. The participants in privacy computing can be different departments of the same organization or different organizations. Among them, secure multi-party computing is a technology for implementing privacy computing. At present, the technologies for secure multi-party computing include oblivious transmission, encrypted Boolean circuits and homomorphic encryption. Among them, the schemes of oblivious transmission and encrypted Boolean circuits can calculate any objective function, but the efficiency is very low. Homomorphic encryption can only perform secure multi-party computation of addition. This makes it difficult to promote the use of secure multi-party computing technology, which limits the development of blockchain technology. Therefore, it is necessary to further study secure multi-party computing schemes with higher execution efficiency.

[0003] For example, Chinese patent CN111737011A, published on October 2, 2020, discloses a method for implementing secure multi-party computing, which is applied to the representative node of the participants of secure multi-party computing. The method includes: determining the secret computing task of the participant that complies with the secure multi-party computing protocol; splitting the secret computing task into at least two subtasks, and distributing the subtasks to at least two auxiliary nodes for calculation; receiving the execution results of the subtasks returned by the auxiliary nodes, and generating the calculation results of the secret computing task that complies with the secure multi-party computing protocol according to the execution results of the subtasks. It performs secure multi-party computing based on homomorphic encryption, which cannot solve the technical problem that the current secure multi-party computing has a narrow application scope. Summary of the invention

[0004] The technical problem to be solved by the present invention is that the current application scope of secure multi-party computing is narrow. A secure multi-party computing method based on a neural network model is proposed, which realizes secure multi-party computing by fitting the target function with the neural network model.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a secure multi-party computing method based on a neural network model, comprising: selecting a host, and the host constructing a neural network model; the host generates several groups of input numbers according to the value range of the input numbers; substituting each group of input numbers into the target function to obtain the function result, and the function result is used as a label to form sample data; the host uses the sample data to train and test the neural network model until the accuracy of the neural network model reaches a preset threshold; the host publishes the neural network model, and the participants verify the accuracy of the neural network model. If the verification is passed, the verification result is signed, and the next step is entered after all the participants pass the verification; the input number of the first layer of neurons in the neural network model will be the weighted sum of the values ​​of the input layer neurons and the sum of the offset values, and the participants substitute their respective privacy numbers into the weighted sum calculation formula to obtain the intermediate value, and send the intermediate value to the host; after receiving all the intermediate values, the host sums the intermediate values ​​and then adds them to the offset value to obtain the input number of the first layer of neurons; after obtaining the input numbers of all neurons in the first layer, the output of the neural network model is calculated, and the output is the result of the secure multi-party computing.

[0006] Preferably, after the host trains the neural network model to reach a preset threshold, the host checks the weight value of the connection involved in each neuron in the first layer. If there is a neuron in the first layer that only involves one connection with a non-zero weight, the neural network model is discarded, and the neural network model is rebuilt and retrained.

[0007] Preferably, when a participant calculates the intermediate value of the first layer of neurons, if the intermediate value only involves one input number of the participant, the participant performs the following steps: select at least one participant from other participants as a collaborator to collaboratively calculate the intermediate value; the participant splits the input number into several addends, where the number of addends is the number of collaborators plus 1; the participant retains one addend, and the remaining addends are sent to the collaborators respectively; the participant uses the retained addend to calculate the intermediate value, and sends the intermediate value to the host; when the collaborator calculates the corresponding intermediate value, it substitutes its own input number and the obtained addend into the calculation formula of the intermediate value to obtain the intermediate value, and sends the intermediate value to the host.

[0008] Preferably, the method for the host to generate several groups of input numbers includes the following steps: the host asks the participants for the value range of each input number; the participants feed back the value range and distribution probability of the input numbers to the host; the supporter randomly generates input numbers within the value range of the input numbers according to the distribution probability.

[0009] Preferably, the participants divide the value range of the input number into several intervals, and calculate the distribution probability of each interval; the distribution probabilities of several intervals are sent to the supporting party, and the supporting party discloses the value range and distribution probability of each input number; when the participants verify the accuracy, several groups of input numbers are generated according to the distribution probability of the input numbers; the input numbers are substituted into the objective function to obtain the function result; the input numbers are substituted into the neural network model to obtain the output of the neural network model, and compared with the function result to obtain the loss value; the percentage of the loss value in the function result is calculated to obtain the average loss percentage. If the average loss percentage is lower than the preset threshold, it is determined that the accuracy verification of the neural network model has passed.

[0010] Preferably, the host selects a partition amount according to the objective function, where the partition amount is the input number of the exponential function involved in the objective function. The host sets several intervals for the partition amount according to the value range of the partition amount, establishes a neural network model for each interval, and associates the neural network model with the corresponding interval. When performing secure multi-party computing, the participant corresponding to the partition amount selects the corresponding neural network model and notifies other participants.

[0011] Preferably, when the host constructs the neural network model, the following steps are performed: a threshold N is set, where N is a positive integer; the host calculates the 1st to Nth order partial derivatives of the objective function for each input number respectively; for the input number, if the mth order partial derivative of the objective function is not a constant, the host adds the mth power of the input number as the input neuron of the neural network model.

[0012] The substantial effects of the present invention are as follows: a neural network model is used to fit an arbitrary objective function to obtain a secure multi-party computing solution within a certain allowable error range, thereby expanding the application scope of secure multi-party computing and improving the efficiency of secure multi-party computing; since there is a certain error in the fitting of the objective function by the neural network model, the data leakage problem caused by accurate calculation is eliminated; collaborative computing is used to enable participants with only one input number to participate in secure multi-party computing while ensuring privacy. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 The figure is a flowchart of a secure multi-party computing method according to Embodiment 1.

[0014] Figure 2 Schematic diagram of collaborative computing method according to Embodiment 1.

[0015] Figure 3 This is a schematic diagram of a method for generating input numbers according to Embodiment 1.

[0016] Figure 4 This is a schematic diagram of input number distribution probability in Example 1.

[0017] Figure 5Schematic diagram of the accuracy verification method of Example 1.

[0018] Figure 6 Schematic diagram of a neural network model according to the first embodiment.

[0019] Figure 7 This is a schematic diagram of a method for establishing a neural network model in Example 2.

[0020] Among them: 10, number of inputs, 20, input layer, 30, first layer, 40, output layer. DETAILED DESCRIPTION

[0021] The specific implementation of the present invention will be further described below through specific examples in conjunction with the accompanying drawings.

[0022] Embodiment 1:

[0023] A secure multi-party computing method based on a neural network model, see the attached Figure 1 , the method comprises the following steps:

[0024] Step A01) selecting a host, and the host constructs a neural network model;

[0025] Step A02) The host generates several groups of input numbers according to the value range of the input numbers;

[0026] Step A03) Substitute each set of input numbers into the target function to obtain the function result, which is used as a label to form sample data;

[0027] Step A04) The host uses the sample data to train and test the neural network model until the accuracy of the neural network model reaches a preset threshold;

[0028] Step A05) The host publishes the neural network model, and the participants verify the accuracy of the neural network model. If the verification is successful, the verification result will be signed. After all participants pass the verification, the next step will be entered;

[0029] Step A06) The number of inputs to the first layer of neurons in the neural network model will be the weighted sum of the values ​​of the input layer neurons and the offset value. The participants will substitute their privacy numbers into the weighted sum calculation formula to obtain the intermediate value, which will be sent to the host. After receiving all the intermediate values, the host will sum the intermediate values ​​and add them to the offset value to obtain the number of inputs to the first layer of neurons.

[0030] Step A07) After obtaining the input number of all neurons in the first layer, the output of the neural network model is calculated, and the output is the result of the secure multi-party computation.

[0031] After the host trains the neural network model to reach the preset threshold, the weight value of the connection involved in each neuron in the first layer is checked. If there is a neuron in the first layer that only involves one connection with a non-zero weight, the neural network model is discarded, and the neural network model is rebuilt and retrained. The neurons in the first layer only involve one connection with a non-zero weight. The corresponding calculated intermediate value can directly infer the input number, which will lead to privacy leakage. The reason for this situation is that the structure of the neural network model is unreasonable or there is a problem with the training. The number of neurons should be reduced, or the gradient when the weight is close to 0 should be reduced. Training the weight to 0 is an abnormal situation that often occurs in neural network training. It usually means that the gradient function selection is unreasonable. This solution only excludes this kind of training abnormality.

[0032] When a participant calculates the intermediate value of the first layer of neurons, if the intermediate value only involves one of the participant's input numbers, the participant performs the following steps, see the attached Figure 2 , including: step B01) select at least one participant from other participants as a collaborator to collaboratively calculate the intermediate value; step B02) the participant splits the input number into several addends, the number of addends is the number of collaborators plus 1; step B03) the participant retains one addend, and the remaining addends are sent to the collaborators; step B04) the participant uses the reserved addend to calculate the intermediate value and sends the intermediate value to the host; step B05) when the collaborator calculates the corresponding intermediate value, it substitutes its own input number and the obtained addend into the calculation formula of the intermediate value to obtain the intermediate value, and sends the intermediate value to the host. Please refer to the attached Figure 6 , for example, Party A has two input numbers: x1 and x2, Party B has one input number: x3, and the host is Party C. A neural network model usually includes an input layer, an output layer, and several hidden layers. The hidden layer is also called the intermediate layer. In some simple neural network models, there may be no hidden layer. The output layer can have one neuron or multiple neurons. A typical neural network model is a fully connected neural network. That is, the neurons in each layer are connected to the neurons in the previous layer. The input layer is also called the 0th layer, and the corresponding hidden layers are called the 1st layer, the 2nd layer, and so on. Figure 6 The neural network model shown in has an input layer 20, an output layer 40 and a hidden layer, namely the first layer 30. The output of the neuron of the input layer 10 is the input number 10, which is used to import the input number 10 into the neural network model.

[0033] Participant B triggers this step because it has only one input number. Participant B splits the input number x3 into x3_1 and x3_2, x3= x3_1+x3_2, sends x3_1 to participant A, and retains x3_2. Participant A calculates the intermediate value Temp1=a11*x1+a12*x2+a13*x3_1, and Participant B calculates the intermediate value Temp2=a13*x3_2, and sends Temp1 and Temp2 to host C. Host C adds Temp1 and Temp2, and the result is exactly a11*x1+a12*x2+a13*x3. Adding the offset value b1, the input value of a neuron in the first layer is obtained. Substituting the input value into the activation function can obtain the output of the neuron. Although host C can calculate x3_2, because host C cannot calculate x3_1 from Temp1, it cannot obtain the value of input number x3. At the same time, although participant A knows the value of x3_1, participant A does not know the value of Temp2, and therefore cannot obtain the value of input number x3, thus achieving privacy protection of input number x3. However, measures should be taken to prevent participant A and host C from colluding to commit evil. Node evil is not within the scope of this embodiment. This embodiment assumes that all nodes follow the steps and do not collude on data. However, the nodes remain curious, that is, they try to infer the input numbers of other nodes from the obtained data.

[0034] For the method of generating several groups of input numbers by the host, please refer to the attached Figure 3 , including the following steps: Step C01) the host asks the participants for the value range of each input number; Step C02) the participants feedback the value range and distribution probability of the input number to the host; Step C03) the supporter randomly generates input numbers within the value range of the input number according to the distribution probability. Please refer to the attached Figure 4 , which is a schematic diagram of distribution probability. The distribution probability used in this embodiment is not a continuous function, but is in the form of a histogram. Specifically, the value range of the input number is divided into several intervals, and the probability of the input number falling into the interval is calculated as the distribution probability of the interval.

[0035] Please see attached Figure 5, the method for the host party to generate input numbers and the participants to verify the accuracy of the neural network model includes the following steps: step D01) the participants divide the value range of the input numbers into several intervals and calculate the distribution probability of each interval; step D02) the distribution probabilities of several intervals are sent to the supporting party, and the supporting party discloses the value range and distribution probability of each input number; step D03) when the participants verify the accuracy, several groups of input numbers are generated according to the distribution probability of the input numbers; step D04) the input numbers are substituted into the objective function to obtain the function result; step D05) the input numbers are substituted into the neural network model to obtain the output of the neural network model, and the loss value is obtained by comparing it with the function result; step D06) the percentage of the loss value in the function result is calculated to obtain the average loss percentage; step D07) if the average loss percentage is lower than the preset threshold, it is determined that the accuracy verification of the neural network model has passed.

[0036] Theoretically, when the target function is known, an unlimited number of labeled samples can be obtained by autonomously generating the number of inputs. Without limiting the number of layers, number of neurons, and training time of the neural network, the neural network can fit any complex function.

[0037] Furthermore, in order to appropriately reduce the training time of the neural network model, the host selects the division amount according to the objective function. The division amount is the number of inputs of the exponential function involved in the objective function. The host sets several intervals for the division amount according to the value range of the division amount, establishes a neural network model for each interval, and associates the neural network model with the corresponding interval. When performing secure multi-party computing, the participant corresponding to the division amount selects the corresponding neural network model and notifies other participants.

[0038] The beneficial technical effect of this embodiment is: using the neural network model to fit any objective function, a secure multi-party computing solution within a certain allowable error range is obtained, which expands the application scope of secure multi-party computing and also improves the efficiency of secure multi-party computing. Since there is a certain error in the fitting of the neural network model to the objective function, the data leakage problem caused by accurate calculation is eliminated. The use of collaborative computing enables participants with only one input number to participate in secure multi-party computing while ensuring privacy.

[0039] Embodiment 2:

[0040] A secure multi-party computing method based on a neural network model. Similarly, this embodiment is to further reduce the difficulty of neural network fitting and save the time of neural network training on the basis of the first embodiment. When the host constructs the neural network model, the following steps are performed. Please refer to the attached Figure 7, including: step E01) setting a threshold N, N is a positive integer; step E02) the host calculates the 1st to Nth order partial derivatives of the objective function for each input number; step E03) for the input number, if the mth order partial derivative of the objective function is not a constant, the host adds the mth power of the input number as the input neuron of the neural network model. If the objective function is y=x1^2+3*x2, the first-order partial derivative and the second-order partial derivative of the objective function for x1 are not 0, and the third-order partial derivative is 0, and the first-order partial derivative for x2 is not 0, and the second-order partial derivative is 0, then a 1st power input neuron and a 2nd power input neuron are established for x1, and a 1st power input neuron is established for x2. Convert the power operation into an addition operation to reduce the complexity of the neural network. Save the training time of the neural network. It is worth noting that even if the 2nd power input neuron of x1 is not established, the neural network model can obtain the result of fitting the square of x1 through training with a large amount of sample data. The general principle is that the multiple hidden layer neurons connected to the x1 input neuron have different weights. When the value of x1 is equal to the weight, the product of x1 and the weight is close to x1 to the power of 2. When there are enough hidden layer neurons, the calculation accuracy will meet the requirements. Similarly, for x1 to the power of 3, when the weight is equal to the square of x1, the product of the weight and x1 is close to x1 to the power of 3.

[0041] Similarly, for more complex functions such as exponential functions, trigonometric functions, and logarithmic functions. When the number of hidden layer neurons is large enough, so that the input number is within its value range, there is always a hidden layer neuron connection whose weight multiplied by the input number is close to the corresponding function value. Other neurons that are not close can be inhibited by the activation function and no longer propagate. Although it will make the neural network model large and complex, it can be implemented.

[0042] It also means that the solution recorded in Example 1 is suitable for the case where the number of input numbers is large and the calculation involved in the objective function is relatively simple. When the technical solution recorded in this embodiment is adopted, due to the increase in the high-order terms of the input numbers, a more complex objective function can be calculated. Including weighted sum calculations containing high-order terms. In fact, corresponding to the function that can be Taylor expanded, Example 2 can fit with high efficiency. For example, in the Taylor expansion of e^x and lnx, including x to the power of 1 to the power of N, when N is large enough, the error can be lower than the threshold. Thereby, this embodiment greatly expands the range of objective functions that can be efficiently fitted by the neural network model. The scope of efficient implementation of this scheme is expanded.

[0043] The above-described embodiment is only a preferred solution of the present invention and does not limit the present invention in any form. There are other variations and modifications without exceeding the technical solution described in the claims.

Claims

1. A secure multi-party computing method based on a neural network model, characterized in that: include: Selecting a host, who builds a neural network model; The host generates several groups of input numbers according to the value range of the input numbers; Substitute each set of input numbers into the target function to obtain the function result, which is used as a label to form sample data; The host uses the sample data to train and test the neural network model until the accuracy of the neural network model reaches a preset threshold; The host publishes the neural network model, and the participants verify the accuracy of the neural network model. If the verification is successful, the verification result will be signed. After all participants pass the verification, they proceed to the next step; The number of inputs to the first layer of neurons in the neural network model will be the weighted sum of the values ​​of the input layer neurons and the sum of the offset values. The participants will substitute their privacy numbers into the weighted sum calculation formula to obtain the intermediate value, which will be sent to the host. After receiving all the intermediate values, the host sums the intermediate values ​​and adds them to the offset value to obtain the input number of the first layer of neurons; After obtaining the input number of all neurons in the first layer, the output of the neural network model is calculated, and the output is the result of the secure multi-party computation; When a participant calculates the intermediate value of the first layer of neurons, if the intermediate value involves only one input number of the participant, the participant performs the following steps: Select at least one participant from other participants as the collaborating party to collaboratively calculate the intermediate value; The participants split the input number into several addends, the number of addends is the number of collaborating parties plus 1; The participating party keeps one addend, and the rest are sent to the coordinating parties; The participants use the reserved addends to calculate the intermediate value and send the intermediate value to the host; When the collaborating party calculates the corresponding intermediate value, it substitutes its own input number and the obtained addend into the calculation formula of the intermediate value, obtains the intermediate value, and sends the intermediate value to the host party.

2. A secure multi-party computing method based on a neural network model according to claim 1, characterized in that: After the host trains the neural network model to reach the preset threshold, the host checks the weight value of the connection involved in each neuron in the first layer. If there is a neuron in the first layer that only involves one connection with a non-zero weight, the neural network model is discarded, the neural network model is rebuilt and retrained.

3. The secure multi-party computing method based on a neural network model according to claim 1, characterized in that: The method for the host to generate several groups of input numbers includes the following steps: The host asks the participants for the value range of each input number; The participants will provide feedback on the value range and distribution probability of the input numbers to the host; The host randomly generates input numbers within the range of input numbers according to the distribution probability.

4. The secure multi-party computing method based on a neural network model according to claim 3, characterized in that: The participants divide the range of the input number into several intervals and calculate the distribution probability of each interval; The distribution probabilities of several intervals are sent to the host, who will make public the value range and distribution probability of each input number; When the participants verify the accuracy, they generate several groups of input numbers according to the distribution probability of the input numbers; Substitute the input number into the objective function to obtain the function result; Substitute the input number into the neural network model, obtain the output of the neural network model, and compare it with the function result to obtain the loss value; Calculate the percentage of loss value to function result and obtain the average loss percentage. If the average loss percentage is lower than the preset threshold, the accuracy verification of the neural network model is determined to have passed.

5. A secure multi-party computing method based on a neural network model according to any one of claims 1 to 3, characterized in that: The host selects the partition amount according to the objective function, where the partition amount is the input number of the exponential function involved in the objective function. The host sets several intervals for the partition amount according to the value range of the partition amount, establishes a neural network model for each interval, and associates the neural network model with the corresponding interval. When performing secure multi-party computing, the participant corresponding to the partition amount selects the corresponding neural network model and notifies other participants.

6. A secure multi-party computing method based on a neural network model according to any one of claims 1 to 3, characterized in that: When the host builds a neural network model, the following steps are performed: Set a threshold value N, where N is a positive integer; The host calculates the 1st to Nth order partial derivatives of the objective function for each input number; For the input number, if the m-th order partial derivative of the objective function is not 0, the host adds the m-th power of the input number as the input neuron of the neural network model.