Skip to content
/ FedLF Public
forked from zibinpan/FedLF

The source code for the AAAI'2024 paper titled "FedLF: Layer-Wise Fair Federated Learning".

License

Notifications You must be signed in to change notification settings

SciYu/FedLF

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image# Introduction This repository is the implementation of the paper FedLF: Layer-Wise Fair Federated Learning (accepted by AAAI 2024).

This work presents a promising way to handle FL non-iid problem that the global model easily has imbalanced performance that favors part of clients while performing poorly on others. The proposed FedLF can significantly increase the average model performance and reduce the performance variance across clients.

What Makes Federated Learning Unfair? image

Challenges of computing a fair update direction in FL:

  1. Model-level gradient conflict.
  2. Improvement bias. image
  3. Layer-level gradient conflict. image

Visualization of unfairness: image

Code of the paper

The code can be run directly in Windows, and all experiments can be replicated by running the code. In the event that our paper is accepted for publication, we plan to release all of our codes as open source. However, for safety concerns, we have encrypted some of the code for review.

Requirements

The code can be run under Python 3.6-3.10 Windows x64 with dependencies below:

numpy>=1.19.5
pytorch>=1.8.1
torchvision>=0.9.0
cvxopt>=1.3.0
matplotlib>=3.1.3

Basic usage

Copy the following command in the Windows cmd under the same folder of ./gfedplat as well as run.py, and then run (one example is shown as follows). By setting different parameters and run the command, you can replicate the results of all experiments.

python run.py --seed 1 --device 0 --module CNN --algorithm FedAvg --dataloader DataLoader_cifar10_dir --N 100 --Diralpha 0.1 --B 50 --C 0.1 --R 3000 --E 1 --lr 0.1 --decay 0.999

All parameters can be seen in ./gfedplat/main.py.

Enjoy yourself!

About

The source code for the AAAI'2024 paper titled "FedLF: Layer-Wise Fair Federated Learning".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%