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 designed to enhance existing FL solutions without requiring additional training or computational overhead. It enables personalization in standard algorithms such as FedAvg and FedYogi, boosting performance in scenarios with non-IID data.

As a modular component, FedPredict operates exclusively during the prediction phase of FL and does not require any modifications to the training process.

This project has been developed through a collaboration between the WISEMAP Lab (UFMG), H.IAAC Lab (UNICAMP), and NESPED Lab (UFV).

The list of projects currently using FedPredict includes (continuously updated):

  • FL-H.IAAC_docker: it has the code of the experiments of FedPredict papers in IEEE DCOSS-IoT 2023 and 2024 (i.e., FedPredict and FedPredict-Dynamic), and IEEE Transactions on Emerging Topics 2025 (extended FedPredict).
  • PFLib (will be available soon).

Documentation

Please access the FedPredict documentation for tutorials and API details. (updating)

Why FedPredict?

It is better working with the prediction stage. See the comparison below!

How does it work?

FedPredict intelligently combines global and local model parameters, assigning dynamic weights to each based on several factors. These factors include the evolution level (el) of the global model, the update level (ul) of the local model, and the similarity (s) between previously seen data (i.e., data used in prior training) and newly acquired data. Using this adaptive combination, the client generates a personalized model, which is then used for prediction on validation or test data.

Benefits

The list of benefits of the plugin is as follows:

  1. High performance: Achieves strong performance in heterogeneous data environments.
  2. High efficiency for FL: Maintains high performance even with reduced training.
  3. Data shift-awareness: FedPredict enables near-instant adaptation to new scenarios in the presence of concept drift.
  4. Task independent: Can be applied to any type of deep neural network task.
  5. Easy to use and modular: No modifications are required in the training phase of your FL solution.
  6. Lightweight: Built from simple, efficient operations.
  7. Low downlink communication cost: The FedPredict server compresses global model parameters to reduce communication overhead.

Just plug and play!

Installation

FedPredict is compatible with Python ≥ 3.8 and has been tested on the latest versions of Ubuntu. With your virtual environment activated, if you are using PyTorch, you can install FedPredict from PyPI by running the following command:

    pip install fedpredict[torch]

FL requirements

In general, if your solution shares structural similarities with FedAvg, then FedPredict is ready to be integrated. The requirements are outlined below:

Requirement Description
Sharing all layers Clients must upload all model layers at each round so that the server can aggregate a global model, which can then be directly utilized by any new client—similar to the standard FedAvg approach.
Same model structure The layers of the global and local models must have matching shapes to enable proper parameter combination.
Predicting using the combined model On the client side, the original method must be flexible enough to perform inference using the combined model; otherwise, the plugin will have no effect.

Components

Our solution has two main components: FedPredict client and FedPredict server. Their objectives are described below:

Components Objective
FedPredict Client Transfer the knowledge from the updated global model to the client's stale local model
FedPredict server (optional) Compresses the updated global model parameters to further send to the clients. Used together with FedPredict client

Citing

If FedPredict has been useful to you, please cite our papers.

FedPredict: Combining Global and Local Parameters in the Prediction Step of Federated Learning (original paper):

@INPROCEEDINGS{capanema2023fedpredict,
  author={Capanema, Cláudio G. S. and de Souza, Allan M. and Silva, Fabrício A. and Villas, Leandro A. and Loureiro, Antonio A. F.},
  booktitle={2023 19th International Conference on Distributed Computing in Smart Systems and the Internet of Things (DCOSS-IoT)}, 
  title={FedPredict: Combining Global and Local Parameters in the Prediction Step of Federated Learning}, 
  year={2023},
  volume={},
  number={},
  pages={17-24},
  keywords={Federated learning;Computational modeling;Neural networks;Mathematical models;Internet of Things;Distributed computing;Personalized Federated Learning;Neural Networks;Federated Learning Plugin},
  doi={10.1109/DCOSS-IoT58021.2023.00012}}

A Novel Prediction Technique for Federated Learning (extended journal paper):

@ARTICLE{capanema2025@novel,
  author={Capanema, Cláudio G. S. and de Souza, Allan M. and da Costa, Joahannes B. D. and Silva, Fabrício A. and Villas, Leandro A. and Loureiro, Antonio A. F.},
  journal={IEEE Transactions on Emerging Topics in Computing}, 
  title={A Novel Prediction Technique for Federated Learning}, 
  year={2025},
  volume={13},
  number={1},
  pages={5-21},
  keywords={Servers;Costs;Training;Downlink;Adaptation models;Computational modeling;Federated learning;Quantization (signal);Context modeling;Accuracy;Federated learning plugin;neural networks;personalized federated learning},
  doi={10.1109/TETC.2024.3471458}}

A Modular Plugin for Concept Drift in Federated Learning (FedPredict-Dynamic):

@INPROCEEDINGS{capanema2024@modular,
  author={Capanema, Cláudio G. S. and Da Costa, Joahannes B. D. and Silva, Fabrício A. and Villas, Leandro A. and Loureiro, Antonio A. F.},
  booktitle={2024 20th International Conference on Distributed Computing in Smart Systems and the Internet of Things (DCOSS-IoT)}, 
  title={A Modular Plugin for Concept Drift in Federated Learning}, 
  year={2024},
  volume={},
  number={},
  pages={101-108},
  keywords={Training;Accuracy;Federated learning;Geology;Concept drift;Data models;Internet of Things;Concept Drift;Personalized Federated Learning;Federated Learning Plugin;Neural Networks},
  doi={10.1109/DCOSS-IoT61029.2024.00024}}

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.66.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fedpredict-0.0.66-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fedpredict-0.0.66.tar.gz
Algorithm Hash digest
SHA256 14b3e430bc221341ccf8141476f7adbb65be439e55c181e0ecc5c1bbf83e4749
MD5 e4ca1d267b035bcb94019175a40bd5e0
BLAKE2b-256 23aa5daac6eb21a2c10c30e352a5351ad53d0e2a222f1c3d7ed8db9d9e7e0524

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fedpredict-0.0.66-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fedpredict-0.0.66-py3-none-any.whl
Algorithm Hash digest
SHA256 de33626bbb2185743798b71aaf8628293b4ae2c6a09aa85bb118b4e29cbf56f7
MD5 ed7e40dd85534a965a4b04553682ab64
BLAKE2b-256 ef5155c3f2bad9a3f8aba0bb8f9557f3fda29672a7082e8eaa27f92d67c6f9f3

See more details on using hashes here.

Supported by

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