Code for paper - [Bidirectional Decoupled Distillation For Heterogeneous Federated Learning]. Our code is highly borrowed from Federated Learning on Non-IID Data with Local-drift Decoupling and Correction (CVPR 2022) by Liang Gao, Huazhu Fu, et al.
- Install the libraries listed in requirements.txt
pip install -r requirements.txt
We give datasets for the benchmark, including CIFAR10, CIFAR100, MNIST dataset.
For example, you can follow the following steps to run the experiments:
python example_code_FMLDKD.py
-
Run the following script to run experiments on the MNIST dataset for all above methods:
python example_code_FMLDKD.py -data minist -
Run the following script to run experiments on CIFAR10 for all above methods:
python example_code_FMLDKD.py -data cifar10 -
Run the following script to run experiments on CIFAR100 for all above methods:
python example_code_FMLDKD.py -data cifar100 -
To show the convergence plots, we use the tensorboardX package. As an example to show the results which stored in "./Folder/Runs/CIFAR100_100_23_iid_":
tensorboard --logdir=./Folder/Runs/CIFAR10_100_23_iid
Modify the DatasetObject() function in the example code. CIFAR-10 IID, 100 partitions, balanced data
data_obj = DatasetObject(dataset='CIFAR10', n_client=100, seed=17, rule='iid', unbalanced_sgm=0, data_path=data_path)
CIFAR-10 Dirichlet (0.3), 100 partitions, balanced data
data_obj = DatasetObject(dataset='CIFAR10', n_client=100, seed=47, unbalanced_sgm=0, rule='Drichlet', rule_arg=0.3, data_path=data_path)
The FedDC method is implemented in utils_methods_FMLDKD.py. The baseline methods are stored in utils_methods.py.
@article{song2024bidirectional,
title={Bidirectional Decoupled Distillation for Heterogeneous Federated Learning},
author={Song, Wenshuai and Yan, Mengwei and Li, Xinze and Han, Longfei},
journal={Entropy},
volume={26},
number={9},
pages={762},
year={2024}
}