---
abstract: 'Face recognition systems have been shown to be vulnerable to adversarial examples resulting from adding small perturbations to probe images. Such adversarial images can lead state-of-the-art face recognition systems to falsely reject a genuine subject (obfuscation attack) or falsely match to an impostor (impersonation attack). Current approaches to crafting adversarial face images lack perceptual quality and take an unreasonable amount of time to generate them. We propose, AdvFaces, an automated adversarial face synthesis method that learns to generate minimal perturbations in the salient facial regions via Generative Adversarial Networks. Once AdvFaces is trained, it can automatically generate imperceptible perturbations that can evade state-of-the-art face matchers with attack success rates as high as $97.22\%$ and $24.30\%$ for obfuscation and impersonation attacks, respectively.'
author:
- |
    Debayan Deb\
    Michigan State University\
    East Lansing, MI, USA\
    [debdebay@msu.edu]{}
- |
    Jianbang Zhang\
    Lenovo Inc.\
    Morrisville, NC, USA\
    [zhangjb2@lenovo.com]{}
- |
    Anil K. Jain\
    Michigan State University\
    East Lansing, MI, USA\
    [jain@cse.msu.edu]{}
bibliography:
- 'egbib.bib'
title: 'AdvFaces: Adversarial Face Synthesis'
---

Introduction
============

From mobile phone unlock, to boarding a flight at airports, the ubiquity of automated face recognition systems (AFR) is evident. With deep learning models, AFR systems are able to achieve accuracies as high as 99% True Accept Rate (TAR) at 0.1% False Accept Rate (FAR) [@nist]. The model behind this success is a Convolutional Neural Network (CNN) [@facenet; @sphereface; @arcface] and the availability of large face datasets to train the model. However, CNN models have been shown to be vulnerable to *adversarial perturbations *[^1][@szegedy; @goodfellow; @universal; @boosting]. Szegedy first showed the dangers of *adversarial examples* in the image classification domain, where perturbing the pixels in the input image can cause CNNs to misclassify the image [@szegedy] even when the amount of perturbation is imperceptible to the human eye. Despite impressive recognition performance, prevailing AFR systems are still vulnerable to the growing threat of adversarial examples (see Figure \[fig:frontpage\]) as explained below.

\

A hacker can maliciously perturb his face image in a manner that can cause AFR systems to match it to a target victim (*impersonation attack*) or any identity other than the hacker (*obfuscation attack*). Yet to the human observer, this adversarial face image should appear as a legitimate face photo of the attacker (see Figure \[fig:overview\]). This is different from face *presentation attacks*, where the hacker assumes the identity of a target by presenting a fake face (also known as spoof face) to a face recognition system (see Figure \[fig:spoof\]). However, in the case of presentation attacks, the hacker needs to actively participate by wearing a mask or replaying a photograph/video of the genuine individual which may be conspicuous in scenarios where human operators are involved (such as airports). As discussed below, adversarial faces, do not require active participation during verification.

Consider for example, the United States Customs and Border Protection (CBP), the largest federal law enforcement agency in the United States [@cbp_largest], which (i) processes entry to the country for over a *million* travellers *everyday* [@cbp_stats] and (ii) employs automated face recognition for verifying travelers’ identities [@cbp_face]. In order to evade being identified as an individual in a CBP watchlist, a terrorist can maliciously enroll an adversarial image in the gallery such that upon entering the border, his legitimate face image will be matched to a known and benign individual or to a fake identity previously enrolled in the gallery. An individual can also generate adversarial examples to dodge his own identity in order to guard personal privacy. Ratha  [@ratha] identified eight points in a biometric system where an attack can be launched against a biometric (including face) recognition system, including AFR (see Figure \[fig:attacks\]). An adversarial face image can be inserted in the AFR system at point 2, where compromised face embeddings will be obtained by the feature extractor that could be used for impersonation or obfuscation attacks. The entire gallery can also be compromised if the hacker enrolls an adversarial image at point 6, where none of the probes will match to the correct identity’s gallery.

![Eight points of attacks in an automated face recognition system [@ratha]. An adversarial image can be injected in the AFR system at points 2 and 6 (solid arrows).[]{data-label="fig:attacks"}](attacks.pdf){width="0.98\linewidth"}

Three broad categories of adversarial attacks have been identified.

1.  *White-box* attack: A majority of the prior work assumes full knowledge of the CNN model and then iteratively adds imperceptible perturbations to the probe image via various optimization schemes [@goodfellow; @madry; @carlini; @xiao; @evtimov; @papernot; @kurakin; @deepfool; @gflm]. We posit that this is unrealistic in real-world scenarios, since the attacker may not be able to access the models.

2.  *Black-box* attack: Generally, black-box attacks are launched by querying the outputs of the deployed AFR system [@dong], [@liu]. This may not be efficient as it may take a large number of queries to obtain a reasonable adversarial image [@dong]. Further, most Commercial-Off-The-Shelf (COTS) face matchers permit only a few queries at a time to prevent such attacks.

3.  *Semi-whitebox* attack: Here, a white-box model is utilized *only during training* and then adversarial examples are synthesized during inference without any knowledge of the deployed AFR model.

Semi-whitebox settings are appropriate for crafting adversarial faces; once the network learns to generate the perturbed instances based on a single face recognition system, attacks can be transferred to any black-box AFR systems. However, past approaches, based on Generative Adversarial Networks (GANs) [@advgan; @atgan; @acgan], were proposed in the image classification domain and rely on softmax probabilities [@advgan; @atgan; @acgan; @song]. Therefore, the number of object classes are assumed to be known during training and testing. In the realm of face recognition, AFR systems do not utilize the softmax layer for classification (as the number of identities are not fixed) instead features from the last fully connected layer are used for comparing face images. Song proposed a GAN for generating adversarial examples specifically in the domain of face recognition, however, their method requires access to the face images enrolled in the gallery which may not be feasible in a real-world setting [@song]. Other approaches for adversarial faces include adding makeup, eyeglasses, hat, or occlusions to faces [@goswami; @sharif_accessorize; @sharif_adversarial].

We emphasize the following requirements of the adversarial face generator:

-   The generated adversarial face images should be perceptually realistic such that a human observer can identify the image as a legitimate face image pertaining to the target subject.

-   The faces need to be perturbed in a manner such that they cannot be identified as the hacker (*obfuscation attack*) or automatically matched to a target subject (*impersonation attack*) by an AFR system.

-   The amount of perturbation should be controllable by the hacker. This will allow the hacker to examine the success of the learning model as a function of amount of perturbation.

-   The adversarial examples should be *transferable* and *model-agnostic* (treat the target AFR model as a black-box). In other words, the generated adversarial examples should have high attack success rate on other black-box AFR systems as well.

We propose an automated adversarial face synthesis method, named *AdvFaces*, which generates an *adversarial mask* for a probe face image and satisfies all the above requirements. The adversarial mask can then be added to the probe to obtain an adversarial face example that can be used either for impersonating any target identity or obfuscating one’s own identity (see Figure \[fig:overview\]). The contributions of the paper can be summarized as follows:

1.  A GAN, AdvFaces, that learns to generate visually realistic adversarial face images that are misclassified by state-of-the-art AFR systems.

2.  Adversarial faces generated via AdvFaces are model-agnostic and transferable, and achieve high success rate on 5 state-of-the-art automated face recognition systems.

3.  Visualizing the facial regions, where pixels are perturbed and analyzing the effect of varying image resolution on the amount of perturbation.

4.  An open-source[^2] automated adversarial face generator permitting users to control the amount of perturbation.

Related Work
============

Generative Adversarial Networks (GANs)
--------------------------------------

Generative Adversarial Networks [@goodfellow_gan] have success in a wide variety of image synthesis applications [@dcgan; @laplacian] such as style transfer [@style_transfer1; @style_transfer2; @style_transfer3], image-to-image translation [@pix_to_pix; @cycle_gan], and representation learning [@rep1; @rep2; @rep3]. Isola showed that an image-to-image conditional GAN can vastly improve the synthesis results [@pix_to_pix]. In our work, we adopt a similar adversarial loss and image-to-image network architecture in order to learn a mapping from the input face image to a perturbed output image such that the perturbed image cannot be distinguished from real face images. However, different from prior work on GANs, our objective is to synthesize face images that are not only visually realistic but are also able to evade AFR systems.

Adversarial Attacks on Image Classification
-------------------------------------------

Majority of the published papers have focused on white-box attacks, where the hacker has full access to the target classification model that is being attacked [@szegedy; @goodfellow; @carlini; @xiao; @madry]. Given an image, Goodfellow proposed the Fast Gradient Sign Method (FGSM) which generates an adversarial example by back-propagating through the target model [@goodfellow]. Madry proposed Projected Gradient Descent (PGD), a multi-step variant of FGSM [@madry]. Other works focused on optimizing adversarial perturbation by minimizing an objective function for targeted attacks while satisfying certain constraints [@carlini]. However, these white-box approaches are not feasible in the face recognition domain, as the attacker may not have any knowledge of the deployed AFR system. In addition, the optimization process can require multiple queries to the target system until convergence. Instead, we propose a feed-forward network that can automatically generate an adversarial image with a single forward pass without the need for any knowledge of AFR system during inference.

Indeed, feed-forward networks have been used for synthesizing adversarial attacks. Baluja and Fischer proposed a deep autoencoder that learns to transform an input image to an adversarial image [@baluja]. In their work, an $L_2$ norm loss is employed in order to constrain the generated adversarial instance to be close to the original image in the $L_2$ pixel space. In contrast, we apply a deep neural network as a discriminator that distinguishes between real and synthesized face images in order to maintain the perceptual quality of the generated adversarial examples. Studies on synthesizing adversarial instances via GANs are limited in literature [@advgan; @atgan; @acgan]. These methods require softmax probabilities in order to evade an image classifier. However, AFR systems do not employ a softmax classification layer as the number of classes (identities) is not fixed. Instead, we propose an identity loss function better suited for generating adversarial faces using the face embeddings obtained from a face matcher.

