A privacy-preserving artificial intelligence reasoning method

By improving the sigmoid function based on the divide-and-conquer strategy and the addition secret sharing of fixed-point numbers on the ring, combined with the secure computing protocol of the EzPC open source code library, the secure sigmoid protocol is designed to solve the high overhead of secure calculation of nonlinear activation functions in artificial intelligence reasoning systems. problem, achieving efficient privacy protection and performance improvement.

CN118133329BActive Publication Date: 2024-09-17JINAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311768087.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2024-09-17
Estimated Expiration
2043-12-21

AI Technical Summary

Technical Problem

When implementing privacy protection in existing artificial intelligence reasoning systems, the secure calculation method of nonlinear activation functions has a high number of communication rounds and a huge amount of communication, making it difficult to apply in real-life scenarios. Moreover, the addition secret sharing based on floating point numbers does not meet the security requirements of information theory.

Method used

Use the divide-and-conquer strategy to build the addition secret sharing of fixed-point numbers on the ring. By constructing the first and second security index protocols, improve the sigmoid function, combine the secure computing protocol of the EzPC open source code library, design a secure sigmoid protocol, and reduce the secure computing sub-protocol. quantity, reducing computational overhead.

Benefits of technology

Without affecting the inference accuracy, the communication volume and computing time are significantly reduced, saving 40% of the communication volume and computing time. Compared with the existing technology, it has an order of magnitude performance advantage and achieves full-process privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118133329B
    Figure CN118133329B
Patent Text Reader

Abstract

The present invention discloses a method for securely calculating a nonlinear activation function for a neural network, which can be used for privacy protection in the neural network reasoning stage. The present invention belongs to the field of information security, and includes: inventing a secure exponential protocol based on a divide-and-conquer strategy; inventing a secure sigmoid protocol based on the symmetry of the sigmoid function. A variant protocol of the secure exponential protocol is the key to constructing the secure sigmoid protocol, and the secure sigmoid protocol is the key to securely calculating sigmoid and tanh nonlinear activation functions in a privacy-preserving artificial intelligence reasoning system. The present invention can significantly reduce the time overhead and communication overhead generated by a privacy-preserving artificial intelligence reasoning system when securely calculating nonlinear activation functions, thereby improving the security reasoning efficiency of the entire system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security, and in particular relates to a privacy-preserving artificial intelligence reasoning method. Background Art

[0002] At present, artificial intelligence reasoning systems are widely used in various fields including healthcare, finance, manufacturing, etc., bringing great convenience to social life. However, while artificial intelligence reasoning systems bring great convenience to people, they also bring serious personal data privacy crises. Personal information may be collected, analyzed, or even abused. How to balance the contradiction between artificial intelligence applications and personal data privacy is a key technical problem that needs to be solved at present.

[0003] As a research hotspot in recent years, secure multi-party computation can ensure that participants can perform computations together without disclosing their private data, which provides a solution to the privacy protection problem in artificial intelligence applications. Artificial intelligence reasoning systems usually contain mathematical operations such as convolution, pooling, and nonlinear activation functions, which can be protected by multi-party secure computation. Currently, the MP-SPDZ open source code library and the EzPC open source code library have provided corresponding secure computing methods for these mathematical operations. However, the nonlinear activation function secure computing method they provide has a high number of communication rounds and huge communication volume, making it difficult to apply in real scenarios.

[0004] Specifically, for the secure computation of complex nonlinear activation functions such as sigmoid, the MP-SPDZ open source code library provides two implementation methods: high-order polynomial approximation and piecewise linear approximation. The EzPC open source code library implements the secure computation of complex nonlinear activation functions by combining a series of simple general secure computation protocols. The former requires a difficult trade-off between performance and accuracy, while the latter needs to endure the high communication overhead and computing time brought by a large number of secure computation sub-protocols. In addition, there are many similar secure computation methods in China, but most of them are based on additive secret sharing on floating-point numbers. Related research has proved that such secure computation methods do not meet the requirements of information-theoretic security. How to reduce computational overhead while achieving privacy protection is a common problem faced by the academic community. Summary of the invention

