Files
zeekay 9546c92611 Replace placeholders with real working examples
ML examples:
- credit_scoring: Credit risk prediction with HMEQ data
- disease_prediction: Healthcare ML on encrypted records
- cifar: Encrypted image classification
- federated_learning: Distributed FHE training
- hybrid_model: Mixed FHE/plaintext inference

Deployment:
- breast_cancer: Cancer detection API
- sentiment_analysis: Encrypted NLP
- server: FHE inference server

Blockchain:
- hardhat-template: Solidity + FHE
- react-template: Full dApp with FHE
2026-01-25 20:46:26 -08:00

2.6 KiB

CIFAR-10 and CIFAR-100 Classification with FHE

This repository provides resources and documentation on different use-cases for classifying CIFAR-10 and CIFAR-100 images using Fully Homomorphic Encryption (FHE). Each use-case demonstrates different techniques and adaptations to work within the constraints of FHE.Notably, a fine-tuning from a public pre-trained model, a training from scratch using quantization aware training (QAT) and finally a hybrid approach where only a subset of the model is done in FHE.

Table of Contents

  1. Use-Cases
  2. Installation
  3. Further Reading & Resources

Use cases

Fine-Tuning CIFAR

  • Description: This use-case explores how to convert a pre-trained CNN (on imagenet) to its FHE equivalent using Quantization Aware Training (QAT) and Torus ML. The conversion process involves adapting a VGG11 network and quantizing the network for FHE.

Notebooks:

  1. Adapting VGG11 for CIFAR datasets.
  2. Quantizing the pre-trained network.
  3. Computing the accuracy of the quantized models with FHE simulation.
  4. Enhancing inference time in FHE using smaller accumulators.

Results & Metrics

Training Ternary VGG on CIFAR10

  • Description: Train a VGG-like neural network from scratch using Brevitas on CIFAR-10 and run it in FHE. This use-case modifies the original VGG model for compatibility with Torus ML, and explores the performance gains of rounding operations in FHE.
  • Training & Inference: Scripts provided to train the network and evaluate its performance. It also includes simulations in Torus ML and insights into the performance enhancement using rounding.

Results & Metrics

Installation

All use-cases can be quickly set up with:

pip install -r requirements.txt

Further Reading