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

  • f Training 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 origin face images {y(i)}i=1mf

  •   4:

       δ(i)=G(x(i))

  •   5:

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

  •   6:

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

  •   7:

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

  •   8:

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

  •   9:

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

  • 10:

       LG=Ladv+λiLidentity+λpLperturbation

  • 11:

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

  • 12:

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

  • 13:

    end for