Adversarial Attacks on Face Recognition
---------------------------------------

In literature, studies on generating adversarial examples in the face recognition domain are relatively limited. Bose craft adversarial examples by solving constrained optimization such that a face detector cannot detect a face [@bose]. In [@sharif_accessorize], perturbations are constrained to the eyeglass region of the face and adversarial image is generated by gradient-based methods. The adversarial eyeglasses can also be synthesized via generative networks [@sharif_adversarial]. However, these methods rely on white-box manipulations of face recognition models, which is impractical in real-world scenarios. Dong proposed an evolutionary optimization method for generating adversarial faces in black-box settings [@dong]. However, they require at least 1,000 queries to the target AFR system before a realistic adversarial face can be synthesized. Song employed a conditional variation autoencoder GAN for crafting adversarial face images in a semi-whitebox setting [@song]. However, they only focused on impersonation attacks and require at least 5 images of the target subject for training and inference. In contrast, we train a GAN that can perform both obfuscation and impersonation attacks and requires a single face image of the target subject.

AdvFaces
========

Our goal is to synthesize a face image that visually appears to pertain to the target person, yet automatic face recognition systems either incorrectly matches the synthesized image to another person or does not match to genuine person’s gallery images. Figure \[fig:arch\] outlines the proposed framework.

![Overview of the proposed adversarial generation method in an obfuscation setting. Given a probe face image, AdvFaces automatically generates an adversarial mask that is then added to the probe to obtain an adversarial face image.[]{data-label="fig:arch"}](arch.pdf){width="\linewidth"}

AdvFaces comprises of a generator $\mathcal{G}$, a discriminator $\mathcal{D}$, and face matcher $\mathcal{F}$ (see Figure \[fig:arch\] and Algorithm \[alg:advfaces\]).

#### Generator

The proposed generator takes an input face image, $x \in \mathcal{X}$, and outputs an image, $\mathcal{G}(x)$. The generator is conditioned on the input image $x$; for different input faces, we will get different synthesized images.

Since our goal is to obtain an adversarial image that is metrically close to the original input image, $x$, we do not wish to perturb all the pixels in the original image. For this reason, we treat the output from the generator as an additive mask and the adversarial face is $x + \mathcal{G}(x)$. If the magnitude of the pixels in $\mathcal{G}(x)$ is minimal, then the adversarial image comprises mostly of the probe $x$. Here, we denote $\mathcal{G}(x)$ as an “adversarial mask". In order to bound the magnitude of the adversarial mask, we introduce a *perturbation hinge loss* during training by minimizing the $L_2$ norm[^3]: $$\begin{aligned}
    {\mathcal{L}}_{perturbation} &= {\mathbb{E}}_{x}\left[\text{max}\left(\epsilon,{{\left\lVert\mathcal{G}(x)\right\rVert}_2}\right)\right]\end{aligned}$$ where $\epsilon\in [0,\infty)$ is a hyperparameter that controls the minimum amount of perturbation allowed.

In order to achieve our goal of impersonating a target subject or obfuscating one’s own identity, we need a face matcher, $\mathcal{F}$, to supervise the training of AdvFaces. For obfuscation attack, the goal is to generate an adversarial image that does not match any of the subject’s gallery images. At each training iteration, AdvFaces tries to minimize the cosine similarity between face embeddings of the input probe $x$ and the generated image $x + \mathcal{G}(x)$ via an *identity* loss function: $$\begin{aligned}
    {\mathcal{L}}_{identity} &= {\mathbb{E}}_{x}{\left[\mathcal{F}(x, x+\mathcal{G}(x))\right]}\end{aligned}$$ For an impersonation attack, AdvFaces maximizes the cosine similarity between the face embeddings of a randomly chosen target’s probe, $y$, and the generated adversarial face $x+\mathcal{G}(x)$ via: $$\begin{aligned}
    {\mathcal{L}}_{identity} &= {\mathbb{E}}_{x}{\left[1- \mathcal{F}(y, x+\mathcal{G}(x))\right]}\end{aligned}$$

The perturbation and identity loss functions enforce the network to learn the salient facial regions that can be perturbed minimally in order to evade automatic face recognition systems.

#### Discriminator

Akin to previous works on GANs [@goodfellow_gan; @pix_to_pix], we introduce a discriminator in order to encourage perceptual realism of the generated images. We use a fully-convolution network as a patch-based discriminator [@pix_to_pix]. Here, the discriminator, $\mathcal{D}$, aims to distinguish between a probe, $x$, and a generated adversarial face image $x+\mathcal{G}(x)$ via a GAN loss: $$\begin{aligned}
    \begin{split}
    {\mathcal{L}}_{GAN} = &\quad{\mathbb{E}}_{x}\left[{\log\mathcal{D}(x)}\right] +\\
    &\quad{\mathbb{E}}_{x}{\left[\log(1-\mathcal{D}(x+\mathcal{G}(x)))\right]}
    \end{split}\end{aligned}$$

Finally, AdvFaces is trained in an end-to-end fashion with the following objective: $$\begin{aligned}
 {\mathcal{L}}&= {\mathcal{L}}_{GAN} + \lambda_{i} {\mathcal{L}}_{identity} + \lambda_{p}{\mathcal{L}}_{perturbation}\end{aligned}$$ where $\lambda_i$ and $\lambda_p$ are hyper-parameters controlling the relative importance of identity and perturbation losses, respectively. Note that ${\mathcal{L}}_{GAN}$ and ${\mathcal{L}}_{perturbation}$ encourages the generated images to be visually similar to the original face images, while ${\mathcal{L}}_{identity}$ optimizes for a high attack success rate. We train AdvFaces as a minmax game via $\{\text{arg}~\text{min}_{\mathcal{G}}\text{max}_{\mathcal{D}}{\mathcal{L}}\}$. After training, the generator $\mathcal{G}$ can generate an adversarial face image for any input image and can be tested on any black-box face recognition system.

[@lcccccccc@]{} **Obfuscation Attack** & & & & & & &\
Attack Success Rate (%)\
FaceNet [@facenet] & 99.67 && 23.34 && 99.70 && **99.96**\
SphereFace [@sphereface] & 97.22 && 29.49 && **99.34** && 98.71\
ArcFace [@arcface] & **64.53** && 03.43 && 33.25 && 35.30\
COTS-A & **82.98** && 08.89 && 18.74 && 32.48\
COTS-B & **60.71** && 05.05 && 01.49 && 18.75\
Structural Similarity & **0.95 $\pm$ 0.01** && 0.82 $\pm$ 0.12 && 0.29 $\pm$ 0.06 && 0.25 $\pm$ 0.06\
Computation Time (s) & **0.01** && 3.22 && 11.74 && 0.03\
\
**Impersonation Attack** & & & & & & &\
Attack Success Rate (%)\
FaceNet [@facenet] & 20.85 $\pm$ 0.40 && 05.99 $\pm$ 0.19 && **76.79 $\pm$ 0.26** && 13.04 $\pm$ 0.12\
SphereFace [@sphereface] & **20.19 $\pm$ 0.27** && 07.94 $\pm$ 0.19 && 09.03 $\pm$ 0.39 && 02.34 $\pm$ 0.03\
ArcFace [@arcface] & **24.30 $\pm$ 0.44** && 17.14 $\pm$ 0.29 && 19.50 $\pm$ 1.95 && 08.34 $\pm$ 0.21\
COTS-A & **20.75 $\pm$ 0.35** && 15.01 $\pm$ 0.30 && 01.76 $\pm$ 0.10 && 01.40 $\pm$ 0.08\
COTS-B & **19.85 $\pm$ 0.28** && 10.23 $\pm$ 0.50 && 12.49 $\pm$ 0.24 && 04.67 $\pm$ 0.16\
Structural Similarity & **0.92 $\pm$ 0.02** && 0.69 $\pm$ 0.04 && 0.77 $\pm$ 0.04 && 0.48 $\pm$ 0.75\
Computation Time (s) & **0.01** && 0.04 && 11.74 && 0.03\

  --------------------------------------------------------- --------------------------------------------------------- ------------------------------------------------------------------ -------------------------------------------------------------- ------------------------------------------------------------- --------------------------------------------------------------
                         **Gallery**                                                **Probe**                                                    **AdvFaces**                                                   **GFLM [@gflm]**                                              **PGD [@madry]**                                            **FGSM [@goodfellow]**
   ![image](fig/state_art/9024.jpg){width=".15\textwidth"}   ![image](fig/state_art/9040.jpg){width=".15\textwidth"}   ![image](fig/state_art/advfaces/9040.jpg){width=".15\textwidth"}   ![image](fig/state_art/gflm/9040.png){width=".15\textwidth"}   ![image](fig/state_art/pgd/9040.jpg){width=".15\textwidth"}   ![image](fig/state_art/fgsm/9040.jpg){width=".15\textwidth"}
                                                                                      0.68                                                           0.14                                                             0.26                                                          0.27                                                           0.04
   ![image](fig/state_art/1067.jpg){width=".15\textwidth"}   ![image](fig/state_art/1066.jpg){width=".15\textwidth"}   ![image](fig/state_art/advfaces/1066.jpg){width=".15\textwidth"}   ![image](fig/state_art/gflm/1066.png){width=".15\textwidth"}   ![image](fig/state_art/pgd/1066.jpg){width=".15\textwidth"}   ![image](fig/state_art/fgsm/1066.jpg){width=".15\textwidth"}
                                                                                      0.38                                                           0.08                                                             0.12                                                          0.21                                                           0.02
  --------------------------------------------------------- --------------------------------------------------------- ------------------------------------------------------------------ -------------------------------------------------------------- ------------------------------------------------------------- --------------------------------------------------------------

\
(a) Obfuscation Attack\

  --------------------------------------------------------- --------------------------------------------------------- --------------------------------------------------------- ------------------------------------------------------------------ -------------------------------------------------------------- --------------------------------------------------------------
                    **Target’s Gallery**                                       **Target’s Probe**                                             **Probe**                                                    **AdvFaces**                                                 **A$^3$GN [@song]**                                           **FGSM [@goodfellow]**
   ![image](fig/state_art/2495.jpg){width=".15\textwidth"}   ![image](fig/state_art/2494.jpg){width=".15\textwidth"}   ![image](fig/state_art/2928.jpg){width=".15\textwidth"}   ![image](fig/state_art/advfaces/2928.jpg){width=".15\textwidth"}   ![image](fig/state_art/a3gn/2928.jpg){width=".15\textwidth"}   ![image](fig/state_art/fgsm/2928.jpg){width=".15\textwidth"}
                                                                                      0.78                                                      0.10                                                           0.30                                                             0.29                                                           0.36
   ![image](fig/state_art/2644.jpg){width=".15\textwidth"}   ![image](fig/state_art/3050.jpg){width=".15\textwidth"}   ![image](fig/state_art/5261.jpg){width=".15\textwidth"}   ![image](fig/state_art/advfaces/5261.jpg){width=".15\textwidth"}   ![image](fig/state_art/a3gn/5261.jpg){width=".15\textwidth"}   ![image](fig/state_art/fgsm/5261.jpg){width=".15\textwidth"}
                                                                                      0.80                                                      0.15                                                           0.34                                                             0.33                                                           0.42
  --------------------------------------------------------- --------------------------------------------------------- --------------------------------------------------------- ------------------------------------------------------------------ -------------------------------------------------------------- --------------------------------------------------------------

\
(b) Impersonation Attack

Experimental Results
====================

#### Evaluation Metrics

We quantify the effectiveness of the adversarial attacks generated by AdvFaces and other state-of-the-art baselines via (i) *attack success rate* and (ii) *structural similarity (SSIM)*.

The attack success rate for *obfuscation attack* is computed as, $$\begin{aligned}
   \text{Attack Success Rate} &= \frac{\text{(No. of Comparisons $< \tau$)}}{\text{Total No. of Comparisons}}
   \label{eq:attack1}\end{aligned}$$ where each comparison consists of a subject’s adversarial probe and an enrollment image. Here, $\tau$ is a pre-determined threshold computed at, say, 0.1% FAR[^4]. Attack success rate for *impersonation attack* is defined as, $$\begin{aligned}
   \text{Attack Success Rate} &= \frac{\text{(No. of Comparisons $\geq \tau$)}}{\text{Total No. of Comparisons}}
   \label{eq:attack2}\end{aligned}$$ Here, a comparison comprises of an adversarial image synthesized with a target’s probe and matched to the target’s enrolled image. We evaluate the success rate for the impersonation setting via 10-fold cross-validation where each fold consists of a randomly chosen target. Similar to prior studies [@song], in order to measure the similarity between the adversarial example and the input face, we compute the structural similarity index (SSIM) between the images. SSIM is a normalized metric between $-1$ (completely different image pairs) to $1$ (identical image pairs): $$\begin{aligned}
    SSIM(x, y)\footnotemark = \frac{(2\mu_x\mu_y + c_1)(2\sigma_{xy}+c_2)}{(\mu_x^{2} + \mu^{2}_y + c_1)(\sigma_x^2 + \sigma_y^2+c_2)}
    \label{eq:ssim}\end{aligned}$$

#### Datasets

We train AdvFaces on CASIA-WebFace [@casia] and then test on LFW [@lfw][^5].

-   **CASIA-WebFace** [@casia] comprises of 494,414 face images belonging to 10,575 different subjects.

-   **LFW** [@lfw] contains 13,233 web-collected images of 5,749 different subjects. In order to compute the attack success rate, we only consider subjects with at least two face images. After this filtering, 9,614 face images of 1,680 subjects are available for evaluation.

[YYYYYY]{} Input & w/o ${\mathcal{L}}_{GAN}$ & w/o ${\mathcal{L}}_{prt}$ & w/o ${\mathcal{L}}_{idt}$ & with all\
![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/1_o.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/ablation/wo_d.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/ablation/wo_prt.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/ablation/wo_idt.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/1_g.jpg "fig:"){width="0.97\linewidth"}\
![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/3_o.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/ablation/wo_d_2.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/ablation/wo_prt_2.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/ablation/wo_idt_2.jpg "fig:"){width="0.97\linewidth"} & ![Variants of AdvFaces trained without GAN loss, perturbation loss, and identity loss, respectively.[]{data-label="fig:ablation"}](fig/3_g.jpg "fig:"){width="0.97\linewidth"}\

  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --
                                                                                                                                                                                                                                                                   **Probe**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                **Adv. Mask**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             **Visualization**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             **Adv. Image**                                                                                                                                                                                                                                                                
        ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/3_o.jpg "fig:"){width=".23\textwidth"}           ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/ming_m.jpg "fig:"){width=".23\textwidth"}         ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/ming_v_o.png "fig:"){width=".23\textwidth"}           ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/3_g.jpg "fig:"){width=".23\textwidth"}       
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         0.12                                                                                                                                                                                                                                                                     
   ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/viz/dwayne_o.jpeg "fig:"){width=".23\textwidth"}   ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/viz/dwayne_m.jpg "fig:"){width=".23\textwidth"}   ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/viz/dwayne_v_o.png "fig:"){width=".23\textwidth"}   ![Pixels that have been perturbed (Column 3) to generate the corresponding adversarial images for the given probes (Column 1). AdvFaces outputs adversarial masks (Column 2) which are added to the probes to obtain adversarial images in the last column. State-of-the-art face matchers can be evaded by slightly perturbing salient facial regions, such as eyebrows, eyeballs, and nose (cosine similarity obtained via ArcFace [@arcface]).[]{data-label="fig:visualization"}](fig/viz/dwayne_g.jpeg "fig:"){width=".23\textwidth"}  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [0.26]{}                                                                                                                                                                                                                                                                   
  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --

