【论文笔记】ZEN: Efficient Zero-Knowledge Proofs for Neural Networks

总结:

把现有的神经网络 (NN) 作为输入,转换成可用于零知识证明的,能保护输入测试数据的隐私,并且输出结果可验证(NN计算过程正确)。

本文提出了zkSNARK友好的量化方法,大大减少约束数量;提出了全新的stranded编码,利用有限域的元素来编码矩阵点积操作,可以批量计算,也减少了矩阵操作的约束数量。提升了证明效率。

零知识证明NN具有计算结果公开可验证、非交互式的优点。本文使用的是Groth16的snark,使用现有的ark-snark库。

架构:浮点NN -> 本文设计的量化方法 -> 量化NN -> 特殊编码 -> 编码成有限域中的元素,能用于零知识证明 -> R1CS -> 用于零知识证明

源码:

https://github.com/UCSB-TDS/ZEN

ZEN源码中提供了用python书写的量化NN的例子,其保存的模型参数,可以用于后续的零知识证明, tutorial 的详细步骤为:

1. 已经训练好的明文模型(浮点的NN)进行量化,先用PyTorch自带的方法进行量化,然后进行校正,使其可以用于zkSNARK系统(论文中的baseline: ZEN-vanilla)。

2. 目前已经有关于神经网络中组件(全连接层、卷积层等)的推断引擎(inference engine),可以用来对量化NN的准确率进行初步检测。

3. 目前已经实现NN中间每层的gadget circuits(例如ReLU, FC, Conv等),可以用来构建不同的NN模型的回路。

4. ZK中的NN结构包括了输入输出、输入输出的commitment、每层的参数和量化参数。

5. P需要根据量化参数得到输出结果,再生成输入输出的commitment,初始化NN回路,生成CRS,然后生成Proof

6. V读取输入输出的commitmentCRSProof进行验证

 

量化方法:

目前的NN使用的是有符号浮点数算数操作,与现有的基于有限域的零知识证明系统不兼容。现有的量化方法中输出层仍是有符号浮点数的操作、需要zkSNARK中非原子的操作(除法)。

首先利用现有的JKC18提出的量化方法把NN转成只包含无符号整数操作的NN,作为baseline,取名为ZEN-vanilla。

然后提出sign-bit grouping:去掉可能的负数

提出remainder-based verification:去掉除法操作。这两个优化后,量化的NN可以用于零知识证明,在不降低准确率的前提下减少了算数回路中的约束数。

 

特殊编码:

目前的量化NN在8位无符号整数下工作正常,但是zkSNARK使用椭圆曲线其有限域很大,因此想到能否多矩阵中的多个element 复用(multiplex)单个有限域元素,从而提升矩阵操作效率,类似于SIMD单指令多数据。本质上就是通过编码,同时批量计算很多向量点积操作,提升效率。

不能直接在有限域中堆叠8位无符号数,因此提出了stranded编码,使向量点乘使用更少的域操作。要同时得到s个向量Ai,Bi的点乘积,本来需要2ns个域元素,通过编码,只需要2n个元素:

 

NN:

X0是输入数据,n为层数,第i层根据权重Wi把上一层的输出Xi-1处理后得到本层输出Xi

利用量化方法,把NN的权重的特征都转成无符号整数,再嵌入有限域。

对于分类任务:

P和V事先约定好NN的结构、权重、激励函数等,也要有共同认可的CRS,P保持输入的隐私,但是会生成输入数据的承诺。V收到证据和承诺后,确定证据是否有效。

Gen:根据安全参数和量化NN模型,随机生成证明密钥pk和验证密钥vk

Prove:根据输入a和随机数r,P利用r来生成a的承诺cm,运行NN后得到的结果为ya,生成整个过程的证据。

Verify:根据承诺cm、验证密钥vk、分类结果ya和证据,对a的分类结果进行验证

 

对于识别任务:

一般先生成输入的embedding向量ya,然后根据距离标准L与ground truth embedding yg进行比较,小于一定阈值则认为识别成功。

         P和V对于NN结构、yg的承诺、距离标准L、阈值都达成共识。P要证明在私密输入ya下输出ya能满足阈值约束,输入ya是保密的。

Gen:根据安全参数和量化NN模型,随机生成证明密钥pk和验证密钥vk

Prove:给定输入a,yg,随机值r1,r2,s,P根据NN训练输入a得到ya,a的承诺cm1,ya的承诺cm2和yg的承诺cmg,P生成证据证明其计算过程以及ya满足阈值范围。

