TAFIM: Targeted Adversarial Attacks against Facial Image Manipulations

Shivangi Aneja, Lev Markhasin, Matthias Nießner · OpenReview

Abstract

Face manipulation methods can be misused to affect an individual's privacy or to spread disinformation. To this end, we introduce a novel data-driven approach that produces image-specific perturbations which are embedded in the original images. The key idea is that these protected images prevent face manipulation by causing the manipulation model to produce a predefined manipulation target (uniformly colored output image in our case) instead of the actual manipulation. In addition, we propose to leverage differentiable compression approximation, hence making generated perturbations robust to common image compression. In order to prevent against multiple manipulation methods simultaneously, we further propose a novel attention-based fusion of manipulation-specific perturbations. Compared to traditional adversarial attacks that optimize noise patterns for each image individually, our generalized model only needs a single forward pass, thus running orders of magnitude faster and allowing for easy integration in image processing stacks, even on resource-constrained devices like smartphones.

Introduction: The Need for Proactive Defense

The rapid advancement of generative models has made high-quality facial manipulation—such as face-swapping (SimSwap) or attribute editing (StyleClip)—accessible to almost anyone. While detection methods exist, they are reactive; by the time a Deepfake is detected, the damage on social media is often already done.

Existing proactive defenses, which use adversarial attacks to "break" manipulation models, face three major hurdles: speed, fragility, and specificity. Traditional attacks require iterative optimization for every single image, taking seconds to process—far too slow for a smartphone camera stack. Furthermore, most adversarial noise is destroyed the moment an image is compressed (e.g., uploaded as a JPEG). TAFIM (Targeted Adversarial Attacks against Facial Image Manipulations) aims to solve these issues by making protection fast, robust, and multi-model aware.

Overview of the TAFIM protection pipeline. Protected images cause manipulation models to fail, producing distorted or uniform outputs compared to successful deepfakes on unprotected images.

Methods: Generative Adversarial Protection

TAFIM moves away from slow, per-image optimization in favor of a data-driven generative approach. The system acts like a digital "vaccine," adding a tiny amount of structured noise at the point of capture to make the image immune to processing by known generative models.

Targeted Disruption and Optimization

Instead of just making the output look "bad," TAFIM is a targeted attack. It trains a protection model ($g_\phi$) to produce a perturbation that forces the manipulation model to output a specific, uniform color. This makes it immediately obvious to a human that the image is protected. The system learns a "global" noise prior that works across all faces, which is then refined by a UNet-based encoder-decoder to create an image-specific "local" perturbation.

The TAFIM training architecture, featuring joint global/conditional optimization and a differentiable JPEG layer to ensure robustness.

Robustness and Multi-Model Fusion

To survive social media uploads, the authors integrated a differentiable approximation of JPEG compression into the training loop. Since the standard "round" function in JPEG is non-differentiable, they used a sine-wave approximation to allow gradients to flow back to the protection model. To handle multiple manipulation models simultaneously, TAFIM uses an attention mechanism ($h_\omega$) to generate spatial maps that highlight which parts of the image are most vulnerable to specific attacks, blending them into a single, manipulation-agnostic perturbation.

Experimental Setup and Results

The researchers used the FFHQ (Flickr-Faces-HQ) dataset, training on 10,000 images and testing against three state-of-the-art frameworks: pSp Encoder (style mixing), SimSwap (face swapping), and StyleClip (text-driven editing).

  • Efficiency: TAFIM achieved a 1600x speedup over traditional iterative attacks (I-FGSM and I-PGD), generating protection in ~10ms compared to ~17 seconds for standard methods. This makes it viable for integration directly into mobile camera apps.
  • Robustness: While baseline adversarial attacks failed completely after JPEG compression, TAFIM remained effective even at high compression levels (e.g., JPEG quality 30).
  • Visual Quality: The perturbations are "quasi-imperceptible," maintaining high PSNR and low LPIPS scores, meaning the protected image looks virtually identical to the original to the human eye.
  • Multi-Attack Success: The attention-based fusion allowed a single protected image to successfully disrupt three different manipulation models at once.

Limitations and Future Work

Currently, the defender needs "white-box" access to the manipulation models to train the protection. Future work could explore "black-box" scenarios where the specific manipulation model is unknown. Additionally, the field remains an arms race, as adaptive attackers might develop "purification" algorithms to strip the TAFIM noise before attempting a Deepfake. Generalization to entirely unseen manipulation architectures remains an open question for future research.

Summary updated

Abstract

Face manipulation methods can be misused to affect an individual's privacy or to spread disinformation. To this end, we introduce a novel data-driven approach that produces image-specific perturbations which are embedded in the original images. The key idea is that these protected images prevent face manipulation by causing the manipulation model to produce a predefined manipulation target (uniformly colored output image in our case) instead of the actual manipulation. In addition, we propose to leverage differentiable compression approximation, hence making generated perturbations robust to common image compression. In order to prevent against multiple manipulation methods simultaneously, we further propose a novel attention-based fusion of manipulation-specific perturbations. Compared to traditional adversarial attacks that optimize noise patterns for each image individually, our generalized model only needs a single forward pass, thus running orders of magnitude faster and allowing for easy integration in image processing stacks, even on resource-constrained devices like smartphones.
BibTeX
@misc{aneja2021tafim,
  author = {Shivangi Aneja and Lev Markhasin and Matthias Nießner},
  title = {{TAFIM: Targeted Adversarial Attacks against Facial Image Manipulations}},
  year = {2021},
  eprint = {2112.09151},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.09151},
}
Figure