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.
As of now, there are two ways to install cryptotree, which is dependent on TenSEAL :
- Manual installation :
- Follow the install instructions of SEAL-python : https://github.com/OpenMined/TenSEAL
- Git clone this repository :
git clone https://github.com/dhuynh95/cryptotree.git
- Cd into the repository and run the installation :
cd cryptotree & pip3 install .
- Use Docker :
- Git clone the cryptotree repository :
git clone https://github.com/dhuynh95/cryptotree.git
- Create the Docker image :
docker build -t cryptotree .
- Git clone the cryptotree repository :
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.
Cryptotree: fast and accurate predictions on encrypted structured data
- 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]$