Phantom: A Unified Face-Swap Deepfake Protection Framework
with Latent and Spatial Constraints

Jungkon Kim1 Cheolseung Jung Jong-Min Choi Juseong Lee
Samsung Electronics, AI Platform Center
{jungkon.kim, cs.jung, jminl.choi, jooseong.lee}@samsung.com


Abstract

Face-swapping deepfakes pose an escalating threat to personal privacy by enabling unauthorized identity manipulation. While adversarial approaches have demonstrated success against black-box face recognition (FR) models, their applicability to face-swapping scenarios remains underexplored. In particular, reliance on fixed or random targets yields ambiguous latent guidance, and the lack of explicit spatial constraints causes perturbations to spill into identity-irrelevant regions. These issues are further exacerbated by identity–style disentanglement, which suppresses adversarial signals during deepfake generation. In this paper, we present \(\textit{\boldsymbol{Phantom}}\), a unified face-swap deepfake protection framework that jointly constrains perturbations in latent and spatial domains. \(\textit{\boldsymbol{Phantom}}\) adaptively synthesizes identity-shifted yet attribute-preserving targets to guide identity-aware latent optimization, and applies masked perturbations confined to semantically relevant facial regions. Extensive experiments on state-of-the-art face-swapping deepfakes demonstrate that \(\textit{\boldsymbol{Phantom}}\) improves protection success rates in dodging scenarios by 27.8%, 25.6%, and 16.6% on UniFace, INSwapper, and SimSwap, respectively, while also enhancing visual quality. Furthermore, \(\textit{\boldsymbol{Phantom}}\) generalizes to impersonation scenario, yielding up to 10.2% higher protection while improving perceptual fidelity. These results underscore the effectiveness of jointly leveraging latent and spatial constraints for robust and coherent facial privacy protection.

1 Introduction↩︎

The advancement of deepfake technology raises significant privacy concerns, particularly as face-swapping deepfakes facilitate unauthorized identity manipulation. To counteract this threat, many researches [1][3] have proposed for detecting deepfake-generated content. However, these retrospective approaches can only mitigate damage after attacks have occurred. To overcome this, recent research has increasingly focused on proactive strategies to disrupt deepfake generation.

Adversarial perturbation has emerged as a proactive protection strategy, disrupting face recognition via either patch-based [4][6] or noise-based [7][11] methods. Patch-based approaches are lightweight and modular but tend to be visually conspicuous and spatially fixed, rendering them vulnerable to trivial removal [12]. Noise-based methods typically achieve strong protection by applying perturbations over the entire face bounding box. However, this global application leads to inefficient updates and perceptual degradation, as perturbations are dispersed across identity-irrelevant regions. A recent work [13] proposes a per-user strategy that trains identity-specific masks from multiple images. While effective, it requires offline optimization and user-level data, limiting its applicability in per-image protection we target. Makeup-based methods [14][17] embed perturbations into visually plausible styles using reference-guided generation. While producing visually natural transformations, these methods often require exaggerated modifications and offer limited spatial control to ensure sufficient protection. Moreover, as most are optimized for impersonation, their applicability to dodging-oriented face-swap deepfake protection remains relatively underexplored.

Another critical limitation of existing methods lies in the definition of perturbation directions in the embedding space. Most prior works define identity-shifting directions using fixed or randomly selected target images [11], [14][16], which entangle identity with confounding attributes such as pose or texture. This often results in arbitrarily maximizing latent distances, leading to ambiguous or suboptimal updates that compromise visual quality or fail to ensure sufficient protection. Recent work by [17] proposes an adaptive target selection strategy based on landmark similarity, which partially constrains geometric variation. However, it still struggles to isolate identity-specific changes, often guiding perturbations along directions that include residual non-identity attributes, thereby limiting its effectiveness.

In this paper, we propose \(\textit{\boldsymbol{Phantom}}\), a unified framework for face-swap deepfake protection that jointly performs adversarial optimization under latent and spatial constraints (See Fig. ¿fig:fig:intro?.).

First, we introduce adaptive target synthesis strategy, which generates identity-shifted yet attribute-preserving target faces to define a semantic direction in latent space for adversarial guidance. Unlike prior works [11], [14][17] that treat target identities as final objectives, we reinterpret the synthesized image as a means of defining a semantically meaningful identity-discriminative direction in the latent space intertwining geometry, style, and identity cues. Specifically, we extract a semantic mask from the input face and reapply the original style onto it to generate a modified image that retains structural and stylistic consistency while inducing subtle identity shifts. With this adaptively synthesized target, we guide adversarial perturbation generation along identity-sensitive directions, enabling effective identity suppression without unintended attribute distortion.

Second, we formulate a masked adversarial attack based on spatial-constrained optimization. Specifically, we constrain gradient updates to semantically important facial regions using segmentation masks. By explicitly guiding perturbations toward identity-aware regions, this strategy ensures that noise is both compact and effective, minimizing visual artifacts while enhancing protection robustness.

Extensive experiments on CelebA-HQ [18] and LADN [19] datasets validate the effectiveness of \(\textit{\boldsymbol{Phantom}}\) across both dodging and impersonation scenarios. In dodging scenarios, which are our primary focus for defending against unauthorized deepfakes, \(\textit{\boldsymbol{Phantom}}\) achieves state-of-the-art protection against black-box FR models while preserving visual quality. Furthermore, we evaluate whether such protection is valid against face-swapping deepfakes, where adversarial signals including those in stylized or unconstrained formats are often discarded due to the disentanglement of identity and style representations. \(\textit{\boldsymbol{Phantom}}\) achieves protection success rate improvements of 27.8%, 25.6%, and 16.6% over state-of-the-art methods on UniFace [20], INSwapper [21], and SimSwap [22], respectively, indicating strong robustness not only against FR models but also in face-swapping deepfake environments.

