Table of Contents
Fetching ...

UniHENN: Designing Faster and More Versatile Homomorphic Encryption-based CNNs without im2col

Hyunmin Choi, Jihun Kim, Seungho Kim, Seonhye Park, Jeongyong Park, Wonbin Choi, Hyoungshick Kim

TL;DR

UniHENN tackles privacy-preserving CNN inference by removing im2col from HE pipelines. It achieves this with a 1D flattening strategy, incremental rotations, and batch packing to enable efficient, model-agnostic encrypted inference across multiple CNN architectures. The approach yields substantial speedups over a non-im2col baseline (e.g., LeNet-1: ~30.1 s vs ~800.6 s for PyCrCNN) and outperforms im2col-based TenSEAL on batch processing, while supporting 1D and 2D CNNs across diverse datasets (MNIST, CIFAR-10, USPS, ECG). Although UniHENN demands higher memory and CPU-based SECURITIES, its flexible, batched HE inference represents a significant advance toward practical privacy-preserving cloud-based CNN services.

Abstract

Homomorphic encryption (HE) enables privacy-preserving deep learning by allowing computations on encrypted data without decryption. However, deploying convolutional neural networks (CNNs) with HE is challenging due to the need to convert input data into a two-dimensional matrix for convolution using the im2col technique, which rearranges the input for efficient computation. This restricts the types of CNN models that can be used since the encrypted data structure must be compatible with the specific model. UniHENN is a novel HE-based CNN architecture that eliminates the need for im2col, enhancing its versatility and compatibility with a broader range of CNN models. UniHENN flattens input data to one dimension without using im2col. The kernel performs convolutions by traversing the image, using incremental rotations and structured multiplication on the flattened input, with results spaced by the stride interval. Experimental results show that UniHENN significantly outperforms the state-of-the-art 2D CNN inference architecture named PyCrCNN in terms of inference time. For example, on the LeNet-1 model, UniHENN achieves an average inference time of 30.089 seconds, about 26.6 times faster than PyCrCNN's 800.591 seconds. Furthermore, UniHENN outperforms TenSEAL, an im2col-optimized CNN model, in concurrent image processing. For ten samples, UniHENN (16.247 seconds) was about 3.9 times faster than TenSEAL (63.706 seconds), owing to its support for batch processing of up to 10 samples. We demonstrate UniHENN's adaptability to various CNN architectures, including a 1D CNN and six 2D CNNs, highlighting its flexibility and efficiency for privacy-preserving cloud-based CNN services.

UniHENN: Designing Faster and More Versatile Homomorphic Encryption-based CNNs without im2col

TL;DR

UniHENN tackles privacy-preserving CNN inference by removing im2col from HE pipelines. It achieves this with a 1D flattening strategy, incremental rotations, and batch packing to enable efficient, model-agnostic encrypted inference across multiple CNN architectures. The approach yields substantial speedups over a non-im2col baseline (e.g., LeNet-1: ~30.1 s vs ~800.6 s for PyCrCNN) and outperforms im2col-based TenSEAL on batch processing, while supporting 1D and 2D CNNs across diverse datasets (MNIST, CIFAR-10, USPS, ECG). Although UniHENN demands higher memory and CPU-based SECURITIES, its flexible, batched HE inference represents a significant advance toward practical privacy-preserving cloud-based CNN services.

Abstract

Homomorphic encryption (HE) enables privacy-preserving deep learning by allowing computations on encrypted data without decryption. However, deploying convolutional neural networks (CNNs) with HE is challenging due to the need to convert input data into a two-dimensional matrix for convolution using the im2col technique, which rearranges the input for efficient computation. This restricts the types of CNN models that can be used since the encrypted data structure must be compatible with the specific model. UniHENN is a novel HE-based CNN architecture that eliminates the need for im2col, enhancing its versatility and compatibility with a broader range of CNN models. UniHENN flattens input data to one dimension without using im2col. The kernel performs convolutions by traversing the image, using incremental rotations and structured multiplication on the flattened input, with results spaced by the stride interval. Experimental results show that UniHENN significantly outperforms the state-of-the-art 2D CNN inference architecture named PyCrCNN in terms of inference time. For example, on the LeNet-1 model, UniHENN achieves an average inference time of 30.089 seconds, about 26.6 times faster than PyCrCNN's 800.591 seconds. Furthermore, UniHENN outperforms TenSEAL, an im2col-optimized CNN model, in concurrent image processing. For ten samples, UniHENN (16.247 seconds) was about 3.9 times faster than TenSEAL (63.706 seconds), owing to its support for batch processing of up to 10 samples. We demonstrate UniHENN's adaptability to various CNN architectures, including a 1D CNN and six 2D CNNs, highlighting its flexibility and efficiency for privacy-preserving cloud-based CNN services.
Paper Structure (51 sections, 2 theorems, 7 equations, 15 figures, 18 tables, 2 algorithms)

This paper contains 51 sections, 2 theorems, 7 equations, 15 figures, 18 tables, 2 algorithms.

Key Result

Theorem 1

Let $W_{img} \times H_{img}$ be the image size and $N_{layer}$ the number of total convolutional layers. Denote $(W_{in(i)}, H_{in(i)})$ and $(W_{out(i)}, H_{out(i)})$ as the input and output sizes of the $i$-th convolutional layer, and the kernel size is $(W_{ker(i)}, H_{ker(i)})$, stride size is $ Then, $H_{img} \geq H_{out(i)} \times H_{[st(i)]}$, where $H_{ker(i)} \geq H_{st(i)} \geq 1$ for al

Figures (15)

  • Figure 1: Overview of the UniHENN architecture.
  • Figure 2: Data transform for UniHENN.
  • Figure 3: Combining multiple ciphertexts into one.
  • Figure 4: Convolution operations on the two-dimensional input data and kernel.
  • Figure 5: Convolution operations on the flattened data.
  • ...and 10 more figures

Theorems & Definitions (4)

  • Theorem 1
  • proof
  • Corollary 1.1
  • proof