Arithmetic PCA for Encrypted Data

Jung Hee Cheon, Hyeongmin Choe, Saebyul Jung, Duhyeong Kim, Dah Hoon Lee, Jai Hyun ParkIACR ePrint 2023

Abstract

Principal Component Analysis (PCA) is a fundamental tool for dimensionality reduction, yet its application to sensitive datasets is often hindered by privacy concerns. Homomorphic Encryption (HE) offers a solution by allowing computation on encrypted data, but standard PCA algorithms rely heavily on non-polynomial operations like division and square roots, which are computationally prohibitive in HE. This paper introduces a division-free variant of Krasulina’s algorithm designed for the CKKS encryption scheme. By eliminating intermediate normalization steps, the proposed method enables efficient, non-interactive PCA at scale. Experimental results demonstrate that the algorithm can extract the top principal components of a 128×128 matrix in under 8 minutes with high numerical precision and competitive accuracy on real-world facial recognition tasks.

Introduction

Performing PCA on sensitive data, such as medical records or financial transactions, requires robust privacy-preserving techniques. Homomorphic Encryption (HE) is a leading candidate for this task, as it allows a server to process data without ever decrypting it. However, the "Achilles' heel" of HE is its inefficiency with non-polynomial operations. Standard iterative methods for PCA, such as the Power Method, require vector normalization at every iteration to prevent numerical instability. These normalization steps involve division and square roots, which must be approximated by high-degree polynomials in HE, leading to significant noise and computational overhead. Consequently, previous HE-based PCA implementations were limited to very small matrices (e.g., 20×20) or required frequent communication with the client to perform intermediate decryptions.

Methodology

Division-Free Krasulina Algorithm

The core innovation of this work is the adaptation of Krasulina’s stochastic approximation method into a purely arithmetic form. The authors reframed the iterative update equation to eliminate the need for division by the vector norm during intermediate steps.

Geometric representation of the division-free update rule, showing the construction of the next iteration vector without explicit normalization.

As illustrated in the figure above, the update rule is modified such that the direction of the eigenvector is preserved while the scale is allowed to grow. By multiplying the update term by the squared norm, the process becomes a sequence of additions and multiplications, which are natively supported by HE schemes. This "delayed normalization" strategy ensures that the computationally expensive division and square root operations are performed only once by the client after the final result is decrypted.

Implementation and Optimization

The algorithm was implemented using the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption scheme, which is optimized for approximate arithmetic on real numbers. To handle the computational demands of 128×128 matrices, the authors utilized Single Instruction, Multiple Data (SIMD) operations. They developed specialized sub-routines, such as RotSum (Rotate and Sum) and Replicate, to optimize matrix-vector multiplications within the encrypted domain, significantly reducing the depth of the arithmetic circuits.

Experimental Evaluation

Datasets and Setup

The researchers evaluated the algorithm using two primary datasets:

  1. Synthetic Data: 128×128 positive semi-definite matrices with known eigenvalues to measure numerical convergence and precision.
  2. Yale Face Database: A benchmark containing 128 facial images used to test the algorithm's utility in a privacy-preserving face recognition pipeline.

Key Results

  • Scalability: The method extracted the first 6 principal components of a 128×128 matrix in approximately 7.85 minutes using 8 threads. This represents a significant advancement over prior state-of-the-art methods that were restricted to much smaller dimensions.
  • Accuracy: The computed eigenvectors maintained high precision, with an error term ($\|Av - \lambda v\|_∞$) of less than 0.012. In face recognition tests, the arithmetic PCA achieved ~89% accuracy (for $k=10$), matching the performance of unencrypted PCA.
  • Efficiency: The implementation is at least 1.2x faster than comparable recent work, even those that bypass expensive bootstrapping procedures.

Discussion and Conclusion

This work demonstrates that by mathematically reformulating standard algorithms to align with the constraints of Homomorphic Encryption, it is possible to achieve high-performance privacy-preserving machine learning. The division-free Krasulina algorithm provides a scalable, non-interactive solution for PCA on encrypted data.

While the growth of vector values during iterations poses a potential risk for precision loss in fixed-precision HE schemes, it did not impact the 128×128 test cases. Future research may focus on applying this arithmetic approach to other iterative linear algebra problems, such as singular value decomposition (SVD) or solving systems of linear equations, further expanding the capabilities of secure multi-party computation.

Summary updated

BibTeX
@article{cheon2023arithmetic,
  author = {Jung Hee Cheon and Hyeongmin Choe and Saebyul Jung and Duhyeong Kim and Dah Hoon Lee and Jai Hyun Park},
  title = {{Arithmetic PCA for Encrypted Data}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2023},
}
Figure