[Paper Review] TenSEAL: A Library for Encrypted Tensor Operations Using Homomorphic Encryption
TenSEAL is an open-source library that provides encrypted tensor computations using CKKS homomorphic encryption, enabling ML inference on encrypted data and easy integration with PyTorch/TensorFlow. It demonstrates a CNN on MNIST with encrypted inference under a second and under 0.5 MB of communication.
Machine learning algorithms have achieved remarkable results and are widely applied in a variety of domains. These algorithms often rely on sensitive and private data such as medical and financial records. Therefore, it is vital to draw further attention regarding privacy threats and corresponding defensive techniques applied to machine learning models. In this paper, we present TenSEAL, an open-source library for Privacy-Preserving Machine Learning using Homomorphic Encryption that can be easily integrated within popular machine learning frameworks. We benchmark our implementation using MNIST and show that an encrypted convolutional neural network can be evaluated in less than a second, using less than half a megabyte of communication.
Motivation & Objective
- Motivate privacy-preserving machine learning where inputs and outputs remain encrypted in MLaaS scenarios.
- Provide a flexible library that maps tensors from popular ML frameworks to encrypted tensors.
- Demonstrate practical encrypted NN evaluation with low communication overhead.
- Enable tensor operations and CNN primitives on encrypted data using CKKS via Microsoft SEAL.
Proposed method
- Build an open-source TenSEAL library that bridges ML frameworks to homomorphic encryption.
- Base the implementation on CKKS and expose PlainTensor and EncryptedTensor abstractions.
- Implement Tensor operations (add, sub, mul, dot_product, matmul, polyval) and specialized kernels (im2col for conv2d).
- Encode tensors efficiently to minimize ciphertext counts and computation depth, leveraging batching in CKKS.
- Demonstrate encrypted CNN inference by encoding images into a single ciphertext and performing convolutions via im2col and batched dot products.
Experimental results
Research questions
- RQ1Can encrypted tensor operations via CKKS support practical CNN inference with acceptable latency and communication overhead?
- RQ2How can TenSEAL encode and operate on tensors to minimize multiplicative depth and ciphertext count while preserving accuracy?
- RQ3What are the performance characteristics (time, bandwidth) of encrypted MNIST inference on representative cloud hardware?
Key findings
- An encrypted CNN on MNIST achieves 97.4% accuracy on encrypted data versus 97.7% on plaintext.
- Encrypted evaluation timings show full forward pass around 1.46 seconds on an 8-core AWS c4.2xlarge and 0.89 seconds on a 16-core AWS c4.4xlarge instance.
- Communication for encrypted inference is approximately 427 KB for input and output.
- The library utilizes single-ciphertext encoding for images with im2col-style convolution, reducing rotations to log2(N) per convolution.
- TenSEAL demonstrates that tensor operations using CKKS are practical for ML tasks with appropriate parameter choices (e.g., 8192 modulus degree, 200-bit coeff modulus).
- The approach emphasizes parallelism and integration simplicity with frontends, while acknowledging CKKS limitations on multiplicative depth and non-linear activations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.