Privacy-Preserving Machine Learning with Fully Homomorphic Encryption for Deep Neural Network

Joon-Woo Lee, HyungChul Kang, Yongwoo Lee, Woosuk Choi, Jieun Eom, Maxim Deryabin, Eunsang Lee, Junghyun Lee, Donghoon Yoo, Young-Sik Kim, Jong-Seon No

Introduction

Privacy-Preserving Machine Learning (PPML) has emerged as a critical field of research, aiming to reconcile the power of deep learning with the necessity of data privacy. The ideal solution for PPML is Fully Homomorphic Encryption (FHE), a cryptographic technique that allows mathematical operations to be performed directly on encrypted data (ciphertexts). In an FHE-enabled workflow, a client can send encrypted sensitive data to a server, which processes it and returns an encrypted result. The server never decrypts the data, ensuring total privacy.

Despite its promise, FHE faces two significant technical hurdles. First is the noise ceiling: every homomorphic operation adds noise to the ciphertext. If this noise exceeds a certain threshold, the data becomes unrecoverable, which has historically limited FHE to very shallow models. Second is the non-arithmetic gap: FHE naturally supports addition and multiplication, but standard neural networks rely on non-linear, non-arithmetic functions like ReLU and Softmax. Previous research often bypassed these by using low-degree polynomials like $x^2$, which significantly degraded model accuracy.

This paper presents a breakthrough implementation of a standard ResNet-20 model on encrypted data, achieving high accuracy on the CIFAR-10 dataset by overcoming these fundamental limitations.

Methodology

The researchers utilized the RNS-CKKS encryption scheme, a variant of FHE optimized for fixed-point arithmetic, implemented using the Microsoft SEAL library. Their approach relies on several key innovations to enable deep inference.

ResNet-20 Architecture for FHE

Rather than designing a custom "HE-friendly" toy model, the authors adapted the industry-standard ResNet-20 architecture. This model consists of an initial convolution layer followed by three stages of residual blocks, ending with global average pooling and a fully connected layer.

The adapted ResNet-20 architecture featuring integrated bootstrapping and polynomial ReLU approximations.

As illustrated in the architecture diagram above, the model incorporates periodic bootstrapping operations (labeled as 'Boot'). Bootstrapping is a high-precision "refresh" operation that resets the noise level of a ciphertext, allowing the computation to proceed through all 20 layers of the network without data corruption.

Approximating Non-Linear Functions

To bridge the non-arithmetic gap, the authors employed Minimax Polynomial Approximation. Instead of a simple square function, they used a composition of high-degree minimax polynomials to mimic the behavior of the ReLU activation function with high fidelity. This ensures that the encrypted model behaves almost identically to its plaintext counterpart. Furthermore, the Softmax function was implemented entirely within the encrypted domain to prevent "model extraction attacks," where an adversary might infer the model's logic by analyzing raw output scores.

Striding Optimization

Efficiency in FHE is often bottlenecked by "rotation" operations required for convolutions. The authors introduced a specific optimization for convolutions with a stride of 2. By using a window kernel approach to transform stride-1 results into stride-2 outputs, they reduced the total number of expensive rotations needed.

Comparison of standard 2D convolution and the optimized 1D representation for stride-2 operations in FHE.

Experimental Results

The model was evaluated on the CIFAR-10 dataset, which contains 60,000 color images across 10 classes. This represents a significant step up in complexity from the MNIST dataset commonly used in prior FHE literature.

Accuracy and Fidelity

The encrypted ResNet-20 achieved an impressive 90.67% accuracy on CIFAR-10. For comparison, the original plaintext model achieves 91.89%. This small gap demonstrates that the polynomial approximations and FHE constraints have a minimal impact on the model's predictive power. Furthermore, the outputs of the encrypted model were found to be 98.67% identical to the plaintext model, confirming high computational fidelity.

Computational Performance

The primary trade-off for this level of privacy is computational latency. Performing inference on a single image takes approximately 4 hours using a high-end dual Intel Xeon Platinum 8280 system (112 cores) with 512 GB of RAM. While this is currently too slow for real-time applications, it represents a massive leap in the capability of FHE systems to handle deep, complex architectures.

Conclusion and Future Work

This work proves that deep, standard neural networks can be executed in the FHE domain with high accuracy. It moves the conversation from "Can we do it?" to "How can we make it faster?" The authors identify the 16-bit average precision in polynomial approximations as a critical "sweet spot" for balancing accuracy and performance.

Future research will focus on reducing latency through hardware acceleration—specifically utilizing GPUs, FPGAs, or dedicated ASICs—and optimizing ciphertext packing methods to process multiple images simultaneously. While the current implementation provides 98-bit security, moving toward the 128-bit industry standard remains a goal that will require further optimization to manage the associated computational overhead.

Summary updated

BibTeX
@article{lee2022privacy,
  author = {Joon-Woo Lee and HyungChul Kang and Yongwoo Lee and Woosuk Choi and Jieun Eom and Maxim Deryabin and Eunsang Lee and Junghyun Lee and Donghoon Yoo and Young-Sik Kim and Jong-Seon No},
  title = {{Privacy-Preserving Machine Learning with Fully Homomorphic Encryption for Deep Neural Network}},
  journal = {IEEE Access},
  year = {2022},
  doi = {10.1109/access.2022.3159694},
}
Figure