UniHENN:设计无需 im2col 的更快且更通用的基于同态加密的 CNN
UniHENN: Designing Faster and More Versatile Homomorphic Encryption-based CNNs without im2col
AI总结:
UniHENN提出一种无需im2col的基于同态加密的CNN架构,通过一维展平与增量旋转执行卷积,显著提升推理速度与模型兼容性。
AI中文摘要:
同态加密(HE)通过允许在不解密的情况下对加密数据进行计算,实现了隐私保护的深度学习。然而,使用 HE 部署卷积神经网络(CNN)具有挑战性,因为需要使用 im2col 技术将输入数据转换为二维矩阵以进行卷积,该技术通过重新排列输入来实现高效计算。这限制了可使用的 CNN 模型类型,因为加密数据结构必须与特定模型兼容。UniHENN 是一种新颖的基于 HE 的 CNN 架构,它消除了对 im2col 的需求,增强了其通用性以及与更广泛 CNN 模型的兼容性。UniHENN 在不使用 im2col 的情况下将输入数据展平为一维。卷积核通过遍历图像,在展平的输入上使用增量旋转和结构化乘法来执行卷积,结果按步长间隔分布。实验结果表明,在推理时间方面,UniHENN 显著优于名为 PyCrCNN 的最先进 2D CNN 推理架构。例如,在 LeNet-1 模型上,UniHENN 的平均推理时间为 30.089 秒,比 PyCrCNN 的 800.591 秒快约 26.6 倍。此外,在并发图像处理方面,UniHENN 优于经过 im2col 优化的 CNN 模型 TenSEAL。对于十个样本,UniHENN(16.247 秒)比 TenSEAL(63.706 秒)快约 3.9 倍,这得益于其对多达 10 个样本批处理的支持。我们展示了 UniHENN 对各种 CNN 架构的适应性,包括一个 1D CNN 和六个 2D CNN,突显了其在隐私保护的基于云的 CNN 服务中的灵活性和效率。
英文摘要:
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.