WO2021029034A1 - 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム - Google Patents

秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム Download PDF

Info

Publication number
WO2021029034A1
WO2021029034A1 PCT/JP2019/031941 JP2019031941W WO2021029034A1 WO 2021029034 A1 WO2021029034 A1 WO 2021029034A1 JP 2019031941 W JP2019031941 W JP 2019031941W WO 2021029034 A1 WO2021029034 A1 WO 2021029034A1
Authority
WO
WIPO (PCT)
Prior art keywords
secret
calculates
gradient
value
activation
Prior art date
Application number
PCT/JP2019/031941
Other languages
English (en)
French (fr)
Inventor
気吹 三品
大 五十嵐
浩気 濱田
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to EP19941104.2A priority Critical patent/EP4016507A4/en
Priority to CN201980099184.2A priority patent/CN114207694B/zh
Priority to AU2019461061A priority patent/AU2019461061B2/en
Priority to JP2021539762A priority patent/JP7279796B2/ja
Priority to PCT/JP2019/031941 priority patent/WO2021029034A1/ja
Priority to US17/634,237 priority patent/US20220329408A1/en
Publication of WO2021029034A1 publication Critical patent/WO2021029034A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/04Masking or blinding
    • H04L2209/046Masking or blinding of operations, operands or results of the operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem

Definitions

  • the present invention relates to a technique for calculating the gradient descent method in secret calculation.
  • Gradient descent is a learning algorithm often used in machine learning such as deep learning and logistic regression.
  • SecureML Non-Patent Document 1
  • SecureNN Non-Patent Document 2
  • the most basic gradient descent method is relatively easy to implement, but it is known to have problems such as being easily stuck in a local solution and slow convergence.
  • various optimization methods for gradient descent have been proposed, and it is known that the method called Adam converges quickly.
  • An object of the present invention is to provide a technique capable of performing the calculation of the gradient descent method in secret calculation at high speed while maintaining the accuracy in view of the above technical problems.
  • the secret gradient descent calculation method of the first aspect of the present invention performs at least a gradient G and a parameter W, which is executed by a secret gradient descent calculation system including a plurality of secret calculation devices. It is a secret gradient descent method calculation method that calculates the gradient descent method while keeping it secret.
  • ⁇ 1 , ⁇ 2 , ⁇ , ⁇ are predetermined hyper parameters
  • is the product of each element
  • t is the number of learnings.
  • [G] is the concealed value of the gradient G
  • [W] is the concealed value of the parameter W
  • [M], [M ⁇ ], [V], [V ⁇ ], [G ⁇ ] are the gradient G and the number of elements.
  • Adam uses the secret value [V ⁇ ] of the matrix V ⁇ of the value v ⁇ as an input and outputs the secret value [G ⁇ ] of the matrix G ⁇ of the value g ⁇ as a function to calculate the secret batch mapping of each secret calculator.
  • the parameter update section calculates [M] ⁇ ⁇ 1 [M] + (1- ⁇ 1 ) [G], and the parameter update section calculates [V] ⁇ ⁇ 2 [V] + (1- ⁇ 2 ) [ G] ⁇ [G] is calculated, the parameter update part calculates [M ⁇ ] ⁇ ⁇ ⁇ 1, t [M], and the parameter update part is [V ⁇ ] ⁇ ⁇ ⁇ 2, t [V] Is calculated, the parameter update part calculates [G ⁇ ] ⁇ Adam ([V ⁇ ]), the parameter update part calculates [G ⁇ ] ⁇ [G ⁇ ] ⁇ [M ⁇ ], and the parameter is updated. The part calculates [W] ⁇ [W]-[G ⁇ ].
  • the secret deep learning method of the second aspect of the present invention is executed by a secret deep learning system including a plurality of secret computing devices, and at least the feature amount X of the training data and the correct answer of the training data are executed. It is a secret deep learning method that learns a deep neural network while keeping the data T and the parameter W secret.
  • ⁇ 1 , ⁇ 2 , ⁇ , ⁇ are predetermined hyperparameters
  • is the product of matrices
  • is The product of each element
  • t is the number of trainings
  • [G] is the secret value of the gradient G
  • [W] is the secret value of the parameter W
  • [X] is the secret value of the feature amount X of the training data
  • [ T] is the concealed value of the correct label T of the training data
  • [M], [M ⁇ ], [V], [V ⁇ ], [G ⁇ ], [U], [Y], [Z] are gradients.
  • Adam is a function that calculates the secret batch mapping that takes the secret value [V ⁇ ] of the matrix V ⁇ of the value v ⁇ as input and outputs the secret value [G ⁇ ] of the matrix G ⁇ of the value g ⁇ , and rshift is the arithmetic right shift.
  • m be the number of training data used for one learning, and H'become the following equation.
  • n is the number of hidden layers in the deep neural network
  • Activation is the activation function of the hidden layers
  • Activation2 is the activation function of the output layer of the deep neural network
  • Activation2' is the loss function corresponding to the activation function Activation2.
  • Activation' is the differentiation of the activation function Activation, and the forward propagation part of each secret calculation device calculates [U 1 ] ⁇ [W 0 ] ⁇ [X], and the forward propagation part is [Y 1 ] ⁇ Activation ( [U 1 ]) is calculated, and the forward propagation part calculates [U i + 1 ] ⁇ [W i ] ⁇ [Y i ] for each i of 1 or more and n-1 or less, and the forward propagation part is 1.
  • [Y i + 1 ] ⁇ Activation ([U i + 1 ]) is calculated for each i above n-1 and below, and the forward propagation part is [U n + 1 ] ⁇ [W n ] ⁇ [Y n ] Is calculated, the forward propagation part calculates [Y n + 1 ] ⁇ Activation2 ([U n + 1 ]), and the back propagation part of each secret computing device is [Z n + 1 ] ⁇ Activation2'([ Y n + 1 ], [T]) is calculated, and the back propagation part calculates [Z n ] ⁇ Activation'([U n ]) ⁇ ([Z n + 1 ] ⁇ [W n ]).
  • the backpropagation part calculates [Z ni ] ⁇ Activation'([U ni ]) ⁇ ([Z n-i + 1 ] ⁇ [W ni ]) for each i of 1 or more and n-1 or less, and each secret
  • the gradient calculation unit of the calculation device calculates [G 0 ] ⁇ [Z 1 ] ⁇ [X], and the gradient calculation unit calculates [G i ] ⁇ [Z i + 1 ] for each i of 1 or more and n-1 or less.
  • the gradient calculation unit calculates [G n ] ⁇ [Z n + 1 ] ⁇ [Y n ], and the parameter update unit of each secret calculation device is [G 0 ] ⁇ rshift ([G 0 ], H') is calculated, and the parameter update unit calculates [G i ] ⁇ rshift ([G i ], H') for each i from 1 to n-1 and updates the parameters.
  • the part calculates [G n ] ⁇ rshift ([G n ], H'), and the parameter update part calculates i by the secret gradient descent method calculation method of the first aspect for each i of 0 or more and n or less.
  • the parameters [W i ] between the i layer and the i + 1 layer are learned using the gradient [G i ] between the layers and the i + 1 layer.
  • the calculation of the gradient descent method for secret calculation can be performed at high speed while maintaining the accuracy.
  • FIG. 1 is a diagram illustrating a functional configuration of a secret gradient descent calculation system.
  • FIG. 2 is a diagram illustrating a functional configuration of the secret calculation device.
  • FIG. 3 is a diagram illustrating a processing procedure of the secret gradient descent calculation method.
  • FIG. 4 is a diagram illustrating a processing procedure of the secret gradient descent calculation method.
  • FIG. 5 is a diagram illustrating the functional configuration of the secret deep learning system.
  • FIG. 6 is a diagram illustrating the functional configuration of the secret calculation device.
  • FIG. 7 is a diagram illustrating a processing procedure of the secret deep learning method.
  • FIG. 8 is a diagram illustrating a functional configuration of a computer.
  • x y_z means that y z is a superscript for x
  • x y_z means that y z is a subscript for x
  • [A] represents a encrypted by secret sharing, etc., and is called "share”.
  • the secret batch mapping is a function to calculate the look-up table, and is a technology that can arbitrarily define the domain and range. Since the secret batch mapping is processed in vector units, it has the property of being efficient when performing the same processing for multiple inputs. The specific processing of the secret batch mapping is shown below.
  • the gradient descent optimization method Adam is realized by using the secret batch map while concealing the gradient, the parameter, and the value in the middle of calculation.
  • ⁇ ⁇ 1, t , ⁇ ⁇ 2, t , g ⁇ are defined by the following equations.
  • ⁇ ⁇ 1, t and ⁇ ⁇ 2, t are calculated in advance for each t.
  • the calculation of g ⁇ is realized by using a secret batch map that takes v ⁇ as input and outputs ⁇ / ( ⁇ v ⁇ + ⁇ ).
  • the secret batch map is written as Adam (v ⁇ ).
  • the constants ⁇ 1 , ⁇ 2 , ⁇ , and ⁇ are plaintext. Since the calculation of g ⁇ includes the square root and division, the processing cost in the secret calculation is large. However, by using the secret batch mapping, only one process is required, which is efficient.
  • the secret gradient descent calculation system 100 includes, for example, N ( ⁇ 2) secret calculation devices 1 1 , ..., 1 N, as shown in FIG.
  • the secret computing devices 1 1 , ..., 1 N are connected to the communication network 9, respectively.
  • the communication network 9 is a circuit-switched or packet-switched communication network configured so that each connected device can communicate with each other.
  • the Internet LAN (Local Area Network), WAN (Wide Area Network). Etc. can be used. It should be noted that each device does not necessarily have to be able to communicate online via the communication network 9.
  • the information input to the secret computing device 1 1 , ..., 1 N is stored in a portable recording medium such as a magnetic tape or a USB memory, and the portable recording medium is offline to the secret computing device 1 1 , ..., 1 N. It may be configured to be input with.
  • a portable recording medium such as a magnetic tape or a USB memory
  • the secret calculation device 1 i includes, for example, a parameter storage unit 10, an initialization unit 11, a gradient calculation unit 12, and a parameter update unit 13.
  • the secret computing device 1 i is configured by loading a special program into, for example, a publicly known or dedicated computer having a central processing unit (CPU), a main storage device (RAM: Random Access Memory), and the like. It is a special device.
  • the secret calculation device 1 i executes each process under the control of the central processing unit, for example.
  • the data input to the secret computing device 1i and the data obtained by each process are stored in the main storage device, for example, and the data stored in the main storage device is read out to the central processing unit as needed. It is used for other processing.
  • At least a part of each processing unit of the secret computing device 1i may be configured by hardware such as an integrated circuit.
  • Each storage unit included in the secret computing device 1 i is, for example, a main storage device such as RAM (Random Access Memory), an auxiliary storage device composed of a hard disk, an optical disk, or a semiconductor memory element such as a flash memory. Alternatively, it can be configured with middleware such as a relational database or key value store.
  • a main storage device such as RAM (Random Access Memory)
  • auxiliary storage device composed of a hard disk, an optical disk, or a semiconductor memory element such as a flash memory.
  • middleware such as a relational database or key value store.
  • the parameter storage unit 10 stores predetermined hyperparameters ⁇ 1 , ⁇ 2 , ⁇ , and ⁇ . These hyperparameters may be set to the values described in, for example, Reference 3. Further, the parameter storage unit 10 stores the hyperparameters ⁇ ⁇ 1, t and ⁇ ⁇ 2, t calculated in advance. Further, the parameter storage unit 10 stores a secret batch mapping Adam in which a domain and a range are set in advance.
  • step S11 the initialization unit 11 of each secret calculation device 1i initializes the secret values [M] and [V] of the matrices M and V to 0.
  • the matrices M and V are matrices of the same magnitude as the gradient G.
  • the initialization unit 11 outputs the secret values [M] and [V] of the matrices M and V to the parameter update unit 13.
  • step S12 the gradient calculation unit 12 of each secret calculation device 1 i calculates the secret value [G] of the gradient G.
  • the gradient G may be obtained by a method usually used in the processing of the object to which the gradient descent method is applied (for example, logistic regression, neural network learning, etc.).
  • the gradient calculation unit 11 outputs the secret value [G] of the gradient G to the parameter update unit 13.
  • step S13-1 the parameter update unit 13 of each secret calculation device 1 i uses the hyperparameter ⁇ 1 stored in the parameter storage unit 10 to [M] ⁇ ⁇ 1 [M] + (1- ⁇ . 1 ) Calculate [G] and update the secret value [M] of the parameter M.
  • step S13-2 the parameter update unit 13 of each secret calculation device 1 i uses the hyperparameter ⁇ 2 stored in the parameter storage unit 10 to [V] ⁇ ⁇ 2 [V] + (1- ⁇ . 2 ) [G] ⁇ Calculate [G] and update the secret value [V] of the matrix V.
  • step S13-3 the parameter update unit 13 of each secret calculation device 1 i uses the hyperparameters ⁇ ⁇ 1, t stored in the parameter storage unit 10 to [M ⁇ ] ⁇ ⁇ ⁇ 1, t [ Calculate M] and generate the secret value [M ⁇ ] of the parameter M ⁇ .
  • the matrix M ⁇ is a matrix with the same number of elements as the matrix M (that is, the same number of elements as the gradient G).
  • step S13-4 the parameter update unit 13 of each secret calculation device 1 i uses the hyperparameters ⁇ ⁇ 2, t stored in the parameter storage unit 10 to [V ⁇ ] ⁇ ⁇ ⁇ 2, t [ Calculate V] and generate the secret value [V ⁇ ] of the matrix V ⁇ .
  • the matrix V ⁇ is a matrix with the same number of elements as the matrix V (that is, the same number of elements as the gradient G).
  • step S13-5 the parameter updating unit 13 of the secure computing apparatus 1 i, using the secret bulk mapping Adam, [G ⁇ ] ⁇ Adam ([V ⁇ ]) is calculated and the matrix G ⁇ confidential value [ G ⁇ ] is generated.
  • the matrix G ⁇ is a matrix with the same number of elements as the matrix V ⁇ (that is, the same number of elements as the gradient G).
  • step S13-6 the parameter updating unit 13 of the secure computing apparatus 1 i updates the [G ⁇ ] ⁇ [G ⁇ ] ⁇ [M ⁇ ] is calculated, and the gradient G ⁇ confidential value [G ⁇ ] ..
  • step S13-7 the parameter updating unit 13 of the secure computing apparatus 1 i is, [W] ⁇ [W] - [G ⁇ ] is calculated, and updates the confidential value parameters W [W].
  • Algorithm 1 shows the parameter update algorithm executed by the parameter update unit 13 of the present embodiment from step S13-1 to step S13-7.
  • the V ⁇ input to the secret batch map Adam is always positive.
  • the secret batch map Adam is a function that decreases monotonically, and has a feature that the slope is very large in the part where V ⁇ is close to 0, and Adam (V ⁇ ) gradually approaches 0 as V ⁇ becomes large. Since secret calculation uses fixed-point numbers from the viewpoint of processing cost, it cannot handle very small decimal numbers that can be handled by floating-point numbers. In other words, the range of the output of Adam (V ⁇ ) does not need to be set so large because very small V ⁇ is not input. For example, when each hyperparameter is set as described in Reference 3 and the precision after the decimal point of V ⁇ is set to 20 bits, the maximum value of Adam (V ⁇ ) may be about 1. Also, since the minimum value of Adam (V ⁇ ) can be determined by the required accuracy of Adam (V ⁇ ), the size of the mapping table can be determined by determining the accuracy of the input V ⁇ and output Adam (V ⁇ ). Can be decided.
  • the parameter update unit 13 of this modification executes step S13-11 after step S13-1, executes step S13-12 after step S13-2, and executes step S13-12 in step S13-6. Later, step S13-13 is executed.
  • step S13-11 the parameter update unit 13 of each secret calculation device 1 i shifts the secret value [M] of the matrix M to the right by b ⁇ bit arithmetic. That is, [M] ⁇ rshift ([M], b ⁇ ) is calculated, and the secret value [M] of the matrix M is updated.
  • step S13-12 the parameter update unit 13 of each secret calculation device 1 i shifts the secret value [V] of the matrix V to the right by b ⁇ bit arithmetic. That is, [V] ⁇ rshift ([V], b ⁇ ) is calculated, and the secret value [V] of the matrix V is updated.
  • step S13-13 the parameter update unit 13 of each secret calculation device 1 i shifts the secret value [G ⁇ ] of the matrix G ⁇ to the right by b g ⁇ + b ⁇ ⁇ _1 bit arithmetic. That is, [G ⁇ ] ⁇ rshift ([G ⁇ ], b g ⁇ + b ⁇ ⁇ _1 ) is calculated, and the secret value [G ⁇ ] of the matrix G ⁇ is updated.
  • Algorithm 2 shows the parameter update algorithm executed by the parameter update unit 13 of this modification in steps S13-1 to S13-7 and S13-11 to S13-13.
  • Algorithm 2 Secret calculation using secret batch mapping
  • Adam algorithm input 1 Gradient [G]
  • Input 2 Parameter [W] [M], [V] initialized with input 3: 0
  • Input 4 Hyperparameters ⁇ 1 , ⁇ 2 , ⁇ ⁇ 1, t , ⁇ ⁇ 2, t
  • Input 5 Number of learnings t
  • Output 1 Updated parameter [W]
  • Output 2 Updated [M]
  • the accuracy setting is devised as follows.
  • the precision here indicates the number of bits in the decimal point part.
  • the variable w is set to the precision b w bits
  • the actual value is w ⁇ 2 b_w .
  • the range is different for each variable, it is advisable to determine the accuracy according to each range.
  • w tends to be a small value, and parameters are very important values in machine learning, so it is better to increase the precision of the decimal point part.
  • the hyperparameters ⁇ 1 and ⁇ 2 are set to about 0.9 or 0.999 in Reference 3, there is little need to increase the precision of the decimal point part.
  • the following measures are taken for the right shift.
  • secret calculation it is faster to process with fixed point numbers instead of floating point numbers from the viewpoint of processing cost, but with fixed point numbers, the decimal point position changes with each multiplication, so it is necessary to adjust by right shift. ..
  • right shift is a costly process in secret calculation, it is better to reduce the number of right shifts as much as possible.
  • secret batch map has the property that the range and domain can be set arbitrarily, it is also possible to adjust the number of digits like a right shift. Due to the characteristics of such secret calculation and secret batch mapping, it is more efficient to process as in this modification.
  • Deep learning is performed by the optimization method Adam realized by using the secret batch mapping.
  • deep learning is performed while keeping the learning data, learning label, and parameters secret.
  • Any activation function can be used for the hidden layer and the output layer, and the shape of the neural network model is arbitrary.
  • L the layer number
  • the secret deep learning system 200 includes, for example, N ( ⁇ 2) secret calculation devices 2 1 , ..., 2 N, as shown in FIG.
  • the secret computing devices 2 1 , ..., 2 N are connected to the communication network 9, respectively.
  • the communication network 9 is a circuit-switched or packet-switched communication network configured so that each connected device can communicate with each other.
  • the Internet LAN (Local Area Network), WAN (Wide Area Network). Etc. can be used. It should be noted that each device does not necessarily have to be able to communicate online via the communication network 9.
  • the information input to the secret calculator 2 1 , ..., 2 N is stored in a portable recording medium such as a magnetic tape or a USB memory, and the portable recording medium is offline to the secret calculator 2 1 , ..., 2 N. It may be configured to be input with.
  • the secret calculation device 2 i includes a parameter storage unit 10, an initialization unit 11, a gradient calculation unit 12, and a parameter update unit 13, as in the first embodiment, and stores learning data.
  • a unit 20, a forward propagation calculation unit 21, and a back propagation calculation unit 22 are further provided.
  • the learning data storage unit 20 stores a secret value [X] of the feature amount X of the learning data and a secret value [T] of the correct answer label T of the learning data.
  • the parameter initialization method is selected according to the activation function. For example, when the ReLU function is used as the activation function of the intermediate layer, it is known that good learning results can be easily obtained by using the initialization method described in Reference 4.
  • Algorithm 3 shows Adam's deep learning algorithm using the secret batch mapping executed by the secret deep learning system 200 of this embodiment.
  • processing other than the parameter initialization in step 1 of Algorithm 3 is executed until it converges, such as for the preset number of learning times or the amount of parameter change becomes sufficiently small.
  • the input layer, hidden layer, and output layer are calculated in this order, and in the calculation of back propagation, the output layer, hidden layer, and input layer are calculated in this order, but (3) gradient calculation. And (4) Since parameter update can be processed in parallel for each layer, the efficiency of processing can be improved by processing them collectively.
  • the activation functions of the output layer and the hidden layer may be set as follows.
  • the activation function used in the output layer is selected according to the analysis to be performed.
  • Equal function f (x) x for numerical prediction (regression analysis), sigmoid function 1 / (1 + exp (-x)) for binary classification such as disease diagnosis and spam judgment, image classification, etc.
  • the ReLU function is known to give good learning results even in deep networks and is frequently used in the field of deep learning.
  • the batch size may be set as follows.
  • the batch size m should be set to a value of 2, and the shift amount H'at that time is calculated by the equation (9).
  • the batch size is the number of training data used in one learning.
  • the forward propagation calculation unit 21 of this modification calculates the secret value [Y i + 1 ] of the output of the i + 1 layer for each integer i of 1 or more and n-1 or less, and then sets [Y i + 1 ] to b. Shift right by w bits. That is, [Y i + 1 ] ⁇ rshift ([Y i + 1 ], b w ) is calculated.
  • Backpropagation calculation unit 22 of this modification after calculating the secret value of the error of the n layer [Z n], to b y bit arithmetic right shift [Z n]. That is, to calculate the [Z n] ⁇ rshift ([ Z n], b y).
  • [Z ni ] is shifted to the right by b w bit arithmetic. That is, [Z ni ] ⁇ rshift ([Z ni ], b w ) is calculated.
  • the hidden value [G 0 ] of the gradient between the input layer and the hidden layer of the first layer is arithmetically shifted to the right by the shift amount b x + H', and the hidden layer from the first layer to the n layer is hidden.
  • the secret value of the gradient [G 1 ],..., [G n-1 ] shifts arithmetically to the right with the shift amount b w + b x + H', and the secret value of the gradient between the hidden layer of the n layer and the output layer [G n-1 ] n] is arithmetically right-shifted by the shift amount b x + b y + H ' .
  • the secret value [W]: ([W 0 ], ..., [W n ]) of the parameter of each layer is updated according to the secret gradient descent calculation method of the second embodiment of the first embodiment.
  • Algorithm 4 shows Adam's deep learning algorithm using the secret batch mapping executed by the secret deep learning system 200 of this modified example.
  • deep learning can be performed until the processes other than the parameter initialization in step 1 in Algorithm 4 are converged, or by repeating the set number of learning times.
  • the same device as in the second modification of the first embodiment is adopted.
  • ⁇ Point of invention> the calculation of the gradient descent method Adam, which is not good at secret calculation such as square root and division, is regarded as one function, and the optimization method Adam is processed by one secret batch mapping.
  • This optimization method can be applied to any model, regardless of the form of the machine learning model, as long as it is trained using the gradient descent method. For example, it can be used in various machine learning such as neural network (deep learning), logistic regression, and linear regression.
  • the program that describes this processing content can be recorded on a computer-readable recording medium.
  • the computer-readable recording medium may be, for example, a magnetic recording device, an optical disk, a photomagnetic recording medium, a semiconductor memory, or the like.
  • the distribution of this program is carried out, for example, by selling, transferring, or renting a portable recording medium such as a DVD or CD-ROM on which the program is recorded.
  • the program may be stored in the storage device of the server computer, and the program may be distributed by transferring the program from the server computer to another computer via a network.
  • a computer that executes such a program first stores, for example, a program recorded on a portable recording medium or a program transferred from a server computer in its own storage device. Then, when the process is executed, the computer reads the program stored in its own storage device and executes the process according to the read program. Further, as another execution form of this program, a computer may read the program directly from a portable recording medium and execute processing according to the program, and further, the program is transferred from the server computer to this computer. It is also possible to execute the process according to the received program one by one each time. In addition, the above processing is executed by a so-called ASP (Application Service Provider) type service that realizes the processing function only by the execution instruction and result acquisition without transferring the program from the server computer to this computer. May be.
  • the program in this embodiment includes information used for processing by a computer and equivalent to the program (data that is not a direct command to the computer but has a property of defining the processing of the computer, etc.).
  • the present device is configured by executing a predetermined program on the computer, but at least a part of these processing contents may be realized by hardware.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Complex Calculations (AREA)
  • Storage Device Security (AREA)

Abstract

秘密計算上の勾配降下法の計算を、精度を保ったまま高速に行う。秘密勾配降下法計算方法は勾配とパラメータを秘匿したまま勾配降下法を計算する。初期化部は行列M, Vの秘匿値[M], [V]を初期化する(S11)。勾配計算部は、勾配gの行列Gの秘匿値[G]を求める(S12)。パラメータ更新部は、[M]←β1[M]+(1-β1)[G]を計算し(S13-1)、[V]←β2[V]+(1-β2)[G]○[G]を計算し(S13-2)、[M^]←β^1,t[M]を計算し(S13-3)、[V^]←β^2,t[V]を計算し(S13-4)、[G^]←Adam([V^])を計算し(S13-5)、[G^]←[G^]○[M^]を計算し(S13-6)、[W]←[W]-[G^]を計算する(S13-7)。

Description

秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム
 本発明は、秘密計算において勾配降下法を計算する技術に関する。
 勾配降下法は、ディープラーニングやロジスティック回帰といった機械学習でよく用いられる学習アルゴリズムである。秘密計算上で勾配降下法を用いた機械学習を行うための従来の技術として、SecureML(非特許文献1)やSecureNN(非特許文献2)がある。
 最も基本的な勾配降下法は、実装が比較的容易であるが、局所解にはまりやすい、収束が遅い等の問題点が知られている。これらの問題点を解決するために、勾配降下法に対する様々な最適化手法が提案されており、特にAdamと呼ばれる手法は収束が速いことが知られている。
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. Sameer Wagh, Divya Gupta, and Nishanth Chandran, "SecureNN: 3-Party Secure Computation for Neural Network Training," Proceedings on Privacy Enhancing Technologies, Vol. 1, p. 24, 2019.
 しかしながら、Adamの処理には平方根の計算や除算が含まれているため、秘密計算での処理コストが非常に大きくなってしまう。一方で、単純な勾配降下法で実装されている従来技術では、収束するまでに必要な学習回数が多いため、全体の処理時間は長くなってしまうという課題もある。
 この発明の目的は、上記のような技術的課題に鑑みて、秘密計算上の勾配降下法の計算を、精度を保ったまま高速に行うことができる技術を提供することである。
 上記の課題を解決するために、本発明の第一の態様の秘密勾配降下法計算方法は、複数の秘密計算装置を含む秘密勾配降下法計算システムが実行する、少なくとも勾配GとパラメータWとを秘匿したまま勾配降下法を計算する秘密勾配降下法計算方法であって、β1, β2, η, εは予め定めたハイパーパラメータとし、○は要素ごとの積とし、tは学習回数とし、[G]は勾配Gの秘匿値とし、[W]はパラメータWの秘匿値とし、[M], [M^], [V], [V^], [G^]は勾配Gと要素数が等しい行列M, M^, V, V^, G^の秘匿値とし、β^1,t, β^2,t, g^を次式とし、
Figure JPOXMLDOC01-appb-M000007
Adamは値v^の行列V^の秘匿値[V^]を入力として値g^の行列G^の秘匿値[G^]を出力する秘密一括写像を計算する関数とし、各秘密計算装置のパラメータ更新部が、[M]←β1[M]+(1-β1)[G]を計算し、パラメータ更新部が、[V]←β2[V]+(1-β2)[G]○[G]を計算し、パラメータ更新部が、[M^]←β^1,t[M]を計算し、パラメータ更新部が、[V^]←β^2,t[V]を計算し、パラメータ更新部が、[G^]←Adam([V^])を計算し、パラメータ更新部が、[G^]←[G^]○[M^]を計算し、パラメータ更新部が、[W]←[W]-[G^]を計算する。
 上記の課題を解決するために、本発明の第二の態様の秘密深層学習方法は、複数の秘密計算装置を含む秘密深層学習システムが実行する、少なくとも学習データの特徴量Xと学習データの正解データTとパラメータWとを秘匿したままディープニューラルネットワークを学習する秘密深層学習方法であって、β1, β2, η, εは予め定めたハイパーパラメータとし、・は行列の積とし、○は要素ごとの積とし、tは学習回数とし、[G]は勾配Gの秘匿値とし、[W]はパラメータWの秘匿値とし、[X]は学習データの特徴量Xの秘匿値とし、[T]は学習データの正解ラベルTの秘匿値とし、[M], [M^], [V], [V^], [G^], [U], [Y], [Z]は勾配Gと要素数が等しい行列M, M^, V, V^, G^, U, Y, Zの秘匿値とし、β^1,t, β^2,t, g^を次式とし、
Figure JPOXMLDOC01-appb-M000008
Adamは値v^の行列V^の秘匿値[V^]を入力として値g^の行列G^の秘匿値[G^]を出力する秘密一括写像を計算する関数とし、rshiftは算術右シフトとし、mは1回の学習に用いる学習データの数とし、H'は次式とし、
Figure JPOXMLDOC01-appb-M000009
nはディープニューラルネットワークの隠れ層の数とし、Activationは隠れ層の活性化関数とし、Activation2はディープニューラルネットワークの出力層の活性化関数とし、Activation2'は活性化関数Activation2に対応する損失関数とし、Activation'は活性化関数Activationの微分とし、各秘密計算装置の順伝搬部が、[U1]←[W0]・[X]を計算し、順伝搬部が、[Y1]←Activation([U1])を計算し、順伝搬部が、1以上n-1以下の各iについて[Ui+1]←[Wi]・[Yi]を計算し、順伝搬部が、1以上n-1以下の各iについて[Yi+1]←Activation([Ui+1])を計算し、順伝搬部が、[Un+1]←[Wn]・[Yn]を計算し、順伝搬部が、[Yn+1]←Activation2([Un+1])を計算し、各秘密計算装置の逆伝搬部が、[Zn+1]←Activation2'([Yn+1],[T])を計算し、逆伝搬部が、[Zn]←Activation'([Un])○([Zn+1]・[Wn])を計算し、逆伝搬部が、1以上n-1以下の各iについて[Zn-i]←Activation'([Un-i])○([Zn-i+1]・[Wn-i])を計算し、各秘密計算装置の勾配計算部が、[G0]←[Z1]・[X]を計算し、勾配計算部が、1以上n-1以下の各iについて[Gi]←[Zi+1]・[Yi]を計算し、勾配計算部が、[Gn]←[Zn+1]・[Yn]を計算し、各秘密計算装置のパラメータ更新部が、[G0]←rshift([G0],H')を計算し、パラメータ更新部が、1以上n-1以下の各iについて[Gi]←rshift([Gi],H')を計算し、パラメータ更新部が、[Gn]←rshift([Gn],H')を計算し、パラメータ更新部が、0以上n以下の各iについて、第一の態様の秘密勾配降下法計算方法により、i層とi+1層間の勾配[Gi]を用いてi層とi+1層間のパラメータ[Wi]を学習する。
 この発明によれば、秘密計算上の勾配降下法の計算を、精度を保ったまま高速に行うことができる。
