Giter Site home page Giter Site logo

fling's Introduction

Fling

Fling is a research platform for Federated Learning using PyTorch as backend.

Its goal is to simulate the distributed learning process of Federated Learning on single or multiple machines, providing a fair testing platform for the performance of various federated learning algorithms on different datasets. It is mainly based on the Python language and uses the PyTorch framework as the backend module for deep learning, supporting a variety of federated learning algorithms and commonly used federated learning datasets.

It mainly supports:

  • Generic Federated Learning methods, such as FedAvg.
  • Personalized Federated Learning methods, such as FedPer.
  • Attacking methods, such as DLG.

Installation

Firstly, it is recommended to install PyTorch manually with a suitable version (specifically 1.1.0 or higher). However, using PyTorch version 2.0.0 or later is preferred due to its better computational efficiency. Instructions for installation can be found at this link.

After the first step, you can simply install the latest version of Fling with the following command by using Git:

git clone https://github.com/kxzxvbk/Fling
cd Fling
pip install -e .

Finally, you can use

fling -v

to check whether Fling is successfully installed.

Quick Start

After successfully install Fling, users can start the first Fling experiment by using the following command. An example for generic federated learning:

python flzoo/mnist/mnist_fedavg_cnn_toy_config.py

Or using our cli util by:

fling run -c flzoo/mnist/mnist_fedper_cnn_toy_config.py -p personalized_model_pipeline

This config is a simplified version for conducting FedAvg on the dataset MNIST and iterate for 4 communication rounds.

For other algorithms and datasets, users can refer to argzoo/ or customize your own configuration files.

For attacking methods, please refer to our examples in: demo for attack

Tutorials:

Overall Framework of Fling | Fling 整体框架

Meaning for Each Configuration Key | 配置文件各字段含义

How to Add a New FL Algorithm | 如何自定义联邦学习算法

How to Add a New Dataset | 如何添加新数据集

Cli Usage in Fling | Fling 的 CLI 使用

Feature

  • Support for a variety of algorithms and datasets.
  • Support multiprocessing training on each client for better efficiency.
  • Using single GPU to simulate Federated Learning process (multi-GPU version will be released soon).

Supported Algorithms

Generic Federated Learning

FedAvg: Communication-Efficient Learning of Deep Networks from Decentralized Data

FedProx: Federated Optimization in Heterogeneous Networks

FedMOON: Model-Contrastive Federated Learning

Personalized Federated Learning

FedPer: Federated Learning with Personalization Layers

FedBN: FedBN: Federated Learning on Non-IID Features via Local Batch Normalization

FedRoD: On Bridging Generic and Personalized Federated Learning for Image Classification

pFedSD: Personalized Edge Intelligence via Federated Self-Knowledge Distillation

FedCAC: Bold but Cautious: Unlocking the Potential of Personalized Federated Learning through Cautiously Aggressive Collaboration

Attacking Methods

DLG: Deep Leakage from Gradients

iDLG: Inverting Gradients -- How easy is it to break privacy in federated learning?

Feedback and Contribution

  • For any bugs, questions, feature requirements, feel free to propose them in issues
  • For any contributions that can improve Fling (more algorithms or better system design), we warmly welcome you to propose them in a pull request.

Acknowledgments

Special thanks to @chuchugloria, @shonnyx, @XinghaoWu,

Citation

@misc{Fling,
    title={Fling: Framework for Federated Learning},
    author={Fling Contributors},
    publisher = {GitHub},
    howpublished = {\url{https://github.com/kxzxvbk/Fling}},
    year={2023},
}

License

Fling is released under the Apache 2.0 license.

fling's People

Contributors

kxzxvbk avatar xinghaowu avatar brighthaozi avatar r-16bob avatar kyeguo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.