#Code to load all the models is provided in: 
load_model_imn.py
load_model.py

- class ECAC contains the code for our method ECAC
- class AAALinear is copied from the code provided by AAA authors.
- function get_model(m_type, m_name, args) loads the model.
  For models which needs to be locally trained, kindly change the path in this function.



For running black box attack, kindly download the code from: https://github.com/adverML/BlackboxBench
To run the code, use these two files. We slighty modified the code so that we can load models using the above two files:
- attack_cifar10_model.py
- attack_imagenet_model.py



Several black box attacks are run as (assuming all the libraries are installed as directed in BlackboxBench repository:
The json files are provided in folder: 

Run CIFAR10 code as:
python attack_cifar10_model.py a_nat_wrn28_sign.json 
python attack_cifar10_model.py a_sat_wrn28_sign.json
python attack_cifar10_model.py a_aaa_nat_wrn28_sign.json
python attack_cifar10_model.py a_ecac_sat_wrn28_sign.json
python attack_cifar10_model.py a_nat_wrn28_sign_2500.json
python attack_cifar10_model.py a_sat_wrn28_sign_2500.json
python attack_cifar10_model.py a_aaa_nat_wrn28_sign_2500.json
python attack_cifar10_model.py a_ecac_sat_wrn28_sign_2500.json
....


Run ImageNet code as:
python attack_imagenet_model.py a_imn_ecac_wrn50_nes.json
python attack_imagenet_model.py a_imn_ecac_wrn50_nes_2500.json
python attack_imagenet_model.py a_imn_aaa_wrn50_nes.json
python attack_imagenet_model.py a_imn_aaa_wrn50_nes_2500.json
python attack_imagenet_model.py a_imn_sat_wrn50_nes.json
python attack_imagenet_model.py a_imn_sat_wrn50_nes_2500.json
python attack_imagenet_model.py a_imn_nat_wrn50_nes.json
python attack_imagenet_model.py a_imn_nat_wrn50_nes_2500.json
....

To run SimBA download code from: https://github.com/cg563/simple-blackbox-attack

