| Algorithm 1. The optimization procedure of DeDiAttack |
| Input: Clean image Ground-truth label Surrogate classifier Stable Diffusion Model Number of optimization iterations Number of deformation samplings |
| Output: Unrestricted adversarial example 1: <- DDIM Inversion () 2: Initialize the adversarial latent variable with 3: for to do 4: <- Decode () 5: for = 1 to do 6: Sample a random deformation noise map 7: Update according to the classification loss in Equation (4) 8: <- T (, ) 9: end for 10: Compute the classification loss using Equation (6) and 11: Compute the distribution alignment loss using Equations (7) and (8) 12: Compute the structure preservation loss using Equation (9) 13: Update by AdamW according to the total objective in Equation (10) 14: end for 15: <- Decode () 16: return |