Federated Learning & Privacy-Preserving ML
Train models without collecting the data: federated averaging, Flower simulations, differential privacy, secure aggregation, encryption, and the attacks these defend against.
Before this: Deep Learning (PyTorch training loops). Basic probability from Python & Math for AI helps for the differential privacy steps.
-
8 min
Step 1What is federated learning?
Train on many devices and share model updates instead of raw data.
What is Federated Learning?codebasics
-
41 min
Step 2Federated learning in production
How Google trains phone keyboard models across millions of devices.
Federated Learning: Machine Learning on Decentralized Data (Google I/O'19)TensorFlow
-
19 min
Step 3Federated learning algorithms
University lecture on FedAvg and the algorithms built on it.
Lecture 11.3 - Federated Learning AlgorithmsUCF CRCV
-
10 min
Step 4Your first Flower simulation
Simulate federated training of a PyTorch model with Flower.
Launching Your First Simulation - 2025 Tutorial: Federated AI Simulations with FlowerFlower
flwrlabs/flower★ 7.2k -
21 min
Step 5Stateful clients in Flower
Keep per-client state across rounds, as personalized methods need.
Designing Stateful ClientApps - 2025 Tutorial: Federated AI Simulations with FlowerFlower
-
7 min
Step 6Differential privacy
Add calibrated noise so no single person changes the result much.
Differential Privacy - Simply ExplainedSimply Explained
-
18 min
Step 7The definition of differential privacy
Cynthia Dwork, who co-invented it, explains the formal definition.
The Definition of Differential Privacy - Cynthia DworkInstitute for Advanced Study
-
14 min
Step 8Differential privacy in deep learning
Whether DP stops models memorizing data, and tips for using it.
Differential Privacy in Deep Learning and AIProbably Private
-
22 min
Step 9Membership inference attacks
How attackers tell whether a record was in the training set.
Membership inference attacks from first principlesIEEE Symposium on Security and Privacy
-
22 min
Step 10Secure aggregation
The server learns the sum of client updates, not each update.
11 1 17 ACM CCS Aaron Segal Practical Secure Aggregation Machine LearningAssociation of Computing Machinery 2017
-
3 min
Step 11Homomorphic encryption
Compute on encrypted data without decrypting it first.
A 3-minute introduction to Fully Homomorphic Encryption by a cryptographerZama
-
21 min
Step 12Federated fine-tuning of LLMs
A benchmark for fine-tuning language models across many data owners.
FlowerTune: A Cross-Domain Benchmark for Federated Fine-Tuning of Large Language ModelsFlower
Build it
Watching isn't learning. Pick one and put it on GitHub.
- Simulate 10 Flower clients on CIFAR-10, split the data so each client sees only two classes, and compare accuracy with centralized training.
- Train an MNIST model with and without DP-SGD using Opacus and plot accuracy against the privacy budget epsilon.
- Run a simple loss-threshold membership inference attack on an overfit model and on a regularized one, and compare how often it succeeds.