Moreover, we demonstrate that \(\textit{\boldsymbol{Phantom}}\) generalizes to impersonation scenarios that induce recognition as a target identity. While the adaptive synthesis module is deactivated in this setting, our spatial optimization remains effective and yields strong protection along with enhanced visual fidelity.

In summary, our contributions are as follows:

  • We present \(\textit{\boldsymbol{Phantom}}\), a unified face-swap deepfake protection framework that combines latent- and spatial-constrained optimization, jointly addressing both directional and regional limitations of prior methods.

  • We propose a latent-constrained adversarial optimization strategy via adaptive target synthesis that produces identity-shifted yet structure-preserving targets, offering coherent directional guidance in embedding space.

  • We introduce a spatial-constrained adversarial optimization strategy using semantically masked gradient updates, enabling compact and visually aligned perturbations for enhanced robustness.

  • \(\textit{\boldsymbol{Phantom}}\) outperforms existing methods in protecting against black-box FR models and generalizes effectively to face-swapping deepfakes while improving visual quality. Notably, it achieves up to 98.2% protection success against face-swapping attacks, surpassing prior approaches by at least 16.6%, and also shows competitive performance in impersonation scenarios.

2 Related Work↩︎

Figure 1: Overview of \textit{\boldsymbol{Phantom}}, our unified face-swap deepfake protection framework.

2.1 Adversarial Attacks on Face Recognition↩︎

Adversarial attacks are categorized as targeted (impersonation) or non-targeted (dodging). Dodging attacks attempt to conceal the true identity of the source image, forcing recognition models to misclassify it as an unknown or incorrect person. In contrast, impersonation attacks aim to manipulate the image such that it is recognized as a specific target identity, thereby achieving targeted identity transfer.

Noise-based methods typically apply imperceptible perturbations over the entire facial region [7], [8], but often suffer from limited visual quality. Subsequent works have improved robustness through momentum [9] and translation-invariant strategies [10]. TIP-IM [11] employs targeted optimization to generate adversarial identity masks effective against black-box FR models. However, this approach introduces perceptible noise within the face bounding box, thereby degrading perceptual quality.

Makeup-based approaches [14][17] embed adversarial perturbations into visually plausible styles using reference images or text prompts. Although [15] addresses both impersonation and dodging, most methods are optimized for impersonation and remain largely unexplored under face-swapping deepfake scenarios. Moreover, these methods offer limited spatial control and high computational cost.

2.2 Face Manipulation↩︎

Face manipulation models aim to generate realistic facial images while controlling attributes such as expression or style. Recent approaches create and leverage semantic segmentation masks to enable structure-aware generation [23], [24]. They synthesize faces conditioned on semantic masks and reference images, allowing localized style transfer. While these models attempt to preserve identity, slight changes can arise during style adaptation. [25] extends this direction by generating identity-diverse images from segmentation masks in a structure-guided manner and optional text prompts for style.

2.3 Face-Swapping Deepfakes↩︎

Face-swapping deepfakes synthesize realistic identity manipulations by disentangling identity features from style (e.g., pose, texture) and recombining them across subjects. Earlier methods such as FaceShifter [26] and SimSwap [22] employ encoder–decoder architectures with FR-guided identity injection, while recent models like UniFace [20] introduce explicit identity and style branches to enhance controllability and fidelity.

3 Methodology↩︎

We propose \(\textit{\boldsymbol{Phantom}}\), a structured adversarial framework for facial privacy protection that proactively defends against black-box FR and face-swapping deepfakes. As illustrated in Fig. 1, \(\textit{\boldsymbol{Phantom}}\) integrates two complementary optimization strategies: a latent-constrained adaptive target synthesis strategy that guides embedding shifts along identity-discriminative directions, and a spatial-constrained masked adversarial attack that restricts perturbations to semantically meaningful regions. Together, these components enable spatially focused and identity-aware perturbations while maintaining high visual fidelity.

3.1 Problem Formulation↩︎

We consider a practical threat scenario where user face images are collected from public sources, such as social media or online platforms, and are exploited without consent. Such images may be used by adversaries for unauthorized face recognition (FR) or identity manipulation via face-swapping deepfakes. Our goal is to proactively defend against both threats by generating visually plausible but identity-disruptive variants.

Let \(x_u\) and \(t_u\) denote the original and target face images of user \(u\), respectively, and let \(x_u^p\) be its protected version. Given a black-box FR model \(f(\cdot)\), we denote the embedding (i.e., the latent representation) of an image \(x\) as \(\mathbf{z}_x = f(x)\). Our goal is to generate \(x_u^p\) such that identity inference is suppressed by disrupting \(\mathbf{z}_{x_u^p}\), while remaining visually similar to \(x_u\). To this end, we define a unified objective that supports both dodging (maximizing deviation from \(\mathbf{z}_{x_u}\)) and impersonation (minimizing distance to \(\mathbf{z}_{t_u}\)), formulated as:

\[\label{eq:general95problem} \begin{array}{c} \displaystyle \max_{x_u^p} \; \mathcal{L}_{adv} = D(\mathbf{z}_{x_u^p}, \mathbf{z}_{x_u}) - D(\mathbf{z}_{x_u^p}, \mathbf{z}_{t_u}) \\[0.8em] \displaystyle \text{s.t.} \quad L_p(x_u^p, x_u) \leq \epsilon \end{array}\tag{1}\]

