Skip to content

kubershahi/mphasis_ppml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Privacy-Preserving Machine Learning (PPML)

Mphasis Lab Research PPML C++ Python License: MIT

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

Overview

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.

PPML research overview: sensitive data is secret-shared across parties, trained via secure MPC, and yields a model without exposing raw inputs. Implementations include SecureML (2-party), BLAZE (3-party), and novel protocol extensions.

The work focuses on:

  1. 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.
  2. BLAZE — A Python prototype of the three-party BLAZE framework (Kumar et al., 2020) with secure multiplication, truncation, and sharing primitives.
  3. 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.


Repository Structure

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

Getting Started

Prerequisites

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/eigen3

BLAZE (Python)

  • Python 3.7+
  • numpy, gmpy2 — install via pip install -r blaze/requirements.txt

Experiments (optional)

  • emp-ot — only required for experiments/ot-test.cpp

Build & Run SecureML

From the repository root:

make linear    # secure linear regression
make logistic  # secure logistic regression

./bin/linear    # run from repository root
./bin/logistic

Both 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

Run BLAZE Tests

pip install -r blaze/requirements.txt
cd blaze
python3 main.py    # primitive and sharing semantics tests
python3 main2.py   # extended protocol tests

Protocols & References

Protocol Setting Paper
SecureML 2-party, semi-honest Mohassel & Zhang, IEEE S&P 2017
BLAZE 3-party, honest majority Kumar et al., 2020

Key Techniques

  • 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

Limitations

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

License

Released under the MIT License.

About

Repo for Mphasis PPML Research Project

Topics

Resources

License

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors