Skip to content

Commit

Permalink
frame saliency (#942)
Browse files Browse the repository at this point in the history
* frame saliency

* apply frame saliency attack to ucf101 scenario

* removing resisc frame saliency config

* adding model kwarg that's present in ucf101_baseline_pretrained.json config

Co-authored-by: lucas.cadalzo <lucas.cadalzo@twosixlabs.com>
  • Loading branch information
davidslater and lucas.cadalzo authored Nov 18, 2020
1 parent a55d880 commit d9f1c35
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
7 changes: 7 additions & 0 deletions armory/art_experimental/attacks/frame.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def get_frame_saliency(classifier, inner_config=None, **kwargs):
from art.attacks.evasion import FrameSaliencyAttack
from armory.utils import config_loading

attacker = config_loading.load_attack(inner_config, classifier)
attack = FrameSaliencyAttack(classifier, attacker, **kwargs)
return attack
65 changes: 65 additions & 0 deletions scenario_configs/ucf101_baseline_pretrained_frame_saliency.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"_description": "Resisc45 image classification, contributed by MITRE Corporation",
"adhoc": null,
"attack": {
"knowledge": "white",
"kwargs": {
"inner_config": {
"kwargs": {
"batch_size": 1,
"eps": 0.2,
"eps_step": 0.1,
"minimal": false,
"num_random_init": 0,
"targeted": false
},
"module": "art.attacks.evasion",
"name": "FastGradientMethod"
},
"method": "iterative_saliency"
},
"module": "armory.art_experimental.attacks.frame",
"name": "get_frame_saliency",
"use_label": false
},
"dataset": {
"batch_size": 1,
"framework": "numpy",
"module": "armory.data.datasets",
"name": "ucf101"
},
"defense": null,
"metric": {
"means": true,
"perturbation": "linf",
"record_metric_per_sample": false,
"task": [
"categorical_accuracy"
]
},
"model": {
"fit": false,
"fit_kwargs": {},
"model_kwargs": {
"max_frames": 512,
"model_status": "ucf101_trained"
},
"module": "armory.baseline_models.pytorch.ucf101_mars",
"name": "get_art_model",
"weights_file": "mars_ucf101_v1.pth",
"wrapper_kwargs": {}
},
"scenario": {
"kwargs": {},
"module": "armory.scenarios.video_ucf101_scenario",
"name": "Ucf101"
},
"sysconfig": {
"docker_image": "twosixarmory/pytorch:0.13.0-dev",
"external_github_repo": "yusong-tan/MARS",
"gpus": "all",
"output_dir": null,
"output_filename": null,
"use_gpu": false
}
}

0 comments on commit d9f1c35

Please sign in to comment.