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

Extensibility for the existing use cases being provided in the Notebook #190

Closed Deepansharora27 closed 1 year ago

Deepansharora27 commented 1 year ago

Feature description Hi, I was going through the IBM FHE Toolkit and have set it up locally on my System. I am very amazed to see the variety of examples that have been packaged along with the Toolkit and are very easy to use and performant. I have a question pertaining to this that I wanted to ask which is that, if let's say I have a customised use case on which I want to build upon and make use of IBM FHE.

Hypothetically let's assume that I want to perform inference using some algorithm(that is not present in the existing code samples) or let's say even if the algorithm that we want to use is already being used as a reference in the existing code examples but I want to use some another variation of the algorithm.

How will this be tackled ? Is there a reference to a wiki or documentation that I am missing out on that contains a set of primitives that I can put to use OR Will I have to be in constant sync with the IBM Team for this OR Is there some work actively going around this ? Any help would be appreciated on this

Thanks !!

github-actions[bot] commented 1 year 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.

boland25 commented 1 year ago

Hi @Deepansharora27 thanks for reaching out. I can help with your question but I want to clarify first what you might be referring to. The IBM Toolkit for Linux is a bit old and has been phased out for the next step in this called HELayers SDK. There is a link on the main page of this site that points you to the HELayers SDK. Is that what you are referring to? The SDK has a c++ and a python image for exploring. There are 19 different tutorial/demos to choose from, so if you haven't seen it yet, please check it out. If this is what you are referring to, then there is a tutorial that shows you how to take existing work and transform it into an encrypted inference. In that case take a look in the python notebook at numbers 12 & 13. They will help show you how.

In the case of documentation, the only docs we currently have are in the c++ image. And that can be reached by running the image and exposing port 8445. While It is c++ the apis are basically the same. we are currently working on python documentation.

Please let me know if I can help explore your use case any further!

Deepansharora27 commented 1 year ago

Hi @boland25, Thanks a lot for your prompt response. Yes, I have setup the HELayers SDK on my Machine and I have explored the Python Image under which as you said that there are a total of 19 different tutorial/demos to choose from. The Tutorials are absolutely well organised and kudos to the team for building such a great SDK with focus on great user experience.

I also took a peek at the C++ Image and have explored the documentation for that as well.

If I put my use case into exact words, it is that let's say apart from the Machine Learning Algorithms that are being used in the Python Notebook(Like Neural Network Inference, Logistic Regression), if I want to use a another variant of the algorithms(like Recurrent Neural Networks(RNN's) OR let's say CNN for that matter) how can I build upon these ?

If the provision for it is not there in the Community Edition of the SDK, is it present in the Premium Edition Program? These are the questions which I have in mind and would love to hear your feedback on this.

I am trying to implement a POC for FHE and after going through the SDK, I found it appropriate to our use case and if there is a provision for extensibility to potentially newer use cases using a different set of algorithms, then I would love to hear your thoughts on this Thanks !!

boland25 commented 1 year ago

To answer your question, it really depends on what you want to do. For Recurrent Neural Networks, there is too much multiplication involved in the models at this point to make it run fast enough for you to use. So that one isn't a good FHE candidate. For Convolutional Neural Network, we can do that and it is explained in the 05_Deep_neural_networks. I would take a look at notebooks 12 & 13. 12 shows simple integration with scikit-learn library to take existing work and make the inferencing encrypted & 13 does it for a Neural Network using Keras.

If you are thinking about using something that isn't in one of our tutorial, it doesn't mean that it isn't possible. You can try to implement it, but if it will probably take a lot of trial and error. And your results may not be what you want

Deepansharora27 commented 1 year ago

Thanks for your prompt response @boland25 I did had a look at the Notebook Number 12 and Notebook Number 13 and that answers my question of taking existing work and then making the inferencing part encrypted.

But yeah, I was more focused on the latter use case, and your explanation has answered my question now :) Thanks a lot for the Help !!

boland25 commented 1 year ago

👍 anytime! Keep me posted on any progress you make, if you want to share, would love to hear about it!