Skip to main content
QUICK REVIEW

[论文解读] nGraph-HE2: A High-Throughput Framework for Neural Network Inference on Encrypted Data

Fabian Boemer, Anamaria Costache|arXiv (Cornell University)|Aug 12, 2019
Advanced Neural Network Applications参考文献 37被引用 31
一句话总结

nGraph-HE2 是一种高吞吐量框架,通过同态加密在加密数据上实现隐私保护的推理,利用 CKKS 方案和客户端辅助的两方计算,支持具有非多项式激活函数的标准预训练模型。它在 CryptoNets 上实现了 1998 张图像/秒的最先进吞吐量,并首次实现了在 ImageNet 上对 MobileNetV2 的同态评估,top-1 准确率为 60.4%,每张图像的平均运行时间为 381 ms。

ABSTRACT

In previous work, Boemer et al. introduced nGraph-HE, an extension to the Intel nGraph deep learning (DL) compiler, that enables data scientists to deploy models with popular frameworks such as TensorFlow and PyTorch with minimal code changes. However, the class of supported models was limited to relatively shallow networks with polynomial activations. Here, we introduce nGraph-HE2, which extends nGraph-HE to enable privacy-preserving inference on standard, pre-trained models using their native activation functions and number fields (typically real numbers). The proposed framework leverages the CKKS scheme, whose support for real numbers is friendly to data science, and a client-aided model using a two-party approach to compute activation functions. We first present CKKS-specific optimizations, enabling a 3x-88x runtime speedup for scalar encoding, and doubling the throughput through a novel use of CKKS plaintext packing into complex numbers. Second, we optimize ciphertext-plaintext addition and multiplication, yielding 2.6x-4.2x runtime speedup. Third, we exploit two graph-level optimizations: lazy rescaling and depth-aware encoding, which allow us to significantly improve performance. Together, these optimizations enable state-of-the-art throughput of 1,998 images/s on the CryptoNets network. Using the client-aided model, we also present homomorphic evaluation of (to our knowledge) the largest network to date, namely, pre-trained MobileNetV2 models on the ImageNet dataset, with 60.4\percent/82.7\percent\ top-1/top-5 accuracy and an amortized runtime of 381 ms/image.

研究动机与目标

  • 通过同态加密在标准预训练深度神经网络上实现高效、高吞吐量的推理。
  • 通过引入客户端辅助计算,克服先前框架仅支持多项式激活函数的限制,支持 ReLU 和 MaxPool 等非多项式函数。
  • 通过新颖的编码、打包和图级技术,优化 CKKS 同态加密方案以适应深度学习工作负载。
  • 无缝集成到 TensorFlow 和 PyTorch 等主流深度学习框架中,无需模型微调或密码学专业知识。
  • 在保留准确率的前提下,实现对真实世界模型(如 ImageNet 上的 MobileNetV2)的低延迟和高吞吐量。

提出的方法

  • 利用原生支持实数和明文打包的 CKKS 同态加密方案,实现对加密数据的高效计算。
  • 提出客户端辅助的两方计算,其中客户端在明文数据上执行非多项式激活函数(如 ReLU、MaxPool),并将加密结果返回服务器。
  • 通过使用复数打包优化 CKKS 中的标量编码,实现高达 88 倍的加速,吞吐量翻倍。
  • 应用图级优化技术,包括延迟重缩放和深度感知编码,以减少重缩放开销,提升 CryptoNets 网络的性能。
  • 采用批量轴明文打包技术,实现高效的重塑(Reshape)操作,并在单个批次中提升多张图像的吞吐量。
  • 采用混合方法,对线性层使用同态加密,对非线性部分使用客户端计算,最大限度减少密码学开销,同时保持隐私。

实验结果

研究问题

  • RQ1同态加密能否高效应用于具有 ReLU 和 MaxPool 等非多项式激活函数的标准预训练深度神经网络?
  • RQ2如何优化 CKKS 中的明文打包,以最大化加密数据上深度学习推理的吞吐量?
  • RQ3哪些图级优化能显著降低同态推理中的运行时开销,特别是在小型网络(如 CryptoNets)中?
  • RQ4能否在加密的 ImageNet 数据上实现对大型现代模型(如 MobileNetV2)的同态评估,并达到可接受的准确率和延迟?
  • RQ5客户端辅助计算在多大程度上能减轻服务器的计算负担,同时保持端到端的隐私性?

主要发现

  • nGraph-HE2 在 CryptoNets 网络上通过优化的标量编码和打包技术,利用 CKKS 同态加密,实现了 1998 张图像/秒的最先进吞吐量。
  • 通过优化的复数打包和 CKKS 特异性优化,标量编码延迟降低了 3 倍至 88 倍。
  • 通过 SEAL 库中的算法和实现级改进,密文-明文加法和乘法操作加速了 2.6 倍至 4.2 倍。
  • 延迟重缩放通过将重缩放操作推迟到必要时刻,在 CryptoNets 网络上将延迟降低了最多 8 倍。
  • 首次在 ImageNet 上实现对 MobileNetV2 的同态评估,top-1 准确率为 60.4%,top-5 准确率为 82.7%,在局域网环境下每张图像的平均运行时间为 381 ms。
  • 由于同态加密导致的准确率下降极小,所有测试图像尺寸下的平均 top-1 准确率下降仅为 0.0136(约 50,000 张图像中少 7 张)

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。