Adv-CPG: A Customized Portrait Generation Framework with Facial Adversarial Attacks

Junying Wang, Hongyuan Zhang, Yuan Yuan

Abstract

The proliferation of Customized Portrait Generation (CPG) has enabled users to create high-fidelity AI avatars, yet it simultaneously exposes them to significant privacy risks from malicious Face Recognition (FR) systems. This paper introduces Adv-CPG, a novel framework that integrates facial adversarial attacks directly into the diffusion process. By employing a two-stage progressive pipeline, Adv-CPG generates aesthetically pleasing, customized portraits that effectively deceive FR systems by projecting a "target" identity while maintaining the user's desired semantic attributes.

1. Introduction

Customized Portrait Generation (CPG) has seen rapid adoption, allowing users to synthesize images of themselves in diverse styles and environments. However, these high-fidelity images are vulnerable to exploitation by Face Recognition (FR) technologies, which can be used for unauthorized tracking or impersonation.

Traditional privacy-preserving methods, such as noise-based adversarial attacks, often degrade visual quality by introducing perceptible artifacts or "digital grain." Conversely, unrestricted generative attacks often fail to provide the fine-grained control necessary for high-quality portrait customization. Adv-CPG addresses these challenges by bridging the gap between robust privacy protection and artistic customization, creating a "privacy-by-generation" paradigm.

2. Methodology

Adv-CPG utilizes Stable Diffusion XL (SDXL) as its core generative engine and implements a two-stage "progressive" pipeline to decouple identity from image semantics.

2.1 Stage 1: Progressive Facial Privacy Protection

The first stage focuses on establishing the adversarial identity. This is achieved through two primary modules:

  • ID Encryptor (En1): This module injects the features of a pre-selected "target" identity (a different person) into the cross-attention layers of the diffusion model.
  • Encryption Enhancer (En2): To ensure the adversarial features are deeply embedded, En2 provides "local guidance" during the denoising process, nudging pixels to align with the mathematical signature of the target identity rather than the source user.

2.2 Stage 2: Fine-Grained Customized Portrait Generation

To maintain high visual fidelity and adhere to user prompts (e.g., "in a chef outfit"), the framework introduces the Multi-Modal Image Customizer (MMIC). This module leverages a Vision-Language Model (LLaVA) to generate detailed textual descriptions of the user's facial features. By converting visual data into rich semantic descriptions—such as the specific shape of eyes, nose, or mouth—the model can reconstruct a realistic face that satisfies the user's prompt while carrying the "poisoned" identity data from Stage 1.

2.3 Temporal Balancing (T2)

A critical finding in this research is the importance of the "Stage II Start Time" (T2). The authors determined that starting the customization stage at Step 30 of a 50-step denoising process provides an optimal balance. The early steps establish the privacy-preserving identity, while the later steps refine the artistic details and background.

3. Experimental Setup

The framework was trained on the FGID dataset, which includes 30,000 images from CelebA and 42,500 from SFHQ, all featuring comprehensive facial annotations. Evaluation was conducted using standard benchmarks, including FFHQ, CelebA-HQ, and LFW (Labeled Faces in the Wild). The effectiveness of the adversarial attacks was tested against open-source models (FaceNet, MobileFace) and commercial platforms (Face++ and Aliyun).

4. Results and Discussion

Adv-CPG demonstrates superior performance compared to existing state-of-the-art (SOTA) methods across several metrics:

  • Attack Success Rate (ASR): Adv-CPG achieved an average ASR 28.1% higher than traditional noise-based methods and 2.86% higher than previous unrestricted generative approaches.
  • Commercial Robustness: When tested against the Face++ API, the framework achieved a confidence score of 77.5 for the target identity, indicating that the AI was highly confident the image belonged to the "wrong" person.
  • Image Fidelity: Despite the adversarial modifications, the generated images maintained high visual quality. PSNR and SSIM scores remained competitive with, or superior to, standard non-protective customization methods, ensuring the images remain visually appealing to human viewers.

5. Conclusion and Future Work

Adv-CPG represents a significant advancement in protecting user privacy within the realm of generative AI. By decoupling identity from semantics and utilizing VLM-guided refinement, the framework provides a robust solution for users seeking both creative expression and digital privacy.

While currently optimized for SDXL, future research will focus on improving model generalization for newer backbones like SD3 and FLUX. Additionally, the researchers suggest that this methodology could be extended beyond static portraits to video editing and face-swapping applications, further broadening the scope of adversarial privacy protection.

Summary updated

BibTeX
@inproceedings{wang2025adv,
  author = {Junying Wang and Hongyuan Zhang and Yuan Yuan},
  title = {{Adv-CPG: A Customized Portrait Generation Framework with Facial Adversarial Attacks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01956},
}
Figure