Verify:根据承诺cm1、cm2、cmg、验证密钥vk和证据,对识别结果进行验证

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Casola, V., & Castiglione, A. (2020). Secure and Trustworthy Big Data Storage. Springer. Corriveau, D., Gerrish, B., & Wu, Z. (2020). End-to-end Encryption on the Server: The Why and the How. arXiv preprint arXiv:2010.01403. Dowsley, R., Nascimento, A. C. A., & Nita, D. M. (2021). Private database access using homomorphic encryption. Journal of Network and Computer Applications, 181, 103055. Hossain, M. A., Fotouhi, R., & Hasan, R. (2019). Towards a big data storage security framework for the cloud. In Proceedings of the 9th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, USA (pp. 402-408). Rughani, R. (2019). Analysis of Security Issues and Their Solutions in Cloud Storage Environment. International Journal of Computer Trends and Technology (IJCTT), 67(6), 37-42. van Esbroeck, A. (2019). Zero-Knowledge Proofs in the Age of Cryptography: Preventing Fraud Without Compromising Privacy. Chicago-Kent Journal of Intellectual Property, 19, 374. Berman, L. (2021). Watch out for hidden cloud costs. CFO Dive. Retrieved from https://www.cfodive.com/news/watch-out-for-hidden-cloud-costs/603921/ Bradley, T. (2021). Cloud storage costs continue to trend downward. Forbes. Retrieved from https://www.forbes.com/sites/tonybradley/2021/08/27/cloud-storage-costs-continue-to-trend-downward/?sh=6f9d6ade7978 Cisco. (2019). Cost optimization in the multicloud. Cisco. Retrieved from https://www.cisco.com/c/dam/en/us/solutions/collateral/data-center-virtualization/cloud-cost-optimization/cost-optimization_in_multicloud.pdf IBM. (2020). Storage efficiency solutions. IBM. Retrieved from https://www.ibm.com/blogs/systems/storage-efficiency-solutions/ Microsoft Azure. (n.d.). Azure Blob storage tiers. Microsoft Azure. Retrieved from https://azure.microsoft.com/en-us/services/storage/blobs/#pricing Nawrocki, M. (2019). The benefits of a hybrid cloud strategy for businesses. DataCenterNews. Retrieved from https://datacenternews.asia/story/the-benefits-of-a-hybrid-cloud-strategy-for,请把这一段reference list改为标准哈佛格式
05-29
Casola, V. & Castiglione, A. (2020) 'Secure and Trustworthy Big Data Storage', Springer. Corriveau, D., Gerrish, B. & Wu, Z. (2020) 'End-to-end Encryption on the Server: The Why and the How', arXiv preprint arXiv:2010.01403. Dowsley, R., Nascimento, A. C. A. & Nita, D. M. (2021) 'Private database access using homomorphic encryption', Journal of Network and Computer Applications, 181, p.103055. Hossain, M. A., Fotouhi, R. & Hasan, R. (2019) 'Towards a big data storage security framework for the cloud', in Proceedings of the 9th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, USA, pp. 402-408. Rughani, R. (2019) 'Analysis of Security Issues and Their Solutions in Cloud Storage Environment', International Journal of Computer Trends and Technology (IJCTT), 67(6), pp. 37-42. van Esbroeck, A. (2019) 'Zero-Knowledge Proofs in the Age of Cryptography: Preventing Fraud Without Compromising Privacy', Chicago-Kent Journal of Intellectual Property, 19, p.374. Berman, L. (2021) 'Watch out for hidden cloud costs', CFO Dive. [online] Available at: https://www.cfodive.com/news/watch-out-for-hidden-cloud-costs/603921/ (Accessed: 5 October 2021). Bradley, T. (2021) 'Cloud storage costs continue to trend downward', Forbes. [online] Available at: https://www.forbes.com/sites/tonybradley/2021/08/27/cloud-storage-costs-continue-to-trend-downward/?sh=6f9d6ade7978 (Accessed: 5 October 2021). Cisco. (2019) 'Cost optimization in the multicloud', Cisco. [online] Available at: https://www.cisco.com/c/dam/en/us/solutions/collateral/data-center-virtualization/cloud-cost-optimization/cost-optimization_in_multicloud.pdf (Accessed: 5 October 2021). IBM. (2020) 'Storage efficiency solutions', IBM. [online] Available at: https://www.ibm.com/blogs/systems/storage-efficiency-solutions/ (Accessed: 5 October 2021). Microsoft Azure. (n.d.) 'Azure Blob storage tiers', Microsoft Azure. [online] Available at: https://azure.microsoft.com/en-us/services/storage/blobs/#pricing (Accessed: 5 October 2021). Nawrocki, M. (2019) 'The benefits of a hybrid cloud strategy for businesses', DataCenterNews. [online] Available at: https://datacenternews.asia/story/the-benefits-of-a-hybrid-cloud-strategy-for (Accessed: 5 October 2021).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Anyanyamy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值