-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_custom.sh
More file actions
52 lines (38 loc) · 3.94 KB
/
run_custom.sh
File metadata and controls
52 lines (38 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# ----------------Evaluate Other Existing Defenses on CIFAR10-ResNet18----------------
## Step 1: Pretrain original models (one victim model and five shadow models)
python pretrain_modi.py 0 ./config/cifar10_resnet18.json
## Step 2-1: Prune and fine-tune models with 'ppb' defense method
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend ppb --defend_arg 4
## Step 2-2: Adaptive attack on pruned models with 'ppb' defense method
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend ppb --defend_arg 4 --adaptive
## Step 3-1: Prune and fine-tune models with 'adv' defense method
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend adv --defend_arg 2
## Step 3-2: Adaptive attack on pruned models with 'adv' defense method
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend adv --defend_arg 2 --adaptive
## Step 4-1: Prune and fine-tune models with 'relaxloss' defense method
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend relaxloss --defend_arg 1
## Step 4-2: Adaptive attack on pruned models with 'relaxloss' defense method
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend relaxloss --defend_arg 1 --adaptive
## Step 5-1: Prune and fine-tune models with 'dp' defense method
python prune_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --prune_iter 5 --defend dp --defend_arg 0.1
## Step 5-2: Adaptive attack on pruned models with 'dp' defense method
python mia_modi.py 0 ./config/cifar10_resnet18.json --pruner_name iter_pruning --prune_sparsity 0.6 --attacks threshold,samia --defend dp --defend_arg 0.1 --adaptive
# ---------------------Evaluate Other Existing Defenses on Location-FC---------------------
## Step 1: Pretrain original models (one victim model and five shadow models)
python pretrain_modi.py 0 ./config/location.json
## Step 2-1: Prune and fine-tune models with 'ppb' defense method
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend ppb --defend_arg 4
## Step 2-2: Adaptive attack on pruned models with 'ppb' defense method
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend ppb --defend_arg 4 --adaptive
## Step 3-1: Prune and fine-tune models with 'adv' defense method
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend adv --defend_arg 2
## Step 3-2: Adaptive attack on pruned models with 'adv' defense method
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend adv --defend_arg 2 --adaptive
## Step 4-1: Prune and fine-tune models with 'relaxloss' defense method
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend relaxloss --defend_arg 1
## Step 4-2: Adaptive attack on pruned models with 'relaxloss' defense method
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend relaxloss --defend_arg 1 --adaptive
## Step 5-1: Prune and fine-tune models with 'dp' defense method
python prune_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --prune_iter 5 --defend dp --defend_arg 0.1
## Step 5-2: Adaptive attack on pruned models with 'dp' defense method
python mia_modi.py 0 ./config/location.json --pruner_name iter_prunetxt --prune_sparsity 0.6 --attacks threshold,samia --defend dp --defend_arg 0.1 --adaptive