defense.clp

class clp[source]

Bases: defense

Data-free backdoor removal based on channel lipschitzness

basic structure:

  1. config args, save_path, fix random seed

  2. load the backdoor test data

  3. load the backdoor attack model

  4. clp defense:
    1. prune the model depend on the estimate of TAC

  5. test the result and get ASR, ACC, RC with regard to the chosen threshold and interval

parser = argparse.ArgumentParser(description=sys.argv[0])
clp.add_arguments(parser)
args = parser.parse_args()
clp_method = clp(args)
if "result_file" not in args.__dict__:
    args.result_file = 'one_epochs_debug_badnet_attack'
elif args.result_file is None:
    args.result_file = 'one_epochs_debug_badnet_attack'
result = clp_method.defense(args.result_file)

Note

@inproceedings{zheng2022data, title={Data-free backdoor removal based on channel lipschitzness}, author={Zheng, Runkai and Tang, Rongjun and Li, Jianze and Liu, Li}, booktitle={European Conference on Computer Vision}, pages={175–191}, year={2022}, organization={Springer}}

Parameters:

args (baisc) – in the base class u (float): the threshold of channel lipschitzness u_min (float): the minimum value of u u_max (float): the maximum value of u u_num (float): the number of u