GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Nousphera/FedCode: Communication-Efficient Federated Learning via Transferring Codebooks

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
scripts
scripts
 
 
src/fedcode
src/fedcode
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

FedCode

Communication-Efficient Federated Learning via Transferring Codebooks

Saeed Khalilian · Vasileios Tsouvalas · Tanir Özçelebi · Nirvana Meratnia

Paper Project Poster

Abstract

FedCode reduces communication in federated learning by exchanging compact codebooks. Clients cluster their model weights and transmit the resulting cluster centers; the server combines these codebooks to update the global model. Periodic calibration exchanges bit-packed weight assignments to realign the client and server models. This separates frequent codebook exchange from less frequent full reconstruction, reducing transmitted data while retaining competitive accuracy. Experiments span CIFAR-10, CIFAR-100 and Speech Commands, using ResNet20, MobileNetV2 and YAMNet.

FedCode: train locally, cluster model weights, exchange codebooks, update models and periodically calibrate weight assignments.

Setup

Create and activate the fedcode environment:

git clone https://github.com/Nousphera/FedCode.git
cd FedCode
python3.12 -m venv --prompt fedcode "$HOME/.venvs/fedcode"
source "$HOME/.venvs/fedcode/bin/activate"

From the activated fedcode environment, install the requirements:

python -m pip install -r requirements.txt

Data and Weights

Download, prepare and validate a dataset:

python scripts/prepare_data.py --dataset cifar10
python scripts/prepare_data.py --dataset cifar100
python scripts/prepare_data.py --dataset speech_commands

# Prepare all three datasets
python scripts/prepare_data.py

Prepare Model

ResNet20 and MobileNetV2 train on CIFAR; YAMNet trains on the 12-class Speech Commands task. All models train from scratch; no pretrained weights are required.

Run Experiments

From the repository root, launch your chosen method as a Flower App:

# Shared experiment settings
common=(--dataset cifar10 --model resnet20 --nr-clients 10
        --rounds 60 --participation 1 --dirichlet-alpha 10
        --local-epochs 4 --batch-size 128 --learning-rate 0.001)

# FedCode (ours) · codebooks and periodic calibration
python scripts/run_experiment.py "${common[@]}" --method fedcode \
  --num-clusters 64 --warmup-rounds 2 --downstream-period 5 --upstream-period 2

# FedAvg · full model exchange
python scripts/run_experiment.py "${common[@]}" --method fedavg

# Clustered FedAvg · codebook and assignments every round
python scripts/run_experiment.py "${common[@]}" --method clustered-fedavg --num-clusters 64

# Centralized · all training examples
python scripts/run_experiment.py "${common[@]}" --method centralized

# Other paper models · their default near-IID settings
python scripts/run_experiment.py --dataset cifar100 --model mobilenetv2
python scripts/run_experiment.py --dataset speech_commands --model yamnet

Note

Codebooks quantize trainable weights; BatchNorm statistics remain unquantized. Calibration sends cluster centers + packed assignments. Metrics, communication sizes and model weights are saved under results/.

Use --dirichlet-alpha 0.1 for heterogeneous clients and --seed for repeated runs. Calibration periods are independent; 0 disables periodic calibration after warm-up. All options are available through --help.

Citation

@inproceedings{khalilian2024fedcode,
  title = {{FedCode}: Communication-Efficient Federated Learning via Transferring Codebooks},
  author = {Khalilian, Saeed and Tsouvalas, Vasileios and Ozcelebi, Tanir and Meratnia, Nirvana},
  booktitle = {2024 IEEE International Conference on Edge Computing and Communications (EDGE)},
  year = {2024},
  pages = {99--109},
  doi = {10.1109/EDGE62653.2024.00022},
  url = {https://doi.org/10.1109/EDGE62653.2024.00022}
}

About

Communication-Efficient Federated Learning via Transferring Codebooks

nousphera.github.io/FedCode/

Topics

cifar10cifar100codebookscommunication-efficiencydistributed-learningfederated-learningflowermodel-compressionpytorchspeech-commandsvector-quantizationweight-clustering

Resources

Readme
License
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.