No project description provided
Project description
FLEX-Clash
flex-clash is a Python library dedicated to adversarial attacks and defences in Federated Learning. It offers the state-of-the methods and features to ease the implementation of custom methods. It is intended to extend the FLEXible framework.
Details
This repository includes both:
- Features to implement poisoning attacks in Federated Learning.
- Features to implement defences in the aggregator in Federated Learning.
- State-of-the-art defences implementedin FLEXible.
Folder structure
- flexclash/data: which contains the features to poison the clients' data.
- flexclash/model: which contains the features to poison the clients' model updates.
- flexclash/pool: which contains the features to implement any defence in the aggregation operator as well as the state-of-the-art implemented defences.
- notebooks: which contains explanatory notebooks showing how to implement poisoning attacks and use the implemented defences.
- test: which contains the test for the implemented features.
Explanatory notebooks
- Poisoning_data_FLEX.ipynb: A notebook showing how to implement data-poisoning attacks using
flexclash
including both byzantine and backdoor attacks. - Poisoning_model_FLEX.ipynb: A notebook showing how to implement model-poisoning attacks using
flexclash
. - Defences_FLEX.ipynb: A notebook showing how to employ defences against adversarial attacks using
flexclash
.
Features
In the following we detail the poisoning attacks implemented:
Attack | Description | Citation |
---|---|---|
Data poisoning | It consists of poisoning a certain amount of data of certain clients randomly or according to certain criteria. Several examples are shown in the notebooks. | Data Poisoning Attacks Against Federated Learning Systems |
Model poisoning | It consists of directly poisoning the weights of the model update that the client shares with the server. | Deep Model Poisoning Attack on Federated Learning |
In the following we detail the defences implemented:
Defence | Description | Citation |
---|---|---|
Median | It is a robust-aggregation operator based on replacing the arithmetic mean by the median of the model updates, which choose the value that represents the centre of the distribution. | Byzantine-robust distributed learning: Towards optimal statistical rates. |
Trimmed mean | It is a version of the arithmetic mean, consisting of filtering a fixed percentage of extreme values both below and above the data distribution. | Byzantine-robust distributed learning: Towards optimal statistical rates. |
MultiKrum | It sorts the clients according to the geometric distances of their model updates. Hence, it employs an aggregation parameter, which specifies the number of clients to be aggregated (the first ones after being sorted) resulting in the aggregated model. | Machine Learning with Adversaries: Byzantine Tolerant Gradient Descent |
Bulyan | It is a federated aggregation operator to prevent poisoning attacks, combining the MultiKrum federated aggregation operator and the trimmed-mean. Hence, it sorts the clients according to their geometric distances, and according to a 𝑓 parameter filters out the 2𝑓 clients of the tails of the sorted distribution of clients and aggregates the rest of them. | The Hidden Vulnerability of Distributed Learning in Byzantium |
Installation
In order to install this repo locally:
pip install -e .
FLEX-Clash is available on the PyPi repository and can be easily installed using pip:
pip install flex-clash
Citation
If you use this repository in your research work, please cite Flexible paper:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flexclash-0.0.3.tar.gz
.
File metadata
- Download URL: flexclash-0.0.3.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0c8458e502c2158e9ede1eb4d5b3dee96ebaeb68a3d50d6ae370f7b569684ce |
|
MD5 | 4378643c03cbef5990d50657be9254a4 |
|
BLAKE2b-256 | 3d11ae72fd857c54389bdcf10f9e927447238b02bd47fadcbc7766358b99d470 |
File details
Details for the file flexclash-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: flexclash-0.0.3-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5fcf8b3159c0e7cdd9b080be098a8beb35b5b4dd74d1afb8eea7691dcc0d70b |
|
MD5 | f84bd6455997d527ee6bf0069144fd94 |
|
BLAKE2b-256 | 571e1e7cae34cab2f15ab8bf35a052fd905ffd35f1ec4bb6a05843d0fa060f50 |