Skip to content

hm-choi/uni-henn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview of the UniHENN

Official repository for UniHENN: Designing More Versatile Homomorphic Encryption-based CNNs without im2col
by Hyunmin Choi1,2, Jihun Kim2, Seungho Kim2, Seonhye Park2, Jeongyong Park2,3, Wonbin Choi1, and Hyoungshick Kim2**

1 NAVER Cloud, South Korea 2 Sungkyunkwan University, South Korea 3 Samsung Electronics, South Korea

** Corresponding author

You can read the paper here: ArXiv Link

Designing Faster and More Versatile Homomorpic Encryption-based CNNs

UniHENN is a Python package that provides Homomorphic Encryption(HE)-based CNN inference. It provides the following features:

  • HE-based CNN inference compatible with pytorch library
    • Automatically convert each layer to a compatible HE-based layer
    • Not only offers 2D-CNN, but also offers 1D CNN inference.
  • It offers batch operation to optimize the inference time

Server Setting

  • We use NAVER Cloud servers (https://www.ncloud.com/product/compute/server)
  • In this scenario, we use the following server spec.
    • All server spec are Standard-g2 Server.
    • CentOS 7.8.64
    • 16 cores (Intel(R) Xeon(R) Gold 5220 CPU @ 2.20GHz) with 64GB DRAM

Requirements

How to use

If you want to test the M3 model, enter the following command in the shell:

python main.py 3

You can enter values from 1 to 6.

Dataset

We use MNIST and CIFAR10 datasets for 2D CNN models which can be downloaded using Torchvision. The details about datasets can be found at https://pytorch.org/vision/0.15/datasets.html.

HE Parameters

We use the Cheon-Kim-Kim-Song(CKKS) scheme following parameter settings:

Parameter Value
# of slots 8,192
log Q 432
PK(MB) 1.87
SK(MB) 0.94
GK(GB) 0.57
RK(MB) 22.52
ctxt(MB) 1.68
# of mult(depth) 11

The PK, SK, GK, and RK mean the public key, secret key, galois key, and relinearization key each other. These parameter settings guarantee the 128-bit security parameters.

Models

We conducted seven experiments to test the performance of UniHENN with various models and data. The test file is in the uni_henn directory.

Model Type Dataset # of layers Test file
M1 2D CNN MNIST 6 M1_test.py
M2 2D CNN MNIST 8 M2_test.py
M3 2D CNN MNIST 7 M3_test.py
M4 2D CNN MNIST 12 M4_test.py
M5 2D CNN Cifar-10 11 M5_test.py
M6 1D CNN ECG Dataset 7 M6_test.py

Contributing

Publications

TBD

License

TBD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •