{"id":9983471,"url":"https://github.com/intel/he-transformer","last_synced_at":"2025-08-30T19:30:48.326Z","repository":{"id":48854082,"uuid":"210706616","full_name":"intel/he-transformer","owner":"intel","description":"nGraph-HE: Deep learning with Homomorphic Encryption (HE) through Intel nGraph","archived":true,"fork":false,"pushed_at":"2023-01-03T22:58:26.000Z","size":27716,"stargazers_count":172,"open_issues_count":25,"forks_count":35,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-15T14:02:09.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/intel.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}},"created_at":"2019-09-24T22:14:20.000Z","updated_at":"2024-11-07T08:37:45.000Z","dependencies_parsed_at":"2023-02-01T12:31:41.039Z","dependency_job_id":null,"html_url":"https://github.com/intel/he-transformer","commit_stats":null,"previous_names":["intel/he-transformer","intelai/he-transformer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fhe-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fhe-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fhe-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fhe-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intel","download_url":"https://codeload.github.com/intel/he-transformer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231518675,"owners_count":18389010,"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":[],"created_at":"2024-05-20T09:09:31.196Z","updated_at":"2024-12-27T17:30:42.875Z","avatar_url":"https://github.com/intel.png","language":"C++","readme":"# DISCONTINUATION OF PROJECT #\nThis project will no longer be maintained by Intel.\nIntel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.\nIntel no longer accepts patches to this project.\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/nGraph_mask_1-1.png\" width=\"200\"\u003e\n\u003c/p\u003e\n\n# HE Transformer for nGraph\n\nThe **Intel® HE transformer for nGraph™** is a Homomorphic Encryption (HE) backend to the [**Intel® nGraph Compiler**](https://github.com/IntelAI/ngraph), Intel's graph compiler for Artificial Neural Networks.\n\nHomomorphic encryption is a form of encryption that allows computation on encrypted data, and is an attractive remedy to increasing concerns about data privacy in the field of machine learning. For more information, see our [original paper](https://arxiv.org/pdf/1810.10121.pdf). Our [updated paper](https://arxiv.org/pdf/1908.04172.pdf) showcases many of the recent advances in he-transformer.\n\nThis project is meant as a proof-of-concept to demonstrate the feasibility of HE  on local machines. The goal is to measure performance of various HE schemes for deep learning. This is  **not** intended to be a production-ready product, but rather a research tool.\n\nCurrently, we support the [CKKS](https://eprint.iacr.org/2018/931.pdf) encryption scheme, implemented by the [Simple Encrypted Arithmetic Library (SEAL)](https://github.com/Microsoft/SEAL) from Microsoft Research.\n\nTo help compute non-polynomial activiations, we additionally integrate with the [ABY](https://github.com/encryptogroup/ABY) multi-party computation library. See also the [NDSS 2015 paper](https://encrypto.de/papers/DSZ15.pdf) introducing ABY. For more details about our integration with ABY, please refer to our [ARES 2020 paper](https://doi.org/10.1145/3407023.3407045).\n\nWe also integrate with the [**Intel® nGraph™ Compiler and runtime engine for TensorFlow**](https://github.com/tensorflow/ngraph-bridge) to allow users to run inference on trained neural networks through Tensorflow.\n\n## Examples\nThe [examples](https://github.com/IntelAI/he-transformer/tree/master/examples) folder contains a deep learning example which depends on the [**Intel® nGraph™ Compiler and runtime engine for TensorFlow**](https://github.com/tensorflow/ngraph-bridge).\n\n## Building HE Transformer\n\n### Dependencies\n- Operating system: Ubuntu 16.04, Ubuntu 18.04.\n- CMake \u003e= 3.12\n- Compiler: g++ version \u003e= 6.0, clang \u003e= 5.0 (with ABY g++ version \u003e= 8.4)\n- OpenMP is strongly suggested, though not strictly necessary. You may experience slow runtimes without OpenMP\n- python3 and pip3\n- virtualenv v16.1.0\n- bazel v0.25.2\n\nFor a full list of dependencies, see the [docker containers](https://github.com/IntelAI/he-transformer/tree/master/contrib/docker), which build he-transformer on a reference OS.\n\n#### The following dependencies are built automatically\n- [nGraph](https://github.com/NervanaSystems/ngraph) - v0.28.0-rc.1\n- [nGraph-bridge](https://github.com/tensorflow/ngraph-bridge) - v0.22.0-rc3\n- [SEAL](https://github.com/Microsoft/SEAL) - v3.4.5\n- [TensorFlow](https://github.com/tensorflow/tensorflow) - v1.14.0\n- [Boost](https://github.com/boostorg) v1.69\n- [Google protobuf](https://github.com/protocolbuffers/protobuf) v3.10.1\n\n### To install bazel\n```bash\n    wget https://github.com/bazelbuild/bazel/releases/download/0.25.2/bazel-0.25.2-installer-linux-x86_64.sh\n    bash bazel-0.25.2-installer-linux-x86_64.sh --user\n ```\n Add and source the bin path to your `~/.bashrc` file to call bazel\n```bash\n export PATH=$PATH:~/bin\n source ~/.bashrc\n```\n\n### 1. Build HE-Transformer\nBefore building, make sure you deactivate any active virtual environments (i.e. run `deactivate`)\n```bash\ngit clone https://github.com/IntelAI/he-transformer.git\ncd he-transformer\nexport HE_TRANSFORMER=$(pwd)\nmkdir build\ncd $HE_TRANSFORMER/build\ncmake .. -DCMAKE_CXX_COMPILER=clang++-6.0\n```\nNote, you may need sudo permissions to install he_seal_backend to the default location. To set a custom installation prefix, add the `-DCMAKE_INSTALL_PREFIX=~/my_install_prefix` flag to the above cmake command.\n\nSee 1a and 1b for additional configuration options. To install, run the below command (note, this may take several hours. To speed up compilation with multiple threads, call `make -j install`)\n```bash\nmake install\n```\n\n### 1a. Multi-party computation (MPC) with garbled circuits (GC)\nTo enable an integration with an experimental multi-party computation backend using garbled circuits via [ABY](https://github.com/encryptogroup/ABY), call\n```bash\ncmake .. -DNGRAPH_HE_ABY_ENABLE=ON\n```\nSee [MP2ML](https://doi.org/10.1145/3407023.3407045) for details on the implementation.\n\nWe would like to thank the [ENCRYPTO group](https://encrypto.de) from TU Darmstadt, particularly Hossein Yalame and Daniel Demmler, for helping with the ABY implementation.\n\nNote: this feature is experimental, and may suffer from performance and memory issues.\nTo use this feature, build python bindings for the client, and see `3. python examples`.\n\n#### 1b. To build documentation\nFirst install the additional required dependencies:\n```bash\nsudo apt-get install doxygen graphviz\n```\nThen add the following CMake flag\n```bash\ncd doc\ncmake .. -DNGRAPH_HE_DOC_BUILD_ENABLE=ON\n```\nand call\n```bash\nmake docs\n```\nto create doxygen documentation in `$HE_TRANSFORMER/build/doc/doxygen`.\n\n#### 1c. Python bindings for client\nTo build a client-server model with python bindings (recommended for running neural networks through TensorFlow):\n```bash\ncd $HE_TRANSFORMER/build\nsource external/venv-tf-py3/bin/activate\nmake install python_client\n```\nThis will create `python/dist/pyhe_client-*.whl`. Install it using\n```bash\npip install python/dist/pyhe_client-*.whl\n```\nTo check the installation worked correctly, run\n```bash\npython3 -c \"import pyhe_client\"\n```\nThis should run without errors.\n\n### 2. Run C++ unit-tests\n```bash\ncd $HE_TRANSFORMER/build\n# To run single HE_SEAL unit-test\n./test/unit-test --gtest_filter=\"HE_SEAL.add_2_3_cipher_plain_real_unpacked_unpacked\"\n# To run all C++ unit-tests\n./test/unit-test\n```\n\n### 3. Run python examples\nSee [examples/README.md](https://github.com/IntelAI/he-transformer/tree/master/examples/README.md) for examples of running he-transformer for deep learning inference on encrypted data.\n\n## Code formatting\nPlease run `maint/apply-code-format.sh` before submitting a pull request.\n\n\n## Publications describing the HE Transformer Implementation\n\n- Fabian Boemer, Yixing Lao, Rosario Cammarota, and Casimir Wierzynski. nGraph-HE: a graph compiler for deep learning on homomorphically encrypted data. In ACM International Conference on Computing Frontiers 2019. https://dl.acm.org/doi/10.1145/3310273.3323047\n- Fabian Boemer, Anamaria Costache, Rosario Cammarota, and Casimir\nWierzynski. 2019. nGraph-HE2: A High-Throughput Framework for\nNeural Network Inference on Encrypted Data. In WAHC’19. https://dl.acm.org/doi/pdf/10.1145/3338469.3358944\n- Fabian Boemer, Rosario Cammarota, Daniel Demmler, Thomas Schneider, and Hossein Yalame. 2020. MP2ML: A Mixed-Protocol Machine\nLearning Framework for Private Inference. In ARES’20. https://doi.org/10.1145/3407023.3407045\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintel%2Fhe-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintel%2Fhe-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintel%2Fhe-transformer/lists"}