![Trade-off between attack success rate and structural similarity for impersonation attacks. We choose $\epsilon = 8.0$.[]{data-label="fig:min_eps"}](test.pdf){width="\linewidth"}

#### Experimental Settings

We use ADAM optimizers in Tensorflow with $\beta_{1} = 0.5$ and $\beta_{2}=0.9$ for the entire network. Each mini-batch consists of $32$ face images. We train AdvFaces for 200,000 steps with a fixed learning rate of $0.0001$. Since our goal is to generate adversarial faces with high success rate, the identity loss is of utmost importance. We empirically set $\lambda_i = 10.0$ and $\lambda_p = 1.0$. We train two separate models and set $\epsilon = 3.0$ and $\epsilon = 8.0$ for obfuscation and impersonation attacks, respectively. All experiments are conducted using Tensorflow r1.12.0 and a NVIDIA Quadro M6000 GPU. Implementations are provided in Appendix \[apdx:implementation\].

#### Face Recognition Systems

For all our experiments, we employ 5 state-of-the-art face matchers[^6]. Three of them are publicly available, namely, FaceNet [@facenet], SphereFace [@sphereface], and ArcFace [@arcface]. We also report our results on two commercial-off-the-shelf (COTS) face matchers, COTS-A and COTS-B[^7]. We use FaceNet [@facenet] as the white-box face recognition model, $\mathcal{F}$, during training. *All the testing images in this paper are generated from the same model (trained only with FaceNet) and tested on different matchers.*

Comparison with State-of-the-Art
--------------------------------

In Table \[tab:recognition\], we find that compared to the state-of-the-art, AdvFaces generates adversarial faces that are similar to the probe. Moreover, the adversarial images attain a high obfuscation attack success rate on 4 state-of-the-art black-box AFR systems in both obfuscation and impersonation settings. AdvFaces learns to perturb the salient regions of the face, unlike PGD [@madry], FGSM [@goodfellow] which perturbs every pixel in the image. Due to this, we find that, albeit high success rate, the structural similarity between probes and synthesized faces for PGD and FGSM are low. GFLM [@gflm], on the other hand, geometrically warps the face images and thereby, results in low structural similarity. In addition, the state-of-the-art matchers are robust to such geometric deformation which explains the low success rate of GFLM on face matchers. A$^3$GN is also a GAN-based method, however, fails to achieve a reasonable success rate in an impersonation setting. In Figure \[fig:comparison\], we see that, in addition to high success rate, adversarial faces generated by the proposed method are visually appealing and the differences between probe and synthesized images are hardly distinguishable compared to the baselines.

Ablation Study
--------------

In order to analyze the importance of each module in our system, in Figure \[fig:ablation\], we train three variants of AdvFaces for comparison by removing the GAN loss (${\mathcal{L}}_{GAN}$), perturbation loss ${\mathcal{L}}_{perturbation}$, and identity loss ${\mathcal{L}}_{identity}$, respectively. The GAN loss helps to ensure the visual quality of the synthesized faces are maintained. With the generator alone, undesirable artifacts are introduced. Without the proposed perturbation loss, perturbations in the adversarial mask are unbounded and therefore, leads to a lack in perceptual quality. The identity loss is imperative in ensuring an adversarial image is obtained. Without the identity loss, the synthesized image cannot evade state-of-the-art face matchers. We find that every component of AdvFaces is necessary in order to obtain an adversarial face that is not only perceptually realistic but can also evade state-of-the-art face matchers.

What is AdvFaces Learning?
--------------------------

During training, AdvFaces learns to perturb the salient facial regions that can evade the face matcher, $\mathcal{F}$ (FaceNet [@facenet] in our case). This is enforced by ${\mathcal{L}}_{perturbation}$ which penalizes large perturbations and thereby, restricts perturbations to only salient pixel locations. In Figure \[fig:visualization\], AdvFaces synthesizes the adversarial masks corresponding to the probes. We then threshold the mask to extract pixels with perturbation magnitudes exceeding $0.40$. It can be inferred that the eyebrows, eyeballs, and nose contain highly discriminative information that an AFR system utilizes to identify an individual. Therefore, perturbing these salient regions are enough to evade state-of-the-art face recognition systems.

Effect of Perturbation Amount
-----------------------------

