Oblivious binary neural networks
A framework is presented that provides a shift in the conceptual and practical realization of privacy-preserving interference on deep neural networks. The framework leverages the concept of the binary neural networks (BNNs) in conjunction with the garbled circuits protocol. In BNNs, the weights and activations are restricted to binary (e.g., ±1) values, substituting the costly multiplications with simple XNOR operations during the inference phase. The XNOR operation is known to be free in the GC protocol; therefore, performing oblivious inference on BNNs using GC results in the removal of costly multiplications. The approach consistent with implementations of the current subject matter provides for oblivious inference on the standard DL benchmarks being performed with minimal, if any, decrease in the prediction accuracy.
1 . A system, comprising: at least one data processor; and at least one memory storing instructions which, when executed by the at least one data processor, provide operations comprising: receiving input data; providing the input data to security protocol comprising a garbled circuits protocol configured to provide an oblivious inference protocol, wherein the input data is modified, via the security protocol, to a neural network architecture, which generates an output; modifying parameters of the neural network architecture to operate and provide the output using the such that the modified neural network architecture implements an oblivious inference protocol, wherein the modifying further comprises binarizing the neural network architecture to create a binary neural network architecture having weights and activations of a binary value, the binary neural network architecture comprising layers including channels and neurons, adjusting the binary neural network architecture by applying a factor variable to the channels and to the neurons of the layers of the binary neural network architecture, and removing redundant channels and neurons from each layer of the binary neural network architecture; wherein modifying the parameters further comprises transforming the input data parameters such that the input data is not discernible to a server executing the modified neural network architecture binary neural network architecture.
2 . The system of claim 1 wherein removing redundant channels and neurons from each layer of the binary neural network architecture comprises: ranking the channels and neurons based on a magnitude of gradient values of each of the channels and neurons; and removing, from each layer of the binary neural network architecture, the channels and neurons having a lowest magnitude of the ranked channels and/or neurons.
3 . The system of claim 2 , wherein removing the channels and neurons having the lowest magnitude is repeated until an accuracy falls below a predefined threshold value.
4 . The system of claim 1 , wherein the at least one memory storing instructions which, when executed by the at least one data processor, provide operations further comprising: executing a first layer of the binary neural network architecture by executing a vector dot product with the input data and a vector comprising binary values based on oblivious transfer.
5 . The system of claim 1 , wherein the at least one memory storing instructions which, when executed by the at least one data processor, provide operations further comprising: creating a Boolean circuit representation of each layer of the binary neural network architecture, wherein each Boolean circuit representation is created separately, and wherein each layer comprises a plurality of micro-circuits forming the Boolean circuit representation.
6 . The system of claim 1 , wherein implementing the security protocol to generate the output comprises a randomizing operation and a decrypting operation for each layer, wherein the randomizing operation and the decrypting operation are performed in succession such that after one layer is randomized, the one layer is successively decrypted, wherein the randomizing operation comprises creating a randomized table for each gate in the Boolean circuit representation for each layer of the binary neural network architecture, wherein random output labels are encrypted using input labels according to a truth table of the gate.
7 . A method, comprising: receiving input data; providing the input data to security protocol comprising a garbled circuits protocol configured to provide an oblivious inference protocol, wherein the input data is modified, via the security protocol, to a neural network architecture, which generates an output; modifying parameters of the neural network architecture to operate and provide the output using the such that the modified neural network architecture implements an oblivious inference protocol, wherein the modifying further comprises binarizing the neural network architecture to create a binary neural network architecture having weights and activations of a binary value, the binary neural network architecture comprising layers including channels and neurons, adjusting the binary neural network architecture by applying a factor variable to the channels and to the neurons of the layers of the binary neural network architecture, and removing redundant channels and neurons from each layer of the binary neural network architecture; wherein modifying the parameters further comprises transforming the input data parameters such that input data is not discernible to a server executing the binary neural network architecture modified neural network architecture.
8 . The method of claim 7 , wherein removing redundant channels and neurons from each layer of the binary neural network architecture comprises: ranking the channels and neurons based on a magnitude of gradient values of each of the channels and neurons; and removing, from each layer of the binary neural network architecture, the channels and neurons having a lowest magnitude of the ranked channels and/or neurons.
9 . The method of claim 8 , wherein removing the channels and neurons having the lowest magnitude is repeated until an accuracy falls below a predefined threshold value.
10 . The method of claim 7 , further comprising: executing a first layer of the binary neural network architecture by executing a vector dot product with the input data and a vector comprising binary values based on oblivious transfer.
11 . The method of claim 7 , further comprising: creating a Boolean circuit representation of each layer of the binary neural network architecture, wherein each Boolean circuit representation is created separately, and wherein each layer comprises a plurality of micro-circuits forming the Boolean circuit representation.
12 . The method of claim 7 , wherein implementing the security protocol to generate the output comprises a randomizing operation and a decrypting operation for each layer, wherein the randomizing operation and the decrypting operation are performed in succession such that after one layer is randomized, the one layer is successively decrypted, wherein the randomizing operation comprises creating a randomized table for each gate in the Boolean circuit representation for each layer of the binary neural network architecture, wherein random output labels are encrypted using input labels according to a truth table of the gate.
13 . A non-transitory computer-readable storage medium including program code, which when executed by at least one data processor, causes operations comprising: receiving input data; providing the input data to security protocol comprising a garbled circuits protocol configured to provide an oblivious inference protocol, wherein the input data is modified, via the security protocol, to a neural network architecture, which generates an output; modifying parameters of the neural network architecture to operate and provide the output using the such that the modified neural network architecture implements an oblivious inference protocol, wherein the modifying further comprises binarizing the neural network architecture to create a binary neural network architecture having weights and activations of a binary value, the binary neural network architecture comprising layers including channels and neurons, adjusting the binary neural network architecture by applying a factor variable to the channels and to the neurons of the layers of the binary neural network architecture, and removing redundant channels and neurons from each layer of the binary neural network architecture; wherein modifying the parameters further comprises transforming the input data parameters such that input data is not discernible to a server executing the binary neural network architecture modified neural network architecture.