Skip to main content

Flower Attacks: This is an extension of the Flower framework for Federated Learning. It provides an extenion module that allows the user to perform various attacks on the federated learning process.

Project description

modified flwr logo

Flower Attacks

GitHub tag (latest by date) GitHub license

This repository is an extension of the Flower Framework that makes possible creating, running, testing and simulating various adversary threats within the FLower Framework. The structure is made very similar to the strategy module to be easy and smooth for someone working with Flower to implement.

Features

  • Federated Learning Attacks: Implement and simulate various types of attacks on federated learning processes to assess their resilience and security

  • Integration with Flower: Seamlessly integrates with the Flower framework, allowing for easy experimentation and extension.

  • Extensible Design: Designed to be easily extended with new types of attacks or modifications to existing ones.

Installation

To install flwr_attacks, you can use pip:

pip install flwr_attacks

Usage

After installation, you can use flwr_attacks as part of your federated learning experiments. Here is a basic example of how to integrate it with your Flower-based federated learning setup:

Configuration for the attack (assuming cfg is an existing configuration object)

from flwr_attacks import MinMax, AttackServer, generate_cids

adversary_cids, benign_cids = generate_cids(NUM_CLIENTS, adversary_fraction=0.4)
all_cids = adversary_cids + benign_cids

Initialize the MinMax attack with your configuration

attack = MinMaxAttack(
    adversary_fraction=0.2,  # 20% of clients are adversaries
    activation_round=5,  # Activate attack at round 5
    adversary_clients=adversary_cids, # by default the attack will be able to access only the adversary clients. Use the argument adversary_accessed_cids to add specific access.
)

strategy = ...

# Create the AttackServer with the specified attack and strategy
attack_server = AttackServer(
    strategy=strategy,
    attack=attack,
)

Use the server as in a typical Flower server

Use simulation

history = fl.simulation.start_simulation(
    client_fn=client_fn,
    clients_ids=all_cids,
    config=fl.server.ServerConfig(num_rounds=cfg.num_rounds),
    server=attack_server,
)

or start the server

fl.server.start_server(
    server=attack_server,
)

Contributing

Contributions to flwr_attacks are welcome! If you have a new attack implementation, improvements or bug fixes, open an issue or a pull request.

License

flwr_attacks is released under the Flower's Apache-2.0 License. See the LICENSE file for more details.

Contact

For any questions or feedback, please contact Nassos Bountioukos Spinaris at nassosbountioukos@gmail.com.

Acknowledgments

Special thanks to the Flower framework team for providing a solid foundation for federated learning experiments.

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

flwr_attacks-0.1.4.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

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

flwr_attacks-0.1.4-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file flwr_attacks-0.1.4.tar.gz.

File metadata

  • Download URL: flwr_attacks-0.1.4.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.18 Linux/6.5.0-1016-azure

File hashes

Hashes for flwr_attacks-0.1.4.tar.gz
Algorithm Hash digest
SHA256 118164239a26e758a0f9a4988dfc13b612a3c3f969b262be1fceebb66eb997fe
MD5 ec609d2acda94f423bcd00b0b28a528e
BLAKE2b-256 98b6fd1bb6f94e964c162671cbc106e7f506fa8a5aa14b99192d46575d028b9a

See more details on using hashes here.

File details

Details for the file flwr_attacks-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: flwr_attacks-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.18 Linux/6.5.0-1016-azure

File hashes

Hashes for flwr_attacks-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1399e71bfa7cf21a8a8f27c21e12447c168e5972d0e66ec31159be940dd6b510
MD5 1d3415a3f9f9b153c811a0edc54634eb
BLAKE2b-256 7dc26f6eed620e2ee2c78c20646289ff75b32e81491be69d6afe74af02071168

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