Course contentsShow
← Machine Learning and Deep Learning
Lesson 3370 of 3,53873. Privacy in Machine LearningFree lesson

Secure Aggregation in Federated Learning

Applying secure aggregation to protect individual model updates while computing the global federated average.

Secure Aggregation in Federated Learning

What you'll learn: How to combine secure aggregation protocols with federated learning to protect individual model updates while still computing accurate global models.

The Privacy Challenge in Federated Learning

In federated learning, clients train local models and send updates (gradients or weights) to a central server. Even without sharing raw data, these updates can leak sensitive information about individual training examples through gradient-based attacks. The server shouldn't be able to inspect any single client's contribution—only the aggregated result.

How Secure Aggregation Protects Updates

Secure aggregation combines the masking and secret sharing techniques you've learned to compute the sum of client updates without revealing individual contributions. Here's how it works in federated learning:

  1. Masking phase: Each client adds a secret random mask to their model update before sending it to the server
  2. Server aggregation: The server sums all masked updates (which reveals nothing about individuals)
  3. Unmasking phase: Clients collaboratively cancel out the masks using pairwise shared secrets, revealing only the true aggregate

Think of it like a secret salary survey: everyone adds a random number to their salary before submitting. The company sums all values, then everyone reveals their random numbers so they can be subtracted out—leaving only the true total, with no individual salary exposed.

Integration with Federated Averaging

When combined with the FedAvg algorithm, secure aggregation ensures the server computes global_model = Σ(client_updates) / n without seeing any single client_update. This maintains the privacy guarantees even against a potentially curious server operator.

Key Takeaway: Secure aggregation enables privacy-preserving federated learning by cryptographically protecting individual model updates during the aggregation step, ensuring the server learns only the global average while remaining blind to each client's contribution.