flexclash


Nameflexclash JSON
Version 0.0.1 PyPI version JSON
download
home_page
Summary
upload_time2024-03-13 08:48:17
maintainer
docs_urlNone
authorNuria Rodríguez Barroso
requires_python
license
keywords adversarial attacks defences fl federated-learning flexible
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/FLEXible-FL/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](https://link.springer.com/chapter/10.1007/978-3-030-58951-6_24) |
| 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](https://www.mdpi.com/1999-5903/13/3/73)|

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.](https://proceedings.mlr.press/v80/yin18a.html) |
| 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.](https://proceedings.mlr.press/v80/yin18a.html) |
| 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](https://proceedings.neurips.cc/paper/2017/file/f4b9ec30ad9f68f89b29639786cb62ef-Paper.pdf) |
| 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](https://proceedings.mlr.press/v80/mhamdi18a/mhamdi18a.pdf) |


## 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:


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "flexclash",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adversarial attacks defences FL federated-learning flexible",
    "author": "Nuria Rodr\u00edguez Barroso",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/0c/8e/9c0224ee0bae49e1d035c75a6fdc84d99c92e032286283ea3a9e5d28826e/flexclash-0.0.1.tar.gz",
    "platform": null,
    "description": "# FLEX-Clash\n\nflex-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](https://github.com/FLEXible-FL/FLEXible) framework.\n\n## Details\n\nThis repository includes both:\n- Features to implement poisoning attacks in Federated Learning.\n- Features to implement defences in the aggregator in Federated Learning.\n- State-of-the-art defences implementedin FLEXible.\n\n### Folder structure\n\n- **flexclash/data**: which contains the features to poison the clients' data.\n- **flexclash/model**: which contains the features to poison the clients' model updates.\n- **flexclash/pool**: which contains the features to implement any defence in the aggregation operator as well as the state-of-the-art implemented defences.\n- **notebooks**: which contains explanatory notebooks showing how to implement poisoning attacks and use the implemented defences.\n- **test**: which contains the test for the implemented features.\n\n### Explanatory notebooks\n\n- **Poisoning_data_FLEX.ipynb**: A notebook showing how to implement data-poisoning attacks using `flexclash` including both byzantine and backdoor attacks.\n- **Poisoning_model_FLEX.ipynb**: A notebook showing how to implement model-poisoning attacks using `flexclash`.\n- **Defences_FLEX.ipynb**: A notebook showing how to employ defences against adversarial attacks using `flexclash`.\n\n\n## Features\n\nIn the following we detail the poisoning attacks implemented:\n\n|  Attack |  Description  | Citation |\n|----------|:-----------------------------------:|------:|\n| 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](https://link.springer.com/chapter/10.1007/978-3-030-58951-6_24) |\n| 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](https://www.mdpi.com/1999-5903/13/3/73)|\n\nIn the following we detail the defences implemented:\n\n|  Defence |  Description  | Citation |\n|----------|:-----------------------------------:|------:|\n| 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.](https://proceedings.mlr.press/v80/yin18a.html) |\n| 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.](https://proceedings.mlr.press/v80/yin18a.html) |\n| 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](https://proceedings.neurips.cc/paper/2017/file/f4b9ec30ad9f68f89b29639786cb62ef-Paper.pdf) |\n| 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 \ud835\udc53 parameter filters out the 2\ud835\udc53 clients of the tails of the sorted distribution of clients and aggregates the rest of them.| [The Hidden Vulnerability of Distributed Learning in Byzantium](https://proceedings.mlr.press/v80/mhamdi18a/mhamdi18a.pdf) |\n\n\n## Installation\n\nIn order to install this repo locally:\n\n``\n    pip install -e .\n``\n\nFLEX-Clash is available on the PyPi repository and can be easily installed using pip:\n\n``\n    pip install flex-clash\n``\n\n## Citation\n\nIf you use this repository in your research work, please cite Flexible paper:\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.0.1",
    "project_urls": null,
    "split_keywords": [
        "adversarial",
        "attacks",
        "defences",
        "fl",
        "federated-learning",
        "flexible"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "daa27b45a86af10bfe523288988a22dd547d3aed41c516d0cc214f24d34e2c6e",
                "md5": "8ede648866fa5b987be0a2e737d59993",
                "sha256": "abd27eb5e811cb43183d619ac353fade7dd0ba6a3deffc284ec14c0af66414a1"
            },
            "downloads": -1,
            "filename": "flexclash-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ede648866fa5b987be0a2e737d59993",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 22789,
            "upload_time": "2024-03-13T08:48:15",
            "upload_time_iso_8601": "2024-03-13T08:48:15.003799Z",
            "url": "https://files.pythonhosted.org/packages/da/a2/7b45a86af10bfe523288988a22dd547d3aed41c516d0cc214f24d34e2c6e/flexclash-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c8e9c0224ee0bae49e1d035c75a6fdc84d99c92e032286283ea3a9e5d28826e",
                "md5": "570226d472646a119e50ec6e81bffff8",
                "sha256": "558edf9d43ef97cdbb9a5a1ad63e4fd6c9347ddc77d54beef8911d4bc2f6af88"
            },
            "downloads": -1,
            "filename": "flexclash-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "570226d472646a119e50ec6e81bffff8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 19419,
            "upload_time": "2024-03-13T08:48:17",
            "upload_time_iso_8601": "2024-03-13T08:48:17.059806Z",
            "url": "https://files.pythonhosted.org/packages/0c/8e/9c0224ee0bae49e1d035c75a6fdc84d99c92e032286283ea3a9e5d28826e/flexclash-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 08:48:17",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "flexclash"
}
        
Elapsed time: 0.20225s