mirror of
https://github.com/luxfi/torus-ml.git
synced 2026-10-30 15:15:23 +00:00
The distribution called itself torus-ml while shipping a package directory named concrete, so the name a user installs and the name they import disagreed — and most of the tree already said torus.ml, which could not resolve against src/concrete. Moved src/concrete to src/torus and pointed the include at it. The dependency was Zama's concrete-python from their index. It is torus-fhe from ours, which is what luxfhe/torus already ships: that frontend declares torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree was already naming our compiler and only the dependency lagged. Two distributions share one namespace, which is the shape the upstream this forked from used and the reason the split works: torus-fhe gives torus.fhe, torus-ml gives torus.ml. Swept every other spelling — identifiers, enum members, workflow variables, filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork owes; the figures carry the old name in JPEG metadata a text sweep cannot reach.
2.6 KiB
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
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:
- Adapting VGG11 for CIFAR datasets.
- Quantizing the pre-trained network.
- Computing the accuracy of the quantized models with FHE simulation.
- Enhancing inference time in FHE using smaller accumulators.
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.
Installation
All use-cases can be quickly set up with:
pip install -r requirements.txt