Here, \(D(\cdot)\) is a similarity metric (e.g., cosine or Euclidean), and \(L_p(\cdot)\) denotes the perceptual distance between \(x_u^p\) and \(x_u\), bounded by a threshold \(\epsilon\) to ensure imperceptibility.

3.2 Adaptive Target Synthesis↩︎

Motivated by the entangled nature of identity, style, and geometry in the latent space of FR models, we seek to isolate identity-discriminative directions while preserving non-identity factors. To this end, we synthesize a target image \(t\) that aligns with the source \(x\) in style and geometry but differs subtly in identity. As depicted in Fig. 2, conventional target selection strategies (e.g., random or fixed) yield perturbations that traverse mixed directions in the latent space, including identity (\(\delta^i = z_t^i - z_x^i\)), style (\(\delta^s = z_t^s - z_x^s\)), and geometry (\(\delta^g = z_t^g - z_x^g\)), which are not optimized solely for identity shift. In contrast, our synthesized \(t\) constrains \(\delta^s\) and \(\delta^g\) near zero by construction, thereby encouraging perturbations aligned predominantly along the identity axis \(\delta^i\). Note that visual similarity between \(x\) and \(t\) is not a concern; rather, it is expected and acceptable, as the objective is not to maximize visual divergence but to extract a semantic direction \(\delta^i\) for identity-axis perturbation. Unlike unconstrained directions that may entangle identity with other attributes, this targeted guidance allows \(\textit{\boldsymbol{Phantom}}\) to suppress identity-discriminative features more effectively with minimal perturbations.

Figure 2: Comparison of guided perturbation directions in latent space across target strategies.

To synthesize a target \(t\) disentangled from \(x\) only in terms of identity, we repurpose face manipulation models. Given an input \(x\), we first extract a semantic mask \(m = G_S(x)\) using a segmentation model \(G_S\). This mask is reused without modification to retain spatial layout. A mask-guided face generation model \(G_F\) then combines \(x\) and \(m\) to produce the synthesized target: \[\label{eq:atsyn} t \gets G_F(x, G_S(x))\tag{2}\] Although \(G_F\) is originally intended for tasks such as retouching or style transfer, it introduces subtle identity shifts while maintaining structure. We reinterpret these changes as semantically aligned traversals in latent space that serve as directional anchors for identity-axis optimization.

3.3 Masked Adversarial Attack↩︎

We identify an optimal perturbation region that maximizes protection against both FR models and face-swapping while minimizing perceptual degradation. Since the spatial placement of adversarial perturbation critically impacts both effectiveness and visual quality, selecting the effective region is essential.

To this end, we empirically evaluate various perturbation scopes including the entire image, full face region, non-face areas (e.g., background, hair), and localized facial components (e.g., eyes, nose, mouth). As detailed in the Supplementary Material, perturbations confined to the face region yield the best trade-off, offering strong protection with minimal artifacts. In contrast, applying perturbations to irrelevant or overly localized regions reduces effectiveness or introduces visible distortions. Based on this analysis, we adopt the face region as our selective region for adversarial optimization.

We formulate a proactive adversarial attack strategy that suppresses identity features in facial images, thereby degrading their utility for downstream recognition or swapping tasks. \(\textit{\boldsymbol{Phantom}}\) combines adaptive target synthesis with spatially constrained perturbation to generate identity-obfuscating perturbations confined to semantically meaningful regions. This enables effective protection under black-box conditions, including unseen FR models or deepfake generators, while preserving image fidelity. The overall objective consists of identity-oriented and quality-preserving terms: \[\label{eq:loss} \begin{align} \mathcal{L}_{total} = \lambda_{id}\lambda_{ori}\mathcal{L}_{ori} + \lambda_{id}\lambda_{tgt}\mathcal{L}_{tgt} + \lambda_{qual}\mathcal{L}_{qual} \end{align}\tag{3}\] \(\mathcal{L}_{ori}\) and \(\mathcal{L}_{tgt}\) represent cosine similarity losses against the original and target embeddings, computed using an ensemble of surrogate FR models to improve transferability. \(\mathcal{L}_{qual}\) enforces perceptual fidelity using pixel-wise MSE loss, and helps bound the perturbation strength by limiting the maximum per-pixel deviation to \(\epsilon\).

We apply per-iteration clamping using a binary mask to constrain adversarial updates within the predefined region. Specifically, a binary mask \(B_u \in {0,1}^{H \times W}\) is constructed based on the selected facial region. During optimization, we compute the gradient \(g\) of the total loss with respect to the adversarial perturbations \(n_{adv}\) and apply a Hadamard product with the mask: \[\label{eq:hadmard} \begin{align} g^* = B_u \odot g, \quad \text{s.t.} \quad g = \nabla_{n_{adv}} \mathcal{L}_{total} \end{align}\tag{4}\] This yields compact, task-aware perturbations that are both visually natural and effective against unseen FR models or deepfake generators.

While \(\textit{\boldsymbol{Phantom}}\) primarily targets dodging scenario (e.g., avoiding unauthorized FR models or deepfakes), it can be naturally extended to impersonation settings. In such cases, adaptive target synthesis is not required. Instead, a specific identity image can be directly selected as \(t_u\) to steer the embedding toward a desired target identity. The rest of the masked adversarial optimization framework remains unchanged.

The full algorithm of \(\textit{\boldsymbol{Phantom}}\) is provided in the Supplementary Material.

4 Experiments↩︎

Figure 3: Deepfake results with UniFace. Numbers represent the cosine similarity on IR152 between deepfake images and the original images. Yellow and Green indicate protection failure and success based on a threshold of 0.167 at FAR@0.01.

4.1 Experimental Settings↩︎

 

