Skip to main content
. 2023 Jan 11;23(2):853. doi: 10.3390/s23020853
Algorithm 2 Training AdvFace in impersonation attack
Input: 
  • X Training Face Dataset

  • f Target Face Dataset

  • F Cosine similarity between an image pair obtained by face matcher

  • G Generator with weight Gθ

  • D Discriminator with Dθ

  • m Batch size

  • α Learning size

  •   1:

    for number of training iterations do

  •   2:

       Sample a batch of probes {x(i)}i=1mX

  •   3:

       Sample a batch of target images {y(i)}i=1mf

  •   4:

       δ(i)=G(x(i),y(i))

  •   5:

       xadv(i)=x(i)+δ(i)

  •   6:

       Lperturbation=1m[i=1mmax(P,||δ(i)||2)]

  •   7:

       Lidentity=1m[i=1mE[1F(y(i),xadv(i))]]

  •   8:

       LD=1m[i=1mlog(1D(xadv(i)))]

  •   9:

       Ladv=1m[i=1mlog(D(y(i)))+log(1D(xadv(i)))]

  • 10:

       LG=LadvG+λiLidentity+λpLperturbation

  • 11:

       Gθ=Adam(GLG,Gθ,β1,β2)

  • 12:

       Dθ=Adam(DLD,Gθ,β1,β2)

  • 13:

    end for