Federated-Learning-PyTorch  by AshwinRJ

PyTorch implementation of federated learning research paper

created 6 years ago
1,364 stars

Top 30.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a PyTorch implementation of federated learning, specifically targeting the "Communication-Efficient Learning of Deep Networks from Decentralized Data" paper. It's designed for researchers and practitioners interested in understanding and experimenting with federated learning on common datasets like MNIST, Fashion MNIST, and CIFAR10, supporting both IID and non-IID data distributions.

How It Works

The project implements federated learning by training multiple local models on decentralized data across simulated users, then aggregating their updates to improve a global model. This approach reduces communication overhead compared to sending raw data, enabling efficient training on distributed datasets. It uses simple MLP and CNN models to clearly illustrate the federated learning paradigm.

Quick Start & Requirements

  • Install: pip install -r requirements.txt
  • Prerequisites: Python 3, PyTorch, Torchvision. Datasets are downloaded automatically or can be manually placed in the data directory. GPU support is optional but recommended.
  • Running:
    • Baseline (CPU): python src/baseline_main.py --model=mlp --dataset=mnist --epochs=10
    • Federated (GPU): python src/federated_main.py --model=cnn --dataset=cifar --gpu=0 --iid=1 --epochs=10
  • Docs: No explicit documentation link provided, but the README offers detailed running instructions and parameter explanations.

Highlighted Details

  • Experiments conducted on MNIST, Fashion MNIST, and CIFAR10 datasets.
  • Supports both IID and non-IID data splits, including unequal distributions.
  • Baseline MLP achieves 92.71% accuracy and CNN achieves 98.42% on MNIST.
  • Federated CNN achieves 97.28% accuracy under IID and 75.94% under non-IID conditions.

Maintenance & Community

  • The repository is maintained by AshwinRJ.
  • No specific community channels (Discord, Slack) or roadmap are mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license.

Limitations & Caveats

The implementation focuses on simple MLP and CNN models, and the README does not detail support for more complex architectures or advanced federated learning techniques beyond the vanilla approach.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
34 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.