Paper code: “Attacking Video Recognition Models with Bullet-Screen Comments”.
UCF-101 and HMDB-51 datasets are preprocessing by the methods in 3D-ResNets-PyTorch.
"dataset.py" file loads specified datasets.
Parameters "root_path", "video_path", "annotation_path" need to be customized in "opts/c3d_opt.py".
C3D and LRCN models are from 3D-ResNets-PyTorch and video_adv respectively. I3D-Slow model is from GluonCV
Parameter "pretrain_path" is the path of the pretrain model in "opts/c3d_opt.py/".
Download here.
Download here.
Download here.
- Use the path of the parameters file to specify the line 21 in 'opts/c3d_opt.py'.
python main.py --root_path <str> --video_path <str> --annotation_path <str> --dataset <kinetics/ucf101/hmdb51> --model <c3d/lrcn/i3d> --n_classes <400/101/51> --mean_dataset <kinetics/ucf101/hmdb51> --pretrain_path <str>
Our implementation inludes four black-box patch-based attack: BSC Attack based on Reinforcement Learning (RL), BSC Attack based on Basin Hopping (BH), BSC Attack based on random selection and Patch Attack with white square patch in our paper. Patch Attack was originally proposed in paper; BH is the baseline in paper, which used to generate the adversarial watermark. Their implementation are in PatchAttack and Adv-watermark respectively. Besides, we use an image captioning model proposed in paper to generate different BSCs for each video, the code is in Image Captioning.
If you use the code or find this project helpful, please consider citing our paper.
@inproceedings{chen2022attacking,
title={Attacking video recognition models with bullet-screen comments},
author={Chen, Kai and Wei, Zhipeng and Chen, Jingjing and Wu, Zuxuan and Jiang, Yu-Gang},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={36},
number={1},
pages={312--320},
year={2022}
}