{"id":13613091,"url":"https://github.com/capeprivacy/tf-world-tutorial","last_synced_at":"2025-04-13T15:32:35.138Z","repository":{"id":43123942,"uuid":"210668499","full_name":"capeprivacy/tf-world-tutorial","owner":"capeprivacy","description":"TensorFlow World 2019 Tutorial: Privacy-Preserving Machine Learning with TF Encrypted \u0026 PySyft","archived":true,"fork":false,"pushed_at":"2023-05-16T22:18:04.000Z","size":4871,"stargazers_count":47,"open_issues_count":14,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-13T21:55:34.010Z","etag":null,"topics":["cryptography","deep-learning","privacy","secure-computation","tensorflow"],"latest_commit_sha":null,"homepage":"https://privacy.ai","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capeprivacy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-09-24T18:12:38.000Z","updated_at":"2024-01-14T00:00:25.000Z","dependencies_parsed_at":"2024-01-14T04:45:58.592Z","dependency_job_id":"40d3ffde-4b38-4a14-aab2-b3b06137deb4","html_url":"https://github.com/capeprivacy/tf-world-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capeprivacy%2Ftf-world-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capeprivacy%2Ftf-world-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capeprivacy%2Ftf-world-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capeprivacy%2Ftf-world-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capeprivacy","download_url":"https://codeload.github.com/capeprivacy/tf-world-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223592494,"owners_count":17170498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","deep-learning","privacy","secure-computation","tensorflow"],"created_at":"2024-08-01T20:00:39.564Z","updated_at":"2024-11-07T21:30:44.390Z","avatar_url":"https://github.com/capeprivacy.png","language":"Jupyter Notebook","funding_links":[],"categories":["Tutorials and Courses"],"sub_categories":[],"readme":"# TensorFlow World: Privacy-Preserving Machine Learning with TensorFlow\n\n**Disclaimer: please note that the installation instructions will be updated until October 22nd and the tutorial until October 28th.**\n\nIn this tutorial, you will learn how to build and deploy privacy-preserving machine learning models using [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted), [PySyft-TensorFlow](https://github.com/OpenMined/PySyft-TensorFlow), and the [TensorFlow](https://www.tensorflow.org/) ecosystem.\n\nThis tutorial was created for the [TensorFlow World conference](https://conferences.oreilly.com/tensorflow/tf-ca/public/schedule/detail/78557) on Tuesday, October the 29th 2019 at 1:30pm PST.\n\nPlease join the [TF Encrypted Slack](https://join.slack.com/t/tf-encrypted/shared_invite/enQtNjI5NjY5NTc0NjczLWM4MTVjOGVmNGFkMWU2MGEzM2Q5ZWFjMTdmZjdmMTM2ZTU4YjJmNTVjYmE1NDAwMDIzMjllZjJjMWNiMTlmZTQ). We will be answering questions in the `tf-world-2019` channel!\n\n## Description\n\nToday, we’re trying to take advantage of machine learning across many facets of modern life. However, many of our most impactful uses of machine learning in health care, transportation, and finance are blocked as they require access to sensitive data. In this tutorial, attendees will learn how to use [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted) and [PySyft](https://github.com/OpenMined/PySyft-TensorFlow) to train and deploy machine learning models using remote execution, secure federated learning, and encrypted predictions in the cloud while preserving the privacy of both the model and the end user’s input data.\n\n[TF Encrypted](https://github.com/tf-encrypted/tf-encrypted) and [PySyft](https://github.com/OpenMined/PySyft-TensorFlow) are complementary open-source libraries for designing and building privacy-preserving machine learning workflows.  They both extend TensorFlow and aim to make privacy-preserving machine learning easy without needing to understand the complexities of cryptography, distributed systems, or high-performance computing.\n\nAttendees will use [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted), [PySyft](https://github.com/OpenMined/PySyft-TensorFlow) and TensorFlow to train and deploy machine learning models to the cloud while preserving the privacy of both the model and the end user’s input data. After an introduction to the landscape of privacy-preserving machine learning, we'll dive into a series of hands-on exercises for building models with [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted)’s secure primitives and [PySyft-TensorFlow](https://github.com/OpenMined/PySyft-TensorFlow).  Attendees will take away the skills needed to identify use cases requiring heightened privacy and security, as well as learn how to design, prototype, and deploy private machine learning.\n\n## Installation\n\nTo run these notebooks you will need to install:\n- UNIX-based OS (e.g. Ubuntu or MacOS)\n- Python 3.6+\n- [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted)\n- [PySyft TensorFlow](https://github.com/OpenMined/PySyft-TensorFlow)\n- [TensorFlow 2.0](https://www.tensorflow.org/api_docs/python/tf)\n- [NumPy](https://numpy.org/)\n- [Jupyter Notebook](https://jupyter.org/)\n\nTo install all these dependencies you can simply run: `pip3 install -r requirements.txt`.\n\nTo manage dependencies, you can use a virtual environment like `venv` or a package manager like `conda`.  Here's an example using `conda`:\n\n```\nconda create -n ppml python=3.7\nconda activate ppml\npip install -r requirements.txt\n```\n\nThe tutorial consists of three sequential parts:\n1. `remote-execution`\n2. `federated-learning`\n3. `private-prediction`\n\nYou can access and execute each step in the tutorial from the Jupyter console by running the command `jupyter notebook` from the root directory.\n\nYou can find the presentation slides [here](TensorFlow-World-Tutorial-2019-final.pdf).\n\n### Google Cloud Installation\n\nIf you want to run this tutorial with [Google Cloud Platform](https://cloud.google.com/), you will need a [GCP account](https://cloud.google.com/) and install [Google SDK](https://cloud.google.com/sdk/install). See below for a quick reference to the installation procedure.\n\nRun the following commands based on your OS to install gcloud tool.\n\n**MacOS**\n\n```shell\nbrew cask install google-cloud-sdk\n```\n\n**Debian/Ubuntu**\n\n```shell\necho \"deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main\" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list\nsudo apt-get install apt-transport-https ca-certificates curl\ncurl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -\nsudo apt-get update \u0026\u0026 sudo apt-get install google-cloud-sdk\n```\n\n**Initialize gcloud (Any OS)**\n\nRun the following command to initialize your Google Cloud configuration. You will have to complete the following:\n\n- Log into the account created above.\n- Set your default project to use, it will prompt you to create one if you haven't already made one.\n- Set your default zone and region to use.\n\n```\ngcloud init\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapeprivacy%2Ftf-world-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapeprivacy%2Ftf-world-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapeprivacy%2Ftf-world-tutorial/lists"}