yanndupis / swift-tensorflow-ppml

Privacy-preserving machine learning with Swift TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Privacy-Preserving Machine Learning with Swift TensorFlow

The purpose of this repository is to provide a series of privacy-preserving machine learning toy examples using Swift Tensorflow. The first technique we are looking into is secure computation (MPC). Federated learning and differential privacy examples will be added in the future.

Why experiment with Swift TensorFlow?

Even though, it's still the early days for Swift TensorFlow, it has lot of key features to build complex systems, combining cryptographic techniques such as secure computation and machine learning. With Swift TensorFlow you get the benefits of a type-safe language, C and PyThon interoperability, and a very performant numeric library with future XLA and MLIR support. Swift also gives you the ability to work in a single language from high abstraction to low level (assembly). If you want to learn more about the potential of Swift TensorFlow, there is an excellent presentation from Fast.ai.

Learning more about Swift TensorFlow

If you are looking for an ambitious project using Swift TensorFlow, you should check out the swiftai library and their amazing course. To get started, Swift TensorFlow also provides this tutorial.

Secure Computation Example: Encrypted Inference

Secure computation gives the amazing ability to compute on encrypted data. Using this cryptographic technique combined with machine learning, you could, for example, provide diabetic retinopathy diagnoses in the cloud without having to decrypt the retina image at any point during the process. If you want to learn more encrypted machine learning with the secure computation protocol(MPC), you can read this excellent blog post from Morten Dahl and TF Ecnrypted.

In the notebook Encrypted-Inference.ipynb, you will find an example where we perform inference on encrypted MNIST digit images. Even the model is encrypted. The MPC protocol is implemented from scratch in this notebook encrypted_tenso.ipynb.

Installation

Installation and /tools were taken from the fastai/swiftai library, which enables quick development and experiments with Swift TensorFlow.

To run the notebooks, run the following command to start the docker container:

make jupyter

About

Privacy-preserving machine learning with Swift TensorFlow


Languages

Language:Jupyter Notebook 81.6%Language:Swift 9.0%Language:Python 8.1%Language:Dockerfile 0.9%Language:Makefile 0.5%