Skip to content

imaddde867/FL-Attack

Repository files navigation

Security in Federated Learning

Python 3.8+ PyTorch License: MIT

🔗 Live Dashboard

A research framework for studying gradient inversion attacks and privacy defenses in federated learning systems.

Research Poster

Key Findings

Configuration PSNR (dB) LPIPS ↓
Baseline (no defense) 29.38 0.117
Differential Privacy (ε=1) 8.12 0.714
Homomorphic Encryption 12.45 0.623
DP + HE (combined) 6.37 0.824
  • Baseline attacks successfully reconstruct recognizable faces
  • Privacy defenses significantly degrade reconstruction quality
  • Combined DP+HE provides strongest protection

Quick Start

# Install dependencies
pip install -r requirements.txt

# Run showcase experiment
bash scripts/run_showcase.sh

# Generate poster visualization
python scripts/make_poster.py

# Launch local dashboard
python -m http.server --directory docs 8000

Project Structure

├── run_experiment.py          # Main experiment runner
├── fl_system.py               # Federated learning simulation
├── gradient_attack.py         # DLG/iDLG attack implementation
├── differential_privacy.py    # Gaussian mechanism for DP
├── homomorphic_encryptor.py   # Paillier-like HE
├── device_utils.py            # Auto device detection
├── scripts/                   # Experiment & analysis scripts
├── results/                   # Experiment outputs
│   └── report/                # Generated reports & dashboard
├── docs/                      # GitHub Pages dashboard
└── data/                      # CelebA dataset (not included)

Experiments

Script Description
run_showcase.sh Single high-quality attack demo
run_multi_client.sh Benchmark across 10 clients
run_defenses.sh DP/HE defense evaluation
run_ablation.sh Attack hyperparameter study

Usage

# Basic attack (no defense)
python run_experiment.py --attack-iterations 3000

# With differential privacy
python run_experiment.py --dp-epsilon 1.0

# With homomorphic encryption
python run_experiment.py --use-he

# Combined defenses
python run_experiment.py --dp-epsilon 1.0 --use-he

See python run_experiment.py --help for all options.

Requirements

  • Python 3.8+
  • PyTorch 2.0+
  • CelebA dataset in data/

Notes

  • Results are specific to this experimental setup
  • DP/HE implementations are research-grade, not production-ready
  • See the interactive dashboard for detailed visualizations

About

Security in Federated Learning: Gradient Inversion, Ablations, and Defenses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors