Unified Forensic Preference Learning for Generalizable Synthetic Image Detection

Laixin Zhang, Shuaibo Li, Wei Ma, Jianyu Lai, Lei Zhu, Hongbin ZhaNeurIPS 2026

TL;DR

AI-generated image detectors often fail in the real world because they memorize low-level pixel quirks of specific generators rather than understanding why an image makes no sense—like a penguin strolling through a hot desert. UniFPL solves this by distilling the rich, common-sense forensic reasoning of Multimodal Large Language Models (MLLMs) into a lightweight, fast CLIP-based detector using preference learning. The result is a detector that thinks like a detective, runs at the speed of a standard classifier, and generalizes remarkably well to unseen image generators.

What Problem Does This Paper Address?

Imagine training a neural network to spot fake images using only "Real" and "Fake" labels. Naturally, the network takes the path of least resistance: it latches onto subtle, generator-specific pixel patterns or frequency artifacts as shortcuts. The moment a new generative model hits the scene—or someone compresses the image on social media—those shortcuts vanish, and the detector breaks. Even worse, aggressive fine-tuning on binary labels causes "catastrophic forgetting," eroding the rich visual knowledge the backbone model (usually CLIP) had in the first place.

Furthermore, standard vision backbones recognize objects ("penguin," "desert"), but struggle with contextual plausibility ("wait, penguins don't live in hot deserts"). Multimodal Large Language Models (MLLMs) do understand these high-level semantic absurdities, but running massive MLLMs at inference time is slow, expensive, and surprisingly brittle for strict binary classification. The authors ask: How can we inject an MLLM’s contextual forensic intuition into a fast, stable discriminative detector without destroying its foundational visual knowledge?

Methods

UniFPL (Unified Forensics Preference Learning) bridges this gap in two stages: building a nuanced forensic dataset, and training a CLIP ViT-L/14 vision encoder (via LoRA) using a three-part objective.

Figure 1: Overview of Forensic Preference Data Construction. Guided by a shared Forensics Knowledge Base, the Controlled Artifact Branch constructs image-text candidates through image- conditioned planning and synthesis, while the Observed Artifact Branch harvests naturally occurring forensic traces from existing detection data. After image- and text-side filtering, adversarial MLLM rewarding evaluates and ranks the retained candidates according to their relative diagnostic value.

First, rather than just pairing images with generic text, the authors build a Forensics Knowledge Base (8 artifact families, 31 specific cues) to guide data creation across two branches:

  1. Controlled Artifact Synthesis: Taking real images, an MLLM plans plausible edits that introduce specific, verifiable forensic flaws, and an instruction-guided generator creates these counterfactual fakes.
  2. Observed Artifact Harvesting: An MLLM inspects existing synthetic datasets to mine naturally occurring generator flaws. After strict quality filtering, an adversarial panel of MLLMs (acting as Judge, Critic, and Verifier) scores and ranks how diagnostic each textual piece of evidence is for a given image, producing ~40K high-quality, list-level preference sets.
Overview of Unified Forensics Preference Learning

Second, during training, UniFPL optimizes the vision encoder using three coordinated losses:

  • Binary Authenticity Supervision (BAS): Standard cross-entropy loss with a linear classifier for crisp Real/Fake decisions.
  • Artifacts-aware Preference Alignment (APA): Inspired by Direct Preference Optimization (DPO), this aligns the detector's image-text similarity scores with the MLLM's soft, list-wise evidence rankings—teaching the encoder which forensic cues actually matter.
  • Semantic Structure Regularization (SSR): Region-level self-distillation against a frozen CLIP teacher to prevent catastrophic forgetting of general visual concepts.

Because these three objectives can pull the network's weights in conflicting directions, the authors use gradient-level coordination (normalizing gradients and finding a conflict-free common update direction) instead of manually tuning loss weights. At inference time, everything else is stripped away—leaving only the vision encoder and linear classifier.

