mpc-msri / EzPC

MIT License
395 stars 121 forks source link

Model and dataset replacement for "EzPC/SIRNN" #154

Open zwxandy opened 1 year ago

zwxandy commented 1 year ago

Hi, I am very interested in SiRNN, but I have difficulties in replacing RNN model and Google-30 dataset with CNN model and CIFAR-10 dataset. I note that the input and weight in "EzPC/SIRNN" are all in the format of "*.npz", but this seems not so friendly to a pre-trained CNN model and CIFAR-10 dataset.

I still have no idea of solving this problem. If anyone can help me with this problem, I would appreciate it very much! Thanks a lot!

xingpz2008 commented 1 year ago

As far as I know, all parameters and input data in the repo are processed and stored with the format of Numpy Array by fixed-point encoding scheme.

If you want to use your own data for secure inference, there are two approaches available:

  1. Convert the network via Athos and get the generated .ezpc file, as I mentioned in another issue by you. This file is protocol-independent and can be further implemented with any valid protocol series. (Note that the final output of Athos might implement protocols from CryptFlow2 by default, and you have to use the intermediate .ezpc file with new EzPC compile command)

  2. You can manually use scripts under Athos folder. One of the scripts is responsible for data conversion. This procedure is network-independent, usually used for input data conversion. If you want to convert network parameters, call Athos and get the input data with .inp postfix.