Skip to main content
. 2024 Mar 19;26(3):269. doi: 10.3390/e26030269
Algorithm 1 uses PGD attack method to generate AE
Input: Cover image ICO, the parameters β of pre-trained target classification network, the maximum iterations T, the perturbation step size α, and the maximum perturbation range S
Output: Adversarial example IA
1: IA0ICO//The initial adversarial example is the cover image.
2: for    i=0:T do
3:       gi=ICOJβ,IAi,TCO//Get the gradient at the current iteration exampl.
4:       di=α×sign(gi)//Get the perturbation magnitude at the current iteration.
5:     if IAi+diICO+S then
6:             IAi+1=IAi+di//Update the perturbed image
7:      Else
8:             IAi+1=Clip(IAi+di,ICO+S)//Confine the perturbations to the range
9:      end if
10: end for
11: IA=IAT