[0005] The present invention proposes a privacy-preserving artificial intelligence reasoning method, which uses the additive secret sharing of fixed-point numbers on a ring to restrict input and output, so as to solve the problems existing in the above-mentioned prior art.

[0006] To achieve the above objectives, the present invention provides a privacy-preserving artificial intelligence reasoning method, comprising:

[0007] (1) Based on the divide-and-conquer strategy, construct the first exponential function;

[0008] (2) constructing a first security index protocol based on the first index function;

[0009] (3) constructing a second security exponential protocol based on the first security exponential protocol, wherein the second security exponential protocol is an exponential protocol whose input is always negative, and is a variant protocol of the first security exponential protocol;

[0010] (4) Based on the function symmetry, the sigmoid function is improved to obtain the improved sigmoid function;

[0011] (5) Based on the improved sigmoid function and in combination with the second secure exponential protocol, a secure sigmoid protocol is constructed, wherein the secure sigmoid protocol is used to securely calculate the nonlinear activation function of a neural network.

[0012] Preferably, the process of constructing the first exponential function based on the divide-and-conquer strategy includes:

[0013] (1.1) Based on the divide-and-conquer strategy, the exponential function on additive secret sharing is divided into piecewise functions;

[0014] (1.2) Based on the intrinsic characteristics of the exponential function, the piecewise function is transformed to obtain a first transformation function;

[0015] (1.3) Based on the relationship between msb and wrap and the input share of the additive secret sharing, the conditional expression in the first conversion function is replaced with an expression consisting of msb and wrap to obtain a first exponential function based on a divide-and-conquer strategy;

[0016] (1.4) The first exponential function based on the divide-and-conquer strategy is converted into a secure computing-friendly first exponential function.

[0017] Preferably, the piecewise function is:

[0018]

[0019] Preferably, the first conversion function is:

[0020]

[0021] Preferably, the msb and wrap are two Boolean variables, wherein,

[0022]

[0023] Preferably, the first safety index function based on the divide-and-conquer strategy is:

[0024]

[0025] Preferably, the secure computing-friendly first exponential function is:

[0026]

[0027] Preferably, the process of constructing the first security index protocol includes:

[0028] (2.1) Based on the additive secret sharing input shares, several multiplication factors are calculated locally;

[0029] (2.2) Based on several multiplication factors and the secure multiplication protocol of the EzPC open source code library, several secure output results are calculated;

[0030] (2.3) Based on the additive secret sharing input shares and the secure computation protocol in the EzPC open source code library, the first secret sharing and the second secret sharing are calculated;

[0031] (2.4) Based on a number of secure output results, the first secret sharing, the second secret sharing, and the secure computing protocol in the EzPC open source code library, a first secure computing result is calculated;

[0032] (2.5) Using the first secure computation result as input, calling the secure computation protocol in the EzPC open source code library, and calculating the first protocol output result.

[0033] Preferably, the plurality of multiplication factors are six multiplication factors;

[0034] The several secure output results are the additive secret sharing shares corresponding to the three output results;

[0035] The first secret sharing is<msb&wrap> i , which represents the addition secret sharing of two Boolean variables msb and wrap after AND operation;

[0036] The second secret is shared as It represents the addition secret sharing of two Boolean variables msb and wrap after XOR operation.

[0037] Preferably, the process of constructing the second security index protocol includes:

[0038] (3.1) Based on the additive secret sharing input shares, four multiplication factors are calculated locally;

[0039] (3.2) Based on the secure multiplication protocol of four multiplication factors and the EzPC open source code library, two secure output results are calculated;

[0040] (3.3) Based on the additive secret sharing input share and the secure computation protocol in the EzPC open source code library, the first output secret share is calculated;

[0041] (3.4) performing secure calculation on the two output results and the first output secret share to obtain a second secure calculation result;

[0042] (3.5) Using the second security calculation result as input, calling the security calculation protocol in the EzPC open source code library, and calculating the second security index protocol output result.

