Jump to content

Federated Learning

From Edge Computing Wiki
Revision as of 00:20, 2 April 2025 by Idvsrevanth (talk | contribs)

Federated Learning in Edge Computing

Overview

Federated Learning (FL) is a decentralized approach to training machine learning models. In FL, edge devices such as smartphones, sensors, or IoT gateways train models locally and only share model updates, not raw data. This minimizes privacy risks and reduces communication overhead.

When combined with Edge Computing (EC)—which brings computational power closer to the data source—FL enables privacy-preserving, real-time intelligence across distributed systems. It is especially useful in domains like healthcare, smart cities, autonomous vehicles, and industrial IoT where data sensitivity and latency are key concerns.

Background

In traditional machine learning, data is collected in a central server for training. This becomes inefficient and risky when devices generate massive volumes of private data at the edge. FL solves this problem by keeping data local.

A typical FL cycle involves these steps:

  1. The central server sends the global model to selected clients.
  2. Each client trains the model on its own local dataset.
  3. The client sends back updated model parameters to the server.
  4. The server aggregates the updates into a new global model.
  5. The process repeats for multiple rounds.

The global objective function is:

F(w) = sum over k from 1 to N of [ λ_k * F_k(w) ]

Where: - F_k(w) is the loss function on client k, - λ_k = n_k / n, - n_k is the number of samples on client k, - n is the total number of samples across all clients.

This ensures clients with more data influence the model proportionally.

Architectures

Centralized Federated Learning

In this structure, a central server manages model distribution and aggregation. Clients train locally and send updates to the server. This is easy to implement but creates a single point of failure.

Decentralized Federated Learning

There is no central server. Clients exchange model updates directly using peer-to-peer or blockchain protocols. While more resilient, this method is harder to synchronize and manage.

Hierarchical Federated Learning

Edge servers collect updates from nearby devices, aggregate them, and forward results to the cloud. This reduces latency and balances load between edge and cloud resources.

Aggregation Algorithms

The most common aggregation method is Federated Averaging (FedAvg). Each client trains locally and sends updated weights, which the server averages. The formula is:

w_next = sum over k of [ λ_k * w_k ]

Where: - w_k is the local model from client k, - λ_k is based on the client’s data size.

When client data is highly variable (non-IID), FedAvg struggles. FedProx improves stability by adding a regularization term:

F_k(w) = Local loss + ρ * ||w_k - w_global||^2

Here, ρ is a tuning parameter and w_global is the last global model. This discourages clients from diverging too far from the shared model.

Local model updates also change to include the regularization in their gradient descent.

Communication Efficiency

To reduce transmission costs and support weak network conditions, FL systems use: - Gradient quantization: Sending compressed updates. - Sparsification: Only sending most important updates. - Local update batching: Performing multiple training steps before communicating. - Client sampling: Selecting only a few clients each round.

These techniques save energy and bandwidth without significantly affecting model accuracy.

Comparison: Federated Learning vs Traditional Machine Learning
Feature Federated Learning Traditional Machine Learning
Data Location On-device Centralized
Privacy Risk Low High
Bandwidth Use Low High
Latency Low (local) High (cloud round-trip)
Scalability High (with sampling and compression) Moderate

Privacy and Security

Although FL avoids raw data collection, it is not completely immune to privacy threats. Attackers can reverse-engineer updates to infer sensitive information.

Differential Privacy

This technique adds random noise to updates to obscure individual data points. It satisfies the formula:

P(A(D) ∈ S) ≤ exp(ε) * P(A(D') ∈ S) + δ

Where D and D′ differ by one user's data, ε is the privacy budget, and δ is a small tolerance for failure.

Secure Aggregation

Uses cryptographic techniques so that the server only sees the sum of updates, not each one individually.

Homomorphic Encryption

Allows computations on encrypted updates. For example, with additive encryption:

Enc(a) + Enc(b) = Enc(a + b)

This keeps updates private even during aggregation.

Applications

Healthcare

Hospitals collaboratively train disease diagnosis models without exchanging patient data. This protects privacy and supports regulation compliance.

Autonomous Vehicles

Cars learn from local driving environments and send encrypted updates. These updates help build a shared driving model without exposing personal or location data.

Smart Cities

FL supports distributed learning across traffic lights, pollution sensors, and public safety systems. The result is real-time learning with citizen privacy intact.

Mobile Applications

Apps like keyboard predictors and fitness trackers use FL to improve personalization while keeping your data local.

Industrial IoT

Factories and energy systems use FL to detect faults and optimize operations without exposing proprietary information.

Challenges

FL faces several deployment issues:

Scalability

Large networks require efficient coordination, especially when devices are frequently offline or have variable resources.

Data Heterogeneity

Client data is often unbalanced and varies in quality. This affects model convergence and generalization.

Security Threats

Poisoning attacks, model backdoors, and inference threats require robust defenses like anomaly detection and trusted execution environments.

Incentives

Devices use battery and compute to participate in FL. Fair reward systems and contribution scoring are under active research.

Interoperability

FL systems must work across various device types, operating systems, and network conditions. Standard APIs and lightweight FL libraries are crucial.

References

  1. Abreha, H.G., Hayajneh, M., & Serhani, M.A. (2022). Federated Learning in Edge Computing: A Systematic Survey. Sensors, 22(2), 450.
  2. Lyu, L., Yu, H., & Yang, Q. (2020). Threats to Federated Learning: A Survey. arXiv preprint arXiv:2003.02133.
  3. Li, T., Sahu, A.K., Talwalkar, A., & Smith, V. (2020). Federated Learning: Challenges, Methods, and Future Directions. IEEE Signal Processing Magazine, 37(3), 50–60.
  4. Kairouz, P., et al. (2019). Advances and Open Problems in Federated Learning. arXiv preprint arXiv:1912.04977.