Coder Social home page Coder Social logo

ytengtan / barre Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hsndbk4/barre

0.0 0.0 0.0 15 KB

Code for the paper titled "On the Robustness of Randomized Ensembles to Adversarial Perturbations" (ICML 2023).

License: MIT License

Python 100.00%

barre's Introduction

On the Robustness of Randomized Ensembles to Adversarial Perturbations

This repository contains the code for our paper On the Robustness of Randomized Ensembles to Adversarial Perturbations by Hassan Dbouk and Naresh R. Shanbhag (ICML 2023).

Running This Repo

This code was run with the following dependencies, make sure you have the appropriate versions downloaded and installed properly.

python 3.6.9
PyTorch 1.7.0
numpy 1.19.2
torchvision 0.8.0
  1. clone the repo: git clone https://github.com/hsndbk4/BARRE.git
  2. make sure the appropriate dataset folders are setup properly (check get_dataloaders in datasets.py)
  3. download a BARRE-trained REC of ResNet-20s on CIFAR-10 from here
  4. place the models in an appropriate folder in the root directory, e.g. res20_cifar10_M5

We are now set to run some scripts. To re-produce the ResNet-20 $\ell_\infty$ numbers in Table 1, you can run the following commands:

In order to evaluate the robustness of the trained models, please run:

python eval_robustness.py --M 5 --model res20 --batch_size 512 --sourcedir "res20_cifar10_M5" --outdir "res20_cifar10_M5" --normalize --use_osp

In order to re-produce the training outcome, please run:

python train_barre.py --M 5 --other_weight 1 --model res20 --batch_size 256 --outdir "res20_cifar10_M5" --normalize --osp_data_len 4096 --osp_batch_size 1024

Citation

If you find our work helpful, please consider citing it.

@inproceedings{dbouk2023robustness,
  title={On the Robustness of Randomized Ensembles to Adversarial Perturbations},
  author={Dbouk, Hassan and Shanbhag, Naresh},
  booktitle={International Conference on Machine Learning},
  pages={7303--7328},
  year={2023},
  organization={PMLR}
}

Acknowledgements

This work was supported by the Center for the Co-Design of Cognitive Systems (CoCoSys) funded by the Semiconductor Research Corporation (SRC) and the Defense Advanced Research Projects Agency (DARPA), and SRC’s Artificial Intelligence Hardware (AIHW) program.

Parts of the code in this repository are based on following public repositories:

barre's People

Contributors

hsndbk4 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.