Precise Approximation of Convolutional Neural Networks for Homomorphically Encrypted Data

Many industries with convolutional neural network models offer privacy-preserving machine learning (PPML) classification service, that is, a service that performs classification of private data for clients while guaranteeing privacy. This work aims to study deep learning on the encrypted data using fully homomorphic encryption (FHE). To implement deep learning on FHE, ReLU and max-pooling functions should be approximated by some polynomials for homomorphic operations. Since the approximate polynomials studied up to now have large errors in ReLU and max-pooling functions, using these polynomials requires many epochs retraining for the classification of small datasets such as MNIST and CIFAR-10. In addition, large datasets such as ImageNet cannot be classified with high accuracy even with many epoch retraining using these polynomials. To overcome these disadvantages, we propose a precise polynomial approximation technique for ReLU and max-pooling functions. Since precise approximation requires a very high-degree polynomial, which may cause large numerical errors in FHE, we propose a method to approximate ReLU and max-pooling functions accurately using a composition of minimax approximate polynomials of small degrees. If we replace the ReLU and max-pooling functions with the proposed approximate polynomials, deep learning models such as ResNet and VGGNet, which have already been studied a lot, can still be used without further modification for PPML on FHE, and even pretrained parameters can be used without retraining. When we approximate ReLU function in the ResNet-152 using the composition of minimax approximate polynomials of degrees 15, 27, and 29, we succeed in classifying the plaintext ImageNet dataset for the first time with 77.52% accuracy, which is very close to the original model accuracy of 78.31%.

[1]  Dumitru Erhan,et al.  Going deeper with convolutions , 2014, 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[2]  Jean-Pierre Hubaux,et al.  Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-Sparse Keys , 2020, IACR Cryptol. ePrint Arch..

[3]  Giorgio Patrini,et al.  SEALion: a Framework for Neural Network Inference on Encrypted Data , 2019, ArXiv.

[4]  Jakub Konecný,et al.  Federated Optimization: Distributed Optimization Beyond the Datacenter , 2015, ArXiv.

[5]  Jong-Seon No,et al.  Optimal Minimax Polynomial Approximation of Modular Reduction for Bootstrapping of Approximate Homomorphic Encryption , 2020, IACR Cryptol. ePrint Arch..

[6]  Jong-Seon No,et al.  High-Precision Approximate Homomorphic Encryption by Error Variance Minimization , 2020, IACR Cryptol. ePrint Arch..

[7]  Zhuowen Tu,et al.  Aggregated Residual Transformations for Deep Neural Networks , 2016, 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[8]  Jung Hee Cheon,et al.  A Full RNS Variant of Approximate Homomorphic Encryption , 2018, IACR Cryptol. ePrint Arch..

[9]  Andrew Zisserman,et al.  Very Deep Convolutional Networks for Large-Scale Image Recognition , 2014, ICLR.

[10]  Constance Morel,et al.  Privacy-Preserving Classification on Deep Neural Network , 2017, IACR Cryptol. ePrint Arch..

[11]  Jie Lin,et al.  The AlexNet Moment for Homomorphic Encryption: HCNN, the First Homomorphic CNN on Encrypted Data with GPUs , 2018, IACR Cryptol. ePrint Arch..

[12]  Hsien-Hsin S. Lee,et al.  Cheetah: Optimizing and Accelerating Homomorphic Encryption for Private Inference , 2020, 2021 IEEE International Symposium on High-Performance Computer Architecture (HPCA).

[13]  Hassan Takabi,et al.  Deep Neural Networks Classification over Encrypted Data , 2019, CODASPY.

[14]  Anantha Chandrakasan,et al.  Gazelle: A Low Latency Framework for Secure Neural Network Inference , 2018, IACR Cryptol. ePrint Arch..

[15]  Lei Jiang,et al.  SHE: A Fast and Accurate Deep Neural Network for Encrypted Data , 2019, NeurIPS.

[16]  Jung Hee Cheon,et al.  Efficient Homomorphic Comparison Methods with Optimal Complexity , 2019, IACR Cryptol. ePrint Arch..

[17]  Jong-Seon No,et al.  High-Precision Bootstrapping of RNS-CKKS Homomorphic Encryption Using Optimal Minimax Polynomial Approximation and Inverse Sine Function , 2021, EUROCRYPT.

[18]  Larry J. Stockmeyer,et al.  On the Number of Nonscalar Multiplications Necessary to Evaluate Polynomials , 1973, SIAM J. Comput..

[19]  Craig Gentry,et al.  Fully homomorphic encryption using ideal lattices , 2009, STOC '09.

[20]  Cynthia Dwork,et al.  Calibrating Noise to Sensitivity in Private Data Analysis , 2006, TCC.

[21]  Li Fei-Fei,et al.  Faster CryptoNets: Leveraging Sparsity for Real-World Encrypted Inference , 2018, ArXiv.

[22]  Sergey Ioffe,et al.  Rethinking the Inception Architecture for Computer Vision , 2015, 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[23]  Jung Hee Cheon,et al.  Homomorphic Encryption for Arithmetic of Approximate Numbers , 2017, ASIACRYPT.

[24]  Yixing Lao,et al.  nGraph-HE: a graph compiler for deep learning on homomorphically encrypted data , 2018, IACR Cryptol. ePrint Arch..

[25]  Jong-Seon No,et al.  Minimax Approximation of Sign Function by Composite Polynomial for Homomorphic Comparison , 2022, IEEE Transactions on Dependable and Secure Computing.

[26]  Jung Hee Cheon,et al.  Over 100x Faster Bootstrapping in Fully Homomorphic Encryption through Memory-centric Optimization with GPUs , 2021, IACR Cryptol. ePrint Arch..

[27]  Frederik Vercauteren,et al.  Somewhat Practical Fully Homomorphic Encryption , 2012, IACR Cryptol. ePrint Arch..

[28]  Antonis Papadimitriou,et al.  Approximate Homomorphic Encryption with Reduced Approximation Error , 2020, IACR Cryptol. ePrint Arch..

[29]  Nicolas Gama,et al.  TFHE: Fast Fully Homomorphic Encryption Over the Torus , 2019, Journal of Cryptology.

[30]  Pierangela Samarati,et al.  Protecting privacy when disclosing information: k-anonymity and its enforcement through generalization and suppression , 1998 .

[31]  Alex Krizhevsky,et al.  Learning Multiple Layers of Features from Tiny Images , 2009 .

[32]  Michael S. Bernstein,et al.  ImageNet Large Scale Visual Recognition Challenge , 2014, International Journal of Computer Vision.

[33]  Jian Sun,et al.  Deep Residual Learning for Image Recognition , 2015, 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[34]  Michael Naehrig,et al.  CryptoNets: applying neural networks to encrypted data with high throughput and accuracy , 2016, ICML 2016.