Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush Maini authored and Pratyush Maini committed Mar 9, 2023
0 parents commit a9cb1d3
Show file tree
Hide file tree
Showing 35 changed files with 3,577 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Adversarial Training

Code base for the paper [Perturbation Type Categorization for Multiple Adversarial Perturbation
Robustness](https://proceedings.mlr.press/v180/maini22a/maini22a.pdf)

## Training a Model

```
CUDA_VISIBLE_DEVICES=0 python pc_train.py --config configs/CIFAR10_pipeline.json
```

Additional Parameters:

> *model_id*: Unique id for the model
*opt_type*: SGD or Adam
*fft*: 0 or 1 (To use fourier transform or not)
*epochs*: Number of epochs to train
*num_iter*: Number of iterations for the attack
*model_type*: Type of model to train
*batch_size*: Batch size
*lr_max*: Maximum learning rate
*lr_mode*: 1 for linear, 2 for cosine
*droprate*: Dropout rate
*attacked_model_list*: List of models to attack
*attack_types*: List of attack types


## Evaluating a Model
```
python test.py --config configs/MNIST_small_step.json --num_iter 200 --model_type cnn_msd --path models/m_cnn/Baselines/max --mode base --restarts 2 --attack pgd --batch_size 500 --attack_types linf l1 l2 ddn
```

### How can I Cite this work?

```
@inproceedings{
maini2022perturbation,
title={Perturbation Type Categorization for Multiple Adversarial Perturbation Robustness},
author={Pratyush Maini and Xinyun Chen and Bo Li and Dawn Song},
booktitle={The 38th Conference on Uncertainty in Artificial Intelligence},
year={2022},
url={https://openreview.net/forum?id=BlbhyDUo9xc}
}
```
Loading

0 comments on commit a9cb1d3

Please sign in to comment.