Giter Club home page Giter Club logo

attack_and_defense_demo_ipynb's Introduction

Attack_and_Defense_demo_ipynb

simulation of Attack_and_Defense for Federated Learning

数据生成

生成过程需要在fl_dataset_load_and_train.ipynb中指定dataset_name, backdoor, iid, alpha, target_label.

建议先不要动poisoned_client_portion, poison_data_portion, num_clients, num_classes = 10 因为后续训练过程中有些是写死的.

它会在你的用户目录下生成一个test_imaget_data目录用于存储下载的原始训练集和测试集文件, 并在你的用户目录下生成一个processed_data目录用于处理好的数据集.

数据训练

训练过程需要在fl_dataset_load_and_train.ipynb中指定dataset_name, iid, alpha, num_clients, backdoor, poisoned_client_portion, poison_data_portion

攻击方式目前集成了

  • LabelFlipping
  • SignFlipping
  • Noise-(0,1)
  • ALIE
  • MinMax
  • IPM-0.1
  • IPM-100
  • Backdoor
  • NoAttack

防御方式目前集成了

  • FLUD
  • FedAvg

训练步骤

  • 目前预设 id 为0-7 的客户端为恶意, 8-19的客户端为良性
  • 根据客户端的类型, 逐个训练良性的/伪造恶意的本地模型更新
  • 服务器采用样本数量的使用鲁棒聚合方法本地模型更新

批量运行

nohup bash train_gpu_0.sh > output_gpu0.txt 2>&1 &
nohup bash train_gpu_1.sh > output_gpu1.txt 2>&1 &
nohup bash train_gpu_2.sh > output_gpu2.txt 2>&1 &
nohup bash train_gpu_3.sh > output_gpu3.txt 2>&1 &

attack_and_defense_demo_ipynb's People

Contributors

imamtom avatar

Stargazers

HuiXuan Wong 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.