This project experiments with the use of homomorphic encryption (HE) in machine learning to enable privacy-preserving machine learning (specifically with MLP and CNN). Homomorphic encryption unlocks the ability to perform computations on encrypted data without decryption, and one example of this is enabling organizations use cloud services without providing any plain data. This became our motivation to explore homomorphic encryption in this project.
We use three key libraries for the experiments:
- PyTorch: For building standard neural network models
- Concrete ML (by Zama): For compiling PyTorch models to FHE-compatible versions
- TenSEAL (by OpenMined): For encrypted tensor operations and neural networks
Homomorphic encryption allows computations to be performed directly on encrypted data without decryption, enabling privacy-preserving inference where sensitive data remains protected throughout the entire process. This project is completed as part of coursework for 95-878 Engineering Privacy in Software.
- PoC_Revised: Initial testing with very simple MLP
- AdultIncomeMLP: Tenseal and Concrete PTQ experiment with MLP on Adult Income dataset
- MNISTPtq: Concrete PTQ experiment with MLP on MNIST
- MNISTQat: Concrete QAT experiment with MLP on MNIST
- PathMNIST: Concrete PTQ experiment with CNN on PathMNIST
archived/# Previous versions and experimentscheckpoints/# Model checkpointspapers/# Reference papers and documentationtutorials/# Tutorials from OpenMined and Zamautils/# Utility functions and helper modulesrequirements.txt# Python dependenciesREADME.md# Project documentation
# Create and activate virtual environment
python3.10 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install requirements
pip install -r requirements.txtDownload PathMNIST from: Drive Unzip and store to ./data