explaingit

cleverhans-lab/optifluence

Analysis updated 2026-05-18

0PythonAudience · researcherComplexity · 5/5LicenseSetup · hard

TLDR

Research code for designing better privacy test examples, called canaries, used to check if machine learning models leak information about their training data.

Mindmap

mindmap
  root((optifluence))
    What it does
      Designs privacy canaries
      Runs membership attacks
      Reproduces ICML paper
    Tech stack
      Python
      JAX
      Slurm
    Use cases
      Privacy auditing
      Canary optimization
      DP noise studies
    Audience
      ML researchers
      Privacy researchers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Reproduce the OptiFluence paper's privacy canary experiments on MNIST, CIFAR, and HAM10000.

USE CASE 2

Run membership inference attacks to test whether a model leaks details about its training data.

USE CASE 3

Compare different canary selection and optimization strategies for privacy auditing.

USE CASE 4

Study how differential privacy noise affects how detectable a canary is.

What is it built with?

PythonJAXSlurmuv

How does it compare?

cleverhans-lab/optifluence0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity5/52/54/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Requires a GPU/Slurm cluster, manual download of the HAM10000 dataset, and running experiment stages in strict order.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

OptiFluence is the research code behind an academic paper accepted to a major machine learning conference in 2026, about how to design better privacy tests for machine learning models. The core idea is a privacy canary: a specially chosen or specially crafted example added to a model's training data, used afterward to test whether someone looking at the trained model could tell if that specific example was part of the training set. If an attacker can reliably spot the canary, that suggests the model may be leaking private information about the rest of its training data too. The code trains models on well known image datasets, including MNIST, CIFAR-10, CIFAR-100, and a medical skin image dataset called HAM10000, and compares several ways of choosing or optimizing which examples to use as canaries. It then runs an attack, called a membership inference attack, which tries to guess whether particular images were used in training, and records how successful that attack was. Using the code involves multiple stages: selecting candidate canaries based on how much influence they have on the model, optionally optimizing them further, initializing them, training many target and shadow models on GPU compute clusters managed by Slurm, and finally running the attack and saving the results. The repository also includes extra experiments that reuse canaries from the main runs to study privacy under differential privacy noise settings and to test whether an attack still works when the model architecture changes. This is not a general purpose tool for typical developers. It is meant for machine learning privacy researchers who have access to a computing cluster and want to reproduce or build on this paper's experiments. The code builds on work from a few other open source research projects for its attack methods and training setup, and it is released under the MIT license.

Copy-paste prompts

Prompt 1
Explain what a privacy canary is and how OptiFluence selects one.
Prompt 2
Walk me through the OptiFluence pipeline steps from canary preselection to the membership inference attack.
Prompt 3
Help me set up the Slurm submission scripts to run OptiFluence on a cluster.
Prompt 4
Summarize how OptiFluence's differential privacy experiments differ from its main experiments.

Frequently asked questions

What is optifluence?

Research code for designing better privacy test examples, called canaries, used to check if machine learning models leak information about their training data.

What language is optifluence written in?

Mainly Python. The stack also includes Python, JAX, Slurm.

What license does optifluence use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is optifluence to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is optifluence for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.