We set \(iter{=}200\), \(\epsilon{=}16\), and use the Adam optimizer with a learning rate of \(5\mathrm{e}{-4}\), \(\beta_1{=}0.9\), and \(\beta_2{=}0.999\). Loss weights are configured as \((\lambda_{id}, \lambda_{qual}){=}(1.0, 1.0)\); for dodging, \((\lambda_{ori}, \lambda_{tgt}){=}(1.0, 0.5)\), and for impersonation, \((0.0, 1.0)\). We use \(G_S\) and \(G_F\) from [23], which preserve both style and geometry. To assess robustness under different synthesis characteristics, we also evaluate \(G_F\) from [25], which preserves geometry only.

Following [14], [16], [17], we use the CelebA-HQ [18] and LADN [19] datasets. For CelebA-HQ, we select 1,000 images from [14] and use 930 image pairs with corresponding counterparts. One pair is randomly selected per image based on official pair information. For LADN, we evaluate on the same 334 images used by existing methods to ensure a fair comparison.

Following [14][17], we evaluate \(\textit{\boldsymbol{Phantom}}\) against four FR models with different backbone architectures: IRSE50 [27], IR152 [28], FaceNet [29], and MobileFace [30]. Before feeding images into these FR models, we detect faces using RetinaFace [31] implemented in the InsightFace [21].

We evaluate our approach against face-swapping deepfake attacks using three state-of-the-art tools: INSwapper [21], deployed in Picsi.Ai [32], UniFace [20], and SimSwap [22]. Each tool utilizes a different pretrained swapper model with unique resizing configurations in pre-processing. See the Supplementary Material for details.

We compare our approach against representative benchmark approaches. Perturbation-based methods include MI-FGSM [9], TI-DIM [10], and TIP-IM [11]. Makeup-based methods include AMT-GAN [14], CLIP2Protect [15], DiffAM [16], and RMT-GAN [17]. All methods adopt the ensemble strategy from [14] for fair comparison. For the dodging scenario, methods without explicit support for dodging-specific optimization (e.g., AMT-GAN [14], DiffAM [16]) are evaluated using their official implementations and recommended hyperparameters from the original papers. Details in the Supplementary Material.

To assess protection effectiveness, we report Rank-1/5 protection (R1-P/R5-P) and Protection Success Rate (PSR) under FAR@0.01. R1-P/R5-P measure how well protection methods prevent the ground-truth pair from appearing in the top-N predictions on the FR model, while PSR quantifies how often a deepfake image fails to match the true identity under a fixed FAR. For PSR, the model-specific thresholds are 0.241 (IRSE50), 0.167 (IR152), 0.409 (FaceNet), and 0.302 (MobileFace). The Attack Success Rate (ASR) is defined as \((1 - \text{PSR})\) for a target identity. For image quality, we use PSNR, SSIM [33], and FID [34]. Higher R1/R5 and PSR indicate stronger protection; higher PSNR and SSIM, and lower FID indicate better visual quality.

In all experiments, we evaluated on an NVIDIA A100 GPU with 80GB of memory.

4.2 Dodging Scenario Evaluation↩︎

 

We evaluate \(\textit{\boldsymbol{Phantom}}\) in a black-box setting using four unseen FR models. As shown in Tab. 1, \(\textit{\boldsymbol{Phantom}}\) achieves an average protection of 95.0% in R1-P and 89.6% in R5-P, outperforming existing methods by 9.1% and 18.2%, respectively. This confirms strong identity obfuscation across diverse FR architectures. AMT-GAN and DiffAM show limited performance due to their impersonation-oriented design. Tab. 2 reports SSIM, PSNR, and FID scores, showing that \(\textit{\boldsymbol{Phantom}}\) preserves perceptual quality (SSIM: 0.973, PSNR: 33.646, FID: 18.705) while maintaining strong protection.

