Skip to content

zhipeng-wei/Heuristic_black_box_adversarial_attack_on_video_recognition_models

Repository files navigation

Heuristic-Black-box-Adversarial-Attack-On-Videos

Paper code: “Heuristic Black-box Adversarial Attacks on Video Recognition Models” paper.

Dataset

UCF-101 and HMDB-51 datasets are preprocessing by the methods in 3D-ResNets-PyTorch.
"dataset_load.py" file loads datasets for the specified model.

Dataset-C3D

Parameters "root_path", "video_path", "annotation_path" need to be customized in "datasets/c3d_dataset/c3d_opt.py".

  • Generate the parameters file in pickle format
python c3d_opt.py

Model

C3D and LRCN models are from 3D-ResNets-PyTorch and video_adv respectively.
"models_load.py" file loads models for the specified model and dataset.

C3D

C3D-UCF101

Parameter "pretrain_path" is the path of the pretrain model in "video_cls_models/c3d/ucf101_opts.py".
Download here.

  • Generate the parameters file in pickle format
python ucf101_opts.py
  • Use the path of the parameters file to specify the line 19 in 'video_cls_models/c3d/c3d.py'.

C3D-HMDB51

Parameter "pretrain_path" is the path of the pretrain model in "video_cls_models/c3d/hmdb51_opts.py".
Download here.

  • Generate the parameters file in pickle format
python hmdb51_opts.py
  • Use the path of the parameters file to specify the line 15 in 'video_cls_models/c3d/c3d.py'.

Attack Method

python main.py --dataset_name <hmdb51/ucf101> --model_name <lrcn/c3d> --target <True/False> --del_frame <True/False> --bound <True/False> --bound_threshold <int> --salient_region <True/False> --spatial_ratio <0~1> --spe_id <int>
  • target: true/false means targeted/untargeted attack.
  • del_frame: if or not use the temporal sparse.
  • bound: if or not use the perturbation bound ω.
  • bound_threshold: the perturbation bound ω.
  • salient_region: if or not use the spatial sparse.
  • spatial_ratio: the area ratio of salient region φ.
  • spe_id: the id of the sample in the dataset.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages