Bi-level optimization for self-supervised AI-generated face detection

Mian Zou, Nan Zhong, Baosheng Yu, Yibing Zhan, Kede Ma

TL;DR

This paper introduces BLADES, a novel self-supervised method for detecting AI-generated faces that doesn't require training on synthetic faces. By using a bi-level optimization strategy, BLADES dynamically adjusts the importance of various pretext tasks (like EXIF tag classification and manipulation detection) to learn features that are highly effective for identifying AI-generated content, achieving state-of-the-art generalization to unseen generators.

What Problem Does This Paper Address?

The rapid advancement of AI face generation models (like GANs and diffusion models) has made it increasingly difficult to distinguish between real and synthetic faces. Existing detection methods often rely on supervised learning with synthetic data from specific generators. This approach suffers from a critical limitation: it struggles to generalize to new, unseen generative techniques because it learns artifacts specific to the training generators. While some methods try to use model-agnostic cues or self-supervised learning on photographic images, they often lack explicit alignment with the downstream detection task, leading to suboptimal performance. This paper addresses the need for robust, generalizable AI-generated face detectors that can adapt to evolving generative technologies without requiring direct exposure to synthetic data during pretraining.

Methods

The core innovation of BLADES lies in its bi-level optimization framework. This approach trains a vision encoder using only photographic face images, steering its learning towards the goal of AI-generated face detection without ever seeing synthetic faces.

The process involves two nested optimization loops:

  • Inner Loop (Feature Learning): A vision encoder is pretrained using a weighted sum of several self-supervised pretext tasks. These tasks are designed to capture intrinsic properties of photographic images and potential manipulations:
  • Coarse-Grained Face Manipulation Detection: This acts as a proxy for AI-generated face detection. It involves classifying images as either "manipulated" or "photographic" based on simple transformations like local flips or global affine transforms.
  • Categorical EXIF Tag Classification: This task leverages metadata embedded in image files (e.g., white balance mode, flash usage) to learn camera-specific characteristics.
  • Ordinal EXIF Tag Ranking: This task ranks ordinal EXIF tags (e.g., ISO speed, aperture) to capture fine-grained photographic information.
  • Fine-Grained Face Manipulation Detection: This task focuses on identifying specific manipulated regions within a face (e.g., eyes, mouth).
  • Outer Loop (Task Weighting): This loop dynamically adjusts the weights assigned to each of the pretext tasks in the inner loop. The goal is to prioritize those tasks that are most beneficial for the coarse-grained face manipulation detection proxy task, thereby aligning the self-supervised learning more closely with the ultimate objective of detecting AI-generated faces.

Once pretraining is complete, the vision encoder is frozen. AI-generated faces are then detected using either a Gaussian Mixture Model (GMM) fitted to the learned features of photographic faces (one-class anomaly detection) or a simple two-layer perceptron classifier (binary classification).

Datasets

  • Training (Self-Supervised Pretraining): A large dataset of 352,961 photographic face images with rich EXIF metadata was assembled from the FDF dataset.
  • Evaluation:
    • Synthetic Faces: Generated using nine state-of-the-art models: StyleGAN2, VQGAN, LDM, DDIM, Stable Diffusion 2.1 (SDv2.1), FreeDoM, HPS, Midjourney, and SDXL.
  • Test Face Photographs: Drawn from the CelebA-HQ and FFHQ datasets.

Key Insights and Ideas

  • Bi-level optimization for task alignment: The core idea of using a bi-level optimization to dynamically weight self-supervised tasks based on their relevance to a downstream proxy task is a powerful way to improve generalization.
  • Leveraging EXIF and manipulation cues: The paper demonstrates that combining EXIF metadata and face manipulation detection tasks provides complementary supervisory signals that are highly effective for distinguishing real from AI-generated faces.
  • Self-supervision without synthetic data: The ability to achieve state-of-the-art performance without ever training on AI-generated faces is a significant step towards more robust and adaptable detection systems.
  • Generalization across diverse generators: The method shows remarkable generalization capabilities, outperforming existing detectors on a wide range of GAN and diffusion models, including those not seen during training.
  • The importance of the "coarse-grained manipulation detection" proxy task: This task serves as a crucial bridge, allowing the model to learn features relevant to AI-generated faces without direct exposure.

Key Results

  • State-of-the-art performance: BLADES-BC (binary classification) achieved an average accuracy of 91.86% across nine generators, significantly outperforming competing detectors. BLADES-OC (one-class anomaly detection) also showed strong performance.
  • Strong cross-generator generalization: The method consistently outperformed prior approaches, even when tested on generators different from those used for training.
  • Robustness to JPEG compression: BLADES-BC showed better resilience to mild JPEG compression compared to FatFormer.
  • Computational efficiency: BLADES-BC is significantly more efficient than FatFormer, requiring fewer parameters, FLOPs, and faster inference times.
  • Ablation studies confirmed the importance of key components: Disabling focal weighting, pairwise ranking, or bi-level optimization led to performance drops, highlighting the effectiveness of the proposed design.

Limitations and Future Work

  • Limitations:
    • The paper notes that while BLADES-BC shows robust performance, accuracy drops under mild JPEG compression, indicating that further improvements in robustness to post-processing are desirable.
  • The authors acknowledge that the definition of "real face" can be complex in the context of image generation.
  • Future Work:
    • Generalization to natural scenes: Extending the bi-level optimization principles to detect forged content in broader natural scenes, which may involve subtler and less structurally constrained manipulations.
  • Enhanced robustness: Developing methods to reduce over-reliance on high-frequency cues and incorporating augmentation-aware pretext losses to improve resilience to benign post-processing like scaling and filtering.
  • Interpretability and decision-making: Integrating multimodal large language models to provide explanations for predictions, reason about imperceptible artifacts, and invoke external tools for validation, transforming the detector into a more transparent forensic assistant.

Summary updated

BibTeX
@inproceedings{zou2025bi,
  author = {Mian ZOU and Nan Zhong and Baosheng Yu and Yibing Zhan and Kede Ma},
  title = {{Bi-level optimization for self-supervised AI-generated face detection}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
  url = {https://openreview.net/forum?id=Wfk3poRBMm},
}
Figure