図1は、秘密勾配降下法計算システムの機能構成を例示する図である。 図2は、秘密計算装置の機能構成を例示する図である。 図3は、秘密勾配降下法計算方法の処理手順を例示する図である。 図4は、秘密勾配降下法計算方法の処理手順を例示する図である。 図5は、秘密深層学習システムの機能構成を例示する図である。 図6は、秘密計算装置の機能構成を例示する図である。 図7は、秘密深層学習方法の処理手順を例示する図である。 図8は、コンピュータの機能構成を例示する図である。
 はじめに、この明細書における表記方法および用語の定義について説明する。
 <表記方法>
 文中で使用する記号「」「^」は、本来直前の文字の真上に記載されるべきものであるが、テキスト記法の制限により、当該文字の直後に記載する。数式中においてはこれらの記号は本来の位置、すなわち文字の真上に記述している。例えば、「a」「a^」は数式中では次式で表される。
Figure JPOXMLDOC01-appb-M000010
 添え字中の「_(アンダースコア)」は下付き添字を表す。例えば、xy_zはyzがxに対する上付き添字であり、xy_zはyzがxに対する下付き添字であることを表す。
 ベクトルをa:=(a0, …, an-1)と書く。aをbで定義することをa:=bと書く。同じ要素数の2つのベクトルaとbとの内積をa・bと書く。また、2つの行列の積を(・)と書き、2つの行列やベクトルの要素ごとの積を(○)と書く。演算子が書かれていないものはスカラー倍である。
 [a]は秘密分散等で暗号化されたaを表し、「シェア」と呼ぶ。
 <秘密一括写像>
 秘密一括写像はルックアップテーブルを計算する機能であり、定義域と値域を任意に定めることができる技術である。秘密一括写像ではベクトル単位で処理を行うため、複数の入力に対して同じ処理をする際の効率が良いという性質がある。以下に、秘密一括写像の具体的な処理を示す。
 シェアの列[a]:=([a0], …, [am-1])と、定義域(x0, …, xl-1)および値域(y0, …, yl-1)とを入力とし、各入力値を写像させたシェア、すなわち0≦i<mについてxj≦ai<xj+1かつbi=yjであるようなシェアの列([b0], …, [bm-1])を出力する。秘密一括写像の詳細は参考文献1を参照されたい。
 〔参考文献1〕濱田浩気, 五十嵐大, 千田浩司, “秘匿計算上の一括写像アルゴリズム”, 電子情報通信学会論文誌A, Vol. 96, No. 4, pp. 157-165, 2013.
 <算術右シフト>
 シェアの列[a]:=([a0], …, [am-1])と公開値tとを入力とし、[a]の各要素をtビット算術右シフトした[b]:=([b0], …, [bm-1])を出力する。以下、右シフトはrshiftと表す。算術右シフトは左側を0ではなく符号ビットでパディングするシフトであり、論理右シフトrlshiftを用いて、式(1)~(3)のように、rshift([A×2n], n-m)=[A×2m]を構成する。なお、論理右シフトrlshiftの詳細は参考文献2を参照されたい。
Figure JPOXMLDOC01-appb-M000011
 〔参考文献2〕三品気吹, 五十嵐大, 濱田浩気, 菊池亮, “高精度かつ高効率な秘密ロジスティック回帰の設計と実装”, In CSS, 2018.
 <最適化手法Adam>
 単純な勾配降下法では、計算した勾配gに対してw=w-ηg(ηは学習率)という処理を行ってパラメータwを更新する。一方、Adamでは勾配に対して式(4)~(8)の処理を行ってパラメータを更新する。勾配gを計算するまでの処理は、単純な勾配降下法の場合でも、Adamを適用した場合でも同じ処理である。なお、tは何回目の学習かを表す変数であり、gtはt回目の勾配を表す。また、m, v, m^, v^はgと同じ大きさの行列であり、すべて0で初期化されているものとする。・t(上付き添え字のt)はt乗を表す。
Figure JPOXMLDOC01-appb-M000012
 ここで、β1, β2は1に近い定数であり、ηは学習率であり、εは√v^t+1=0の場合に式(8)が計算できないことを防ぐための値である。Adamの提案論文(参考文献3)では、β1=0.9, β2=0.999, η=0.001, ε=10-8となっている。
 〔参考文献3〕Diederik P Kingma and Jimmy Ba, "Adam: A Method for Stochastic Optimization," arXiv preprint arXiv:1412.6980, 2014.
 Adamでは、単純な勾配降下法と比較して処理が増えるため、1回の学習に必要な処理時間は増える。一方、収束までに必要な学習回数は大幅に減少するため、学習に必要な全体の処理時間は短くなる。
 以下、この発明の実施の形態について詳細に説明する。なお、図面中において同じ機能を有する構成部には同じ番号を付し、重複説明を省略する。
 [第一実施形態]
 第一実施形態では、秘密一括写像を用いて、勾配やパラメータ、計算途中の値を秘匿したまま、勾配降下法の最適化手法Adamを実現する。
 以降の説明では、β^1,t, β^2,t, g^を次式で定義する。
Figure JPOXMLDOC01-appb-M000013
 β^1,tおよびβ^2,tは事前に各tについて計算しておく。g^の計算は、v^を入力とし、η/(√v^+ε)を出力する秘密一括写像を用いて実現する。その秘密一括写像をAdam(v^)と表記する。定数β1, β2,η,εは平文とする。g^の計算には平方根や除算が含まれるため、秘密計算での処理コストが大きい。しかしながら、秘密一括写像を用いることで1回の処理で済むため、効率が良い。
 図1を参照して、第一実施形態の秘密勾配降下法計算システムの構成例を説明する。秘密勾配降下法計算システム100は、例えば、図1に示すように、N(≧2)台の秘密計算装置11, …, 1Nを含む。本実施形態では、秘密計算装置11, …, 1Nはそれぞれ通信網9へ接続される。通信網9は、接続される各装置が相互に通信可能なように構成された回線交換方式もしくはパケット交換方式の通信網であり、例えばインターネットやLAN(Local Area Network)、WAN(Wide Area Network)などを用いることができる。なお、各装置は必ずしも通信網9を介してオンラインで通信可能である必要はない。例えば、秘密計算装置11, …, 1Nへ入力する情報を磁気テープやUSBメモリなどの可搬型記録媒体に記憶し、その可搬型記録媒体から秘密計算装置11, …, 1Nへオフラインで入力するように構成してもよい。
 図2を参照して、第一実施形態の秘密勾配降下法計算システム100に含まれる秘密計算装置1i(i=1, …, N)の構成例を説明する。秘密計算装置1iは、例えば、図2に示すように、パラメータ記憶部10、初期化部11、勾配計算部12、およびパラメータ更新部13を備える。この秘密計算装置1i(i=1, …, N)が他の秘密計算装置1i'(i'=1, …, N、ただしi≠i')と協調しながら後述する各ステップの処理を行うことにより本実施形態の秘密勾配降下法計算方法が実現される。
 秘密計算装置1iは、例えば、中央演算処理装置(CPU: Central Processing Unit)、主記憶装置(RAM: Random Access Memory)などを有する公知又は専用のコンピュータに特別なプログラムが読み込まれて構成された特別な装置である。秘密計算装置1iは、例えば、中央演算処理装置の制御のもとで各処理を実行する。秘密計算装置1iに入力されたデータや各処理で得られたデータは、例えば、主記憶装置に格納され、主記憶装置に格納されたデータは必要に応じて中央演算処理装置へ読み出されて他の処理に利用される。秘密計算装置1iの各処理部は、少なくとも一部が集積回路等のハードウェアによって構成されていてもよい。秘密計算装置1iが備える各記憶部は、例えば、RAM(Random Access Memory)などの主記憶装置、ハードディスクや光ディスクもしくはフラッシュメモリ(Flash Memory)のような半導体メモリ素子により構成される補助記憶装置、またはリレーショナルデータベースやキーバリューストアなどのミドルウェアにより構成することができる。
 図3を参照して、第一実施形態の秘密勾配降下法計算システム100が実行する秘密勾配降下法計算方法の処理手続きを説明する。
 パラメータ記憶部10には、予め定めたハイパーパラメータβ1, β2, η, εが記憶されている。これらのハイパーパラメータは、例えば参考文献3に記載された値に設定すればよい。また、パラメータ記憶部10には、予め計算したハイパーパラメータβ^1,t, β^2,tが記憶されている。さらに、パラメータ記憶部10には、予め定義域と値域が設定された秘密一括写像Adamが記憶されている。
 ステップS11において、各秘密計算装置1iの初期化部11は、行列M, Vの秘匿値[M], [V]を0で初期化する。行列M, Vは勾配Gと同じ大きさの行列である。初期化部11は、行列M, Vの秘匿値[M], [V]をパラメータ更新部13へ出力する。
 ステップS12において、各秘密計算装置1iの勾配計算部12は、勾配Gの秘匿値[G]を計算する。勾配Gは勾配降下法を適用する対象の処理(例えば、ロジスティック回帰やニューラルネットワークの学習等)において通常行われている方法で求めればよい。勾配計算部11は、勾配Gの秘匿値[G]をパラメータ更新部13へ出力する。
 ステップS13-1において、各秘密計算装置1iのパラメータ更新部13は、パラメータ記憶部10に記憶されているハイパーパラメータβ1を用いて、[M]←β1[M]+(1-β1)[G]を計算し、行列Mの秘匿値[M]を更新する。
 ステップS13-2において、各秘密計算装置1iのパラメータ更新部13は、パラメータ記憶部10に記憶されているハイパーパラメータβ2を用いて、[V]←β2[V]+(1-β2)[G]○[G]を計算し、行列Vの秘匿値[V]を更新する。
 ステップS13-3において、各秘密計算装置1iのパラメータ更新部13は、パラメータ記憶部10に記憶されているハイパーパラメータβ^1,tを用いて、[M^]←β^1,t[M]を計算し、行列M^の秘匿値[M^]を生成する。行列M^は行列Mと要素数が同じ(すなわち、勾配Gとも要素数が同じ)行列となる。
 ステップS13-4において、各秘密計算装置1iのパラメータ更新部13は、パラメータ記憶部10に記憶されているハイパーパラメータβ^2,tを用いて、[V^]←β^2,t[V]を計算し、行列V^の秘匿値[V^]を生成する。行列V^は行列Vと要素数が同じ(すなわち、勾配Gとも要素数が同じ)行列となる。
 ステップS13-5において、各秘密計算装置1iのパラメータ更新部13は、秘密一括写像Adamを用いて、[G^]←Adam([V^])を計算し、行列G^の秘匿値[G^]を生成する。行列G^は行列V^と要素数が同じ(すなわち、勾配Gとも要素数が同じ)行列となる。
 ステップS13-6において、各秘密計算装置1iのパラメータ更新部13は、[G^]←[G^]○[M^]を計算し、勾配G^の秘匿値[G^]を更新する。
 ステップS13-7において、各秘密計算装置1iのパラメータ更新部13は、[W]←[W]-[G^]を計算し、パラメータWの秘匿値[W]を更新する。
 本実施形態のパラメータ更新部13がステップS13-1からステップS13-7で実行するパラメータ更新のアルゴリズムをAlgorithm 1に示す。
 Algorithm 1: 秘密一括写像を用いた秘密計算Adamアルゴリズム
