Research implementation and evaluation of secure multi-party machine learning protocols, developed during a research internship at Mphasis Lab, Ashoka University (May–August 2021).
Advisor: Prof. Mahavir Jhawar
This repository contains implementations and experiments for Privacy-Preserving Machine Learning (PPML) — training and evaluating ML models on sensitive data without exposing raw inputs to any single party.
The work focuses on:
- SecureML — A C++ implementation of the two-party secure training protocol from Mohassel & Zhang (IEEE S&P 2017), supporting linear and logistic regression on tabular and image datasets.
- BLAZE — A Python prototype of the three-party BLAZE framework (Kumar et al., 2020) with secure multiplication, truncation, and sharing primitives.
- Novel protocol research — Exploratory work on optimized activation functions (Double ReLU) and fixed-point arithmetic for business-specific PPML use cases.
The goal was to compare protocol efficiency and security trade-offs, then extend the most promising approaches for real-world deployment scenarios.
mphasis_ppml/
├── assets/ # README figures and diagrams
├── secureml/ # C++ SecureML implementation (linear & logistic regression)
├── blaze/ # Python BLAZE protocol primitives and tests
├── novel/ # Custom protocol research (Double ReLU, fixed-point MPC)
├── datasets/ # Sample datasets and preprocessing notebooks
├── experiments/ # Auxiliary prototypes and unit tests
├── bin/ # Compiled executables (generated)
└── build/ # Object files (generated)
| Directory | Description |
|---|---|
assets/ |
Overview diagram and other documentation figures |
secureml/ |
Two-party secure ML training in C++ with Eigen |
blaze/ |
Three-party BLAZE protocol in Python |
novel/ |
Research notes and prototypes for custom PPML extensions |
datasets/ |
Medical insurance splits, MNIST archive, preprocessing notebooks |
experiments/ |
Truncation tests, OT experiments, and helper scripts |
SecureML (C++)
- Eigen — linear algebra
g++with C++14 support
If Eigen is not on the default include path (common on macOS with Homebrew):
make EIGEN_INCLUDE=/opt/homebrew/include/eigen3BLAZE (Python)
- Python 3.7+
numpy,gmpy2— install viapip install -r blaze/requirements.txt
Experiments (optional)
- emp-ot — only required for
experiments/ot-test.cpp
From the repository root:
make linear # secure linear regression
make logistic # secure logistic regression
./bin/linear # run from repository root
./bin/logisticBoth programs prompt for a dataset:
| Option | Dataset |
|---|---|
| 1 | MNIST (requires extraction — see datasets/README.md) |
| 2 | Medical insurance (included) |
| 3 | Binary MNIST (requires generation — see Binary MNIST generation.ipynb) |
| 4 | Sanity-check toy data |
pip install -r blaze/requirements.txt
cd blaze
python3 main.py # primitive and sharing semantics tests
python3 main2.py # extended protocol tests| Protocol | Setting | Paper |
|---|---|---|
| SecureML | 2-party, semi-honest | Mohassel & Zhang, IEEE S&P 2017 |
| BLAZE | 3-party, honest majority | Kumar et al., 2020 |
- Secret sharing — Additive and special (three-party) sharing schemes
- Beaver triples — Secure multiplication without revealing inputs
- Fixed-point arithmetic — Integer-ring embeddings with configurable precision (13–18 bit scaling)
- Truncation — Post-multiplication fixed-point reduction to control overflow
This is research prototype code, not a production-ready secure ML framework:
- Semi-honest security assumptions; no formal side-channel hardening
- Fixed-point precision and truncation parameters are dataset-dependent
- MNIST and binary MNIST require manual setup (see
datasets/) - Some BLAZE networking paths are stubbed for local testing
Released under the MIT License.
