Production-grade federated learning with FedAvg, FedProx, differential privacy, and secure aggregation.
./launch-platform.shThen visit:
- Dashboard: http://localhost:8050
- MLflow: http://localhost:5000
That's it. The platform will:
- Start FL server and clients
- Train across multiple clients
- Show real-time progress
- Track experiments in MLflow
complete/fl/
├── fl/
│ ├── task.py # ⭐ Core: train(), test(), load_data()
│ ├── server_app.py # ⭐ Server: aggregation logic
│ ├── client_app.py # ⭐ Client: local training
│ ├── aggregation.py # FedAvg, FedProx, FedNova
│ ├── dp.py # Differential privacy
│ └── secure_agg.py # Secure aggregation
├── config/
│ └── default.yaml # Configuration
└── tests/
└── test_*.py # Test suite (80%+ coverage)
Three files to understand the entire system:
task.py- Training loopserver_app.py- Server logicclient_app.py- Client logic
- ✅ FedAvg (Federated Averaging)
- ✅ FedProx (Proximal term for non-IID)
- ✅ FedNova (Normalized averaging)
- ✅ Scaffold (Variance reduction)
- ✅ Differential Privacy (DP-SGD, ε-δ guarantees)
- ✅ Secure Aggregation (encrypted updates)
- ✅ Non-IID data (Dirichlet, label skew)
- ✅ Docker deployment
- ✅ MLflow tracking
- ✅ Real-time dashboard
- ✅ 80%+ test coverage
- ✅ CI/CD pipeline
Edit complete/fl/config/default.yaml:
topology:
num_clients: 10
fraction: 0.5
train:
lr: 0.01
local_epochs: 1
num_server_rounds: 10
data:
dataset: "albertvillanova/medmnist-v2"
subset: "pneumoniamnist"
batch_size: 32
# Optional: Non-IID data
non_iid:
type: "label_skew"
params:
alpha: 0.5
# Optional: Differential Privacy
privacy:
dp_sgd:
enabled: true
noise_multiplier: 0.8
target_epsilon: 3.0| Configuration | Dataset | Accuracy | Rounds | Time |
|---|---|---|---|---|
| FedAvg (IID) | MNIST | 98.5% | 10 | 90s |
| FedAvg (non-IID) | MNIST | 96.8% | 20 | 180s |
| FedProx | MNIST | 97.3% | 20 | 195s |
| FedAvg + DP | MNIST | 97.2% | 15 | 120s |
| FedAvg | PneumoniaMNIST | 94.7% | 50 | 300s |
Tested on: Intel i7-10700K, 32GB RAM, NVIDIA RTX 3080
cd complete/fl
pip install -e ".[dev]"
pytest tests/ -v --cov=fl
flwr run . local-simulation --stream./launch-platform.sh # Start
docker compose -f complete/compose-with-ui.yml down # StopSuperLink (Server)
├── Aggregates updates (FedAvg/FedProx)
├── Manages rounds
└── Logs to MLflow
│
┌────┴────┬────────┬────────┐
│ │ │ │
SuperNode SuperNode ... SuperNode
(Client 1) (Client 2) (Client N)
│ │ │
Private Private Private
Data Data Data
- ARCHITECTURE.md - System design
- TROUBLESHOOTING.md - Common issues
- DEPLOYMENT.md - Production deployment
- CONTRIBUTING.md - Development guide
cd complete/fl
# All tests
pytest tests/ -v
# With coverage
pytest tests/ -v --cov=fl --cov-report=html
# Specific test
pytest tests/test_integration.py -vCoverage: 80%+
- Battle-tested algorithms: FedAvg, FedProx, DP-SGD
- Comprehensive testing: 80%+ coverage
- Production deployment: Docker, Kubernetes
- Privacy guarantees: Differential privacy (ε-δ)
- Real-world datasets: Medical imaging
- Experiment tracking: MLflow integration
- Professional docs: Complete guides
Apache 2.0
./launch-platform.shEverything else is in the docs.