The perturbation hinge loss, ${\mathcal{L}}_{perturbation}$ is bounded by a hyper-parameter, $\epsilon$. That is, the $L_2$ norm of the adversarial mask must be at least $\epsilon$. Without this constraint, the adversarial mask becomes an empty image with no changes to the probe. With $\epsilon$, we can observe a trade-off between the attack success rate and the structural similarity between the probe and synthesized adversarial face in Figure \[fig:min\_eps\]. A higher $\epsilon$ leads to less perturbation restriction. This generates a higher attack success rate at the cost of a lower structural similarity. For an impersonation attack, this implies that the adversarial image may contain facial features from both the hacker and the target. In our experiments, we chose $\epsilon = 8.0$ and $\epsilon = 3.0$ for impersonation and obfuscation attacks, respectively.

Conclusions
===========

We proposed a new method of adversarial face synthesis, namely *AdvFaces*, that automatically generates adversarial face images with imperceptible perturbations evading state-of-the-art face matchers. With the help of a GAN, and the proposed perturbation and identity losses, AdvFaces learns the set of pixel locations required by face matchers for identification and only perturbs those salient facial regions (such as eyebrows and nose). Once trained, AdvFaces generates high quality and perceptually realistic adversarial examples that are benign to the human eye but can evade state-of-the-art black-box face matchers, outperforming other state-of-the-art adversarial face methods.

Implementation Details
======================

*AdvFaces* is implemented using Tensorflow r1.12.0. A single NVIDIA Quadro M6000 GPU is used for training and testing. \[apdx:implementation\]

#### Data Preprocessing

All face images are passed through MTCNN face detector [@mtcnn] to detect five landmarks (two eyes, nose, and two mouth corners). Via similarity transformation, the face images are aligned. After transformation, the images are resized to $160\times 160$. Before passing into networks, each pixel in the RGB image is normalized by subtracting 127.5 and dividing by 128.

#### Architecture

Let `c7s1-k` be a $7\times7$ convolutional layer with $k$ filters and stride $1$. `dk` denotes a $4\times 4$ convolutional layer with $k$ filters and stride $2$. `Rk` denotes a residual block that contains two $3\times 3$ convolutional layers. `uk` denotes a $2\times$ upsampling layer followed by a $5\times 5$ convolutional layer with $k$ filters and stride $1$. We apply Instance Normalization and Batch Normalization to the generator and discriminator, respectively. We use Leaky ReLU with slope 0.2 in the discriminator and ReLU activation in the generator. The architectures of the two modules are as follows:

-   Generator:\
    `c7s1-64,d128,d256,R256,R256,R256, u128, u64, c7s1-3`

-   Discriminator:\
    `d32,d64,d128,d256,d512`

A $1\times 1$ convolutional layer with $3$ filters and stride $1$ is attached to the last convolutional layer of the discriminator for the patch-based GAN loss ${\mathcal{L}}_{GAN}$.

We apply the `tanh` activation function on the last convolution layer of the generator to ensure that the generated image $\in[-1, 1]$. In the paper, we denoted the output of the tanh layer as an “adversarial mask”, $\mathcal{G}(x) \in [-1,1]$ and $x \in [-1,1]$. The final adversarial image is computed as $x_{adv} = 2 \times \texttt{clamp}\left[ \mathcal{G}(x) + \left(\frac{x+1}{2}\right) \right]_{0}^{1} -1$. This ensures $\mathcal{G}(x)$ can either add or subtract pixels from $x$ when $\mathcal{G}(x) \neq 0$. When $\mathcal{G}(x)\to0$, then $x_{adv}\to x$.

The overall algorithm describing the training procedure of *AdvFaces* can be found in Algorithm \[apdx:alg\].

