Skip to content

sail-research/flat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLAT

This repository contains the full artifact code for the FLAT federated-learning backdoor experiments, including the implementation, experiment configs, and instructions for clean warm-start checkpoints on CIFAR-10, CIFAR-100, and Tiny-ImageNet. Generated runs, checkpoints, figures, and paper draft files are excluded so the repository stays focused on reproducible code and inputs.

Setup

The locked environment targets Linux machines with NVIDIA CUDA 12.1.

uv python install 3.12.13
uv sync --frozen

For CPU-only or macOS machines, replace the pinned PyTorch CUDA wheels in pyproject.toml with wheels supported by the target platform before syncing.

Quick Check

uv run flad validate configs/hfl_cifar10_base_smoke.yaml
uv run flad run configs/hfl_cifar10_base_smoke.yaml

Run FLAT

Single-target FLAT on CIFAR-10:

uv run flad run configs/hfl_cifar10_flat.yaml --seed 0

Multi-target FLAT on CIFAR-10:

uv run flad run configs/hfl_cifar10_flat_multi_target.yaml --seed 0

Warm-start CIFAR-10 FLAT from a downloaded clean checkpoint:

uv run flad run configs/hfl_cifar10_flat_multi_target.yaml \
  --seed 0 \
  --set model.checkpoint_path=checkpoints/cifar10_clean_round0199.pt \
  --set model.lr_milestones=250,375 \
  --set fl.start_round=200 \
  --set fl.rounds=400 \
  --set attack.start_round=200 \
  --set attack.end_round=299

Cross-dataset FLAT:

uv run flad run configs/hfl_cifar100_flat_multi_target.yaml --seed 0
uv run flad download-data tiny_imagenet
uv run flad run configs/hfl_tiny_imagenet_flat_multi_target.yaml --seed 0

Warm-start cross-dataset FLAT from downloaded clean checkpoints:

uv run flad run configs/hfl_cifar100_flat_multi_target.yaml \
  --seed 0 \
  --set model.checkpoint_path=checkpoints/cifar100_clean_round0199.pt \
  --set model.lr_milestones=500,750 \
  --set fl.start_round=200 \
  --set fl.rounds=400 \
  --set attack.start_round=200 \
  --set attack.end_round=299

uv run flad run configs/hfl_tiny_imagenet_flat_multi_target.yaml \
  --seed 0 \
  --set model.checkpoint_path=checkpoints/tiny_imagenet_clean_round0199.pt \
  --set model.lr_milestones=500,750 \
  --set fl.start_round=200 \
  --set fl.rounds=400 \
  --set attack.start_round=200 \
  --set attack.end_round=299

Run FLAT under a server-side defense by overriding the aggregator:

uv run flad run configs/hfl_cifar10_flat_multi_target.yaml \
  --seed 0 \
  --set attack.participation=fixed_k \
  --set attack.attackers_per_round=1 \
  --set defense.aggregator=multi_krum \
  --set defense.krum_f=1

Other supported aggregators include fedavg, median, trimmed_mean, krum, multi_krum, foolsgold, rfa, flame, and fltrust.

Checkpoints

Clean warm-start checkpoints are hosted separately on Google Drive:

https://drive.google.com/drive/folders/1OwZXvyKg-t8UgHaaBgFwmdxT8DJTelQ0?usp=sharing

Download the three checkpoint files into checkpoints/ with these exact names:

checkpoints/cifar10_clean_round0199.pt
checkpoints/cifar100_clean_round0199.pt
checkpoints/tiny_imagenet_clean_round0199.pt

Their matching pretraining configs are included as:

configs/hfl_cifar10_clean_500.yaml
configs/hfl_cifar100_clean_1000.yaml
configs/hfl_tiny_imagenet_clean_1000.yaml

Outputs

Runs write to runs/ and produce config.resolved.yaml, manifest.json, metrics.jsonl, and final_checkpoint.pt.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages