Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 3.04 KB

README.md

File metadata and controls

50 lines (34 loc) · 3.04 KB

cryptotree

Cryptotree is an implementation of Neural Random Forests, and Homomorphic Random Forests.

Cryptotree is an open-source package to allow the Decision Trees and Random Forests to be used on encrypted data, using the homomorphic encryption library Microsoft SEAL, and its Python wrapper TenSEAL. Cryptotree uses the recent encryption scheme CKKS, which is implemented in SEAL, to perform homomorphic computation.

By leveraging the fact that Random Forests can be modeled by Neural Random Forests (2016, Biau, Scornet & Welbl), cryptotree proposes an homomorphic evaluation of these Neural Networks in a SIMD (Single Instruction Multiple Data) manner, in order to do homomorphic evaluation of Homomorphic Random Forests.

Cryptotree therefore both implements Neural Random Forests, and Homomorphic Random Forests, and allows the use of powerful supervised models on encrypted data.

Cryptotree is developped using nbdev, which allows to develop efficiently in Jupyter notebooks. The code is therefore available in the folder nbs/, and has been structured to be heavily documented with examples for a better understanding of cryptotree.

Install

As of now, there are two ways to install cryptotree, which is dependent on TenSEAL :

  1. Manual installation :
    1. Follow the install instructions of SEAL-python : https://github.com/OpenMined/TenSEAL
    2. Git clone this repository : git clone https://github.com/dhuynh95/cryptotree.git
    3. Cd into the repository and run the installation : cd cryptotree & pip3 install .
  2. Use Docker :
    1. Git clone the cryptotree repository :
      git clone https://github.com/dhuynh95/cryptotree.git
    2. Create the Docker image : docker build -t cryptotree .

Examples

A full example of the Adult income dataset can be found in https://github.com/dhuynh95/cryptotree/blob/master/examples/adult_dataset.ipynb.

It can be run easily with the Docker image, just by running the following command after the image has been successfully built : sudo docker run -p 8888:8888 cryptotree /bin/sh /cryptotree/examples/adult_income/run_jupyter_server.sh. This command simply performs port forwarding for the Jupyter server which will be launched.

Paper

Cryptotree: fast and accurate predictions on encrypted structured data

TODO

  • Implement Baby step, Giant step for homomorphic polynomial evaluation
  • Find a way to fine tune the comparator and the matcher of the neural decision trees, while preserving the invariant which is having an output in $[-1,1]$

Contributors