入力1: 勾配[G]
入力2: パラメータ[W]
入力3: 0で初期化した[M], [V]
入力4: ハイパーパラメータβ1, β2, β^1,t, β^2,t
入力5: 学習回数t
出力1: 更新したパラメータ[W]
出力2: 更新した[M], [V]
1: [M]←β1[M]+(1-β1)[G]
2: [V]←β2[V]+(1-β2)[G]○[G]
3: [M^]←β^1,t[M]
4: [V^]←β^2,t[V]
5: [G^]←Adam([V^])
6: [G^]←[G^]○[M^]
7: [W]←[W]-[G^]
 [第一実施形態の変形例1]
 変形例1では、第一実施形態で用いた秘密一括写像Adamを構成する際に、定義域と値域からなるテーブルの作成方法を工夫する。
 秘密一括写像Adamに入力されるV^は必ず正である。また、秘密一括写像Adamは単調減少する関数であり、V^が0に近い部分では非常に傾きが大きく、V^が大きくなるとAdam(V^)が緩やかに0に近づく特徴を持っている。秘密計算では処理コストの観点から固定小数点数で処理するため、浮動小数点数で扱えるような非常に小さな小数は扱えない。つまり、非常に小さなV^が入力されることはないため、Adam(V^)の出力の値域はそこまで大きく設定しておく必要はない。例えば、各ハイパーパラメータを参考文献3のとおりに設定し、V^の小数点以下の精度を20ビットにした場合のAdam(V^)の最大値は1程度でよい。また、Adam(V^)の最小値は必要とするAdam(V^)の精度によって決めればよいので、入力V^と出力Adam(V^)の精度を決めることで、写像のテーブルの大きさを決めることができる。
 [第一実施形態の変形例2]
 変形例2では、第一実施形態で、さらに各変数の精度を表1のように設定する。
Figure JPOXMLDOC01-appb-T000014
 本変形例のパラメータ更新部13は、図4に示すように、ステップS13-1の後にステップS13-11を実行し、ステップS13-2の後にステップS13-12を実行し、ステップS13-6の後にステップS13-13を実行する。
 ステップS13-11において、各秘密計算装置1iのパラメータ更新部13は、行列Mの秘匿値[M]をbβビット算術右シフトする。すなわち、[M]←rshift([M],bβ)を計算し、行列Mの秘匿値[M]を更新する。
 ステップS13-12において、各秘密計算装置1iのパラメータ更新部13は、行列Vの秘匿値[V]をbβビット算術右シフトする。すなわち、[V]←rshift([V],bβ)を計算し、行列Vの秘匿値[V]を更新する。
 ステップS13-13において、各秘密計算装置1iのパラメータ更新部13は、行列G^の秘匿値[G^]をbg^+bβ^_1ビット算術右シフトする。すなわち、[G^]←rshift([G^],bg^+bβ^_1)を計算し、行列G^の秘匿値[G^]を更新する。
 本変形例のパラメータ更新部13がステップS13-1~S13-7およびS13-11~S13-13で実行するパラメータ更新のアルゴリズムをAlgorithm 2に示す。
 Algorithm 2: 秘密一括写像を用いた秘密計算Adamアルゴリズム