Datasets

  • Training & Newly Constructed Data: Using the Stable Diffusion v1.4 subset of DRCT-2M as the source, the authors construct a new Forensic Preference Dataset (~40K filtered image-text candidate sets with calibrated MLLM preference rankings).
  • Evaluation: Tested across 11 diverse benchmarks spanning GANs, diffusion, autoregressive, and unknown commercial models:
  • Manually Curated (7): GenImage, DRCT-2M, Synthbuster, DDA-COCO, EvalGEN, AIGCDetection, and ForenSynths.
  • In-the-Wild (4): Chameleon, WildRF, SynthWildx, and BFree-Online (featuring social media compressions and highly realistic commercial fakes).

Key Insights and Ideas

  • Not all true descriptions are forensically useful: Simply matching an image of a penguin in a desert to the text "a penguin in a desert" via standard contrastive learning doesn't tell a detector how to judge authenticity. Ranking candidate explanations by their diagnostic value (preference learning) is what actually teaches forensic reasoning.
  • Soft list-wise beats pairwise: Ablations show that aligning against the complete, soft probability distribution of MLLM rewards (94.9% accuracy on GenImage) noticeably outperforms standard pairwise DPO-style comparisons (92.2%) or hard rankings (93.4%), because forensic evidence often comes in shades of gray.
  • Gradient surgery matters: Balancing classification, alignment, and distillation with fixed weights yields 92.4% accuracy, whereas resolving directional conflicts directly at the gradient level jumps performance to 94.9%.

Key Results

Across all 11 benchmarks, UniFPL achieves a state-of-the-art 93.4% average balanced accuracy, outperforming the strongest baseline, DDA (90.7%), by 2.7 percentage points.

Table 1: Overall comparison across 11 benchmarks. We report balanced accuracy (%) across all benchmarks except EvalGEN, which contains only synthetic images and is evaluated using synthetic- image detection accuracy. For datasets with multiple generators, results are reported as mean ± standard deviation. We follow the same evaluation protocol as DDA [8] and adopt its reported baseline results. The best and second-best results are marked in bold and underline, respectively.
  • Raising the floor: Perhaps more impressively, UniFPL boosts worst-case (minimum) accuracy across all benchmarks from 81.4% to 86.1%. That 86.1% occurs on Chameleon—a notoriously difficult in-the-wild dataset designed to fool detectors—beating DDA by 3.7 percentage points.
  • Robustness: When subjected to heavy JPEG compression, resizing, and Gaussian blurring on GenImage, UniFPL maintains stable, top-tier accuracy while competing methods degrade sharply.

Limitations and Future Work

There is no free lunch: while UniFPL is lightweight and fast at inference time, its offline data preparation pipeline is computationally heavy. Generating counterfactual images, running multi-stage filtering, and querying an adversarial pool of MLLMs to score candidates makes scaling the training dataset expensive. Future work will focus on streamlining this preference construction pipeline to make harvesting MLLM forensic knowledge cheaper and more scalable.

Summary updated

Abstract

Despite rapid progress in synthetic image detection, detectors that perform well on known generators often become brittle when the source model, post-processing pipeline, or scene composition changes. A key reason is that standard binary supervision teaches models to separate training distributions rather than to identify authenticity-relevant evidence: low-level artifacts become shortcuts, while higher-level semantic implausibilities remain weakly grounded. To address this limitation, we propose **UniFPL**, a unified forensics preference learning framework that converts multimodal large language model (MLLM) forensic knowledge into image-specific preference supervision. UniFPL constructs forensic preference data from both controlled artifact synthesis and observed artifact harvesting, then learns from list-level evidence rankings that encode which visual-textual cues are more diagnostic of synthetic manipulation. On top of a CLIP-based discriminative detector, UniFPL jointly optimizes authenticity classification, artifacts-aware preference alignment, and semantic structure regularization, allowing the model to inherit contextual forensic reasoning while retaining the stable and efficient inference of a discriminative encoder. Across eleven curated and in-the-wild benchmarks, UniFPL achieves an average balanced accuracy of 93.4\% and improves the worst-case accuracy from 81.4\% to 86.1\% over the strongest baseline, demonstrating stronger cross-generator generalization and robustness to real-world image degradations.
BibTeX
@inproceedings{zhang2026unified,
  author = {Laixin Zhang and Shuaibo Li and Wei Ma and Jianyu Lai and Lei Zhu and Hongbin Zha},
  title = {{Unified Forensic Preference Learning for Generalizable Synthetic Image Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=fGUaeL5g1k},
}
Figure