- Python 3.6 (Anaconda3):
conda create -n envname python==3.7 anaconda
conda activate envname- Pytorch >=1.4:
conda install pytorch torchvision -c pytorch- Geffnet and scikit-image
pip install geffnet scikit-imageDownload NIST-Round0 data from https://data.nist.gov/od/id/mds2-2175 and save it in ./data/
Generate meta data for NIST-Round0 models, run python data_pre.py output is data_meta.txt and then split the data into data_meta_tain.txt and data_meta_test.txt
To train the model(s) in the paper, run these commands
- generate l infinity norm bounded adversarial perturbations for training and test set
and save them to
./Pert/pert_mb/train_infand./Pert/pert_mb/test_infrespectively by running:
python pert_gen.py --meta_file ./data/data_meta_train.txt --pert_loc ./Pert/pert_mb/train_inf --max_iter 5 --p_norm 2
- generate l2 norm bounded adversarial perturbations for training and test set
and save them to
./Pert/pert_mb/train_l2and./Pert/pert_mb/test_l2respectively by running:
python pert_gen.py --meta_file ./data/data_meta_train.txt --pert_loc ./Pert/pert_mb/train_l2 --max_iter 5 --p_norm 3 --p_value 40
- train the model
python train.py
The generated model will be saved in ./models/detector/pretrained/
Run evaluation using
python eval.py
To evaluate my pretrained model download pretrained model from: Google Drive Link and save it to ./models/detector/pretrained/ before running evaluation.
| Model | Precision |
|---|---|
| mobilenetv3_0.95_0.925_mnet.pth | 0.95 |