Hidden-trigger backdoor attacks
This section will go through a more sophisticated backdoor attack that uses an image_inset
to create a hidden trigger. The example is based on a 2019 paper by Aniruddha Saha, Akshayvarun Subramanya, and Hamed Pirsiavash called Hidden Trigger Backdoor Attacks and can be found at https://arxiv.org/abs/1910.00033.
Like our previous example, we must create a backdoor trigger using an image insert with a carefully crafted image found in the Resources
folder of the ch4
source code:
patch_size = 8 x_shift = 32 - patch_size - 5 y_shift = 32 - patch_size – 5 # Define the backdoor poisoning object. Calling backdoor. Poison (x) will insert the trigger into x. from art.attacks.poisoning import perturbations def mod(x): original_dtype = x.dtype x = perturbations.insert_image(x, backdoor_path="../../utils/data/backdoors/htbd.png", channels_first=False, random=False, x_shift=x_shift, y_shift=y_shift, size=(patch_size,patch_size), mode='RGB...