入力1: 勾配[G]
入力2: パラメータ[W]
入力3: 0で初期化した[M], [V]
入力4: ハイパーパラメータβ1, β2, β^1,t, β^2,t
入力5: 学習回数t
出力1: 更新したパラメータ[W]
出力2: 更新した[M], [V]
1: [M]←β1[M]+(1-β1)[G]      (精度:bw+bβ
2: [M]←rshift([M],bβ)       (精度:bw
3: [V]←β2[V]+(1-β2)[G]○[G]   (精度:2bw+bβ
4: [V]←rshift([V],bβ)       (精度:2bw
5: [M^]←β^1,t[M]         (精度:bw+bβ^_1
6: [V^]←β^2,t[V]         (精度:2bw+bβ^_2
7: [G^]←Adam([V^])        (精度:bg^
8: [G^]←[G^]○[M^]        (精度:bg^+bw+bβ^_1
9: [G^]←rshift([G^],bg^+bβ^_1)   (精度:bw
10: [W]←[W]-[G^]         (精度:bw
 本変形例では、精度の設定を以下のように工夫している。ここでの精度とは小数点部分のビット数を示し、例えば変数wを精度bwビットに設定した場合、実際の値はw×2b_wとなっている。また、変数ごとに値域が異なるため、それぞれの値域に応じて精度を決めるとよい。例えば、wは小さな値になりやすく、また機械学習においてパラメータは非常に重要な値であるため、小数点部分の精度を大きくしておく方がよい。一方でハイパーパラメータβ1, β2などは参考文献3で0.9や0.999程度に設定されていることから、小数点部分の精度を大きくする必要性が低い。このような工夫をすることで、できるだけ全体のビット数を抑え、処理コストの大きい秘密計算でも効率よく計算することができる。
 本変形例では、右シフトに対して以下のような工夫をしている。秘密計算では、処理コストの観点から浮動小数点数ではなく固定小数点数で処理した方が高速になるが、固定小数点数では乗算の度に小数点位置が変化するため、右シフトによって調節する必要がある。しかしながら、秘密計算において右シフトはコストの大きい処理であるため、なるべく右シフトを行う回数は減らした方がよい。また、秘密一括写像は値域と定義域を任意に設定できる性質を持っているため、右シフトのように桁数を調節することも可能である。このような秘密計算や秘密一括写像の特徴から、本変形例のように処理するとより効率がよい。
 [第二実施形態]
 第二実施形態では、秘密一括写像を用いて実現した最適化手法Adamによってディープラーニングを行う。この例では、学習データ、学習ラベル、パラメータを秘匿したままディープラーニングを行う。隠れ層および出力層で用いる活性化関数は何を用いてもよく、ニューラルネットワークのモデルの形も任意である。ここでは、隠れ層の数がn層のディープニューラルネットワークを学習するものとする。すなわち、Lを層の番号として、入力層はL=0であり、出力層はL=n+1となる。第二実施形態によれば、単純な勾配降下法を用いた従来技術と比較して、少ない学習回数であっても良い学習結果を得られる。
 図5を参照して、第二実施形態の秘密深層学習システムの構成例を説明する。秘密深層学習システム200は、例えば、図5に示すように、N(≧2)台の秘密計算装置21, …, 2Nを含む。本実施形態では、秘密計算装置21, …, 2Nはそれぞれ通信網9へ接続される。通信網9は、接続される各装置が相互に通信可能なように構成された回線交換方式もしくはパケット交換方式の通信網であり、例えばインターネットやLAN(Local Area Network)、WAN(Wide Area Network)などを用いることができる。なお、各装置は必ずしも通信網9を介してオンラインで通信可能である必要はない。例えば、秘密計算装置21, …, 2Nへ入力する情報を磁気テープやUSBメモリなどの可搬型記録媒体に記憶し、その可搬型記録媒体から秘密計算装置21, …, 2Nへオフラインで入力するように構成してもよい。
 図6を参照して、第二実施形態の秘密深層学習システム200に含まれる秘密計算装置2i(i=1, …, N)の構成例を説明する。秘密計算装置2iは、例えば、図6に示すように、第一実施形態と同様に、パラメータ記憶部10、初期化部11、勾配計算部12、およびパラメータ更新部13を備え、学習データ記憶部20、順伝搬計算部21、および逆伝搬計算部22をさらに備える。この秘密計算装置2i(i=1, …, N)が他の秘密計算装置2i'(i'=1, …, N、ただしi≠i')と協調しながら後述する各ステップの処理を行うことにより本実施形態の秘密深層学習方法が実現される。
 図7を参照して、第二実施形態の秘密深層学習システム200が実行する秘密深層学習方法の処理手続きを説明する。
 学習データ記憶部20には、学習データの特徴量Xの秘匿値[X]および学習データの正解ラベルTの秘匿値[T]が記憶されている。
 ステップS11において、各秘密計算装置2iの初期化部11は、パラメータWの秘匿値[W]:=([W0], …, [Wn])を初期化する。パラメータの初期化方法は活性化関数などに合わせて選択する。例えば、中間層の活性化関数にReLU関数を用いる場合は、参考文献4に記載された初期化方法を用いると良い学習結果を得やすいことが知られている。
 〔参考文献4〕Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun, "Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification," In Proceedings of the IEEE international conference on computer vision, pp. 1026-1034, 2015.
 ステップS21において、各秘密計算装置2iの順伝搬計算部21は、学習データの特徴量の秘匿値[X]を用いて、順伝搬を計算し、各層の出力の秘匿値[Y]:=([Y1], …, [Yn+1])を求める。具体的には、[U1]←[W0]・[X], [Y1]←Activation([U1])を計算し、1以上n-1以下の各整数iについて[Ui+1]←[Wi]・[Yi], [Yi+1]←Activation([Ui+1])を計算し、[Un+1]←[Wn]・[Yn], [Yn+1]←Activation2([Un+1])を計算する。ここで、Activationは任意の隠れ層の活性化関数を表し、Activation2は任意の出力層の活性化関数を表す。
 ステップS22において、各秘密計算装置2iの逆伝搬計算部22は、学習データの正解ラベルの秘匿値[T]を用いて、逆伝搬を計算し、各層の誤差の秘匿値[Z]:=([Z1], …, [Zn+1])を求める。具体的には、[Zn+1]←Activation2'([Yn+1],[T]), [Zn]←Activation'([Un])○([Zn+1]・[Wn])を計算し、1以上n-1以下の各整数iについて[Zn-i]←Activation'([Un-i])○([Zn-i+1]・[Wn-i])を計算する。ここで、Activation'は活性化関数Activationの微分を表し、Activation2'は活性化関数Activation2に対応する損失関数を表す。
 ステップS12において、各秘密計算装置2iの勾配計算部12は、学習データの特徴量の秘匿値[X]と各層の誤差の秘匿値[Z]と各層の出力の秘匿値[Y]を用いて、各層の勾配の秘匿値[G]:=([G0], …, [Gn])を計算する。具体的には、[G0]←[Z1]・[X]を計算し、1以上n-1以下の各整数iについて[Gi]←[Zi+1]・[Yi]を計算し、[Gn]←[Zn+1]・[Yn]を計算する。
 ステップS13において、各秘密計算装置2iのパラメータ更新部13は、各層の勾配の秘匿値[G]をシフト量H'で右シフトした後、第一実施形態の秘密勾配降下法計算方法に従って、各層のパラメータの秘匿値[W]:=([W0], …, [Wn])を更新する。具体的には、まず、[G0]←rshift([G0],H')を計算し、1以上n-1以下の各整数iについて[Gi]←rshift([Gi],H')を計算し、[Gn]←rshift([Gn],H')を計算する。続いて、0以上n以下の各整数iについて[Mi]←β1[Mi]+(1-β1)[Gi], [Vi]←β2[Vi]+(1-β2)[Gi]○[Gi], [M^i]←β^1,t[Mi], [V^i]←β^2,t[Vi], [G^i]←Adam([V^i]), [G^i]←[G^i]○[M^i], [Wi]←[Wi]-[G^i]を計算する。
 本実施形態の秘密深層学習システム200が実行する秘密一括写像を用いたAdamによるディープラーニングのアルゴリズムをAlgorithm 3に示す。
 Algorithm 3: 秘密一括写像を用いたAdamによるディープラーニングアルゴリズム
入力1: 学習データの特徴量[X]
入力2: 学習データの正解ラベル[T]
入力3: l層とl+1層間のパラメータ[Wl]
出力: 更新したパラメータ[Wl]
 1: すべての[W]を初期化
 2: (1)順伝搬の計算
 3: [U1]←[W0]・[X]
 4: [Y1]←Activation([U1])
 5: for i=1 to n-1 do
 6:   [Ui+1]←[Wi]・[Yi]
 7:   [Yi+1]←Activation([Ui+1])
 8: end for
 9: [Un+1]←[Wn]・[Yn]
10: [Yn+1]←Activation2([Un+1])
11: (2)逆伝搬の計算
12: [Zn+1]←Activation2'([Yn+1],[T])
13: [Zn]←Activation'([Un])○([Zn+1]・[Wn])
14: for i=1 to n-1 do
15:   [Zn-i]←Activation'([Un-i])○([Zn-i+1]・[Wn-i])
16: end for
17: (3)勾配の計算
18: [G0]←[Z1]・[X]
19: for i=1 to n-1 do
20:   [Gi]←[Zi+1]・[Yi]
21: end for
22: [Gn]←[Zn+1]・[Yn]
23: (4)パラメータの更新
24: [G0]←rshift([G0],H')
25: for i=1 to n-1 do
26:   [Gi]←rshift([Gi],H')
27: end for
28: [Gn]←rshift([Gn],H')
29: for i=0 to n do
30:   [Mi]←β1[Mi]+(1-β1)[Gi]
31:   [Vi]←β2[Vi]+(1-β2)[Gi]○[Gi]
32:   [M^i]←β^1,t[Mi]
33:   [V^i]←β^2,t[Vi]
34:   [G^i]←Adam([V^i])
35:   [G^i]←[G^i]○[M^i]
36:   [Wi]←[Wi]-[G^i]
37: end for
 実際のディープラーニングではAlgorithm 3の手順1のパラメータの初期化以外の処理を、予め設定した学習回数分もしくはパラメータの変化量が十分に小さくなる等、収束するまで実行する。
 (1)順伝播の計算では入力層、隠れ層、出力層の順に計算し、(2)逆伝播の計算では出力層、隠れ層、入力層の順に計算していくが、(3)勾配計算と(4)パラメータ更新は各層ごとに並列でも処理できるため、まとめて処理することによって処理の効率を上げることができる。
 本実施形態では、出力層と隠れ層の活性化関数は以下のように設定すればよい。出力層で用いる活性化関数は行いたい分析に応じて選択する。数値予測(回帰分析)であれば恒等関数f(x)=x、病気の診断やスパム判定といった2値の分類であればシグモイド関数1/(1+exp(-x))、画像分類などの3値以上の分類問題であればソフトマックス関数softmax(ui)=exp(ui)/Σj=1 kexp(uj)などが用いられる。隠れ層で用いる活性化関数は、非線形な関数が選ばれ、近年はReLU関数ReLU(u)=max(0, u)が頻繁に用いられる。ReLU関数は、深いネットワークであっても良い学習結果を得られることが知られており、ディープラーニングの分野で頻繁に使われている。
 本実施形態では、バッチサイズを以下のように設定すればよい。勾配を計算する際、バッチサイズmでの除算をrshiftで処理すると効率が良い。そのため、バッチサイズmは2べきの値にしておくのがよく、その際のシフト量H'は式(9)で求める。バッチサイズとは1回の学習で使う学習データの件数である。
Figure JPOXMLDOC01-appb-M000015
 [第二実施形態の変形例1]
 第二実施形態のディープラーニングで、学習に用いる各値の精度を表2のように設定する。wは各層の間のパラメータ、xは学習データ、tは各学習データに対応する正解データ(教師データ)である。隠れ層の活性化関数の出力は、正解データの精度と同じになるように処理する。また、g^は秘密一括写像Adamの計算によって得られる値である。
Figure JPOXMLDOC01-appb-T000016
 本変形例の順伝搬計算部21は、1以上n-1以下の各整数iについてi+1層の出力の秘匿値[Yi+1]を計算した後、[Yi+1]をbwビットだけ右シフトする。すなわち、[Yi+1]←rshift([Yi+1],bw)を計算する。
 本変形例の逆伝搬計算部22は、n層の誤差の秘匿値[Zn]を計算した後、[Zn]をbyビット算術右シフトする。すなわち、[Zn]←rshift([Zn],by)を計算する。また、1以上n-1以下の各整数iについてn-i層の誤差の秘匿値[Zn-i]を計算した後、[Zn-i]をbwビット算術右シフトする。すなわち、[Zn-i]←rshift([Zn-i],bw)を計算する。
 本変形例のパラメータ更新部13は、入力層と1層の隠れ層間の勾配の秘匿値[G0]はシフト量bx+H'で算術右シフトし、1層からn層までの隠れ層間の勾配の秘匿値[G1], …, [Gn-1]はシフト量bw+bx+H'で算術右シフトし、n層の隠れ層と出力層間の勾配の秘匿値[Gn]はシフト量bx+by+H'で算術右シフトする。また、各層のパラメータの秘匿値[W]:=([W0], …, [Wn])は、第一実施形態の変形例2の秘密勾配降下法計算方法に従って更新する。
 本変形例の秘密深層学習システム200が実行する秘密一括写像を用いたAdamによるディープラーニングのアルゴリズムをAlgorithm 4に示す。
 Algorithm 4: 秘密一括写像を用いたAdamによるディープラーニングアルゴリズム
入力1: 学習データの特徴量[X]
入力2: 学習データの正解ラベル[T]
入力3: l層とl+1層間のパラメータ[Wl]
出力: 更新したパラメータ[Wl]
 1: すべての[W]を初期化             (精度:bw
 2: (1)順伝搬の計算
 3: [U1]←[W0]・[X]                (精度:bw+bx
 4: [Y1]←ReLU([U1])               (精度:bw+bx
 5: for i=1 to n-1 do
 6:   [Ui+1]←[Wi]・[Yi]              (精度:2bw+bx
 7:   [Yi+1]←ReLU([Ui+1])             (精度:2bw+bx
 8:   [Yi+1]←rshift([Yi+1],bw)          (精度:bw+bx
 9: end for
10: [Un+1]←[Wn]・[Yn]              (精度:2bw+bx
11: [Yn+1]←softmax([Un+1])            (精度:by
12: (2)逆伝搬の計算
13: [Zn+1]←[Yn+1]-[T]              (精度:by
14: [Zn]←ReLU'([Un])○([Zn+1]・[Wn])       (精度:bw+by
15: [Zn]←rshift([Zn],by)            (精度:bw
16: for i=1 to n-1 do
17:   [Zn-i]←ReLU'([Un-i])○([Zn-i+1]・[Wn-i])    (精度:2bw
18:   [Zn-i]←rshift([Zn-i],bw)          (精度:bw
19: end for
20: (3)勾配の計算
21: [G0]←[Z1]・[X]               (精度:bw+bx
22: for i=1 to n-1 do
23:   [Gi]←[Zi+1]・[Yi]             (精度:2bw+bx
24: end for
25: [Gn]←[Zn+1]・[Yn]              (精度:bw+bx+by
26: (4)パラメータの更新
27: [G0]←rshift([G0],bx+H')           (精度:bw
28: for i=1 to n-1 do
29:   [Gi]←rshift([Gi],bw+bx+H')        (精度:bw
30: end for
31: [Gn]←rshift([Gn],bx+by+H')         (精度:bw
32: for i=0 to n do
33:   [Mi]←β1[Mi]+(1-β1)[Gi]         (精度:bw+bβ
34:   [Mi]←rshift([Mi],bβ)           (精度:bw
35:   [Vi]←β2[Vi]+(1-β2)[Gi]○[Gi]       (精度:2bw+bβ
36:   [Vi]←rshift([Vi],bβ)           (精度:2bw
37:   [M^i]←β^1,t[Mi]             (精度:bw+bβ^_1
38:   [V^i]←β^2,t[Vi]             (精度:2bw+bβ^_2
39:   [G^i]←Adam([V^i])            (精度:bg^
40:   [G^i]←[G^i]○[M^i]            (精度:bg^+bw+bβ^_1
41:   [G^i]←rshift([G^i],bg^+bβ^_1)       (精度:bw
42:   [Wi]←[Wi]-[G^i]             (精度:bw
43: end for
 第二実施形態と同様に、Algorithm 4中の手順1のパラメータ初期化以外の処理を収束するまで、もしくは設定した学習回数分繰り返すことでディープラーニングができる。精度の設定や右シフトを行う箇所については、第一実施形態の変形例2と同様の工夫を取り入れている。
 (1)順伝搬の計算では、特徴量Xの精度bxがあまり大きくない場合(例えば画像データの画素値であれば8ビットで十分である)、bw+bxはビット数にゆとりがあるため右シフトを省略している。また、(4)パラメータ更新の計算では学習率とバッチサイズでの除算をH'ビットでの算術右シフトで近似し、さらにそれを精度調節のための算術右シフトと同時に行うことで効率化している。
 <発明のポイント>
 本発明では、勾配降下法の最適化手法Adamに含まれる平方根や除算といった秘密計算が苦手とする計算をまとめて1つの関数とみなすことで、1回の秘密一括写像で最適化手法Adamの処理を効率的に行えるようにした。これによって、秘密計算上で機械学習を行う従来技術よりも少ない回数での学習が可能になり、全体の処理時間を短く抑えることができる。この最適化手法は機械学習モデルの形は問わず、勾配降下法を用いて学習する場合であればどのようなモデルにも適用できる。例えば、ニューラルネットワーク(ディープラーニング)やロジスティック回帰、線形回帰といった様々な機械学習で用いることができる。
 このように、本発明によれば、勾配降下法の最適化手法Adamを秘密計算上で実現したことにより、秘密計算でも少ない学習回数で高い予測性能を持つ機械学習モデルの学習が可能となる。
 以上、この発明の実施の形態について説明したが、具体的な構成は、これらの実施の形態に限られるものではなく、この発明の趣旨を逸脱しない範囲で適宜設計の変更等があっても、この発明に含まれることはいうまでもない。実施の形態において説明した各種の処理は、記載の順に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。
 [プログラム、記録媒体]
 上記実施形態で説明した各装置における各種の処理機能をコンピュータによって実現する場合、各装置が有すべき機能の処理内容はプログラムによって記述される。そして、このプログラムを図8に示すコンピュータの記憶部1020に読み込ませ、制御部1010、入力部1030、出力部1040などに動作させることにより、上記各装置における各種の処理機能がコンピュータ上で実現される。
 この処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、例えば、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリ等どのようなものでもよい。
 また、このプログラムの流通は、例えば、そのプログラムを記録したDVD、CD-ROM等の可搬型記録媒体を販売、譲渡、貸与等することによって行う。さらに、このプログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することにより、このプログラムを流通させる構成としてもよい。
 このようなプログラムを実行するコンピュータは、例えば、まず、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、一旦、自己の記憶装置に格納する。そして、処理の実行時、このコンピュータは、自己の記憶装置に格納されたプログラムを読み取り、読み取ったプログラムに従った処理を実行する。また、このプログラムの別の実行形態として、コンピュータが可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することとしてもよく、さらに、このコンピュータにサーバコンピュータからプログラムが転送されるたびに、逐次、受け取ったプログラムに従った処理を実行することとしてもよい。また、サーバコンピュータから、このコンピュータへのプログラムの転送は行わず、その実行指示と結果取得のみによって処理機能を実現する、いわゆるASP(Application Service Provider)型のサービスによって、上述の処理を実行する構成としてもよい。なお、本形態におけるプログラムには、電子計算機による処理の用に供する情報であってプログラムに準ずるもの(コンピュータに対する直接の指令ではないがコンピュータの処理を規定する性質を有するデータ等)を含むものとする。
 また、この形態では、コンピュータ上で所定のプログラムを実行させることにより、本装置を構成することとしたが、これらの処理内容の少なくとも一部をハードウェア的に実現することとしてもよい。

Claims (8)

  1.  複数の秘密計算装置を含む秘密勾配降下法計算システムが実行する、少なくとも勾配GとパラメータWとを秘匿したまま勾配降下法を計算する秘密勾配降下法計算方法であって、
     β1, β2, η, εは予め定めたハイパーパラメータとし、○は要素ごとの積とし、tは学習回数とし、[G]は上記勾配Gの秘匿値とし、[W]は上記パラメータWの秘匿値とし、[M], [M^], [V], [V^], [G^]は上記勾配Gと要素数が等しい行列M, M^, V, V^, G^の秘匿値とし、β^1,t, β^2,t, g^を次式とし、
    Figure JPOXMLDOC01-appb-M000001

    Adamは値v^の行列V^の秘匿値[V^]を入力として値g^の行列G^の秘匿値[G^]を出力する秘密一括写像を計算する関数とし、
     各秘密計算装置のパラメータ更新部が、[M]←β1[M]+(1-β1)[G]を計算し、
     上記パラメータ更新部が、[V]←β2[V]+(1-β2)[G]○[G]を計算し、
     上記パラメータ更新部が、[M^]←β^1,t[M]を計算し、
     上記パラメータ更新部が、[V^]←β^2,t[V]を計算し、
     上記パラメータ更新部が、[G^]←Adam([V^])を計算し、
     上記パラメータ更新部が、[G^]←[G^]○[M^]を計算し、
     上記パラメータ更新部が、[W]←[W]-[G^]を計算する、
     秘密勾配降下法計算方法。
  2.  請求項1に記載の秘密勾配降下法計算方法であって、
     rshiftは算術右シフトとし、bβはβ1およびβ2の精度とし、bβ^_1はβ^1,tの精度とし、bg^はg^の精度とし、
     上記パラメータ更新部が、[M]←β1[M]+(1-β1)[G]を計算した後に、[M]←rshift([M],bβ)を計算し、
     上記パラメータ更新部が、[V]←β2[V]+(1-β2)[G]○[G]を計算した後に、[V]←rshift([V],bβ)を計算し、
     上記パラメータ更新部が、[G^]←[G^]○[M^]を計算した後に、[G^]←rshift([G^],bg^+bβ^_1)を計算する、
     秘密勾配降下法計算方法。
  3.  複数の秘密計算装置を含む秘密深層学習システムが実行する、少なくとも学習データの特徴量Xと学習データの正解データTとパラメータWとを秘匿したままディープニューラルネットワークを学習する秘密深層学習方法であって、
     β1, β2, η, εは予め定めたハイパーパラメータとし、・は行列の積とし、○は要素ごとの積とし、tは学習回数とし、[G]は勾配Gの秘匿値とし、[W]は上記パラメータWの秘匿値とし、[X]は上記学習データの特徴量Xの秘匿値とし、[T]は上記学習データの正解ラベルTの秘匿値とし、[M], [M^], [V], [V^], [G^], [U], [Y], [Z]は上記勾配Gと要素数が等しい行列M, M^, V, V^, G^, U, Y, Zの秘匿値とし、β^1,t, β^2,t, g^を次式とし、
    Figure JPOXMLDOC01-appb-M000002

    Adamは値v^の行列V^の秘匿値[V^]を入力として値g^の行列G^の秘匿値[G^]を出力する秘密一括写像を計算する関数とし、rshiftは算術右シフトとし、mは1回の学習に用いる学習データの数とし、H'は次式とし、
    Figure JPOXMLDOC01-appb-M000003

    nは上記ディープニューラルネットワークの隠れ層の数とし、Activationは上記隠れ層の活性化関数とし、Activation2は上記ディープニューラルネットワークの出力層の活性化関数とし、Activation2'は上記活性化関数Activation2に対応する損失関数とし、Activation'は上記活性化関数Activationの微分とし、
     各秘密計算装置の順伝搬部が、[U1]←[W0]・[X]を計算し、
     上記順伝搬部が、[Y1]←Activation([U1])を計算し、
     上記順伝搬部が、1以上n-1以下の各iについて[Ui+1]←[Wi]・[Yi]を計算し、
     上記順伝搬部が、1以上n-1以下の各iについて[Yi+1]←Activation([Ui+1])を計算し、
     上記順伝搬部が、[Un+1]←[Wn]・[Yn]を計算し、
     上記順伝搬部が、[Yn+1]←Activation2([Un+1])を計算し、
     各秘密計算装置の逆伝搬部が、[Zn+1]←Activation2'([Yn+1],[T])を計算し、
     上記逆伝搬部が、[Zn]←Activation'([Un])○([Zn+1]・[Wn])を計算し、
     上記逆伝搬部が、1以上n-1以下の各iについて[Zn-i]←Activation'([Un-i])○([Zn-i+1]・[Wn-i])を計算し、
     各秘密計算装置の勾配計算部が、[G0]←[Z1]・[X]を計算し、
     上記勾配計算部が、1以上n-1以下の各iについて[Gi]←[Zi+1]・[Yi]を計算し、
     上記勾配計算部が、[Gn]←[Zn+1]・[Yn]を計算し、
     各秘密計算装置のパラメータ更新部が、[G0]←rshift([G0],H')を計算し、
     上記パラメータ更新部が、1以上n-1以下の各iについて[Gi]←rshift([Gi],H')を計算し、
     上記パラメータ更新部が、[Gn]←rshift([Gn],H')を計算し、
     上記パラメータ更新部が、0以上n以下の各iについて、請求項1に記載の秘密勾配降下法計算方法により、i層とi+1層間の勾配[Gi]を用いてi層とi+1層間のパラメータ[Wi]を学習する、
     秘密深層学習方法。
  4.  請求項3に記載の秘密深層学習方法であって、
     bwはwの精度とし、byはYの要素の精度とし、bβはβ1およびβ2の精度とし、bβ^_1はβ^1,tの精度とし、bg^はg^の精度とし、
     上記順伝搬計算部が、[Yi+1]←Activation([Ui+1])を計算した後に、[Yi+1]←rshift([Yi+1],bw)を計算し、
     上記逆伝搬計算部が、[Zn]←Activation'([Un])○([Zn+1]・[Wn])を計算した後に、[Zn]←rshift([Zn],by)を計算し、
     各上記逆伝搬計算部が、[Zn-i]←Activation'([Un-i])○([Zn-i+1]・[Wn-i])を計算した後に、[Zn-i]←rshift([Zn-i],bw)を計算し、
     上記パラメータ更新部が、0以上n以下の各iについて、請求項2に記載の秘密勾配降下法計算方法により、i層とi+1層間の勾配[Gi]を用いてi層とi+1層間のパラメータ[Wi]を学習する、
     秘密深層学習方法。
  5.  複数の秘密計算装置を含み、少なくとも勾配GとパラメータWとを秘匿したまま勾配降下法を計算する秘密勾配降下法計算システムであって、
     β1, β2, η, εは予め定めたハイパーパラメータとし、○は要素ごとの積とし、tは学習回数とし、[G]は上記勾配Gの秘匿値とし、[W]は上記パラメータWの秘匿値とし、[M], [M^], [V], [V^], [G^]は上記勾配Gと要素数が等しい行列M, M^, V, V^, G^の秘匿値とし、β^1,t, β^2,t, g^を次式とし、
    Figure JPOXMLDOC01-appb-M000004

    Adamは値v^の行列V^の秘匿値[V^]を入力として値g^の行列G^の秘匿値[G^]を出力する秘密一括写像を計算する関数とし、
     各秘密計算装置は、
     [M]←β1[M]+(1-β1)[G]と、[V]←β2[V]+(1-β2)[G]○[G]と、[M^]←β^1,t[M]と、[V^]←β^2,t[V]と、[G^]←Adam([V^])と、[G^]←[G^]○[M^]と、[W]←[W]-[G^]とを計算するパラメータ更新部を含む、
     秘密勾配降下法計算システム。
  6.  複数の秘密計算装置を含み、少なくとも学習データの特徴量Xと学習データの正解データTとパラメータWとを秘匿したままディープニューラルネットワークを学習する秘密深層学習システムであって、
     β1, β2, η, εは予め定めたハイパーパラメータとし、・は行列の積とし、○は要素ごとの積とし、tは学習回数とし、[G]は勾配Gの秘匿値とし、[W]は上記パラメータWの秘匿値とし、[X]は上記学習データの特徴量Xの秘匿値とし、[T]は上記学習データの正解ラベルTの秘匿値とし、[M], [M^], [V], [V^], [G^], [U], [Y], [Z]は上記勾配Gと要素数が等しい行列M, M^, V, V^, G^, U, Y, Zの秘匿値とし、β^1,t, β^2,t, g^を次式とし、
    Figure JPOXMLDOC01-appb-M000005

    Adamは値v^の行列V^の秘匿値[V^]を入力として値g^の行列G^の秘匿値[G^]を出力する秘密一括写像を計算する関数とし、rshiftは算術右シフトとし、mは1回の学習に用いる学習データの数とし、H'は次式とし、
    Figure JPOXMLDOC01-appb-M000006

    nは上記ディープニューラルネットワークの隠れ層の数とし、Activationは上記隠れ層の活性化関数とし、Activation2は上記ディープニューラルネットワークの出力層の活性化関数とし、Activation2'は上記活性化関数Activation2に対応する損失関数とし、Activation'は上記活性化関数Activationの微分とし、
     各秘密計算装置は、
     [U1]←[W0]・[X]と、[Y1]←Activation([U1])と、1以上n-1以下の各iについての[Ui+1]←[Wi]・[Yi], [Yi+1]←Activation([Ui+1])と、[Un+1]←[Wn]・[Yn]と、[Yn+1]←Activation2([Un+1])とを計算する順伝搬部と、
     [Zn+1]←Activation2'([Yn+1],[T])と、[Zn]←Activation'([Un])○([Zn+1]・[Wn])と、1以上n-1以下の各iについての[Zn-i]←Activation'([Un-i])○([Zn-i+1]・[Wn-i])とを計算する逆伝搬部と、
     [G0]←[Z1]・[X]と、1以上n-1以下の各iについての[Gi]←[Zi+1]・[Yi]と、[Gn]←[Zn+1]・[Yn]とを計算する勾配計算部と、
     [G0]←rshift([G0],H')と、1以上n-1以下の各iについての[Gi]←rshift([Gi],H')と、[Gn]←rshift([Gn],H')とを計算し、0以上n以下の各iについて、請求項5に記載の秘密勾配降下法計算システムにより、i層とi+1層間の勾配[Gi]を用いてi層とi+1層間のパラメータ[Wi]を学習するパラメータ更新部と、
     を含む秘密深層学習システム。
  7.  請求項5に記載の秘密勾配降下法計算システムまたは請求項6に記載の秘密深層学習システムにおいて用いられる秘密計算装置。
  8.  請求項7に記載の秘密計算装置としてコンピュータを機能させるためのプログラム。
PCT/JP2019/031941 2019-08-14 2019-08-14 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム WO2021029034A1 (ja)

Priority Applications (6)

Application Number Priority Date Filing Date Title
EP19941104.2A EP4016507A4 (en) 2019-08-14 2019-08-14 SECRET GRADIENT DESCENT CALCULATION METHOD, SECRET DEEP LEARNING METHOD, SECRET GRADIENT DESCENT CALCULATION SYSTEM, SECRET DEEP LEARNING SYSTEM, SECRET CALCULATION DEVICE AND PROGRAM
CN201980099184.2A CN114207694B (zh) 2019-08-14 2019-08-14 秘密梯度下降法计算方法及系统、秘密深度学习方法及系统、秘密计算装置、记录介质
AU2019461061A AU2019461061B2 (en) 2019-08-14 2019-08-14 Secure gradient descent computation method, secure deep learning method, secure gradient descent computation system, secure deep learning system, secure computation apparatus, and program
JP2021539762A JP7279796B2 (ja) 2019-08-14 2019-08-14 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム
PCT/JP2019/031941 WO2021029034A1 (ja) 2019-08-14 2019-08-14 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム
US17/634,237 US20220329408A1 (en) 2019-08-14 2019-08-14 Secure gradient descent computation method, secure deep learning method, secure gradient descent computation system, secure deep learning system, secure computation apparatus, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/031941 WO2021029034A1 (ja) 2019-08-14 2019-08-14 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム

Publications (1)

Publication Number Publication Date
WO2021029034A1 true WO2021029034A1 (ja) 2021-02-18

Family

ID=74570940

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/031941 WO2021029034A1 (ja) 2019-08-14 2019-08-14 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム

Country Status (6)

Country Link
US (1) US20220329408A1 (ja)
EP (1) EP4016507A4 (ja)
JP (1) JP7279796B2 (ja)
CN (1) CN114207694B (ja)
AU (1) AU2019461061B2 (ja)
WO (1) WO2021029034A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017183587A1 (ja) * 2016-04-18 2017-10-26 日本電信電話株式会社 学習装置、学習方法および学習プログラム
JP2018156619A (ja) * 2017-03-16 2018-10-04 株式会社デンソー 連続最適化問題の大域的探索装置及びプログラム
JP2019008383A (ja) * 2017-06-21 2019-01-17 キヤノン株式会社 画像処理装置、撮像装置、画像処理方法、プログラム、および、記憶媒体

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09106390A (ja) * 1995-10-12 1997-04-22 Sumitomo Metal Ind Ltd ニューラルネットワーク
JP4354609B2 (ja) * 1999-07-16 2009-10-28 パナソニック株式会社 有限体上の連立方程式求解装置及び逆元演算装置
CN101635021B (zh) * 2003-09-26 2011-08-10 日本电信电话株式会社 标签装置、标签自动识别系统和标签隐私保护方法
KR20150122162A (ko) * 2013-03-04 2015-10-30 톰슨 라이센싱 프라이버시 보호 카운팅을 위한 방법 및 시스템
JP6309432B2 (ja) * 2014-11-12 2018-04-11 日本電信電話株式会社 秘密計算システム及び方法並びに管理サーバ及びプログラム
CN109328377B (zh) * 2016-07-06 2021-12-21 日本电信电话株式会社 秘密计算系统、秘密计算装置、秘密计算方法、以及程序
CN109416894B (zh) * 2016-07-06 2021-12-31 日本电信电话株式会社 秘密计算系统、秘密计算装置、秘密计算方法及记录介质
KR101852116B1 (ko) * 2016-11-15 2018-04-25 재단법인대구경북과학기술원 디노이징 장치 및 노이즈 제거 방법
EP3602422B1 (en) * 2017-03-22 2022-03-16 Visa International Service Association Privacy-preserving machine learning
CA3072638A1 (en) * 2017-08-30 2019-03-07 Inpher, Inc. High-precision privacy-preserving real-valued function evaluation
JP6730740B2 (ja) * 2017-12-25 2020-07-29 株式会社アクセル 処理装置、処理方法、処理プログラム、及び暗号処理システム
JP6730741B2 (ja) * 2017-12-26 2020-07-29 株式会社アクセル 処理装置、処理方法、処理プログラム、及び暗号処理システム
US11816575B2 (en) * 2018-09-07 2023-11-14 International Business Machines Corporation Verifiable deep learning training service
CN110084063B (zh) * 2019-04-23 2022-07-15 中国科学技术大学 一种保护隐私数据的梯度下降计算方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017183587A1 (ja) * 2016-04-18 2017-10-26 日本電信電話株式会社 学習装置、学習方法および学習プログラム
JP2018156619A (ja) * 2017-03-16 2018-10-04 株式会社デンソー 連続最適化問題の大域的探索装置及びプログラム
JP2019008383A (ja) * 2017-06-21 2019-01-17 キヤノン株式会社 画像処理装置、撮像装置、画像処理方法、プログラム、および、記憶媒体

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
KAIMING HEXIANGYU ZHANGSHAOQING RENJIAN SUN: "Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification", PROCEEDINGS OF THE IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION, 2015, pages 1026 - 1034, XP032866428, DOI: 10.1109/ICCV.2015.123
KOKI HAMADADAI IKARASHIKOJI CHIDA: "A Batch Mapping Algorithm for Secure Function Evaluation", IEICE TRANSACTIONS A, vol. 96, no. 4, 2013, pages 157 - 165, XP008184067
PAYMAN MOHASSELYUPENG ZHANG: "SecureML: A System for Scalable Privacy-Preserving Machine Learning", IEEE SYMPOSIUM ON SECURITY AND PRIVACY, SP 2017, 2017, pages 19 - 38, XP055554322, DOI: 10.1109/SP.2017.12
SAMEER WAGHDIVYA GUPTAAND NISHANTH CHANDRAN: "SecureNN: 3-Party Secure Computation for Neural Network Training", PROCEEDINGS ON PRIVACY ENHANCING TECHNOLOGIES, vol. 1, 2019, pages 24
See also references of EP4016507A4

Also Published As

Publication number Publication date
EP4016507A4 (en) 2023-05-10
AU2019461061A1 (en) 2022-03-03
CN114207694B (zh) 2024-03-08
JPWO2021029034A1 (ja) 2021-02-18
US20220329408A1 (en) 2022-10-13
EP4016507A1 (en) 2022-06-22
JP7279796B2 (ja) 2023-05-23
AU2019461061B2 (en) 2023-03-30
CN114207694A (zh) 2022-03-18

Similar Documents

Publication Publication Date Title
US11087223B2 (en) Learning and inferring insights from encrypted data
Nandakumar et al. Towards deep neural network training on encrypted data
US11354539B2 (en) Encrypted data model verification
US11343068B2 (en) Secure multi-party learning and inferring insights based on encrypted data
US20200366459A1 (en) Searching Over Encrypted Model and Encrypted Data Using Secure Single-and Multi-Party Learning Based on Encrypted Data
Yu et al. Regularized extreme learning machine for regression with missing data
Nguyen et al. Quantum key distribution protocol based on modified generalization of Deutsch-Jozsa algorithm in d-level quantum system
CN112805768B (zh) 秘密s型函数计算系统及其方法、秘密逻辑回归计算系统及其方法、秘密s型函数计算装置、秘密逻辑回归计算装置、程序
Paszyński et al. Deep learning driven self-adaptive hp finite element method
US11681939B2 (en) Quantum data loader
Joshi Support vector machines
Liu et al. An experimental study on symbolic extreme learning machine
Lauriola et al. Radius-margin ratio optimization for dot-product boolean kernel learning
WO2021029024A1 (ja) 秘密ソフトマックス関数計算システム、秘密ソフトマックス関数計算装置、秘密ソフトマックス関数計算方法、秘密ニューラルネットワーク計算システム、秘密ニューラルネットワーク学習システム、プログラム
Zhang et al. Improved circuit implementation of the HHL algorithm and its simulations on QISKIT
Luo et al. Finding second-order stationary points in nonconvex-strongly-concave minimax optimization
WO2021029034A1 (ja) 秘密勾配降下法計算方法、秘密深層学習方法、秘密勾配降下法計算システム、秘密深層学習システム、秘密計算装置、およびプログラム
WO2019225531A1 (ja) 秘密一括近似システム、秘密計算装置、秘密一括近似方法、およびプログラム
Mandal et al. Hybrid phase-based representation of quantum images
Zhao et al. PPCNN: An efficient privacy‐preserving CNN training and inference framework
WO2022254599A1 (ja) 秘密共役勾配法計算方法、秘密共役勾配法計算システム、秘密計算装置、およびプログラム
KR102684265B1 (ko) 완전 동형 평가를 위한 컴퓨테이션 네트워크 변환
US20240039691A1 (en) Management of accurate scales in fully-homomorphic encryption schemes
Flynn et al. A simultaneous perturbation weak derivative estimator for stochastic neural networks
Kabziński Rank-Revealing Orthogonal Decomposition in Extreme Learning Machine Design

Legal Events

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

Ref document number: 19941104

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021539762

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019461061

Country of ref document: AU

Date of ref document: 20190814

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2019941104

Country of ref document: EP

Effective date: 20220314