DWFed: A statistical- heterogeneity-based dynamic weighted model aggregation algorithm for federated learning

Aiguo Chen, Yang Fu, Lingfu Wang, Guiduo DuanFrontiers Neurorobotics 2022 · DOI

Abstract

Federated Learning (FL) enables collaborative model training across decentralized devices while preserving data privacy. However, the presence of non-independent and identically distributed (non-IID) data across clients—known as statistical heterogeneity—often leads to model divergence and degraded performance. This paper introduces DWFed (Dynamic Weighted Federated Learning), an aggregation algorithm designed to mitigate these effects. By employing Earth Mover’s Distance (EMD) to quantify the discrepancy between local and global data distributions, DWFed calculates an Index of Statistical Heterogeneity (ISH) to dynamically weight client updates. Our evaluations on MNIST, Fashion MNIST, and CIFAR-10 datasets demonstrate that DWFed significantly improves convergence speed, stability, and final model accuracy compared to traditional methods like FedAvg and FedProx.

Introduction: The Challenge of Statistical Heterogeneity

The primary advantage of Federated Learning is its ability to train models on private, local data without requiring raw data transfer. Despite its promise, the practical implementation of FL is hindered by statistical heterogeneity. In real-world scenarios, data distributions vary significantly between users; for instance, one user's image library might consist entirely of one class of objects, while another's is more diverse.

Standard aggregation algorithms, such as FedAvg, typically weight client contributions based on the number of local samples. This approach fails to account for the quality or representativeness of the data. When data is highly non-IID, local models tend to drift toward local optima, causing the global model to diverge. DWFed addresses this by mathematically defining a heterogeneity index and using it to intelligently weight updates during the aggregation process.

Methodology: Quantifying and Mitigating Heterogeneity

The DWFed algorithm introduces a robust framework for handling heterogeneous data through three key components:

1. Quantifying Heterogeneity with EMD

To measure the distance between a client's local label distribution and the global population distribution, DWFed utilizes Earth Mover’s Distance (EMD). EMD provides a metric for the minimum cost of transforming one distribution into another, offering a more nuanced view of data divergence than simple heuristics.

2. The Index of Statistical Heterogeneity (ISH)

The authors derive the Index of Statistical Heterogeneity (ISH), a metric mathematically grounded in minimizing the divergence between the federated model and a theoretical centralized model. Unlike previous methods that use EMD as a loose heuristic, ISH is directly linked to the gradient updates in Stochastic Gradient Descent (SGD), ensuring that the weighting scheme has a solid theoretical foundation.

3. Dynamic Weighting and Greedy Optimization

During each communication round, the central server calculates weights based on each client's ISH. Clients whose data more closely mirrors the global distribution are assigned higher weights, giving them greater influence over the global model update. This greedy optimization approach ensures that the global model follows the most efficient path toward convergence, prioritizing representative data over sheer volume.

Experimental Evaluation

The performance of DWFed was evaluated using three benchmark datasets: MNIST, Fashion MNIST (FMNIST), and CIFAR-10. To simulate extreme statistical heterogeneity, two non-IID partitioning strategies were employed:

  • 1-class non-IID: Each client possesses data from only a single category (e.g., only "Digit 1").
  • 2-class non-IID: Each client possesses data from exactly two categories.

Results and Discussion

Accuracy and Convergence Speed

DWFed consistently outperformed baseline algorithms across all tested scenarios. On the CIFAR-10 dataset under a 2-class non-IID setup, DWFed achieved an accuracy of 77.8%, surpassing FedAvg's 75%. Furthermore, DWFed demonstrated superior communication efficiency. For the same CIFAR-10 task, DWFed reached target accuracy in 520 rounds, whereas FedAvg required 800 rounds—a 35% improvement in communication efficiency.

Test accuracy on MNIST. The plot shows that DWFed (solid lines) achieves higher accuracy and faster convergence than FedAvg (dashed/dotted lines) in various non-IID settings.

Training Stability

The stability of the training process is a critical factor in FL. As shown in the training loss curves, DWFed exhibits a much smoother trajectory with significantly fewer fluctuations compared to FedAvg. This indicates that the dynamic weighting mechanism effectively prevents the global model from being pulled away by outlier local updates, ensuring a more robust training process in the face of "messy" data.

Training loss on MNIST. DWFed demonstrates a more stable and rapid decline in loss compared to traditional aggregation methods.

Conclusion and Future Work

DWFed offers a computationally efficient and mathematically sound solution to the problem of statistical heterogeneity in Federated Learning. By prioritizing representative data updates, it achieves better performance with lower communication overhead.

However, the requirement for clients to share label distributions introduces a potential metadata leak. Future research will focus on integrating DWFed with privacy-preserving techniques such as Differential Privacy or Secure Multi-Party Computation. Additionally, adapting the algorithm for dynamic environments where the global distribution shifts over time remains an open challenge.

Summary updated

BibTeX
@article{chen2022dwfed,
  author = {Aiguo Chen and Yang Fu and Lingfu Wang and Guiduo Duan},
  title = {{DWFed: A statistical- heterogeneity-based dynamic weighted model aggregation algorithm for federated learning}},
  journal = {Frontiers Neurorobotics},
  year = {2022},
  doi = {10.3389/fnbot.2022.1041553},
}
Figure