The GPU version of HEaaN code is not available for public release as it is a proprietary asset of CryptoLab.
So, these codes are re-constructed by using HEaaN-SDK.
HEaaN-SDK is a package for data science/data analysis under homomorphic encryption using the HEaaN library.
We used the CPU version of the HEaaN-SDK, which is publicly available, to program in the same manner as described in our paper.
Costs such as communication and time might be different which is represented in the paper.
GPU version of HEaaN
- Experiment environment : AMD RYZEN 5950X CPU, NVIDIA Quadro RTX A6000 48GB GPU, and 128GB RAM using ubuntu 20.04LTS
D1 | D2 | D3 | D4 | |
---|---|---|---|---|
Training Time(seconds) | 12.73 ± 0.87 | 12.87 ± 0.06 | 14.2 ± 0.11 | 9.97 ± 0.11 |
Inference Time(milliseconds) | 835 ± 0.7 | 835 ± 0.3 | 838 ± 0.2 | 3180 ± 4.0 |
CPU version of HEaaN (HEaaN-SDK)
- Experiment environment : Same as GPU version. The experiments were conducted within a Docker container.
D1 | D2 | D3 | D4 | |
---|---|---|---|---|
Training Time(seconds) | 77.19 ± 2.14 | 77.50 ± 2.74 | 85.49 ± 2.13 | 63.96 ± 1.69 |
Inference Time(seconds) | 8.83 ± 0.12 | 8.65 ± 0.05 | 8.62 ± 0.05 | 35.57 ± 0.61 |
The accuracy of the CPU version code is identical to the accuracy of the reported in the paper.
D1 | D2 | D3 | D4 | |
---|---|---|---|---|
Accuracy | 100% | 100% | 97.8% | 74.9% |
- run.sh : shell script for running the main
- NB_WMain.py : main code for training and classfy each data
- NB_WModule.py : functions for encrypt, train, inference
- NB_log.py : approximate logarithm function
- data_devide.py : devide the test data
keys
├─public_keypack
│ └─PK
└─secret_keypack
- Create directories with this structure
- Unzip the "PK1.zip, PK2.zip, PK3.zip, PK4.zip" files and place those inside the "PK" directory
- Place the scretekey.bin file inside the "secret_keypack" directory
-
Install HEaaN.stat docker image (https://hub.docker.com/r/cryptolabinc/heaan-stat)
docker pull cryptolabinc/heaan-stat:0.2.0-cpu-x86_64-avx512
-
Create docker container
docker run -d -p 8888:8888 --name <container-id> cryptolabinc/heaan-stat:0.2.0-cpu-x86_64-avx512
-
Clone this repository in your docker container
-
According to the instructions in the Key File Setting, Unzip the zip files and create a ‘keys’ directory
-
Devide the test data : change the directory name in 'data_devide.py’
python3 data_devide.py
-
Run shell script