-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
a55d880
commit d9f1c35
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
65
scenario_configs/ucf101_baseline_pretrained_frame_saliency.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |