Skip to content

waLLLnut/FHE16-CNN

Repository files navigation

FHE16-CNN on MNIST

A small CNN trained on MNIST and executed over encrypted data using the FHE16 homomorphic encryption scheme.

  • Dataset: MNIST (handwritten digits)
  • Architecture: Conv(3×3, stride=3) → ReLU → SumPool(3×3) → FC(27→10)

Run Instructions

(Optional) Train a new CNN model

python train_mnist_fhe_cnn.py --epochs 15

build essentials

sudo apt install libjemalloc2
sudo apt install libnuma-dev

Download MNIST samples

python export_mnist_samples.py

Build

mkdir build
mv run_all.sh build/
cd build
cmake ..
make

Set library path (required before running)

echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../FHE_TEST/lib' >> ~/.bashrc
source ~/.bashrc

Run the executables

./test          # Inference for a single MNIST sample
./run_all.sh    # Run inference for 1000 MNIST samples (divided into 10 batches)
                 # Results will be saved to accuracy_log.txt

FHE16 CNN Report

📄 Reports

Click below to view each version of the report:

English Version

👉 FHE16 CNN Report (English)

Korean Version

👉 FHE16 CNN Report (Korean)

About

FHE16-Encrypted CNN on MNIST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •