Federated Learning with Class Imbalance Reduction

Miao Yang, Ximin Wang, Hongbin Zhu, Haifeng Wang, Hua Qian

TL;DR

This paper introduces a clever way to speed up Federated Learning (FL) by solving the "class imbalance" problem. It uses a gradient-based estimation trick to figure out which labels a device has without actually seeing its private data, then uses a Multi-Armed Bandit algorithm to select the most balanced group of participants for each training round.

What Problem Does This Paper Address?

Federated Learning allows a central server to train a global model using data stored on thousands of edge devices (like phones or cars) without that data ever leaving the device. While great for privacy, it creates a massive headache: Non-IID data.

In the real world, your phone's photo library looks nothing like mine. One user might have 1,000 photos of cats, while another has 500 photos of cars. This is "class imbalance." Because bandwidth is limited, the server can only pick a small subset of users to participate in each training round. If the server accidentally picks only "cat owners" for several rounds, the global model becomes biased and converges much slower.

The catch? Because of privacy, the server isn't allowed to ask, "Hey, how many cat photos do you have?" It has to fly blind—until now.

Methods

The researchers propose a two-step framework called FL-CIR (Federated Learning with Class Imbalance Reduction):

  1. Class Estimation Scheme: To "see" the data distribution without seeing the data, the server uses a small, balanced auxiliary dataset. When a client sends back its model updates (gradients), the server passes this auxiliary data through the updated model. By looking at the magnitudes of the gradients in the final output layer, the server can mathematically estimate the ratio of classes the client used during its local training. This is based on a theorem showing that the expectation of gradient squares is approximately proportional to the number of samples for that class.
  2. Combinatorial Multi-Armed Bandit (CMAB): Once the server has an idea of each client's "composition vector," it needs to pick a team. They treat this as a bandit problem—a classic "exploration vs. exploitation" scenario. They use a CUCB (Combinatorial Upper Confidence Bound) algorithm to select a subset of clients whose combined data distribution is as close to "perfectly balanced" (uniform) as possible, using Kullback-Leibler (KL) divergence as the metric for imbalance.

Datasets

The authors evaluated their approach using the CIFAR-10 dataset, a standard benchmark consisting of 60,000 images across 10 classes (airplanes, dogs, etc.).

  • The Setup: They simulated 100 clients. To mimic real-world "non-IID" conditions, they split the data so each client received a random number of classes and a random number of samples, creating significant imbalance across the network.

Key Insights and Ideas

  • Gradients as Proxies: The most elegant "aha" moment is using the model's own weights as a sensor. You don't need to inspect raw pixels if you can observe how the model's "brain" changed in response to those pixels.
  • The Power of the Group: Instead of trying to find "perfect" clients, the algorithm looks for complementary clients. If Client A has too many "cats" and Client B has too many "dogs," picking them together creates a balanced update for the global model.
  • Exploration is Essential: By using a bandit framework, the server doesn't just stick to the clients it "thinks" are good. It occasionally picks less-known clients to update its estimate of their data distribution, ensuring it doesn't get stuck in a sub-optimal selection loop.

Key Results

The proposed FL-CIR method was compared against random selection and a "greedy" selection method:

  • Higher Accuracy: In simulations, the proposed method reached a test accuracy of approximately 65%, significantly outperforming random selection (which hovered around 55%) and the greedy approach.
  • Faster Convergence: The model reached stable accuracy in far fewer communication rounds. As seen in the paper's figures, the "Proposed" curve climbs much steeper than the "Random" or "Greedy" curves.
  • Scalability: The researchers found that while adding more clients generally helps, the performance gains diminish after a certain point (e.g., picking 30 vs 40 clients), suggesting that smart selection is more important than massive selection.

Limitations and Future Work

  • The Auxiliary Dataset: The method relies on the server having a small, balanced "auxiliary dataset." While the authors argue this can be pulled from a standard test set, in some highly specialized domains (like medical imaging), even a small balanced dataset might be hard to acquire.
  • Static vs. Dynamic Data: The paper introduces a "forgetting factor" ($\rho$) to handle cases where a user's data might change over time, but the primary experiments assume the data on devices remains relatively static during the training process.
  • Computational Overhead: While the estimation scheme is clever, performing these calculations for thousands of potential clients every round adds a layer of complexity to the server's workload that would need to be optimized for massive-scale deployments.

Summary updated

BibTeX
@inproceedings{yang2021federated,
  author = {Miao Yang and Ximin Wang and Hongbin Zhu and Haifeng Wang and Hua Qian},
  title = {{Federated Learning with Class Imbalance Reduction}},
  booktitle = {2021},
  year = {2021},
  doi = {10.23919/eusipco54536.2021.9616052},
}
Figure