Coder Social home page Coder Social logo

yizeng623 / i-bau Goto Github PK

View Code? Open in Web Editor NEW
49.0 2.0 13.0 12.23 MB

Official Implementation of ICLR 2022 paper, ``Adversarial Unlearning of Backdoors via Implicit Hypergradient''

Home Page: https://openreview.net/forum?id=MeeQkFYVbzW

License: MIT License

Jupyter Notebook 54.78% Python 45.22%
deep-learning adversarial-attacks adversarial-machine-learning ai-security backdoor-attacks backdoor-defense

i-bau's Introduction

I-BAU: Adversarial-Unlearning-of-Backdoors-via-Implicit-Hypergradient

Python 3.6 Pytorch 1.8.1 CUDA 10.1

Official Implementation of ICLR 2022 paper, Adversarial Unlearning of Backdoors via Implicit Hypergradient [openreview][video] .

We propose a novel minimax formulation for removing backdoors from a given poisoned model based on a small set of clean data:

To solve the minimax problem, we propose the Implicit Backdoor Adversarial Unlearning (I-BAU) algorithm, which utilizes the implicit hypergradient to account for the interdependence between inner and outer optimization. I-BAU requires less computation to take effect; particularly, it is more than 13 X faster than the most efficient baseline in the single-target attack setting. It can still remain effective in the extreme case where the defender can only access 100 clean samples โ€” a setting where all the baselines fail to produce acceptable results . Picture1

Requirements

This code has been tested with Python 3.6, PyTorch 1.8.1 and cuda 10.1.

Usage & HOW-TO

  • Install required packages.
  • Get poisoned models prepared in the directory ./checkpoint/.
  • We provide two examples on poisoned models trained on GTSRB and CIFAR10 datasets, check clean_solution_batch_op..._cifar.ipynb and clean_solution_batch_op..._gtsrb.ipynb for more details.
  • For a more flexible usage, run python defense.py. An example is as follow:
python defense.py --dataset cifar10 --poi_path './checkpoint/badnets_8_02_ckpt.pth'  --optim Adam --lr 0.001 --n_rounds 3 --K 5

Clean data used for backdoor unlearning can be specified with argument --unl_set; if it is not specified, then a subset of data from testset will be used for unlearning.

  • For more information regarding training options, please check the help message:
    python defense.py --help.

Poster

Citation

If you find our work useful please cite:

@inproceedings{zeng2021adversarial,
  title={Adversarial Unlearning of Backdoors via Implicit Hypergradient},
  author={Zeng, Yi and Chen, Si and Park, Won and Mao, Zhuoqing and Jin, Ming and Jia, Ruoxi},
  booktitle={International Conference on Learning Representations},
  year={2021}
}

Special thanks to...

Stargazers repo roster for @YiZeng623/I-BAU Forkers repo roster for @YiZeng623/I-BAU

i-bau's People

Contributors

scccc21 avatar yizeng623 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

i-bau's Issues

How to run the code?

Dear authors,

Thanks for releasing the codes! Could you please provide instructions on how to run the codes to reproduce the results? For example, what is the command to defense the BadNet attack on CIFAR10?

Thanks in advance.

Differentiated Tensors not Used in Graph

Hi,
I've used a modified version of your code. The modification is supposed to be just some refactors (assuming I've made no mistakes).
I ran it on MNIST and a simple network, and it worked. But when I tried to use it on Cifar10 with Resnet18_comp I got the following error (line 61 of hypergrad.py):

One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior.

Do you know what the reason might be?

missing the implementation on ResNet study

Hi, zeng @YiZeng623 .

Thanks for the great work and the open-sourced implementation from your team. It is very nice that you guys offered the jupyter interactive way for running the code. User friendly and easy to get the results.

But there is still one thing puzzled me. This repo does not have the ResNet implementation. I noticed the almost all of the main experiments were conducted on VGG architecture but both the appendix from your paper and the rebuttal from the openreview did mention the experiments on ResNet models. Do you have the plan to opensource the ResNet experiment code?

Really appreciate to hear from you.

Best,
Terry

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.