[0043] Preferably, the first output secret share is <wrap> i ;

[0044] Preferably, the process of improving the sigmoid function includes:

[0045] (4.1) dividing the sigmoid function into piecewise functions, and fine-tuning the input value in the piecewise function to obtain a second conversion function;

[0046] (4.2) Based on the symmetry of the sigmoid function, the second transformation function is transformed to obtain an improved sigmoid function.

[0047] (4.3) Convert the improved sigmoid function into a safe and computationally friendly sigmoid function.

[0048] Preferably, the piecewise function is:

[0049]

[0050] The second conversion function is:

[0051]

[0052] The improved sigmoid function is:

[0053]

[0054] in,

[0055]

[0056] The secure computing-friendly sigmoid function is:

[0057]

[0058] Preferably, the process of building a secure sigmoid protocol includes:

[0059] (5.1) Based on the additive secret sharing input share, a first additive secret sharing share and a second output secret share are calculated;

[0060] (5.2) Taking the first addition secret sharing share and the second output secret sharing share as input, calling the secure computing protocol in the EzPC open source code library, and calculating the third addition secret sharing share;

[0061] (5.3) Based on the third added secret sharing share, calling the second security index protocol, and calculating a fourth added secret sharing share;

[0062] (5.4) Based on the fourth additive secret sharing share, the second output secret share and the security-computation-friendly sigmoid function, the output result of the protocol is calculated.

[0063] Preferably, the first additive secret sharing share is [2x+ε] i , the second output secret share is <msb> i , the third added secret sharing share is The fourth added secret sharing share is

[0064] Compared with the prior art, the present invention has the following advantages and technical effects: The present invention provides a secure nonlinear activation function calculation method for a neural network, which cleverly utilizes the symmetry of the function itself to reduce the number of secure computing sub-protocols required for the secure sigmoid protocol, thereby achieving the effect of reducing overhead and improving performance. The secure exponential protocol designed based on the divide-and-conquer strategy of the present invention is not inferior to the prior art in terms of calculation accuracy and security. Compared with the lookup table-based method of the EzPC open source code library, it can save 40% of the communication volume and computing time, and has an order of magnitude performance advantage over the implementation from the MP-SPZD open source code library. The present invention can provide full-process privacy protection for the neural network reasoning process, protecting the privacy and security of user data without affecting the reasoning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0066] Figure 1 Schematic diagram of a privacy-preserving artificial intelligence reasoning system based on additive secret sharing according to an embodiment of the present invention;

[0067] Figure 2 This is a schematic diagram of a traditional artificial intelligence reasoning system;

[0068] Figure 3 A schematic diagram of additive secret sharing according to an embodiment of the present invention;

[0069] Figure 4 Schematic diagram of a secure computing protocol based on additive secret sharing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0070] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0071] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0072] Embodiment 1

[0073] This embodiment implements a secure calculation method for a nonlinear activation function for a neural network, including:

[0074] (1) constructing a first security index protocol based on the first index function;

[0075] (2) constructing a second security exponential protocol based on the first security exponential protocol, wherein the second security exponential protocol is an exponential protocol whose input is always negative, and is a variant protocol of the first security exponential protocol;

[0076] (3) Based on the improved sigmoid function and combined with the second security index protocol, a secure sigmoid protocol is constructed, such as Figure 1 As described above, the secure sigmoid protocol will be used to securely calculate the nonlinear activation function of the neural network.

[0077] In this embodiment, the system models of the first security index protocol, the second security index protocol, and the security sigmoid protocol are as follows: Figure 4 As shown in the figure, the input and output of the protocol are both the additive secret sharing corresponding to the original data. The process of generating additive secret sharing from the original data is as follows: Figure 3 In this embodiment, the specific steps of the security index protocol include:

