{"id":13641401,"url":"https://github.com/Jumpst3r/tensorflow-lite-sgx","last_synced_at":"2025-04-20T07:33:22.742Z","repository":{"id":79527905,"uuid":"353600949","full_name":"Jumpst3r/tensorflow-lite-sgx","owner":"Jumpst3r","description":"A port of the tensorflow-lite for microcontrollers framework to Intel's SGX Framework. Designed to simplify research of privacy preserving machine learning in the context of trusted execution environments (TEEs).","archived":false,"fork":false,"pushed_at":"2021-05-12T06:45:45.000Z","size":26579,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-09T11:38:21.109Z","etag":null,"topics":["privacy-preserving-machine-learning","sgx","sgx-enclave","tensorflow"],"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/Jumpst3r.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":"2021-04-01T06:40:16.000Z","updated_at":"2024-09-10T06:53:00.000Z","dependencies_parsed_at":"2023-06-14T11:30:46.379Z","dependency_job_id":null,"html_url":"https://github.com/Jumpst3r/tensorflow-lite-sgx","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/Jumpst3r%2Ftensorflow-lite-sgx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jumpst3r%2Ftensorflow-lite-sgx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jumpst3r%2Ftensorflow-lite-sgx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jumpst3r%2Ftensorflow-lite-sgx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jumpst3r","download_url":"https://codeload.github.com/Jumpst3r/tensorflow-lite-sgx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249864351,"owners_count":21336727,"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":["privacy-preserving-machine-learning","sgx","sgx-enclave","tensorflow"],"created_at":"2024-08-02T01:01:20.429Z","updated_at":"2025-04-20T07:33:22.322Z","avatar_url":"https://github.com/Jumpst3r.png","language":"C++","funding_links":[],"categories":["Machine Learning"],"sub_categories":["Library OSes and SDKs"],"readme":"# Tensorflow Lite For Intel SGX\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"header.png\"\u003e\n\u003c/p\u003e\n\n\n\n*A minimal port of the Tensorflow Lite for Microcontrollers on Intel SGX*\n\n\n\n## Table of Contents\n\n  * [Description](#Description)\n  * [Disclaimer](#Disclaimer)\n  * [Requirements](#Requirements)\n  * [Usage](#Usage)\n\n## Description\n\nThis repository contains a port of [TensorFlow Lite for Microcontrollers](https://www.tensorflow.org/lite/microcontrollers) library for Intel SGX. It is intended to be easy to understand and follows the same source code structure as Intel's sample enclave code. Furthermore, it does not require an a priori installation of Tensorflow or complex build systems and toolchains (except the Intel SGX SDK \u0026 tools).\n\nThis port supports non-quantized `float32` models and compatible `float32` inputs. The port is model and input agnostic and should work on any [TF light flatbuffer](https://www.tensorflow.org/lite/convert) model and input. \n\nThe sole restriction is that the model **must** be compromised of operators supported by the TensorFlow Lite for Microcontrollers library, a full list of supported operators can be found [here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/all_ops_resolver.cc).\n\nThe library can only be used to perform inference tasks, this limitation is due to the Tensorflow lite library and not the SGX environment.\n\n## Disclaimer\n\nThis port is designed to facilitate research on privacy preserving ML in the context of Intel SGX Enclaves. As such, it is not intended to be used in production and should not be used to protect model or data confidentiality.\n\n## Requirements\n\nRequires a platform with Intel SGX support, an installed SGX [driver](https://github.com/intel/linux-sgx-driver) and the Intel SGX [SDK](https://github.com/intel/linux-sgx). If you are able to compile and run the [sample Enclave](https://github.com/intel/linux-sgx/tree/master/SampleCode/SampleEnclave) after installing the SGX driver \u0026 SDK, you should have no problems building and running this project.\n\n## Usage\n\nAfter compiling the project (`make clean \u0026\u0026 make -j4`), the application can be launched with \n\n```bash\n./tf-sgx-infer \u003cmodel path\u003e \u003cinput path\u003e\n```\n\nAny  [TF light flatbuffer](https://www.tensorflow.org/lite/convert)  model (non quantized, in `float32` format) is compatible, up to the list of supported operators. Model inputs should also be saved in a `float32` format, which can be done for example in the following manner:\n\n```python\nnparr.astype('float32').tofile('input.bin')\n```\n\nLoading large models from disk might require increasing the default stack size on linux. If you run into segmentation faults, try increasing the stack size as follows:\n\n```bash\nulimit -S -s 131072   \n```\n\nThis will temporarly increase the stack size from 8MB to 128MB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJumpst3r%2Ftensorflow-lite-sgx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJumpst3r%2Ftensorflow-lite-sgx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJumpst3r%2Ftensorflow-lite-sgx/lists"}