This is the official implementation of AdvMask, as was used for the paper.
You can directly start off using our implementations on CIFAR-10 and CIFAR-100.
- Clone this directory and
cdinto it.
git clone https://github.com/Jackbrocp/AdvMask
cd AdvMask
- 2023/7/10: Initial release
- Python 3
- PyTorch 1.6.0
- Torchvision 0.7.0
- Numpy
Download the attack mask and put them into ./Attack_Mask/.
--conf,path to the config file, e.g., confs/resnet18.yaml
Apply AdvMask as a data augmentation method training ResNet18 model on CIFAR10/100 dataset.
python train.py --conf confs/resnet18.yaml
Run additional comparisons on AdvMask combined with other data augmentation methods. (e.g., "AdvMask+AutoAugment")
First change mask parameter in the config file, e.g. "AutoAugment", "Fast-AutoAugment"
python additional_comparison.py --conf confs/resnet18.yaml
If you find this repository useful in your research, please cite our paper:
@article{YANG2023109847, title = {AdvMask: A sparse adversarial attack-based data augmentation method for image classification}, journal = {Pattern Recognition}, volume = {144}, pages = {109847}, year = {2023}, issn = {0031-3203}, doi = {https://doi.org/10.1016/j.patcog.2023.109847}, url = {https://www.sciencedirect.com/science/article/pii/S0031320323005459}, author = {Suorong Yang and Jinqiao Li and Tianyue Zhang and Jian Zhao and Furao Shen} }