Skip to main content

FedPredict is a personalization plugin for Federated Learning methods.

Project description

Welcome to FedPredict

The first ever plugin for Federated Learning!

FedPredict is a Federated Learning (FL) plugin that can significantly improve FL solutions without requiring additional training or expensive processing. FedPredict enables personalization for traditional methods, such as FedAvg and FedYogi. It is also a modular plugin that operates in the prediction stage of FL without requiring any modification in the training step. This project has been developed in the laboratories WISEMAP (UFMG), H.IAAC (UNICAMP), and NESPED (UFV).

The list of projects that use FedPredict is the following (updating):

  • FL-H.IAAC: it has the code of the experiments of FedPredict papers in DCOSS-IoT 2023 and 2024 (i.e., FedPredict and FedPredict-Dynamic).
  • PFLib (will be available soon).
  • PyFlexe (will be available soon).

Documentation

Please access the FedPredict documentation for tutorials and API details.

How it works?

FedPredict intelligently combines global and local model parameters. In this process, it assigns more or less weight to each type of parameter according to various factors, such as the evolution level (el) of the global model, the update level (ul) of the local model, and the similarity (s) between the old data (i.e., the one in which the model was previously trained) and the recently acquired data). Then, the client uses the combined model to make predictions over the test/val data.

Benefits

The list of benefits of the plugin as listed as follows:

  1. High accuracy: it pushes up FL accuracy without requiring additional training!
  2. Support for dynamic data: it is designed for stationary and non-stationary non-IID data.
  3. Concept drift: FedPredict makes the model almost instantly adapt to the new scenario when concept drift occurs.
  4. Task independent: apply FedPredict for any type of deep neural network task.
  5. Easy to use: no modifications are necessary in the training stage of your solution!
  6. Low computational cost: it is composed of simple operations.

Just plug and play!

Installation

FedPredict is compatible with Python>=3.8 and is tested on the latest versions of Ubuntu. With your virtual environment opened, if you are using torch type the following command to install FedPredict from Pypi:

    pip install fedpredict[torch]

If you are using Flower for FL simulation, type:

    pip install fedpredict[flwr]

FL requirements

In general, if your solution shares some level of similarity with FedAvg, then FedPredict is ready to use. The requirements are described as follows:

  1. Sharing all layers. The clients have to upload all model layers at every round so the server can aggregate a global model that can be directly leveraged by a new client, as in FedAvg.
  2. Same model structure. The layers of the global and local models have to have the same shape to allow the combination of parameters.
  3. Predicting using the combined model. On the client side, the original method has to be flexible enough to make predictions based on the combined model; otherwise, the plugin will have no effect.

Components

FedPredict-Client is placed on the client side and the features of its versions are listed below:

Module Static clients Dynamic clients Static heterogeneous data Dynamic heterogeneous data
FedPredict Client :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:

FedPredict-Server is placed on the server side and is responsible for compressing the shared global model parameters.

Citing

If FedPredict has been useful to you, please cite our paper. The BibTeX is presented as follows:

@inproceedings{capanema2023fedpredict,
  title={FedPredict: Combining Global and Local Parameters in the Prediction Step of Federated Learning},
  author={Capanema, Cl{\'a}udio GS and de Souza, Allan M and Silva, Fabr{\'\i}cio A and Villas, Leandro A and Loureiro, Antonio AF},
  booktitle={2023 19th International Conference on Distributed Computing in Smart Systems and the Internet of Things (DCOSS-IoT)},
  pages={17--24},
  year={2023},
  doi={https://doi.org/10.1109/DCOSS-IoT58021.2023.00012},
  organization={IEEE}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fedpredict-0.0.7.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

fedpredict-0.0.7-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file fedpredict-0.0.7.tar.gz.

File metadata

  • Download URL: fedpredict-0.0.7.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for fedpredict-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ca5931c4e12f86c51844a65935a794b1f9ec03dfb0d52d040796c6f09f278116
MD5 735e2446cafc0cddf72cb5014d622f17
BLAKE2b-256 11d43eb69f36c02c2bf34ac5f9d393d2a6fc296548e1e8bd5e3ff7287db62444

See more details on using hashes here.

File details

Details for the file fedpredict-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: fedpredict-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 30.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for fedpredict-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 714e326afc519e93b0eff5c829f822288d89d3bc483bc6d9a2ada39ae8b64784
MD5 099664f3c5402e981473ae60e5141930
BLAKE2b-256 596dce7ddcfbd08d6f46332fcadc27e08636e4433a081ea60ab051f20b724e7a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page