FedKA
April 14, 2026 · View on GitHub
Official repository for the ACM MM 2023 paper:
Chen J, Zhu J, Zheng Q. Towards fast and stable federated learning: Confronting heterogeneity via knowledge anchor. In Proceedings of the 31st ACM International Conference on Multimedia (ACM MM), 2023, pp. 8697-8706.
Overview
This repository contains the implementation of FedKA, a federated learning method designed to improve training efficiency and stability under heterogeneous client data distributions.
The codebase includes:
- dataset generation scripts under
PFL/dataset/ - federated training pipeline under
PFL/system/ - experiment templates under
PFL/system/template/ - environment specification in
freeze.yml
Getting Started
Step 1. Create the environment from freeze.yml
At the repository root, create and activate the conda environment:
conda env create -f freeze.yml
conda activate FL
The environment name is defined as FL in freeze.yml.
Step 2. Generate the dataset
For CIFAR-10 with Dirichlet non-IID partitioning, run:
cd PFL/dataset
python generate_cifar10.py noniid - dir 20 0.1
This command is consistent with the argument parser in PFL/dataset/generate_cifar10.py, where the arguments are interpreted as:
python generate_cifar10.py <iid_or_noniid> <balance_or_-> <partition> <num_clients> <dirichlet_alpha>
So in the above example:
noniidmeans non-IID partitioning-means not using balanced splittingdirmeans Dirichlet partitioning20is the number of clients0.1is the Dirichlet concentration parameter
After generation, the dataset directory will be created automatically, e.g.:
Cifar10_NonIID_Dir0.1_Client20/
Step 3. Run federated training
Go to the training directory and launch an experiment with the provided config file:
cd ../system
python main.py --config template/FedKA_cifar10_dir0.1.yaml
The training entry is PFL/system/main.py, and the example configuration file is located at:
PFL/system/template/FedKA_cifar10_dir0.1.yaml
Project Structure
FedKA/
├── freeze.yml
├── README.md
└── PFL/
├── dataset/
│ ├── generate_cifar10.py
│ └── ...
└── system/
├── main.py
├── template/
│ └── FedKA_cifar10_dir0.1.yaml
└── ...
Notes
- The commands above are written to match the actual repository structure.
- There is no top-level
main.pyat the repository root; the correct training entry isPFL/system/main.py. - Likewise, the CIFAR-10 data generation script is
PFL/dataset/generate_cifar10.py.
Citation
If you find this repository useful, please cite:
@inproceedings{chen2023towards,
title={Towards fast and stable federated learning: Confronting heterogeneity via knowledge anchor},
author={Chen, J and Zhu, J and Zheng, Q},
booktitle={Proceedings of the 31st ACM International Conference on Multimedia},
pages={8697--8706},
year={2023}
}