IBM / fhe-toolkit-linux

IBM Fully Homomorphic Encryption Toolkit For Linux. This toolkit is a Linux based Docker container that demonstrates computing on encrypted data without decrypting it! The toolkit ships with two demos including a fully encrypted Machine Learning inference with a Neural Network and a Privacy-Preserving key-value search.
MIT License
1.43k stars 158 forks source link

Keras layers support #188

Closed stealthBanana closed 2 years ago

stealthBanana commented 2 years ago

Hi I'm having a lot of trouble in finding out which keras layers are supported by the library, is there a documentation? I checked out the ML-HElib api documentation but did not find any answers, furthermore, in the ML-HElib doc states that the SimpleNeuralNet class has a fixed architecture of 3 fully connected layers, however in the examples there are models with one single layer and models like the AlexNet which has more than 3 layers. What are the limitations of a model's architecture using this library, and are there any workarounds for said limitations?

github-actions[bot] commented 2 years ago

Thank you very much for helping us to improve the quality of our software. The FHE Toolkit development team want to sincerely thank you for submitting your first issue and joining our technical community! We will get started on your issue immediately.

dubek commented 2 years ago

Hi @stealthBanana . fhe-toolkit-linux and its ML-HElib library are no longer supported; you can try to use the HELayers C++ or Python docker images, as explained in the README. HELayers supports complex models such as AlexNet, as you found out.

boland25 commented 2 years ago

@stealthBanana thanks for posting, and as @dubek has already explained we aren't supporting the toolkit anymore, and have moved onto HELayers SDK. Please check out the latest release as it will have more of what you are looking for. You can either go to hub.docker.com and download helayers or run one of the scripts in this repo that will help you do it, such as this one ./StartHELayers.sh python. thanks!

stealthBanana commented 2 years ago

My bad, I didn't mention it in my question but I'm already using the docker image or the pyhelyers library, however the only documentation I could find are the notebook examples and I did not find any information on which keras layers are supported.

boland25 commented 1 year ago

@stealthBanana I see what you are saying. While we currently don't have any complete documentation that describes how to use the different tools, we do have several notebook examples. Several of them use keras.layers such as Activation or Dense. You can look at these examples and get a general idea of how to use it in your work. Specifically they are used in 04_TextClassification, 09_NeuralNetwork_MNIST, 13_pyhelayersext_NeuralNetwork_FraudDetection. There are a few others too if you search for them. The other thing that we do have is basic documentation on the C++ image. It is available by exposing another port, 8445, and then accessing it from there. It should help give you an overview of the SDK. I hope this helps get you started, as we are working toward more complete documentation. thanks!