Federated Learning Fundamentals
From the course Federated Learning: Privacy-Preserving AI
Federated learning (FL) is a machine learning paradigm where models are trained across multiple decentralized devices or servers holding local data, without exchanging the data itself. Instead of bringing data to the model, federated learning brings the model to the data.
How Federated Learning Works
The basic federated learning process:
- Server Initialization — a central server initializes a global model
- Client Selection — server selects a subset of clients for this training round
- Model Distribution — server sends the current global model to selected clients
- Local Training — each client trains the model on its local data for several epochs
- Update Transmission — clients send model updates (gradients or weights) back to the server
- Aggregation — server combines client updates (typically via FedAvg) to create an improved global model
- Iteration — repeat steps 2-6 until convergence
FedAvg (Federated Averaging)
The foundational aggregation algorithm:
- Each client trains locally for multiple epochs
- Updates are weighted by the number of local training samples
- Server computes a weighted average of all client models
- Simple yet effective for many IID (independent and identically distributed) scenarios
Types of Federated Learning
- Cross-Device FL — millions of mobile phones or IoT devices (e.g., Google Gboard keyboard prediction)
- Cross-Silo FL — multiple organizations collaborating (e.g., hospitals sharing medical AI models)
- Vertical FL — different organizations have different features about the same entities
- Federated Transfer Learning — transfer knowledge when data distributions and feature spaces differ
Real-World Deployments
Federated learning is already deployed at scale:
- Google Gboard — next-word prediction trained on billions of phones without collecting typing data
- Apple — Siri improvements, QuickType, and facial recognition without uploading photos
- Healthcare — multi-hospital medical imaging AI without sharing patient records
- Finance — cross-bank fraud detection without exposing transaction data
Horizontal vs. Vertical Federated Learning
Horizontal FL (the most common form) assumes all participants have the same features but different data samples — hospitals all collect the same vitals but for different patients. Vertical FL handles a different scenario: different organizations hold different features about the same individuals. For example, a bank holds transaction data and a retailer holds purchase data for the same customer base. The two can train a joint fraud-detection model without either party sharing their raw feature columns. Vertical FL is technically more complex and uses cryptographic protocols like Homomorphic Encryption or Secure Multi-Party Computation to protect column-level information.
Common Pitfall: Assuming Federated = Private
A frequent misconception is that federated learning guarantees privacy because data never leaves each client. In practice, gradient inversion attacks (Geiping et al., 2020) have demonstrated that high-fidelity images can be reconstructed from shared gradients in just a few optimization steps. FL provides a baseline of privacy by keeping raw data local, but it must be combined with Differential Privacy noise addition or Secure Aggregation to provide meaningful formal privacy guarantees. Never deploy FL as a privacy solution without explicitly adding one of these additional layers.
Key Takeaways
- •Federated learning trains models without centralizing data
- •FedAvg aggregates client model updates using weighted averaging
- •Cross-device FL spans millions of phones; cross-silo FL connects organizations
- •Google, Apple, and healthcare organizations deploy FL at scale
- •The model goes to the data, not data to the model
Progress is kept in this browser only.