Code repository accompanying the paper "On Adversarial Robustness: A Neural Architecture Search perspective"

Overview

Python 3.6

On Adversarial Robustness: A Neural Architecture Search perspective

Preparation:

Clone the repository:

https://github.com/tdchaitanya/nas-robustness.git

prerequisites

  • Python 3.6
  • Pytorch 1.2.0
  • CUDA 10.1

For a hassle-free environment setup, use the environment.yml file included in the repository.

Pre-trained models:

For easy reproduction of the result shown in the paper, this repository is organized dataset-wise, and all the pre-trained models can be downloaded from here

CIFAR-10/100

All the commands in this section should be executed in the cifar directory.

Hand-crafted models on CIFAR-10

All the files corresponding to this dataset are included in cifar-10/100 directories. Download cifar weigths from the shared drive link and place them in nas-robustness/cifar-10/cifar10_models/state_dicts directory.

For running all the four attacks on Resnet-50 (shown in Table 1) run the following command.

python handcrafted.py --arch resnet50

Change the architecture parameter to run attacks on other models. Only resnet-18, resnet-50, densenet-121, densenet-169, vgg-16 are supported for now. For other models, you may have to train them from scratch before running these attacks.

Hand-crafted models on CIFAR-100

For training the models on CIFAR-100 we have used fastai library. Download cifar-100 weigths from the shared drive link and place them in nas-robustness/cifar/c100-weights directory.

Additionally, you'll also have to download the CIFAR-100 dataset from here and place it in the data directory (we'll not be using this anywhere, this is just needed to initialize the fastai model).

python handcrafted_c100.py --arch resnet50
DARTS

Download DARTS CIFAR-10/100 weights from the drive and place it nas-robustness/darts/pretrained

For running all the four attacks on DARTS run the following command:

python darts-nas.py

Add --cifar100 to run the experiments on cifar-100

P-DARTS

Download P-DARTS CIFAR-10/100 weights from the drive and place it nas-robustness/pdarts/pretrained

For running all the four attacks on P-DARTS run the following command:

python pdarts-nas.py

Add --cifar100 to run the experiments on CIFAR-100

NSGA-Net

Download NSGA-Net CIFAR-10/100 weights from the drive and place it nas-robustness/nsga_net/pretrained

For running all the four attacks on P-DARTS run the following command:

python nsganet-nas.py

Add --cifar100 to run the experiments on CIFAR-100

PC-DARTS

Download PC-DARTS CIFAR-10/100 weights from the drive and place it nas-robustness/pcdarts/pretrained

For running all the four attacks on PC-DARTS run the following command:

python pcdarts-nas.py

Add --cifar100 to run the experiments on CIFAR-100

ImageNet

All the commands in this section should be executed in ImageNet directory.

Hand-crafted models

All the files corresponding to this dataset are included in imagenet directory. We use the default pre-trained weights provided by PyTorch for all attacks.

For running all the four attacks on Resnet-50 run the following command:

python handcrafted.py --arch resnet50

For DARTS, P-DARTS, PC-DARTS follow the same instructions as mentioned above for CIFAR-10/100, just change the working directory to ImageNet

DenseNAS

Download DenseNAS ImageNet weights from the drive (these are same as the weights provided in thier official repo) and place it nas-robustness/densenas/pretrained

For running all the four attacks on DenseNAS-R3 run the following command:

python dense-nas.py --model DenseNAS-R3

Citation

@InProceedings{Devaguptapu_2021_ICCV,
    author    = {Devaguptapu, Chaitanya and Agarwal, Devansh and Mittal, Gaurav and Gopalani, Pulkit and Balasubramanian, Vineeth N},
    title     = {On Adversarial Robustness: A Neural Architecture Search Perspective},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops},
    month     = {October},
    year      = {2021},
    pages     = {152-161}
}

Acknowledgements

Some of the code and weights provided in this library are borrowed from the libraries mentioned below:

Owner
Chaitanya Devaguptapu
Masters by Research (M.Tech-RA), IIT Hyderabad
Chaitanya Devaguptapu
[NeurIPS-2021] Mosaicking to Distill: Knowledge Distillation from Out-of-Domain Data

MosaicKD Code for NeurIPS-21 paper "Mosaicking to Distill: Knowledge Distillation from Out-of-Domain Data" 1. Motivation Natural images share common l

ZJU-VIPA 37 Nov 10, 2022
Paddle-Adversarial-Toolbox (PAT) is a Python library for Deep Learning Security based on PaddlePaddle.

Paddle-Adversarial-Toolbox Paddle-Adversarial-Toolbox (PAT) is a Python library for Deep Learning Security based on PaddlePaddle. Model Zoo Common FGS

