The present invention relates to secure computation techniques and, in particular, relates to a technique for performing secure computation of a sigmoid function.
As an existing method for performing secure computation of a sigmoid function, there is a method described in Non-patent Literature 1.
Secure computation is a method for obtaining the computation result of a designated computation without reconstructing the encrypted numerical values (see, for example, Reference Non-patent Literature 1). With the method of Reference Non-patent Literature 1, it is possible to perform encryption by which a plurality of pieces of information, whose numerical values can be reconstructed, are distributed over three secure computation apparatuses and make the three secure computation apparatuses hold the results of addition and subtraction, constant addition, multiplication, constant multiplication, logical operations (a NOT, an AND, an OR, and an XOR), and data format conversion (an integer or a binary) with the results being distributed over these secure computation apparatuses, that is, in an encrypted state, without reconstructing the numerical values. In general, the number of secure computation apparatuses over which the information is distributed is not limited to 3 and can be set at W (W is a predetermined constant greater than or equal to 3), and a protocol that implements secure computation by cooperative computations by W secure computation apparatuses is called a multi-party protocol.
Non-patent Literature 1: Payman Mohassel and Yupeng Zhang, “SecureML: A System for Scalable Privacy-Preserving Machine Learning”, In IEEE Symposium on Security and Privacy (SP) 2017, pp. 19-38, 2017.
However, a sigmoid function is a nonlinear function which is expressed by the following formula (see
σ(x)=1/(1+exp(−x)) (1)
For example, in the method described in Non-patent Literature 1, processing can be performed at a relatively high speed because a function using the fact that ½ can be processed at high speed over a ring of integers and a logic circuit is used; however, the accuracy of approximation is low because a function whose principal purpose is not approximation of a sigmoid function and which gives high priority to processing speed is used.
Therefore, an object of the present invention is to provide a technique for performing secure computation of a sigmoid function with high speed and precision.
An aspect of the present invention is a secret sigmoid function calculation system, in which to and ti are assumed to be real numbers that satisfy t0<t1 and g(x) is assumed to be a secure computable function, which is configured with three or more secret sigmoid function calculation apparatuses and calculates, from a share [[x]] of an input value x, a share [[σ′(x)]] of a value of a sigmoid function for the input value x. The secret sigmoid function calculation system includes: a first comparing means that generates a first comparison result [[c]] by [[c]]=less_than([[x]], t1) from the share [[x]]; a second comparing means that generates a second comparison result [[d]] by [[d]]=greater than([[x]], t0) from the share [[x]]; a first logical computation means that generates a first logical computation result [[e]] by [[e]]=not([[c]]) from the first comparison result [[c]]; a second logical computation means that generates a second logical computation result [[k]] by [[k]]=and([[c]], [[d]]) or [[k]]=mul([[c]], [[d]]) from the first comparison result [[c]] and the second comparison result [[d]]; and a function value calculating means that calculates the share [[σ′(x)]] by [[σ′(x)]]=mul([[k]], [[g(x)]])+[[e]] from the share [[x]], the first logical computation result [[e]], and the second logical computation result [[k]].
According to the present invention, it is possible to perform secure computation of a sigmoid function with high speed and precision.
Hereinafter, embodiments of the present invention will be described in detail. It is to be noted that constituent units having the same function are denoted by the same reference character and overlapping explanations are omitted.
A secret sigmoid function calculation algorithm and a secret logistic regression calculation algorithm, which will be described later, are constructed of a combination of computations on the existing secure computation. Computations required by these algorithms include concealment, addition, multiplication, magnitude comparison, logical operations (a NOT and an AND), and hpsum. Here, hpsum is the sum of products. Hereinafter, each computation will be described.
<Computations>
[Concealment]
Assume that [[x]] is a value (hereinafter referred to as a share of x) obtained by concealing x by secret sharing. Any method can be used as a secret sharing method. For example, Shamir's secret sharing over GF(261−1) or replicated secret sharing over Z2 can be used.
A plurality of secret sharing methods may be combined and used in a certain algorithm. In this case, it is assumed that the secret sharing methods are mutually converted as appropriate.
Moreover, assume that [[x→]]=([[x0]], . . . , [[xn−1]]) for an n-dimensional vector x→=(x0, . . . , xn−1).
It is to be noted that x is referred to as plaintext of [[x]].
As a method for obtaining [[x]] from x (concealment) and a method for obtaining x from [[x]] (reconstruction), specifically, there are methods described in Reference Non-patent Literature 1 and Reference Non-patent Literature 2.
[Addition and Multiplication]
Addition [[x]]+[[y]] by secure computation uses [[x]] and [[y]] as input and outputs [[x+y]]. Multiplication [[x]]×[[y]] (mul([[x]], [[y]])) by secure computation uses [[x]] and [[y]] as input and outputs [[x×y]].
Here, either one of [[x]] and [[y]] may be a value that is not concealed (hereinafter referred to as a public value). For example, a configuration can be adopted in which, on the assumption that β and γ are public values, [[x]] and β are used as input and [[x+β]] is output or γ and [[y]] are used as input and [[γ×y]] is output.
As specific methods of addition and multiplication, there are methods described in Reference Non-patent Literature 3 and Reference Non-patent Literature 4.
[Magnitude Comparison]
Secure computation less_than([[x]], t) (t is a public value) uses [[x]] as input and outputs [[[x<t]]]. Secure computation greater_than([[x]], t) (t is a public value) uses [[x]] as input and outputs [[[x>t]]]. [.] represents a predicate. For example, [x<t] represents a predicate meaning that “x is less than t”; [[[x<t]]]=[[1]] holds if “x is less than t” is true and [[[x<t]]]=[[0]] holds if “x is less than t” is false.
[Logical Operations]
A NOT ¬[[x]] by secure computation uses [[x]] as input and outputs [[¬x]]. An AND and([[x]], [[y]]) by secure computation uses [[x]] and [[y]] as input and outputs [[and(x, y)]].
[hpsum]
Secure computation hpsum(([[x→]], [[y→]]) uses [[x→]] and [[y→]] (where x→=(x0, . . . , xn−1) and y→=(y0, . . . , yn−1)) as input and outputs [[Σj=0n−1xjyj]], that is, outputs the sum of products of j-th elements of two vectors.
<Technical Background>
(Approximate Sigmoid Function)
A sigmoid function σ(x) is a monotonically increasing function as shown in
Therefore, with consideration given to this feature of the sigmoid function σ(x), the sigmoid function σ(x) is approximated using three formulae in accordance with the value of x. That is, a function σ′(x) (hereinafter referred to as an approximate sigmoid function σ′(x)) that approximates the sigmoid function σ(x) is defined by the following formula.
As is clear from the formula (2), σ′(x) is a function that is 1 when x is greater than or equal to a threshold t1, that is 0 when x is less than or equal to a threshold t0, and that approximates σ(x) by a predetermined function g(x) when x is located between the threshold t0 and the threshold t1.
The approximate sigmoid function σ′(x) can be expressed as one formula like the following formula by using the fact that a conditional branch expression “IF γ THEN α ELSE β” can be expressed by a mathematical formula “γα+(1−γ)β”.
σ′(x)=cdg(x)+(¬c) (3)
Here, c=[x<t1] and d=[x>t0]. Thus, c and d are 1 when the formulae in brackets are true and c and d are 0 when the formulae in brackets are false. It is to be noted that the formula (3) can also be expressed as the following formula because and(c, d)=cd.
σ′(x)=and(c, d)g(x)+(¬c) (3)′
For example, the function g(x) that is used to define the approximate sigmoid function σ′(x) can be set as a linear function g(x)=ax+b.
[Algorithm]
The following description deals with an algorithm (a secret sigmoid function calculation algorithm) that performs secure computation of the sigmoid function using the approximate sigmoid function σ′(x). The secret sigmoid function calculation algorithm uses the share [[x]] of x as input, calculates [[σ′(x)]] using the parameters t0 and t1 and the secure computable function g(x), and outputs [[σ′(x)]]. Here, the secure computable function g(x) means a function that allows a share [[g(x)]] of a function value g(x) to be calculated from the share [[x]] of the input value x. A specific procedure which is performed when g(x)=ax+b is shown in
Since the linear function g(x)=ax+b can be calculated by performing one multiplication and one addition, calculation cost is very low. By contrast, for example, when the sigmoid function is approximated using a cubic function as the function g(x), as is clear from the fact that a cubic function is generally expressed as ax3+bx2+cx+d, calculation cost is obviously higher than the calculation cost required when the sigmoid function is approximated using a linear function. Moreover, it is also clear that complicated calculation of the sigmoid function can be composed only of simple computations, such as two magnitude comparisons, one NOT, three multiplications, and two additions (or two magnitude comparisons, one NOT, one AND, two multiplications, and two additions), which are processing necessary to calculate the approximate sigmoid function σ′(x), as a whole.
It is to be noted that, in the following description, the secret sigmoid function calculation algorithm is expressed as Sigmoid. Therefore, Sigmoid([[x]])=[[σ′(x)]] holds.
(Logistic Regression Analysis)
A model f(x→) (where x→=(x1, . . . , xn)) of a logistic regression analysis is expressed by the following formula using an n+1-dimensional vector w→=(w0, . . . , wn) as a model parameter.
Here, (1, x→) represents an n+1-dimensional vector (1, x1, . . . , xn).
As a method for learning the model parameter w→, there is the steepest descent method which is a learning method for searching for a minimum value of a function. In the steepest descent method, learning is performed using the following input and parameters.
(Input) Data xi→ on an explanatory variable and data yi on a response variable (0≤i≤m−1, where in is an integer greater than or equal to 1 and represents the number of pieces of learning data)
(Parameters) A learning rate η (0<η<1) and the number of learning processes T
It is assumed that appropriate values are set as the learning rate η and the number of learning processes T.
wt→=(w0, t, . . . , wn, t) is learned by the following formula as the model parameter obtained as a result of t (0≤t≤T−1) updates.
That is, an update is performed for each j-th element wj of the model parameter w→ using the learning data xi→ and yi. It is assumed that an appropriate value is set as an initial value w0→ of the model parameter w→.
[Algorithm]
The following description deals with an algorithm (a secret logistic regression calculation algorithm) that performs secure computation of a model parameter of a logistic regression model. The secret logistic regression calculation algorithm uses a share [[xi→]] of the data xi→ on the explanatory variable and a share [[yi]] of the data yi on the response variable as input, calculates a share [[w→]] of the model parameter w→ using the parameters η and T which are public values, and outputs the share [[w→]]. A specific procedure is shown in
Using the secret sigmoid function calculation algorithm Sigmoid enhances the precision of calculation of the sigmoid function, which also enhances the precision of calculation of logistic regression. Moreover, as is clear from each step of the secret logistic regression calculation algorithm, a secret is kept in the course of calculation, which makes it possible to perform calculations securely without leaking information at all to the outside.
It is to be noted that, when calculation of the secret logistic regression calculation algorithm is performed using a fixed point (not a floating point) from the viewpoint of processing cost, numerical precision sometimes increases every time a multiplication is performed and exceeds the upper limit of a data type. Since processing including multiplication is repeatedly performed in this algorithm, it is necessary to perform truncate (intentionally decrease numerical precision in the middle of processing) to prevent overflow.
(Application Example)
The approximate sigmoid function σ′(x) which is obtained when a=0.25, b=0.5, t0=−2, and t1=2 is shown in
Moreover, in the logistic regression analysis, a value near x=0 is often used as a threshold at the time of final binary classification; therefore, it is preferable that the accuracy of approximation of the sigmoid function near x=0 is high. Using the approximate sigmoid function σ′(x) makes high the accuracy of approximation near x=0, which enhances the precision of a model parameter which is a final calculation result in the logistic regression analysis.
Hereinafter, a secret sigmoid function calculation system 10 will be described with reference to
As shown in
By cooperative computations which are performed by the W secret sigmoid function calculation apparatuses 100i, the secret sigmoid function calculation system 10 implements the secret sigmoid function calculation algorithm which is a multi-party protocol. Thus, a first comparing means 110 (which is not shown in the drawing) of the secret sigmoid function calculation system 10 is configured with the first comparing units 1101, . . . , 110W, a second comparing means 120 (which is not shown in the drawing) is configured with the second comparing units 1201, . . . , 120W, a first logical computation means 130 (which is not shown in the drawing) is configured with the first logical computation units 1301, . . . , 130W, a second logical computation means 140 (which is not shown in the drawing) is configured with the second logical computation units 1401, . . . , 140W, and a function value calculating means 150 (which is not shown in the drawing) is configured with the function value calculating units 1501, . . . , 150W.
The secret sigmoid function calculation system 10 calculates, from the share [[x]] of the input value x, the share [[σ′(x)]] of the value of the sigmoid function for the input value x (see
The first comparing means 110 generates a first comparison result [[c]] by [[c]]=less than([[x]], t1) from the share [[x]] of the input value x (S110). This corresponds to Step 1 of the secret sigmoid function calculation algorithm of
The second comparing means 120 generates a second comparison result [[d]] by [[d]]=greater_than([[x]], t0) from the share [[x]] of the input value x (S120). This corresponds to Step 2 of the secret sigmoid function calculation algorithm of
The first logical computation means 130 generates a first logical computation result [[e]] by [[e]]=not([[c]]) from the first comparison result [[c]] generated in S110 (S130). This corresponds to Step 3 of the secret sigmoid function calculation algorithm of
The second logical computation means 140 generates a second logical computation result [[k]] by [[k]]=and([[c]], [[d]]) from the first comparison result [[c]] generated in S110 and the second comparison result [[d]] generated in S120 (S140). This corresponds to Step 4 of the secret sigmoid function calculation algorithm of
The function value calculating means 150 calculates the share [[σ′(x)]] of the function value by [[σ′(x)]]=mul([[k]], [[g(x)]])+[[e]] from the share [[x]] of the input value x, the first logical computation result [[e]] generated in S130, and the second logical computation result [[k]] generated in S140 (S150). This corresponds to Step 5 of the secret sigmoid function calculation algorithm of
According to the embodiment of the present invention, it is possible to perform secure computation of the sigmoid function with high speed and precision.
In the embodiment of the present invention, calculation of the sigmoid function, which is a nonlinear function whose secure computation is not easy, is reduced to a combination of simple computations such as concealment, addition, and multiplication. This makes it possible to perform high-speed and high-precision secure computation of the sigmoid function. Moreover, since the value in the middle of calculation is concealed, it is possible to perform secure computation of the sigmoid function securely.
Hereinafter, a secret logistic regression calculation system 20 will be described with reference to
As shown in
By cooperative computations which are performed by the W′ secret logistic regression calculation apparatuses 200i, the secret logistic regression calculation system 20 implements the secret logistic regression calculation algorithm which is a multi-party protocol. Thus, an initializing means 210 (which is not shown in the drawing) of the secret logistic regression calculation system 20 is configured with the initializing units 2101, . . . , 210W′, an error calculating means 220 (which is not shown in the drawing) is configured with the error calculating units 2201, . . . , 220W′, a model parameter updating means 230 (which is not shown in the drawing) is configured with the model parameter updating units 2301, . . . , 230W′, and a convergence condition judging means 240 (which is not shown in the drawing) is configured with the convergence condition judging units 2401, . . . , 240W′.
The secret logistic regression calculation system 20 calculates the share [[w→]] of the model parameter w→ of the logistic regression model from the share [[xi→]] (0≤i≤m−1, where in is an integer greater than or equal to 1) of the data xi→ on the explanatory variable and the share [[yi]] (0≤i≤m−1) of the data yi on the response variable (see
The initializing means 210 sets a share [[w0→]] of the initial value w0→ of the model parameter w→ (S210). Specifically, the initializing means 210 only has to set the share [[w0→]] of the appropriate initial value w0→ recorded on the recording unit 290i in advance. This corresponds to Step 1 of the secret logistic regression calculation algorithm of
For i=0, . . . , m−1, the error calculating means 220 calculates [[bi]] by [[bi]]=hpsum([[wt→]], [[(1, xi→)]]) from a share [[wt→]] of a value wt→ of the model parameter w→ obtained as a result of t updates and the share [[xi→]], calculates [[ci]] by [[ci]]=Sigmoid([[bi]]) from [[bi]], and calculates an error [[di]] by [[di]]=[[ci]]−[[yi]] from the shares [[yi]] and [[ci]] (S220). This corresponds to Steps 5 to 11 of the secret logistic regression calculation algorithm of
For j=0, . . . , n, the model parameter updating means 230 calculates [[e]] by [[e]]=Σi=0m−1[[di]][[xi,j]] from the error [[di]] (0≤i≤m−1) calculated in S220 and a j-th element [[xi, j]] (0≤i≤m−1) of the share [[xi→]] and calculates, from a j-th element [[wj, t]] of the share [[wt→]] and [[e]], a j-th element [[wj, t+1]] of a share [[wt+1→]] of a value wt+1→ of the model parameter w→ obtained as a result of t+1 updates by [[wj, t+1]]=[[wj, t]]−η(1/m)[[e]] (S230). It is assumed that xi,0=1 (i=0, . . . , m−1). This corresponds to Steps 12 to 17 of the secret logistic regression calculation algorithm of
The convergence condition judging means 240 judges whether or not a repetition condition, that is, t<T, for model parameter update, which is set in advance, is satisfied. If the condition is satisfied, the processing from S220 to S230 is repeated; if the repetition condition is not satisfied (when the number of learning processes reaches a predetermined number of learning processes T), a share [[wT−1→]] is output as the share [[w→]] of the model parameter w→ and the processing is ended (S240).
According to the embodiment of the present invention, it is possible to perform secure computation of a model parameter of a logistic regression model with high speed and precision.
<Appendix>
Each apparatus according to the present invention has, as a single hardware entity, for example, an input unit to which a keyboard or the like is connectable, an output unit to which a liquid crystal display or the like is connectable, a communication unit to which a communication device (for example, communication cable) capable of communication with the outside of the hardware entity is connectable, a central processing unit (CPU, which may include cache memory and/or registers), RAM or ROM as memories, an external storage device which is a hard disk, and a bus that connects the input unit, the output unit, the communication unit, the CPU, the RAM, the ROM, and the external storage device so that data can be exchanged between them. The hardware entity may also include, for example, a device (drive) capable of reading and writing a recording medium such as a CD-ROM as desired. A physical entity having such hardware resources may be a general-purpose computer, for example.
The external storage device of the hardware entity has stored therein programs necessary for embodying the aforementioned functions and data necessary in the processing of the programs (in addition to the external storage device, the programs may be prestored in ROM as a storage device exclusively for reading out, for example). Also, data or the like resulting from the processing of these programs are stored in the RAM and the external storage device as appropriate.
In the hardware entity, the programs and data necessary for processing of the programs stored in the external storage device (or ROM and the like) are read into memory as necessary to be interpreted and executed/processed as appropriate by the CPU. As a consequence, the CPU embodies predetermined functions (the components represented above as units, means, or the like).
The present invention is not limited to the above embodiments, but modifications may be made within the scope of the present invention. Also, the processes described in the embodiments may be executed not only in a chronological sequence in accordance with the order of their description but may be executed in parallel or separately according to the processing capability of the apparatus executing the processing or any necessity.
As already mentioned, when the processing functions of the hardware entities described in the embodiments (the apparatuses of the present invention) are to be embodied with a computer, the processing details of the functions to be provided by the hardware entities are described by a program. By the program then being executed on the computer, the processing functions of the hardware entity are embodied on the computer.
The program describing the processing details can be recorded on a computer-readable recording medium. The computer-readable recording medium may be any kind, such as a magnetic recording device, an optical disk, a magneto-optical recording medium, or a semiconductor memory. More specifically, a magnetic recording device may be a hard disk device, flexible disk, or magnetic tape; an optical disk may be a DVD (digital versatile disc), a DVD-RAM (random access memory), a CD-ROM (compact disc read only memory), or a CD-R (recordable)/RW (rewritable); a magneto-optical recording medium may be an MO (magneto-optical disc); and a semiconductor memory may be EEP-ROM (electronically erasable and programmable-read only memory), for example.
Also, the distribution of this program is performed by, for example, selling, transferring, or lending a portable recording medium such as a DVD or a CD-ROM on which the program is recorded. Furthermore, a configuration may be adopted in which this program is distributed by storing the program in a storage device of a server computer and transferring the program to other computers from the server computer via a network.
The computer that executes such a program first, for example, temporarily stores the program recorded on the portable recording medium or the program transferred from the server computer in a storage device thereof. At the time of execution of processing, the computer then reads the program stored in the storage device thereof and executes the processing in accordance with the read program. Also, as another form of execution of this program, the computer may read the program directly from the portable recording medium and execute the processing in accordance with the program and, furthermore, every time the program is transferred to the computer from the server computer, the computer may sequentially execute the processing in accordance with the received program. Also, a configuration may be adopted in which the transfer of a program to the computer from the server computer is not performed and the above-described processing is executed by so-called application service provider (ASP)-type service by which the processing functions are implemented only by an instruction for execution thereof and result acquisition. Note that a program in this form shall encompass information that is used in processing by an electronic computer and acts like a program (such as data that is not a direct command to a computer but has properties prescribing computer processing).
Further, although the hardware entity was described as being configured via execution of a predetermined program on a computer in this form, at least some of these processing details may instead be embodied with hardware.
The foregoing description of the embodiments of the invention has been presented for the purpose of illustration and description. It is not intended to be exhaustive and to limit the invention to the precise form disclosed. Modifications or variations are possible in light of the above teaching. The embodiment was chosen and described to provide the best illustration of the principles of the invention and its practical application, and to enable one of ordinary skill in the art to utilize the invention in various embodiments and with various modifications as are suited to the particular use contemplated. All such modifications and variations are within the scope of the invention as determined by the appended claims when interpreted in accordance with the breadth to which they are fairly, legally, and equitably entitled.
Number | Date | Country | Kind |
---|---|---|---|
2018-189296 | Oct 2018 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/037451 | 9/25/2019 | WO | 00 |