Pytorch implementation for Fedcism, a participant selection framework based on Class Imbalance using Similarity Measurement. By adaptively blending the distribution similarity factor into the utility function that can determine the sampling priority of participant selection, our method can tolerate various levels of data imbalance while penalizing straggler with acceptable computation overhead in aggregator.
Correspondence to:
- Yu-Hsuan Yeh @yhyeh (yhyeh.cs09@nycu.edu.tw)
- Kate C.J. Lin (katelin@cs.nycu.edu.tw)
Distribution-Aware Participant Selection for Federated Learning
Yu-Hsuan Yeh, Kate C.J. Lin
If you find this repository useful, please cite our paper.
conda env create --name fedcism_env -f conda_environment.yml
- Install required python packages Doc
pip install -r pip_requirements.txt
- Clone the repository
git clone https://github.com/yhyeh/Fedcism.git
We run FedAvg, Oort and Fedcism experiments on CIFAR-10. See our paper for how we process and partition the data for federated learning experiments.
Results can be reproduced running the following:
Please refer to example script scripts/algo3_gbalan.sh.
python main_fed.py --dataset mnist --model mlp --num_classes 10 --epochs 1000 --lr 0.05 --num_users 100 --shard_per_user 2 --frac 0.1 --local_ep 1 --local_bs 10 --results_save run1
python main_fed.py --dataset cifar10 --model cnn --num_classes 10 --epochs 2000 --lr 0.1 --num_users 100 --shard_per_user 2 --frac 0.1 --local_ep 1 --local_bs 50 --results_save run1
The figures are plotted using pyplot on jupyter notebook, please refer to folder result_processing.
This codebase was adapted from LG-FedAvg.