Git Product home page Git Product logo

datapoisoning_fl's Introduction

Data Poisoning Attacks Against Federated Learning Systems

Code for the ESORICS 2020 paper: Data Poisoning Attacks Against Federated Learning Systems

Installation

  1. Create a virtualenv (Python 3.7)
  2. Install dependencies inside of virtualenv (pip install -r requirements.pip)
  3. If you are planning on using the defense, you will need to install matplotlib. This is not required for running experiments, and is not included in the requirements file

Instructions for execution

Using this repository, you can replicate all results presented at ESORICS. We outline the steps required to execute different experiments below.

Setup

Before you can run any experiments, you must complete some setup:

  1. python3 generate_data_distribution.py This downloads the datasets, as well as generates a static distribution of the training and test data to provide consistency in experiments.
  2. python3 generate_default_models.py This generates an instance of all of the models used in the paper, and saves them to disk.

General Information

Some pointers & general information:

  • Most hyperparameters can be set in the federated_learning/arguments.py file
  • Most specific experiment settings are located in the respective experiment files (see the following sections)

Experiments - Label Flipping Attack Feasibility

Running an attack: python3 label_flipping_attack.py

Experiments - Attack Timing in Label Flipping Attacks

Running an attack: python3 attack_timing.py

Experiments - Malicious Participant Availability

Running an attack: python3 malicious_participant_availability.py

Experiments - Defending Against Label Flipping Attacks

Running the defense: python3 defense.py

Experiment Hyperparameters

Recommended default hyperparameters for CIFAR10 (using the provided CNN):

  • Batch size: 10
  • LR: 0.01
  • Number of epochs: 200
  • Momentum: 0.5
  • Scheduler step size: 50
  • Scheduler gamma: 0.5
  • Min_lr: 1e-10

Recommended default hyperparameters for Fashion-MNIST (using the provided CNN):

  • Batch size: 4
  • LR: 0.001
  • Number of epochs: 200
  • Momentum: 0.9
  • Scheduler step size: 10
  • Scheduler gamma: 0.1
  • Min_lr: 1e-10

Citing

If you use this code, please cite the paper:

@ARTICLE{2020arXiv200708432T,
       author = {{Tolpegin}, Vale and {Truex}, Stacey and {Emre Gursoy}, Mehmet and
         {Liu}, Ling},
        title = "{Data Poisoning Attacks Against Federated Learning Systems}",
      journal = {arXiv e-prints},
     keywords = {Computer Science - Machine Learning, Computer Science - Cryptography and Security, Statistics - Machine Learning},
         year = 2020,
        month = jul,
          eid = {arXiv:2007.08432},
        pages = {arXiv:2007.08432},
archivePrefix = {arXiv},
       eprint = {2007.08432},
 primaryClass = {cs.LG},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv200708432T},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

datapoisoning_fl's People

Contributors

darkmattervale avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.