detection_pretrain.ac
- class ac(args)[source]
Bases:
defense
Detecting Backdoor Attacks on Deep Neural Networks by Activation Clustering
basic sturcture for defense method:
basic setting: args
attack result(model, train data, test data)
- ac detection:
classify data by activation results
identify backdoor data according to classification results
compute TPR and FPR
parser = argparse.ArgumentParser(description=sys.argv[0]) ac.add_arguments(parser) args = parser.parse_args() ac_method = ac(args) if "result_file" not in args.__dict__: args.result_file = 'defense_test_badnet' elif args.result_file is None: args.result_file = 'defense_test_badnet' result = ac_method.detection(args.result_file)
Note
@article{chen2018detecting, title={Detecting backdoor attacks on deep neural networks by activation clustering}, author={Chen, Bryant and Carvalho, Wilka and Baracaldo, Nathalie and Ludwig, Heiko and Edwards, Benjamin and Lee, Taesung and Molloy, Ian and Srivastava, Biplav}, journal={arXiv preprint arXiv:1811.03728}, year={2018}}
- Parameters:
args (baisc) – in the base class