[0078] (1.1) Participant P i According to the additive secret shared input share [x] held by the party i Calculate the multiplication factor a locally i ,b i ,c i , where i∈{0,1}, [x] i represents the additive secret sharing share of a fixed-point number x, and [x]0+[x]1modL=x, L=2 l , l represents the bit length corresponding to the fixed-point number x, s represents the bit length corresponding to the decimal part of the fixed-point number x. For the convenience of expression, we use [*] in the subsequent expressions. i represents the additive secret sharing share of a fixed-point number*;

[0079] (1.2) Participant P i According to the a i ,b i ,c i Calling the security F from the EzPC open source code library CrossTerm The calculation protocol obtains the additive secret shares [a'] corresponding to the three output results i , [b'] i , [c'] i ;

[0080] (1.3)Participant P i Input share [x] with the additive secret shared by the party i Calls a secure F from the EzPC open source code library for input msb Computational Protocols and Security msbTOwrap The calculation protocol calculates the secret shared between the MSB and wrap of the secret input x <msb> i and <wrap> i ; where msb represents the most significant bit of the secret input x, Wrap represents the relationship between the two-addition secret input share and the modulus L.

[0081] (1.4) Participant P i With own <msb> i and <wrap> i Calls a secure F from the EzPC open source code library for input AND Calculation protocol calculates the secret sharing corresponding to msb&wrap<msb&wrap> i , where msb&wrap represents the result of AND operation of two Boolean variables msb and wrap, < > i Indicates that this is a Boolean additive secret share;

[0082] (1.5)Participant P i With own <msb> i and <wrap> i Compute locally The corresponding secret sharing in

[0083] (1.6)Participant P i [a'] held by one's side i , [b'] i , [c'] i Compute [b'-a'] locally i and [c'-a'] i , where [b'-a'] i =[b'] i -[a'] i , [c'-a'] i =[c'] i -[a'] i , note that the subtraction here is the subtraction on the module;

[0084] (1.7)Participant P i With [c'-a'] held by oneself i and<msb&wrap> i Calls a secure F from the EzPC open source code library for input Mux Compute protocol calculation [res1] i Where, res1 = (c'-a')·(msb&wrap);

[0085] (1.8)Participant P i With [b'-a'] held by oneself i and Calls a secure F from the EzPC open source code library for input Mux Compute protocol calculation [res2] i ,in,

[0086] (1.9)Participant P i With [res1] held by oneself i 、[res2] i and [a'] i Compute locally [res] i , where [res] i =[res1] i +[res2] i +[a'] i ;

[0087] (1.10)Participant P i With your own possession [res] i Calls a secure F from the EzPC open source code library for input TR The calculation protocol calculates the final output result [y] i .

[0088] The secure exponential protocol, in the additive secret sharing, the MSB corresponding to the fixed-point number x is wrapped with its corresponding floating-point number x f The relationship between them is shown in Table 1.

[0089] Table 1

[0090]

[0091] According to Table 1, the floating point number x f Output results on exponential function There are three possibilities in total, which can be expressed as:

[0092]

[0093] Also because Therefore, the participant P i The six multiplication factors corresponding to the three possible outputs can be calculated locally first, and then the additive secret shares corresponding to the three possible outputs can be obtained through a secure multiplication protocol. Finally, the final output secret share is securely obtained from the three possible outputs through a corresponding secure selection method. The characteristics of the secure exponential protocol based on the divide-and-conquer strategy proposed in this embodiment are that compared with the secure exponential protocol based on piecewise linear approximation, high-order piecewise approximation and lookup table, the secure exponential protocol has less communication volume, communication rounds and running time when the calculation accuracy is equivalent.

[0094] Among them, three outputs are possible and The secure computation of corresponds to (1.1) to (1.2) in the above steps. In the secure computation based on additive secret sharing, formula (1) also needs to be converted into a secure computation-friendly form:

[0095]

[0096] (msb&wrap) and The safety calculation of corresponds to (1.3) to (1.5) in the above steps, and the safety calculation of the above formula corresponds to (1.6) to (1.10) in the above steps.

[0097] The specific steps of the security exponential protocol in which the secret input is always negative include:

[0098] (2.1) Participant P i According to the additive secret shared input share [x] held by the party i Calculate the multiplication factor a locally i ,b i , where i∈{0,1},

[0099] (2.2) Participant P i According to the a i ,b i Calling the security F from the EzPC open source code library CrossTerm The calculation protocol obtains the addition secret share [a'] corresponding to the two output results i , [b'] i ;

[0100] (2.3) Participant P i Input share [x] with the additive secret shared by the party i Calls a secure F from the EzPC open source code library for input msb Computational Protocols and Security msbTOwrap The calculation protocol calculates the secret shared between the MSB and wrap of the secret input x <msb> i and <wrap> i ;

[0101] (2.4) Participant P i [a'] held by one's side i , [b'] i , calculate [b'-a'] locally i , where [b'-a'] i =[b'] i -[a'] i , note that the subtraction here is the subtraction on the module;

[0102] (2.5)Participant P i With [b'-a'] held by oneself i and <wrap> i Calls a secure F from the EzPC open source code library for input Mux Compute protocol calculation [res1] i Where, res1 = (b'-a')·wrap;

[0103] (2.6)Participant P i With [res1] held by oneself i and [a'] i Compute locally [res] i , where [res] i =[res1] i +[a'] i ;

[0104] (2.7)Participant P i With [res] held by oneself i Calls a secure F from the EzPC open source code library for input TR The calculation protocol calculates the final output result [y] i .

[0105] The secure exponential protocol where the secret input is always negative, in additive secret sharing, the floating point number x corresponding to the fixed point number x f When it is a negative number, the MSB corresponding to the fixed-point number x is always equal to 1. According to Table 1, if the MSB is always equal to 1, then the exponential function There are only two possible calculation results, which can be expressed as:

[0106]

[0107] Also because Therefore, the participant P i The four multiplication factors corresponding to the two possible outputs can be calculated locally first, and then the additive secret shares corresponding to the two possible outputs can be obtained through a secure multiplication protocol. Finally, the final output secret share can be securely obtained from the two possible outputs through a corresponding secure selection method. Compared with the secure exponential protocol described in this embodiment, the secure exponential protocol with a constant negative input in this embodiment reduces the possible outputs from three to two, and the output of the secret share is changed from the original secure three-choice to a lower-cost secure two-choice. This protocol will be used as a key submodule in the secure sigmoid protocol described in this embodiment. Among them, the two possible outputs are and The secure computation of corresponds to (2.1) to (2.2) in the above steps. In the secure computation based on secret sharing, formula (2) also needs to be converted into the following secure computation-friendly form:

[0108]

[0109] The safety calculation of wrap corresponds to step (2.3) in the above steps, and the safety calculation of the above formula corresponds to (2.4) to (2.7) in the above steps.

[0110] In this embodiment, the specific steps of the secure sigmoid protocol include:

[0111] (3.1) Participant P i According to the additive secret shared input share [x] held by the party i Compute [2x+ε] locally i , where i∈{0,1}, [x] i is the additive secret sharing share corresponding to the fixed-point number x, [2x+ε]0=2·[x]0+1, [2x+ε]1=2·[x]1, 2x+ε means "x is first enlarged by 2 times, and then a very small value ε=2 is added -s "The calculation result after [] i This indicates that this is an additive secret sharing. In additive secret sharing, x = [x]0 + [x]1 mod L (L = 2 l , l represents the bit length corresponding to the fixed-point number x, and s represents the bit length corresponding to the decimal part of the fixed-point number x);

[0112] (3.2) Participant P i Input share [x] with the additive secret shared by the party i Calls a secure F from the EzPC open source code library for input msb Compute the secret shared value corresponding to the MSB of the secret input x <msb> i ;

[0113] (3.3) Participant P i With own <msb> i and [2x+ε] i Calls a secure F from the EzPC open source code library for input Mux Calculation protocol calculation [(2x+ε)·msb] i ;

[0114] (3.4) Participant P i With [(2x+ε)·msb] held by one's side i and [x] i Compute locally in,

[0115] (3.5)Participant P i With own The secure exponential protocol calculation is called for the input, where the secret input is always negative.

[0116] (3.6)Participant P i With own Compute locally in, s is a fixed-point number The bit length corresponding to the fractional part of ;

[0117] (3.7)Participant P i With own Calls a secure F from the EzPC open source code library for input Rec Computational Protocol Computation

[0118] (3.8)Participant P i Compute locally in, s is a fixed-point number The bit length corresponding to the fractional part of ;

[0119] (3.9)Participant P i With own and <msb> i Input calls to the secure F from the EzPC open source code library Mux Computational Protocol Computation

[0120] (3.10)Participant P i Calculate the additive secret share corresponding to the final result locally [y] i ,in,

[0121] For the secure sigmoid protocol, the EzPC open source code library divides the sigmoid function into piecewise functions as shown below:

[0122]

[0123] In order to further reduce the cost of the secure sigmoid protocol based on the EzPC open source code, this embodiment first f ≥0, and fine-tune each input f Add a very small value ε = 2 -s , convert the above formula into:

[0124]

[0125] Where s is the floating point number x f The length of bits occupied by the decimal part of the corresponding fixed-point number x. This conversion can reduce one security judgment in my secure calculation method and will not cause any harm to the final result. Then formula (5) can be expressed as:

[0126]

[0127] Then, based on the symmetry of the sigmoid function, formula (6) can be further transformed into:

[0128]

[0129] This conversion allows the secure sigmoid protocol of this embodiment to save the use of one secure multiplication protocol and a secure truncation protocol, thereby reducing the cost of the secure sigmoid protocol proposed by the invention. In secure computing based on secret sharing, it is also necessary to convert the above formula into a secure computing-friendly form:

[0130]

[0131] In the secure sigmoid protocol described in this embodiment, The secure calculation corresponds to (3.1) to (3.4) in the above steps, and the secure sigmoid calculation based on the improved function symmetry corresponds to (3.8) to (3.10) in the above steps. In addition, in step (3.5), we use the secure exponential protocol in which the secret input is always negative proposed by the present invention to further reduce the cost overhead.

[0132] Embodiment 2

[0133] This embodiment implements a privacy-preserving artificial intelligence reasoning system based on a variant protocol of the security index protocol described in the invention and the EzPC open source code library. The embodiment uses a trained FastGRNN model as the reasoning model, uses a test sample from the Google-30 dataset as the query data, creates two ubuntu20.04 containers on a host with a Core i9-12900KF processor and 128GB RAM to simulate the user (Participant P0) and the artificial intelligence reasoning service provider (Participant P1), and uses the network traffic controller in the Linux operating system to set the network card port forwarding delay and speed to simulate the LAN / WAN environment. The embodiment network environment settings, specific average bandwidth and delay settings are shown in Table 2.

[0134] Table 2

[0135] Network environment Average bandwidth Average latency Local Area Network (LAN) 385MBps 0.3ms Wide Area Network (WAN) 44MBps 40ms

[0136] like Figure 2 The system model of a traditional artificial intelligence reasoning system is described, where the participant P0 holds the data x, and the participant P1 holds the model parameter W. The participant P0 needs to send the data x to be queried to the participant P1; then, the participant P1 calculates the data x and the model parameter W to obtain the reasoning result y; finally, the participant P1 returns the obtained reasoning result y to the participant P0 to complete the reasoning process.

[0137] like Figure 1 The invention is a privacy-preserving artificial intelligence reasoning system based on the method disclosed in this embodiment, and the steps are as follows:

[0138] Step 1: Participants P0 and P1 follow Figure 3 The method performs additive secret sharing on the secret data held by each party. The participant P0 divides the data to be queried x into two additive secret shares [x]0 and [x]1, and the participant P1 divides the model parameter W into two additive secret shares [W]0 and [W]1. The result of the additive secret sharing is that the other party obtains one of the two additive secret shares. For example, the participant P0 will obtain one of the additive secret shares [W]0 of the model parameter W, and the participant P1 will obtain one of the additive secret shares [x]1 of the data to be queried x.

[0139] Step 2: Participants P0 and P1 use their respective additive secret sharing shares as input, jointly execute the corresponding secure computation protocol, and obtain the additive secret sharing corresponding to the output result;

[0140] Step 3: Repeat the calculation process described in step 2 until all the calculation steps of the privacy-preserving AI reasoning system are completed;

[0141] Step 4: Participant P1 shares the addition secret corresponding to the result of the last secure calculation (corresponding to Figure 1 [o n ]1)Sent to participant P0;

[0142] Step 5: Participant P0 shares the addition secret (corresponding to Figure 1 [o n ]0) and the additive secret shared by party P1 (corresponding to Figure 1 [o n ]1) Get the final inference result (corresponding to Figure 1 y in the .

[0143] Among them, the secure sigmoid protocol used by this privacy-preserving artificial intelligence reasoning system is the secure sigmoid protocol from the present embodiment, and the exponential protocol with a constant negative input described in the present embodiment is used in its underlying implementation. In addition, because tanh(x)=2·sigmoid(2x)-1, the secure tanh protocol used by this privacy-preserving artificial intelligence reasoning system is also based on the secure sigmoid protocol described in the present embodiment.

[0144] Test: The test set samples in the Google-30 dataset are used as the query data of participant P0. After adding secret sharing to the query data, a privacy-preserving artificial intelligence reasoning process is performed to obtain the corresponding reasoning results, communication volume, and running time.

[0145] Table 3

[0146] plan traffic Uptime (LAN) Uptime (WAN) EzPC 98.93MB 10.27s 442.96s This embodiment 78.16MB 8.17s 339.06s

[0147] Using the secure computing protocol described in the invention, our reasoning accuracy can be as high as 84.9%, which is better than 84.5% using the EzPC open source code base. In addition, the data comparison between this embodiment and EzPC on FastGRNN secure reasoning is shown in Table 3, which shows the communication volume and running time generated by the FastGRNN secure reasoning system implemented based on two different methods when securely calculating sigmoid and tanh nonlinear activation functions.

[0148] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / msb> < / msb> < / msb> < / wrap> < / wrap> < / msb> < / wrap> < / msb> < / wrap> < / msb> < / wrap> < / msb> < / msb> < / wrap>

Claims

1. A privacy-preserving artificial intelligence reasoning method, characterized in that: include: Acquire first secret data of the user and second secret data of the service provider; Based on the divide-and-conquer strategy, construct the first exponential function; Based on the first exponential function, construct a first security index protocol; Based on the first security exponent protocol, construct a second security exponent protocol, wherein the second security exponent protocol is an exponential protocol whose input is always negative; Based on the function symmetry, the sigmoid function is improved to obtain the improved sigmoid function; Based on the improved sigmoid function and combined with the second security exponential protocol, a secure sigmoid protocol is constructed, wherein the secure sigmoid protocol is used to securely calculate the nonlinear activation function of the privacy-preserving artificial intelligence reasoning process; The input and output of the first secure exponential protocol, the second secure exponential protocol and the secure sigmoid protocol are all additive secret sharing of fixed-point numbers on a ring; performing additive secret sharing on the first secret data and the second secret data respectively; The service provider sends the additive secret sharing corresponding to the result of the last secure calculation to the user; The user obtains the final reasoning result through the additive secret sharing held by itself and the additive secret sharing from the service provider; The process of constructing the first exponential function based on the divide-and-conquer strategy includes: Based on the divide-and-conquer strategy, the exponential function on additive secret sharing is divided into the first piecewise function; Based on the intrinsic characteristics of the exponential function, transform the first piecewise function to obtain a first transformation function; Based on the relationship between msb and wrap and the additive secret sharing input share, the conditional expression in the first conversion function is replaced with an expression consisting of msb and wrap to obtain a first exponential function based on a divide-and-conquer strategy; Converting the first exponential function based on the divide-and-conquer strategy into a secure computing-friendly first exponential function; The first piecewise function is: in, And x=[x]0+[x]1modL; Where [x] i represents the additive secret sharing share of a fixed-point number x, i∈{0,1}, L represents the modulus of the integer ring, L=2 l , l represents the bit length corresponding to the fixed-point number x, s represents the bit length corresponding to the decimal part of the fixed-point number x, x is the fixed-point number corresponding to the secret data, x f The floating point number corresponding to the secret data; The first conversion function is: The msb and wrap are two Boolean variables, where Right now The first exponential function based on the divide-and-conquer strategy is: Among them, msb&wrap represents the result of the AND operation of two Boolean variables msb and wrap. It represents the result of the XOR operation on two Boolean variables msb and wrap; The secure computing friendly first exponential function is: The process of improving the sigmoid function includes: Dividing the sigmoid function into a second piecewise function, and fine-tuning an input value in the second piecewise function to obtain a second conversion function; Based on the symmetry of the sigmoid function, the second conversion function is converted to obtain an improved sigmoid function; Converting the improved sigmoid function into a safe and computationally friendly sigmoid function; The second piecewise function is: The second conversion function is: The improved sigmoid function is: Among them, ε is the smallest representable floating point number, and the specific value is 2 -s , is a negative number; The secure computing-friendly sigmoid function is:

2. The privacy-preserving artificial intelligence reasoning method according to claim 1, characterized in that: The process of building the First Security Index protocol includes: Based on the additive secret sharing input shares, several multiplication factors are calculated locally; Based on several multiplication factors and the secure multiplication protocol of the EzPC open source code library, several secure output results are calculated; Based on the additive secret sharing input shares and the secure computation protocol in the EzPC open source code library, the first secret sharing and the second secret sharing are calculated; Based on a number of secure output results, the first secret sharing, the second secret sharing, and a secure computing protocol in the EzPC open source code library, a first secure computing result is calculated; The first secure calculation result is used as input, and the secure calculation protocol in the EzPC open source code library is called to calculate and obtain the first protocol output result.

3. The privacy-preserving artificial intelligence reasoning method according to claim 2, characterized in that: The plurality of multiplication factors are six multiplication factors, the plurality of secure output results are three secure output results, and the first secret sharing is<msb&wrap> i ,<msb&wrap> i represents the addition secret sharing of two Boolean variables msb and wrap after AND operation, and the second secret sharing is Represents the additive secret sharing of two Boolean variables msb and wrap after the XOR operation.

4. The privacy-preserving artificial intelligence reasoning method according to claim 1, characterized in that: The process of building the Second Security Index protocol includes: Based on the additive secret shared input shares, four multiplication factors are calculated locally; Based on the secure multiplication protocol of four multiplication factors and the EzPC open source code library, two secure output results are calculated; Based on the additive secret sharing input share and the secure computing protocol in the EzPC open source code library, the first output secret share is calculated. The first output secret share is <wrap> i ;< / wrap> Performing secure calculation on the two secure output results and the first output secret share to obtain a second secure calculation result; The second secure calculation result is used as input, and the secure calculation protocol in the EzPC open source code library is called to calculate and obtain the second protocol output result.

5. The privacy-preserving artificial intelligence reasoning method according to claim 1, characterized in that: The process of building a secure sigmoid protocol includes: Based on the additive secret sharing input share, a first additive secret sharing share and a second output secret share are calculated; Taking the first addition secret sharing share and the second output secret sharing share as input, calling the secure computing protocol in the EzPC open source code library, and calculating the third addition secret sharing share; Based on the third added secret shared share, calling the second security index protocol to calculate and obtain a fourth added secret shared share; Based on the fourth added secret sharing share, the second output secret share and the secure computing-friendly sigmoid function, an output result of the protocol is obtained.

6. The privacy-preserving artificial intelligence reasoning method according to claim 5, characterized in that: The first additive secret sharing share is [2x+ε] i , the second output secret share is <msb> i , the third added secret sharing share is The fourth added secret sharing share is < / msb>