[Training Dataset]{} [Cosine similarity between an image pair obtained by face matcher]{} [Generator with weights $\mathcal{G}_\theta$]{} [Discriminator with weights $\mathcal{D}_\theta$]{} [Batch size]{} [Learning rate]{} Sample a batch of target images ${y^{(i)}} \sim \mathcal{X}$ $\delta^{(i)} = \mathcal{G}((x^{(i)}, y^{(i)})$ $\delta^{(i)} = \mathcal{G}(x^{(i)})$ $x_{adv}^{(i)} = x^{(i)} + \delta^{(i)}$ ${\mathcal{L}}_{perturbation} = \frac{1}{m}\left[ \sum_{i=1}^{m}\text{max}\left(\epsilon,||\delta^{(i)}||_2\right)\right]$ ${\mathcal{L}}_{identity} = \frac{1}{m}\left[\sum_{i=1}^{m}\mathcal{F}\left(x^{(i)}, x_{adv}^{(i)}\right)\right]$ ${\mathcal{L}}_{identity} = \frac{1}{m}\left[\sum_{i=1}^{m}\left(1 - \mathcal{F}\left(y^{(i)}, x_{adv}^{(i)}\right)\right)\right]$ ${\mathcal{L}}^{\mathcal{G}}_{GAN} = \frac{1}{m}\left[\sum_{i=1}^{m}log\left(1-\mathcal{D}(x_{adv}^{(i)}) \right)\right]$ ${\mathcal{L}}^{\mathcal{D}} = \frac{1}{m}\left[\sum_{i=1}^{m}log\left(\mathcal{D}(x^{(i)}) \right) +  log\left(1-\mathcal{D}(x_{adv}^{(i)}) \right)\right]$ ${\mathcal{L}}^{\mathcal{G}} = {\mathcal{L}}^{\mathcal{G}}_{GAN} + \lambda_i {\mathcal{L}}_{identity} + \lambda_p {\mathcal{L}}_{perturbation}$ $\mathcal{G}_{\theta} = \text{Adam}(\triangledown_{\mathcal{G}}{\mathcal{L}}^{\mathcal{G}}, \mathcal{G}_{\theta},\beta_{1},\beta_{2})$ $\mathcal{D}_\theta = \text{Adam}(\triangledown_{\mathcal{D}}{\mathcal{L}}^{\mathcal{D}}, \mathcal{D}_{\theta},\beta_{1},\beta_{2})$

\[apdx:alg\]

Structural Similarity
=====================

Image comparison techniques, such Mean Squared Error (MSE) or Peak Signal-to-Noise Ratio (PSNR), estimate the absolute errors, disregarding the *perceptual* differences; on the other hand, SSIM is a perception-based model that considers image differences as perceived change in structural information, while also incorporating important perceptual phenomena, including both luminance masking and contrast masking terms. For instance, consider the image pair comprising of two images of Ming Xi. We can notice that perceptually, the image pairs are similar, but this perceptual similarity is not reflected appropriately in MSE and PSNR. Since, SSIM is a normalized similarity metric, it is better suited for our application where a face image pair is subjectively judged by human operators.

Effect on Cosine Similarity
===========================

In Figure \[fig:sim\_scores\], we see the effect on cosine similarity scores when adversarial face images synthesized by AdvFaces is introduced to a black-box face matcher, ArcFace [@arcface]. A majority ($64.53\%$) of the scores fall below the threshold at $0.1\%$ FAR causing the AFR system to falsely reject under obfuscation attack. In the impersonation attack setting, the system falsely accepts $24.30\%$ of the image pairs.

\

Baseline Implementation Details
===============================

All the state-of-the-art baselines in the paper are implementations proposed specifically for evading face recognition systems.

#### FGSM [@goodfellow]

We use the Cleverhans implementation[^8] of FGSM on FaceNet. This implementation supports both obfuscation and impersonation attacks. The only modification was changing $\epsilon = 0.01$ to $\epsilon = 0.08$ in order to create more effective attacks.

#### PGD [@madry]

We use a variant of PGD proposed specifically for face recognition systems [^9]. Originally, this implementation is proposed for impersonation attacks, however, for obfuscation we randomly choose a target other than genuine subject. We do not make any modifications to the parameters.

#### GFLM [@gflm]

Code for this landmark-based attack synthesis method is publicly available [^10]. This method relies on softmax probalities implying that the training and testing identities are fixed. Originally, the classifier is trained on CASIA-WebFace. However, for a fairer evaluation, we trained a face classifier on LFW and then ran the attack.

#### A$^3$GN [@song]

To the best of our knowledge, there is no publicly available implementation of A$^3$GN. Our implementation is included with our open-source code [^11]. We made the following modifications to achieve an effective baseline:

-   The authors originally used ArcFace [@arcface] as the target model. Since all other baselines employ FaceNet as the target model, we also used FaceNet for training A$^3$GN.

-   Originally, a cycle-consistency loss was proposed for content preservation. However, we were not able to reproduce this and therefore, opted for the same $L_1$ norm loss, but without the second generator. This greatly helps in the visual quality of the generated adversarial image. That is, we modified Equation 3 [@song], from ${\mathcal{L}}_{rec} = {\mathbb{E}}_{x,z}\left[||x-G_2(G_1(x,z))||_1\right]$ to ${\mathcal{L}}_{rec} = {\mathbb{E}}_{x,z}\left[||x-G_1(x,z)||_1\right]$

[^1]: Adversarial perturbations refer to altering an input image instance with small, human imperceptible changes in a manner that can evade CNN models.

[^2]: \[link omitted for blind review\]

[^3]: For brevity, we denote ${\mathbb{E}}_x \equiv {\mathbb{E}}_{x \in \mathcal{X}}$.

[^4]: We compute the threshold at $0.1\%$ FAR on all possible image pairs in LFW. For , threshold @ $0.1\%$ FAR for ArcFace is $0.28$.

[^5]: Training on CASIA-WebFace and evaluating on LFW is a common approach in face recognition literature [@arcface; @sphereface]

[^6]: All the open-source and COTS matchers achieve 99% accuracy on LFW under LFW protocol.

[^7]: Both COTS-A and COTS-B utilize CNNs for face recognition.

[^8]: <https://github.com/tensorflow/cleverhans/tree/master/examples/facenet_adversarial_faces>

[^9]: <https://github.com/ppwwyyxx/Adversarial-Face-Attack>

[^10]: <https://github.com/alldbi/FLM>

[^11]: \[Link omitted for blind review\]