Table 1: R1-P/R5-P performance (%) comparison of different methods on CelebA-HQ dataset. For each columns, the other three FR models are used as surrogates to generate the protected images.
IRSE50 IR152 FaceNet MobileFace
Method R1-P R5-P R1-P R5-P R1-P R5-P R1-P R5-P
Clean 07.3 04.4 04.0 03.3 16.2 07.7 18.0 10.8
TIP-IM [11] 84.5 73.3 65.2 60.0 82.4 66.6 81.9 68.3
AMT-GAN [14] 71.1 52.8 65.2 47.3 87.3 70.9 76.5 59.4
CLIP2Protect (CVPR 2023) 87.7 73.3 78.4 61.3 83.3 65.8 94.5 85.2
DiffAM [16] 68.9 42.1 44.5 25.6 78.0 55.1 80.5 57.4
Ours \((\lambda_{ori}{ = }1.0, \lambda_{tgt}{ = }0.5)\) 95.8 91.9 91.6 85.4 93.9 83.9 98.8 97.3
Table 2: Perceptual Quality under Dodging Setting
Method SSIM (\(\uparrow\)) PSNR (\(\uparrow\)) FID (\(\downarrow\))
TIP-IM [11] 0.884 30.715 30.858
AMT-GAN [14] 0.787 19.505 34.441
CLIP2Protect [15] 0.570 16.904 39.890
DiffAM [16] 0.874 20.526 26.102
Ours \((\lambda_{ori}{ = }1.0, \lambda_{tgt}{ = }0.5)\) 0.973 33.646 18.705
Table 3: Evaluation of PSR for dodging (non-targeted) scenario at FAR@0.01 against state-of-the-art face-swapping deepfakes: UniFace [20], INSwapper [21], and SimSwap [22].For each evaluated FR model, the other three FR models are used as surrogates to generate the protected images.
Method CelebA-HQ LADN
Deepfakes IRSE50 IR152 FaceNet MobileFace Average IRSE50 IR152 FaceNet MobileFace Average
Clean UniFace 0.000 0.000 0.003 0.000 0.001 0.003 0.129 0.087 0.024 0.061
INSwapper 0.003 0.003 0.010 0.006 0.006 0.000 0.000 0.000 0.000 0.000
SimSwap 0.000 0.000 0.024 0.005 0.007 0.000 0.000 0.000 0.000 0.000
TIP-IM [11] UniFace 0.309 0.681 0.427 0.347 0.441 0.725 0.847 0.680 0.781 0.758
INSwapper 0.660 0.422 0.604 0.684 0.593 0.683 0.599 0.410 0.671 0.591
SimSwap 0.775 0.657 0.754 0.790 0.744 0.820 0.799 0.599 0.820 0.760
AMT-GAN [14] UniFace 0.191 0.563 0.793 0.284 0.458 0.296 0.722 0.716 0.296 0.508
INSwapper 0.218 0.275 0.728 0.359 0.395 0.368 0.449 0.695 0.437 0.487
SimSwap 0.486 0.534 0.856 0.580 0.614 0.590 0.692 0.766 0.527 0.644
CLIP2Protect [15] UniFace 0.505 0.771 0.757 0.700 0.683 0.569 0.811 0.626 0.802 0.702
INSwapper 0.495 0.447 0.640 0.738 0.580 0.482 0.512 0.578 0.743 0.579
SimSwap 0.728 0.741 0.837 0.884 0.798 0.698 0.749 0.677 0.850 0.743
DiffAM [16] UniFace 0.095 0.337 0.582 0.273 0.322 0.135 0.353 0.482 0.296 0.317
INSwapper 0.140 0.092 0.473 0.328 0.258 0.171 0.141 0.434 0.323 0.267
SimSwap 0.319 0.283 0.707 0.530 0.460 0.308 0.353 0.578 0.458 0.424
Ours \((\lambda_{ori}{ = }1.0, \lambda_{tgt}{ = }0.5)\) UniFace 0.930 0.976 0.970 0.969 0.961 0.982 0.997 0.958 0.991 0.982
INSwapper 0.820 0.783 0.840 0.953 0.849 0.802 0.796 0.656 0.919 0.793
SimSwap 0.927 0.962 0.979 0.986 0.964 0.898 0.967 0.895 0.976 0.934
RMT-GAN [17] is excluded in this evaluation due to lack of publicly available code.

We further assess robustness under face-swapping pipelines, where identity and style are explicitly disentangled. Tab. 3 shows adversarial perturbations embedded in peripheral regions or stylistic forms (e.g, makeup), as in prior methods, often struggles to persist through the face swap, leading to reduced protection effectiveness. In contrast, \(\textit{\boldsymbol{Phantom}}\) constrains perturbations to identity-relevant facial regions and optimizes them along identity-aware axes, maintaining their effect even after identity-style disentanglement. This allows \(\textit{\boldsymbol{Phantom}}\) to consistently outperform baselines across face-swapping pipelines. Specifically, we observe substantial PSR improvements of 27.8%, 25.6%, and 16.6% over the best-performing baseline on CelebA-HQ, and 22.4%, 20.2%, and 17.4% on LADN against UniFace, INSwapper, and SimSwap, respectively. Notably, the largest gains against UniFace, known for its dedicated identity disentanglement module, highlight the robustness of our latent- and spatial-constrained strategies. Meanwhile, PSR scores on INSwapper are relatively lower than on other pipelines. Nonetheless, \(\textit{\boldsymbol{Phantom}}\) consistently maintains superior protection across all deepfakes and datasets, as shown in Fig. 3.

These results reaffirm a key limitation of impersonation-driven protection such as AMT-GAN and DiffAM: increasing similarity to a target identity does not ensure sufficient separation from the original one. Face swap makes this gap more evident, underscoring the need for dodging-oriented protection that explicitly maximizes identity separation.

To evaluate the robustness of post-processing transformations, we apply five levels of JPEG compression, Gaussian blur, and resizing to the protected images, and evaluate cosine similarity using black-box FR models. \(\textit{\boldsymbol{Phantom}}\) consistently exhibits minimal degradation, with cosine similarity increasing by no more than 10% under all types of distortion. Notably, in the resizing, the similarity loss remains below 1% across all scales. This robustness stems from applying perturbations at a low-resolution stage and spatially aligning them with the original image, making them less vulnerable to downstream transformations while preserving their spectral effect. These results highlight the robustness of our method against common post-processing distortions. See Supplementary Material for visual examples and detailed results.

4.3 Impersonation Scenario Evaluation↩︎

We evaluate \(\textit{\boldsymbol{Phantom}}\) under the impersonation setting by fixing a target identity and disabling adaptive synthesis. As shown in Tab. 4 and Tab. 5, \(\textit{\boldsymbol{Phantom}}\) consistently outperforms impersonation-optimized baselines on both CelebA-HQ and LADN in terms of ASR and perceptual quality. Notably, on LADN, it achieves at least a 10.2% absolute PSR gain over all compared methods. These results indicate that our spatially constrained masked optimization generalizes effectively to impersonation scenarios without architectural changes, surpassing baselines tailored for impersonation. Compared to the dodging setting, \(\textit{\boldsymbol{Phantom}}\) exhibits notably higher visual fidelity under impersonation, suggesting that embedding target-specific identity cues requires milder perturbations than suppressing the source identity.

Table 4: Perceptual Quality under Impersonation Setting
Method SSIM (\(\uparrow\)) PSNR (\(\uparrow\)) FID (\(\downarrow\))
TIP-IM [11] 0.884 30.715 30.858
AMT-GAN [14] 0.787 19.505 34.441
CLIP2Protect [15] 0.603 19.354 37.117
DiffAM [16] 0.874 20.526 26.102
RMT-GAN [17] 0.811 21.171 21.254
Ours \((\lambda_{ori}{ = }0.0, \lambda_{tgt}{ = }1.0)\) 0.975 36.809 13.978
Table 5: Evaluation of ASR for impersonation (targeted) scenario at FAR@0.01. For each evaluated FR model, the other three FR models are used as surrogates to generate the protected images and the numbers in brackets indicate the improvements compared to the rates before protection.
Method CelebA-HQ LADN
IRSE50 IR152 FaceNet MobileFace Average IRSE50 IR152 FaceNet MobileFace Average
source 07.3 03.8 01.1 12.7 06.2 02.7 03.6 00.6 05.1 03.0
MI-FGSM [9] 45.8(+38.5) 25.0(+21.2) 02.6(+01.5) 45.9(+33.2) 29.8(+23.6) 48.9(+46.2) 25.6(+22.0) 06.3(+05.7) 45.0(+39.9) 31.5(+28.5)
TI-DIM [10] 63.6(+56.3) 36.2(+32.4) 15.3(+14.2) 57.1(+44.4) 43.1(+36.9) 56.4(+53.7) 34.2(+30.6) 22.1(+21.5) 48.3(+43.2) 40.3(+37.3)
TIP-IM [11] 72.1(+64.8) 50.0(+46.2) 11.5(+10.4) 79.0(+66.3) 53.2(+47.0) 45.3(+42.6) 50.5(+46.9) 15.1(+14.5) 55.3(+50.2) 41.6(+38.6)
Adv-makeup [35] 17.2(+09.9) 09.5(+05.7) 01.4(+00.3) 22.0(+09.3) 12.5(+06.3) 29.6(+26.9) 10.0(+06.4) 01.0(+00.4) 22.4(+17.3) 15.8(+12.8)
AMT-GAN [14] 77.0(+69.7) 35.1(+31.3) 16.6(+15.5) 50.7(+38.0) 44.9(+43.7) 89.6(+86.9) 49.1(+45.5) 32.1(+31.5) 72.4(+67.3) 60.8(+57.8)
CLIP2Protect [15] 81.1(+73.8) 48.4(+44.6) 41.7(+40.6) 75.2(+62.5) 61.6(+55.4) 91.6(+88.9) 53.3(+49.7) 47.9(+47.3) 79.9(+74.8) 68.2(+65.2)
DiffAM [16] 92.0(+84.7) 63.1(+59.3) 64.7(+63.6) 83.5(+70.7) 75.8(+69.6) 95.7(+93.0) 66.8(+63.2) 65.4(+64.8) 92.0(+86.9) 80.0(+77.0)
source* 09.0 04.0 01.6 19.4 08.5 10.8 05.7 06.6 24.6 11.9
RMT-GAN [17] 91.4(+82.4) 51.8(+47.8) 31.0(+29.4) 93.4(+74.0) 66.9(+58.4) 98.5(+87.7) 80.8(+75.1) 76.9(+70.3) 99.4(+74.8) 88.9(+77.0)
ours (\(\lambda_{ori}{=}0.0, \lambda_{tgt}{=}1.0\)) 96.0(+88.7) 73.7(+69.9) 40.7(+39.6) 93.4(+80.7) 76.0(+69.8) 99.7(+97.0) 91.0(+87.4) 71.0(+70.4) 99.1(+94.0) 90.2(+87.2)
ASR values for all baseline methods are cited from CLIP2Protect, DiffAM, and RMT-GAN, which report results under a unified evaluation protocol.
* indicates that the ASR of the source image may differ from other methods due to RMT-GAN’s target selection strategy.

4.4 Ablation Study↩︎

 

Table 6: Ablation Study for selective region (SR) and masked adversarial attack (MAA).
Ablation Protection (%) Perceptual Quality
1-2 SR MAA R1-O R5-O R1-P R5-P SSIM (\(\uparrow\)) PSNR (\(\uparrow\)) FID (\(\downarrow\))
Face Box 85.80 79.50 97.42 94.30 0.90 31.213 35.087
Non-Face 0.00 0.00 8.71 4.84 0.94 33.498 29.344
Face 73.10 61.50 94.09 87.53 0.95 33.565 24.141
Face 84.60 76.80 97.42 95.16 0.94 33.057 24.561
RN-O: ranked-N protection rate with the protected image and the original.

We investigate how perturbation placement affects protection and visual quality by disabling target-guided optimization (\(\lambda_{tgt}=0\)) and varying spatial constraints.

Tab. 6 compares four configurations: full face bounding box (baseline), non-face region, face region via post hoc masking, and our masked adversarial attack that constrains optimization to the selective face region. The baseline achieves strong protection (R1-O: 85.8%) but degrades visual quality (FID: 35.1). Conversely, non-face perturbation yields minimal protection (R1-O: 0.0%) despite better quality, confirming that most discriminative features lie in facial regions. Post hoc masking yields similar visual quality but leads to reduced protection (R1-O: 72.1%).

Our approach achieves a better trade-off (R1-O: 84.6%, FID: 24.6) by constraining gradients during optimization, not after. This enforces spatial alignment and compact perturbations, preserving both robustness and visual fidelity. These results highlight the importance of integrating spatial priors directly into the optimization process.

We evaluate \(\textit{\boldsymbol{Phantom}}\) under four adversarial target strategies: Fixed, a shared target across all images adopted in most existing methods; AT-Sel, an adaptive selection approach based on landmark and identity similarity as proposed in RMT-GAN; AT-Syn, our adaptive target synthesis strategy that leverages a generative model from [23]; and AT-Syn(*g), a variant of AT-Syn without style conditioning, following [25].

Table 7: Comparison of target strategies: geometry consistency and identity similarity with the original image.
Fixed AT-Sel AT-Syn(g) AT-Syn
face landmarks NME\(^{*}\) (mean) 0.074 0.063 0.033 0.021
face landmarks NME\(^{*}\) (std) 0.028 0.022 0.016 0.013
identity similarity (mean) 0.036 0.061 0.248 0.503
NME\(^{*}\): normalized mean error.
Figure 4: Sample target and protected images for dodging.
Table 8: Comparison of target strategies: protection performance (%) and perceptual quality of protected images.
IRSE50 IR152 FaceNet MobileFace Quality
Method R1-P R5-P R1-P R5-P R1-P R5-P R1-P R5-P FID(\(\downarrow\))
Fixed 96.7 92.0 91.2 82.3 92.6 83.2 98.1 97.2 21.282
AT-Sel 95.9 90.8 90.7 82.1 92.2 83.3 98.6 97.3 20.811
AT-Syn(*g) 96.5 91.3 90.0 81.8 93.4 83.5 98.8 97.1 20.027
AT-Syn 95.8 91.9 91.6 85.4 93.9 83.9 98.8 97.3 18.705

As shown in Tab. 7, synthesis-based targets yield lower NME and variance, indicating superior geometry consistency, whereas selection-based targets lack such control and exhibit higher variability. In particular, AT-Syn can remain close to the source and within recognition bounds by design. Rather than generating a drastically different visual identity, AT-Syn defines a semantically meaningful direction in latent space to guide perturbation learning. Leveraging this structured signal, \(\textit{\boldsymbol{Phantom}}\) generates identity-disruptive perturbations more effectively through adversarial amplification. As shown in Tab. 8, AT-Syn achieves superior perceptual quality over all alternatives, including its geometry-only variant, without sacrificing protection. Fig. 4 further illustrates that AT-Syn yields cleaner outputs, highlighting the benefit of structure- and style-aware synthesis in guiding effective and visually coherent perturbations.

Fig. 5 illustrates that as \(\epsilon\) increases, facial distortion becomes more pronounced, yet protection against face swap improves owing to enhanced identity obfuscation. This trade-off highlights that \(\textit{\boldsymbol{Phantom}}\) allows controllable balancing between visual fidelity and protection strength. See the Supplementary Material for detailed results w.r.t. \(\epsilon\) and iteration.

Figure 5: Deepfake results with UniFace for varying \epsilon values. Numbers indicate cosine similarity on IRSE50 between deepfake and original images. Yellow/Green indicate protection failure/success at a 0.241 threshold (FAR@0.01).

To further analyze robustness under imperfect masking (e.g., due to occlusion or extreme pose), We partition the evaluation set into two splits: \(\mathcal{D}_{sts}\) (imperfect masking stress set, at least one missing face element) and \(\mathcal{D}_{std}\) (reliable masking standard set, the remainder). \(\mathcal{D}_{sts}\) exhibits greater perceptual drift and weaker protection, consistent with minor spatial misalignment and slightly contaminated geometry cues that yield mildly off-identity targets and localized visible noise. Nevertheless, our method outperforms baselines because most facial regions remain covered, keeping the noise budget on salient ROIs, and the synthesized target is better aligned in style and geometry than random or fixed targets, helping preserve identity-axis guidance. See the Supplementary for qualitative and quantitative analyses.

5 Conclusion↩︎

1.0 In this paper, we propose \(\textit{\boldsymbol{Phantom}}\), a unified face-swap deepfake protection framework for facial privacy protection that jointly constrains perturbations in latent and spatial domains. By introducing adaptively synthesized targets and enforcing region-aware updates, \(\textit{\boldsymbol{Phantom}}\) achieves robust and perceptually coherent defense against both face recognition and face-swapping deepfakes. This work highlights the importance of precise perturbation placement and guided optimization for effective identity obfuscation.

References↩︎

[1]
D. Cozzolino, A. Rössler, J. Thies, M. Nießner, and L. Verdoliva, “ID-reveal: Identity-aware DeepFake video detection , booktitle = Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV),” 2021, pp. 15108–15117 # diffusion mode.
[2]
X. Dong et al., “Protecting celebrities from DeepFake with identity consistency transformer , booktitle = Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR),” 2022, pp. 9468–9478.
[3]
S. Dong, J. Wang, R. Ji, J. Liang, H. Fan, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Ge Zheng, “Implicit identity leakage: The stumbling block to improving deepfake detection generalization,” 2023, pp. 3994–4004.
[4]
Y.-C.-T. Hu, B.-H. Kung, D. S. Tan, J.-C. Chen, K.-L. Hua, and booktitle=Proceedings. of the I. I. C. on C. V. (ICCV). Cheng Wen-Huang, “Naturalistic physical adversarial patch for object detectors,” 2021, pp. 7848–7857.
[5]
Z. Xiao et al., “Improving transferability of adversarial patches on face recognition with generative models,” 2021, pp. 11845–11854.
[6]
A. Guesmi, R. Ding, M. A. Hanif, I. Alouani, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Shafique Muhammad, “Dap: A dynamic adversarial patch for evading person detectors,” 2024, pp. 24595–24604.
[7]
I. J. Goodfellow, J. Shlens, and booktitle =. P. of the I. C. on L. R. (ICLR). Szegedy Christian, “Explaining and harnessing adversarial examples,” 2015 # I-FSG.
[8]
A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and booktitle =. P. of the I. C. on L. R. (ICLR). Vladu Adrian, “Towards deep learning models resistant to adversarial attacks,” 2018 # MIFGS.
[9]
Y. Dong et al., “Boosting adversarial attacks with momentum,” 2018 # DIFGS, pp. 9185–9193.
[10]
Y. Dong, T. Pang, H. Su, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Zhu Jun, “Evading defenses to transferable adversarial examples by translation-invariant attacks,” 2019 # NIFGS, pp. 4312–4321.
[11]
X. Yang et al., “Towards face encryption by generating adversarial identity masks,” 2021 # Metric ########################################################################################## # SSI, pp. 3897–3907.
[12]
L. Jing, R. Wang, W. Ren, X. Dong, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Zou Cong, “PAD: Patch-agnostic defense against adversarial patch attacks,” 2024, pp. 24472–24481.
[13]
K.-H. Chow, S. Hu, T. Huang, and booktitle=Proceedings. of the E. C. on C. V. (ECCV). Liu Ling, “Personalized privacy protection mask against unauthorized facial recognition,” 2024.
[14]
S. Hu et al., “Protecting facial privacy: Generating adversarial identity masks via style-robust makeup transfer,” 2022 # CLIP2Protec, pp. 15014–15023.
[15]
F. Shamshad, M. Naseer, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Nandakumar Karthik, “CLIP2Protect: Protecting facial privacy using text-guided makeup via adversarial latent search,” 2023 # DiffA, pp. 20595–20605.
[16]
Y. Sun, L. Yu, H. Xie, J. Li, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Zhang Yongdong, “DiffAM: Diffusion-based adversarial makeup transfer for facial privacy protection,” 2024 # RMT-GA, pp. 24584–24594.
[17]
X. Liu et al., “Recoverable facial identity protection via adaptive makeup transfer adversarial attacks,” 2025 #########################################################################################, pp. 514–522.
[18]
T. Karras, T. Aila, S. Laine, and booktitle =. P. of the I. C. on L. R. (ICLR). Lehtinen Jaakko, “Progressive growing of GANs for improved quality, stability, and variation,” 2018 # LF.
[19]
Q. Gu, G. Wang, M. T. Chiu, Y.-W. Tai, and booktitle=Proceedings. of the I. I. conference on computer vision (ICCV). Tang Chi-Keung, “Ladn: Local adversarial disentangling network for facial makeup and de-makeup,” 2019.
[20]
C. Xu et al., “Designing one unified framework for high-fidelity face reenactment and swapping,” 2022 , organization={Springer} # SimSwa, pp. 54–71.
[21]
“InsightFace , howpublished = https://github.com/deepinsight/insightface.” 2025 , note = {(Accessed on 11/11/2025)} # UniFac.
[22]
R. Chen, X. Chen, B. Ni, and booktitle=Proceedings. of the A. I. C. on M. (ACMMM). Ge Yanhao, “Simswap: An efficient framework for high fidelity face swapping,” 2020 #IPGA, pp. 2003–2011.
[23]
C.-H. Lee, Z. Liu, L. Wu, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Luo Ping, “Maskgan: Towards diverse and interactive facial image manipulation,” 2020 ########################################################################################## # makeup # AMT-GA, pp. 5549–5558.
[24]
R. Durall Lopez, J. Jam, D. Strassel, M. H. Yap, and booktitle=Proceedings. of B. M. V. C. (BMVC). Keuper Janis, “Facialgan: Style transfer and attribute manipulation on synthetic faces,” 2021.
[25]
Z. Huang, K. C. Chan, Y. Jiang, and booktitle=Proceedings. of the I. conference on computer vision and pattern recognition (CVPR). Liu Ziwei, “Collaborative diffusion for multi-modal face generation and editing,” 2023.
[26]
L. Li, J. Bao, H. Yang, D. Chen, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Wen F, “Faceshifter: Towards high fidelity and occlusion aware face swapping.” 2020 #Meg.
[27]
J. Hu, L. Shen, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Sun Gang, “Squeeze-and-excitation networks,” 2018 # MobileFac, pp. 7132–7141.
[28]
J. Deng, J. Guo, N. Xue, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Zafeiriou Stefanos, “Arcface: Additive angular margin loss for deep face recognition,” 2019 # Facene, pp. 4690–4699.
[29]
F. Schroff, D. Kalenichenko, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Philbin James, “Facenet: A unified embedding for face recognition and clustering,” 2015 # IRSE5, pp. 815–823.
[30]
S. Chen, Y. Liu, X. Gao, and booktitle=Proceedings. of the C. C. on B. R. (CCBR). Han Zhen, “Mobilefacenets: Efficient cnns for accurate real-time face verification on mobile devices,” 2018 , organization={Springer} # Retinafac, pp. 428–438.
[31]
J. Deng, J. Guo, E. Ververas, I. Kotsia, and booktitle=Proceedings. of the I. C. on C. V. and P. R. (CVPR). Zafeiriou Stefanos, “Retinaface: Single-shot multi-level face localisation in the wild,” 2020 ########################################################################################## # Mas, pp. 5203–5212.
[32]
“Picsi.ai , howpublished = https://www.picsi.ai/.” 2025 , note = {(Accessed on 11/11/2025)} # InsightFac.
[33]
Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, “Image quality assessment: From error visibility to structural similarity,” IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600–612, 2004.
[34]
M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, “Gans trained by a two time-scale update rule converge to a local nash equilibrium,” Advances in Neural Information Processing Systems (NIPS), vol. 30, 2017 # Dataset ########################################################################################## # CelebA-H.
[35]
B. Yin et al., “Adv-makeup: A new imperceptible and transferable attack on face recognition,” 2021 ### rebutta.

  1. Corresponding author↩︎