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.
