/FedAvg_pytorch

Framework for Federated Learning with FedAvg algorithm in PyTorch

Primary LanguagePythonBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Federated Learning framework based on FedAvg

PyTorch-based Federated Learning framework based on FederatedAveraging (FedAvg) algorithm. This is an unofficial translation of the framework proposed by Caldas et al. in LEAF (written in TensorFlow). References follow.

Resources

Datasets

  1. FEMNIST
  • Overview: Image Dataset
  • Details: 62 different classes (10 digits, 26 lowercase, 26 uppercase), images are 28 by 28 pixels (with option to make them all 128 by 128 pixels), 3500 users
  • Task: Image Classification
  1. Celeba
  1. CIFAR-100
  • Overview: Image Dataset based on CIFAR-100 and Federated Vision Datasets
  • Details: 100 users with 500 images each. Different combinations are possible, following Dirichlet's distribution
  • Task: Image Classification over 100 classes
  1. CIFAR-10
  • Overview: Image Dataset based on CIFAR10 and Federated Vision Datasets
  • Details: 100 users with 500 images each. Different combinations are possible, following Dirichlet's distribution
  • Task: Image Classification over 10 classes
  1. iNaturalist
  • Overview: Image Dataset based on iNaturalist-2017 dataset and iNaturalist-User-120k from Federated Vision Datasets
  • Details: 9,275 users. Non-i.i.d. and unbalanced setting.
  • Task: Image Classification over 1,203 classes

Notes

  • Install the libraries listed in requirements.txt
    • I.e. with pip: run pip3 install -r requirements.txt
  • Go to directory of respective dataset for instructions on generating data
  • models directory contains instructions on running baseline reference implementations