Encrypted Image Classification with Low Memory Footprint Using Fully Homomorphic Encryption
Abstract
Classifying images has become a straightforward and accessible task, thanks to the advent of Deep Neural Networks. Nevertheless, not much attention is given to the privacy concerns associated with sensitive data contained in images. In this study, we propose a solution to this issue by exploring an intersection between Machine Learning and cryptography. In particular, Fully Homomorphic Encryption (FHE) emerges as a promising solution, as it enables computations to be performed on encrypted data. We therefore propose a Residual Network implementation based on FHE which allows the classification of encrypted images, ensuring that only the user can see the result. We suggest a circuit which reduces the memory requirements by more than compared to the most recent works, while maintaining a high level of accuracy and a short computational time. We implement the circuit using the well-known Cheon–Kim–Kim–Song (CKKS) scheme, which enables approximate encrypted computations. We evaluate the results from three perspectives: memory requirements, computational time and calculations precision. We demonstrate that it is possible to evaluate an encrypted ResNet20 in less than five minutes on a laptop using approximately 15GB of memory, achieving an accuracy of 91.67% on the CIFAR-10 dataset, which is almost equivalent to the accuracy of the plain model (92.60%).
References
- 1. , An efficient multi-objective evolutionary zero-shot neural architecture search framework for image classification, Int. J. Neural Syst. 33(5) (2023) 2350016. Link, Web of Science, Google Scholar
- 2. , Evaluation of spiking neural nets-based image classification using the runtime simulator RAVSim, Int. J. Neural Syst. 33(9) (2023) 2350044. Link, Web of Science, Google Scholar
- 3. , Regulation (EU) 2016/679 of the european parliament and of the council, Regulation (EU) 679 (2016) 2016. Google Scholar
- 4. , Detection of trees on street-view images using a convolutional neural network, Int. J. Neural Syst. 32(1) (2022) 2150042. Link, Web of Science, Google Scholar
- 5. , Backpropagation applied to handwritten zip code recognition, Neural Comput. 1(4) (1989) 541–551. Crossref, Web of Science, Google Scholar
- 6. , Deep residual learning for image recognition, 2016 IEEE Conf. Computer Vision and Pattern Recognition (CVPR) (IEEE, 2016), pp. 770–778. Crossref, Google Scholar
- 7. , On data banks and privacy homomorphisms, Found. Secure Comput. 4(11) (1978) 169–180. Google Scholar
- 8. , A method for obtaining digital signatures and public-key cryptosystems, Commun. ACM 21 (1978) 120–126. Crossref, Web of Science, Google Scholar
- 9. , Fully homomorphic encryption using ideal lattices, in Proc. Forty-First Annual ACM Symp. Theory of Computing, STOC ’09 (ACM, New York, NY, USA, 2009), pp. 169–178. Crossref, Google Scholar
- 10. , TFHE: Fast fully homomorphic encryption over the torus, J. Cryptol. 33 (2020) 34–91. Crossref, Web of Science, Google Scholar
- 11. , FHEW: Bootstrapping homomorphic encryption in less than a second, Advances in Cryptology – EUROCRYPT 2015, eds. E. Oswald and M. Fischlin (Springer, Berlin, Heidelberg, 2015), pp. 617–640. Crossref, Google Scholar
- 12. J. Fan and F. Vercauteren, Somewhat practical fully homomorphic encryption, Cryptology ePrint Archive, Paper 2012/144 (2012), https://eprint.iacr.org/2012/144. Google Scholar
- 13. , (Leveled) fully homomorphic encryption without bootstrapping, in Proc. 3rd Innovations in Theoretical Computer Science Conf., ITCS ’12 (ACM, New York, USA, 2012), pp. 309–325. Crossref, Google Scholar
- 14. , Homomorphic encryption for arithmetic of approximate numbers, Advances in Cryptology – ASIACRYPT 2017, eds. T. Takagi and T. Peyrin (Springer International Publishing, Cham, 2017), pp. 409–437. Crossref, Google Scholar
- 15. , CryptoNets: Applying neural networks to encrypted data with high throughput and accuracy, in Proc. 33rd Int. Conf. Machine Learning, eds. M. F. Balcan and K. Q. Weinberger ,
Proceedings of Machine Learning Research , Vol. 48 (ACM, New York, USA, 2016), pp. 201–210. Google Scholar - 16. , Towards the AlexNet moment for homomorphic encryption: HCNN, the first homomorphic CNN on encrypted data with GPUs, IEEE Trans. Emerg. Top. Comput. 9(3) (2021) 1330–1343. Crossref, Web of Science, Google Scholar
- 17. A. Krizhevsky, G. Hinton et al., Learning multiple layers of features from tiny images, Technical Report (2009), https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf. Google Scholar
- 18. , Swarm-FHE: Fully homomorphic encryption-based swarm learning for malicious clients, Int. J. Neural Syst. 33(8) (2023) 2350033. Link, Web of Science, Google Scholar
- 19. , Efficient bootstrapping for approximate homomorphic encryption with non-sparse keys, Advances in Cryptology – EUROCRYPT 2021, eds. A. Canteaut and F.-X. Standaert (Springer International Publishing, Cham, 2021), pp. 587–617. Crossref, Google Scholar
- 20. , Privacy-preserving machine learning with fully homomorphic encryption for deep neural network, IEEE Access 10 (2022) 30039–30054. Crossref, Web of Science, Google Scholar
- 21. , Low-complexity deep convolutional neural networks on fully homomorphic encryption using multiplexed parallel convolutions, in Proc. 39th Int. Conf. Machine Learning, eds. K. Chaudhuri, S. Jegelka, L. Song, C. Szepesvari, G. Niu and S. Sabato , Proceedings of the 39 th International Conference on Machine Learning,
Baltimore, Maryland, USA , Vol. 162 (PMLR, 2022), pp. 12403–12422. Google Scholar - 22. A. Benamira, T. Gurand, T. Peyrin and S. Saha, Tt-tfhe: A torus fully homomorphic encryption-friendly neural network architecture (2023), https://doi.org/10.48550/arXiv.2302.01584. Google Scholar
- 23. , Optimized privacy-preserving cnn inference with fully homomorphic encryption, Trans. Inf. Foren. Secur. 18 (2023) 2175–2187. Crossref, Web of Science, Google Scholar
- 24. , GAZELLE: A low latency framework for secure neural network inference, 27th USENIX Security Sympos. (ACM, Baltimore, MD, 2018), pp. 1651–1669. Google Scholar
- 25. L. de Castro, R. Agrawal, R. Yazicigil, A. Chandrakasan, V. Vaikuntanathan, C. Juvekar and A. Joshi, Does fully homomorphic encryption need compute acceleration? (2021), https://doi.org/10.48550/arXiv.2112.06396. Google Scholar
- 26. J. Lee, E. Lee, Y.-S. Kim, Y. Lee, J.-W. Lee, Y. Kim and J.-S. No, Optimizing layerwise polynomial approximation for efficient private inference on fully homomorphic encryption: A dynamic programming approach (2023), https://doi.org/10.48550/arXiv.2310.10349. Google Scholar
- 27. , Minimax approximation of sign function by composite polynomial for homomorphic comparison, IEEE Trans. Depend. Secure Comput. 19(6) (2022) 3711–3727. Crossref, Web of Science, Google Scholar
- 28. , A full RNS variant of approximate homomorphic encryption, Sel. Areas Cryptogr. 11349 (2019) 347–368. Google Scholar
- 29. , On lattices, learning with errors, random linear codes, and cryptography, in Proc. Thirty-Seventh Annual ACM Sympos. Theory of Computing, STOC ’05 (ACM, New York, USA, 2005), pp. 84–93. Crossref, Google Scholar
- 30. , On ideal lattices and learning with errors over rings, Advances in Cryptology – EUROCRYPT 2010, ed. H. Gilbert (Springer, Berlin, Heidelberg, 2010), pp. 1–23. Crossref, Google Scholar
- 31. , OpenFHE: Open-source fully homomorphic encryption library, in Proc. 10th Workshop on Encrypted Computing & Applied Homomorphic Cryptography, WAHC’22 (ACM, New York, USA, 2022), pp. 53–63. Crossref, Google Scholar
- 32. , Algorithms in HElib, Advances in Cryptology – CRYPTO 2014, eds. J. A. Garay and R. Gennaro (Springer, Berlin, Heidelberg, Berlin, Heidelberg, 2014), pp. 554–571. Crossref, Google Scholar
- 33. A. A. Badawi and Y. Polyakov, Demystifying bootstrapping in fully homomorphic encryption Cryptology ePrint Archive, Paper 2023/149 (2023), https://eprint.iacr.org/2023/149. Google Scholar
- 34. , Better bootstrapping for approximate homomorphic encryption, Topics in Cryptology – CT-RSA 2020, ed. S. Jarecki (Springer International Publishing, Cham, 2020), pp. 364–390. Crossref, Google Scholar
- 35. , Revisiting homomorphic encryption schemes for finite fields, Advances in Cryptology – ASIACRYPT 2021, eds. M. Tibouchi and H. Wang (Springer International Publishing, Cham, 2021), pp. 608–639. Crossref, Google Scholar
- 36. , Approximation Theory and Approximation Practice, Extended Edition (SIAM, Philadelphia, PA, 2019). Crossref, Google Scholar
- 37. M. Albrecht, M. Chase, H. Chen, J. Ding, S. Goldwasser, S. Gorbunov, S. Halevi, J. Hoffstein, K. Laine, K. Lauter, S. Lokam, D. Micciancio, D. Moody, T. Morrison, A. Sahai and V. Vaikuntanathan, Homomorphic encryption security standard, Technical Report, https://HomomorphicEncryption.org, Toronto, Canada (2018). Google Scholar
- 38. Lattigo v5 Online: EPFL-LDS, Tune Insight SA (2023), https://github.com/tuneinsight/lattigo. Google Scholar
- 39. , A survey on FHE acceleration, 2023 IEEE 16th Dallas Circuits and Systems Conf. (DCAS) (IEEE, 2023), pp. 1–6. Crossref, Google Scholar
- 40. , CraterLake: A hardware accelerator for efficient unbounded computation on encrypted data, in Proc. 49th Annual Int. Sympos. Computer Architecture, ISCA’22 (ACM, New York, USA, 2022), pp. 173–187. Crossref, Google Scholar