AgentMaker 17 Nov 08, 2022
Implementation for our AAAI2021 paper (Entity Structure Within and Throughout: Modeling Mention Dependencies for Document-Level Relation Extraction).

SSAN Introduction This is the pytorch implementation of the SSAN model (see our AAAI2021 paper: Entity Structure Within and Throughout: Modeling Menti

benfeng 69 Nov 15, 2022
[ICCV 2021 Oral] NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo

NerfingMVS Project Page | Paper | Video | Data NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo Yi Wei, Shaohui

Yi Wei 369 Dec 24, 2022
the code used for the preprint Embedding-based Instance Segmentation of Microscopy Images.

EmbedSeg Introduction This repository hosts the version of the code used for the preprint Embedding-based Instance Segmentation of Microscopy Images.

JugLab 88 Dec 25, 2022
In this project we use both Resnet and Self-attention layer for cat, dog and flower classification.

cdf_att_classification classes = {0: 'cat', 1: 'dog', 2: 'flower'} In this project we use both Resnet and Self-attention layer for cdf-Classification.

3 Nov 23, 2022
(Preprint) Official PyTorch implementation of "How Do Vision Transformers Work?"

(Preprint) Official PyTorch implementation of "How Do Vision Transformers Work?"

xxxnell 656 Dec 30, 2022
A Temporal Extension Library for PyTorch Geometric

Documentation | External Resources | Datasets PyTorch Geometric Temporal is a temporal (dynamic) extension library for PyTorch Geometric. The library

Benedek Rozemberczki 1.9k Jan 07, 2023
The codes and related files to reproduce the results for Image Similarity Challenge Track 2.

ISC-Track2-Submission The codes and related files to reproduce the results for Image Similarity Challenge Track 2. Required dependencies To begin with

Wenhao Wang 89 Jan 02, 2023
Train emoji embeddings based on emoji descriptions.

emoji2vec This is my attempt to train, visualize and evaluate emoji embeddings as presented by Ben Eisner, Tim Rocktäschel, Isabelle Augenstein, Matko

Miruna Pislar 17 Sep 03, 2022
Patch-Diffusion Code (AAAI2022)

Patch-Diffusion This is an official PyTorch implementation of "Patch Diffusion: A General Module for Face Manipulation Detection" in AAAI2022. Require

H 7 Nov 02, 2022
Official Pytorch Implementation of Relational Self-Attention: What's Missing in Attention for Video Understanding

Relational Self-Attention: What's Missing in Attention for Video Understanding This repository is the official implementation of "Relational Self-Atte

mandos 43 Dec 07, 2022
Only works with the dashboard version / branch of jesse

Jesse optuna Only works with the dashboard version / branch of jesse. The config.yml should be self-explainatory. Installation # install from git pip

Markus K. 8 Dec 04, 2022
An implementation of the proximal policy optimization algorithm

PPO Pytorch C++ This is an implementation of the proximal policy optimization algorithm for the C++ API of Pytorch. It uses a simple TestEnvironment t

Martin Huber 59 Dec 09, 2022
A Pytorch implementation of "Splitter: Learning Node Representations that Capture Multiple Social Contexts" (WWW 2019).

Splitter ⠀⠀ A PyTorch implementation of Splitter: Learning Node Representations that Capture Multiple Social Contexts (WWW 2019). Abstract Recent inte

Benedek Rozemberczki 201 Nov 09, 2022
wmctrl ported to Python Ctypes

work in progress wmctrl is a command that can be used to interact with an X Window manager that is compatible with the EWMH/NetWM specification. wmctr

Iyad Ahmed 22 Dec 31, 2022
Code for EMNLP2020 long paper: BERT-Attack: Adversarial Attack Against BERT Using BERT

BERT-ATTACK Code for our EMNLP2020 long paper: BERT-ATTACK: Adversarial Attack Against BERT Using BERT Dependencies Python 3.7 PyTorch 1.4.0 transform

Linyang Li 142 Jan 04, 2023
Lightweight tool to perform MITM attack on local network

ARPSpy - A lightweight tool to perform MITM attack Using many library to perform ARP Spoof and auto-sniffing HTTP packet containing credential. (Never

MinhItachi 8 Aug 28, 2022
Code reproduce for paper "Vehicle Re-identification with Viewpoint-aware Metric Learning"

VANET Code reproduce for paper "Vehicle Re-identification with Viewpoint-aware Metric Learning" Introduction This is the implementation of article VAN

EMDATA-AILAB 23 Dec 26, 2022
A PyTorch re-implementation of the paper 'Exploring Simple Siamese Representation Learning'. Reproduced the 67.8% Top1 Acc on ImageNet.

Exploring simple siamese representation learning This is a PyTorch re-implementation of the SimSiam paper on ImageNet dataset. The results match that

Taojiannan Yang 72 Nov 09, 2022