Source-linked AI summary

Dual Data Alignment Makes AI-Generated Image Detector Easier Generalizable

Ruoxin Chen, Junwei Xi, Zhiyuan Yan, Ke-Yue Zhang, Shuang Wu, Jingyi Xie, Xu Chen, Lei Xu, Isabel Guan, Taiping Yao, Shouhong Ding

arXiv:2505.14359v6cs.CV

TL;DR

AIGI detectors can overfit non-causal image attributes because existing datasets contain systematic biases, while pixel-level reconstruction leaves frequency misalignment. The paper proposes Dual Data Alignment to align both domains, introduces DDA-COCO and EvalGEN, and reports consistent gains across diverse benchmarks. These results support training on carefully aligned data to improve detector generalizability, though real-world post-processing remains a challenge.

  • Problem

    Existing AIGI detector datasets contain systematic discrepancies that can encourage reliance on non-causal cues, while pixel-level alignment may leave frequency-level misalignment.

  • Method

    Dual Data Alignment combines VAE reconstruction, high-frequency fusion, and pixel mixup to align synthetic and real images across pixel and frequency domains.

  • Results

    DDA consistently outperforms other methods across 11 benchmarks, achieving 90.7% average accuracy and a 15.7% improvement over the second-best method.

  • Takeaways & Limitations

    Training on DDA-aligned data improves cross-dataset and cross-model generalization, while DDA-COCO and EvalGEN provide aligned-data and newer-generator evaluation settings.

  • Takeaways & Limitations

    Real-world application remains constrained by heavy image post-processing, including AI-based enhancements in smartphone camera pipelines.

Abstract

from arXiv · show

Existing detectors are often trained on biased datasets, leading to the possibility of overfitting on non-causal image attributes that are spuriously correlated with real/synthetic labels. While these biased features enhance performance on the training data, they result in substantial performance degradation when applied to unbiased datasets. One common solution is to perform dataset alignment through generative reconstruction, matching the semantic content between real and synthetic images. However, we revisit this approach and show that pixel-level alignment alone is insufficient. The reconstructed images still suffer from frequency-level misalignment, which can perpetuate spurious correlations. To illustrate, we observe that reconstruction models tend to restore the high-frequency details lost in real images (possibly due to JPEG compression), inadvertently creating a frequency-level misalignment, where synthetic images appear to have richer high-frequency content than real ones. This misalignment leads to models associating high-frequency features with synthetic labels, further reinforcing biased cues. To resolve this, we propose Dual Data Alignment (DDA), which aligns both the pixel and frequency domains. Moreover, we introduce two new test sets: DDA-COCO, containing DDA-aligned synthetic images for testing detector performance on the most aligned dataset, and EvalGEN, featuring the latest generative models for assessing detectors under new generative architectures such as visual auto-regressive generators. Finally, our extensive evaluations demonstrate that a detector trained exclusively on DDA-aligned MSCOCO could improve across 8 diverse benchmarks by a non-trivial margin, showing a +7.2% on in-the-wild benchmarks, highlighting the improved generalizability of unbiased detectors. Our code is available at: https://github.com/roy-ch/Dual-Data-Alignment.

1 Introduction

Dataset biases can make detectors rely on non-causal image attributes rather than authenticity-related cues. The paper argues that pixel alignment alone leaves frequency misalignment and proposes DDA plus two evaluation datasets to improve generalization.

  • 1 Introduction: Dataset discrepancies in format, content, and size can cause detectors to learn non-causal features that fail to generalize across datasets.Examples include JPEG format, image size, and semantic composition differences between real and synthetic images.
  • 1 Introduction: Pixel-level reconstruction does not fully eliminate bias because reconstructed images can retain or amplify frequency differences.High-frequency details diminished in real images, often through JPEG compression, may be restored in synthetic counterparts.
  • 1 Introduction: DDA aligns synthetic and real images across pixel and frequency domains to reduce spurious detector cues.Its three steps are VAE reconstruction, high-frequency fusion, and pixel mixup.
  • 1 Introduction: +11.4% on Chameleon, +26.6% on BFree-Online, and +19.4% on EvalGEN are reported improvements for a model trained on DDA-aligned MSCOCO.The model also showed lower fluctuations across subsets, usually about half those of baselines.
  • 1 Introduction: DDA-COCO tests detectors on real MSCOCO images and DDA-aligned counterparts, while EvalGEN evaluates generalization to newer generative models.EvalGEN includes FLUX, GoT, Infinity, NOVA, and OmniGen, spanning auto-regressive and diffusion generators.

2 Related Works

Prior AIGI detection work studies generalization through model architectures, preprocessing, semantic concepts, and frequency artifacts. Dataset-alignment methods reduce content and style biases, motivating further alignment of real and synthetic training data.

  • 2 Related Works: AIGI detectors have explored CNNs, CLIP backbones, concept injection, model architectures, preprocessing, and frequency-domain artifacts.These approaches target detection and generalization to unseen generators through different representations and model designs.
  • 2 Related Works: Dataset-alignment research addresses evaluation and training bias by matching synthetic images with real images in content, style, or semantic structure.FakeInversion reduces thematic and stylistic bias, while later work explores bias-reduced training data.

3 Methodology

The paper identifies frequency-level bias that persists after pixel-level reconstruction and proposes Dual Data Alignment (DDA) to align synthetic and real images in both domains.

  • Motivation and Analysis: Misaligned training datasets can make detectors associate non-causal attributes with authenticity, hindering generalization.Spurious signals may be more salient than genuine real–synthetic artifacts.
  • Motivation and Analysis: 93% detection of visually identical VAE reconstructions, followed by a sharp drop after high-frequency masking, indicates exploitable frequency bias.The bias is attributed to richer high-frequency details in synthetic images because real images undergo JPEG compression.
  • Dual Data Alignment: DDA combines VAE reconstruction, high-frequency fusion, and pixel-level mixup to align synthetic images with real ones across frequency and pixel domains.The method applies equivalent JPEG compression to real images and their reconstructions before mixup.
  • Dual Data Alignment: DDA’s generalizability is motivated by VAE artifacts that are close to real images and may remain effective for distinguishing more distant synthetic variants.The paper presents this as one foundation for DDA’s generalizability rather than as a universal guarantee.
  • Dual Data Alignment: DDA-aligned images achieve the closest similarity to real images across pixel, frequency, and feature domains among the compared alignment methods.The comparisons use MSE, frequency-space error, and t-SNE cluster-center proximity.

4 Experiments

Experiments evaluate DDA across diverse benchmarks, proposed test sets, robustness conditions, ablations, and generation cost. DDA shows strong cross-dataset performance, robustness, and efficiency, with a noted exception on ForenSynths.

  • Overall comparison: DDA achieves 90.7% average accuracy across 11 benchmarks, improving 15.7% over the second-best method.It also reaches 81.4% minimal accuracy and has the smallest cross-benchmark deviation.
  • Detailed comparisons: DDA surpasses other detectors by 3% to 10% in average accuracy across seven detailed benchmarks while showing lower deviations.The evaluations include diverse real-image sources and both GAN- and diffusion-based generators.
  • Detailed comparisons: DDA underperforms slightly on ForenSynths, where competing methods benefit from training on the same ProGAN generator and older-model samples differ from modern generators.This benchmark-specific result contrasts with DDA’s broader cross-benchmark superiority.
  • DDA-COCO and EvalGEN: DDA generalizes across diffusion models, performs strongly on emerging auto-regressive generators, and exposes accuracy disparities caused by missing alignment on DDA-COCO.DDA is trained solely on SD 2.1-reconstructed data and achieves state-of-the-art performance on EvalGEN.
  • Generation cost: DDA requires the least training data and reconstruction time among the compared data-generation methods.The comparison includes DRCT, AlignedForensics, and B-Free.
  • Robustness evaluation: DDA outperforms the second-best method by 10.5%, 4.1%, and 5.7% under JPEG 60, RESIZE 2.0, and BLUR 2.0, respectively.Alignment-based methods are more robust than frequency-based methods lacking alignment.
  • Ablation studies: Detector accuracy remains consistent when Ppixel and Rpixel range from 0.2 to 0.8, drops at 0.0 and 1.0, and is strongest with SD21.The ablation varies pixel-alignment probabilities, pixel-mixup ratios, and reconstruction VAEs.

5 Conclusion

The paper concludes that pixel-domain alignment alone does not fully align real and synthetic images, motivating DDA’s joint pixel- and frequency-domain alignment. It also introduces DDA-COCO and EvalGEN, while noting a remaining gap in heavily post-processed real-world imagery.

  • Pixel-domain alignment alone is insufficient for fully aligning real and synthetic image pairs.
  • DDA aligns synthetic and real images across pixel and frequency domains to mitigate bias.
  • DDA-COCO and EvalGEN are introduced as two AIGI detection benchmarks.
  • DDA’s application to real-world scenarios remains limited by heavy image post-processing, including AI-based smartphone camera enhancements.

A Implementation Details

The detector was trained on MSCOCO images and DDA-aligned synthetic counterparts using Stable Diffusion 2.1’s VAE. Training used gradient accumulation to reach an effective batch size of 64 within GPU memory limits.

  • Training paired MSCOCO images with synthetic counterparts generated through DDA alignment using Stable Diffusion 2.1’s VAE.
  • The model used a base batch size of 16 and a learning rate of 1e-4.
  • Four-step gradient accumulation produced an effective batch size of 64 without exceeding GPU memory limits.
  • Experiments were conducted on eight NVIDIA V100 GPUs, with balanced accuracy evaluated.

B Peer Methods

The paper compares frequency-based, CLIP-based, reconstruction-based, and aligned-forensics detectors, alongside visualizations of how alignment affects real–synthetic separation.

  • Frequency-based methods: NPR uses neighboring-pixel relationships and trains ResNet-50 to identify upsampling patterns.
  • CLIP-based methods: UnivFD combines CLIP-ViT features with a linear classifier to reduce overfitting to specific generative artifacts.
  • CLIP-based methods: FatFormer adapts ViT features in image and frequency domains and uses language-guided contrastive alignment.
  • Frequency-based methods: SAFE detects frequency-domain artifacts with a ResNet backbone and augmentation including random masking.
  • CLIP-based methods: C2P-CLIP trains CLIP image encoders with category-specific caption-image contrastive learning for deepfake detection.
  • Hybrid methods: AIDE fuses DCT-selected frequency patches and SRM noise patterns with CLIP semantic features.
  • Alignment methods: DRCT reconstructs real images with diffusion models to create challenging synthetic samples and uses contrastive learning to target generation fingerprints.
  • Alignment methods: AlignedForensics reconstructs real images through an LDM autoencoder to focus detection on VAE-decoder artifacts.

C More Comparison Results

Stronger dataset alignment produces more separable real and synthetic feature distributions, suggesting clearer detector decision boundaries.

  • Detectors trained on progressively better-aligned datasets yield more separable real and synthetic feature distributions.The visualizations suggest that enhanced alignment facilitates clearer decision boundaries between real and synthetic images.

D More Ablation Results

The ablations examine input size, backbone architecture, and training strategy. Performance remains comparable across tested input sizes, while backbone behavior reflects differences in feature emphasis and training stability.

  • Ablation on Input Size: Detectors achieve comparable accuracies across input sizes ranging from 224 to 504.
  • Ablation on Backbone: ResNet is excluded because of training instability and failure to converge.
  • Ablation on Backbone: Linear probing performs relatively poorly because a single linear layer has limited representational capacity.
  • Ablation on Backbone: DINO is more attuned to low-level visual patterns, which are more indicative of AI-generated image artifacts than the high-level semantic features emphasized by CLIP.
  • Ablation on Backbone: DINO-LoRA achieves a lower standard deviation, indicating greater stability for robust AGI detection.

E More Details of EvalGEN

EvalGEN uses diverse prompts to generate synthetic images from multiple generators, with a standardized JPEG format and a defined quantitative-evaluation subset.

  • EvalGEN uses 553 distinct prompts, generating 20 synthetic images per generator and 11,060 images per generator.The complete dataset contains 55,300 synthetic images across the generators.
  • All EvalGEN images are stored in JPEG format with a quality factor of 96.
  • For quantitative comparisons in Tables 2 and 10, the first image for each prompt is selected, yielding 2,765 samples.This subset is calculated as 55,300 / 20.

F Regional Detection Analysis

Regional detection analysis visualizes prediction scores across image regions and compares examples drawn from multiple synthetic-image datasets.

  • Detection-score heatmaps across segmented image regions show that synthetic artifacts are spatially uneven.Numerical overlays indicate the detector’s predictions for each region.
  • The regional variation suggests that localized detection strategies could further enhance robustness.
  • Figure 12 provides visual examples from EvalGEN.
  • Patch-level results include images from Synthbuster, Chameleon, ForenSynths, SynthWildx, AIGCDetectionBenchmark, WildRF, and EvalGEN.

NeurIPS Paper Checklist

The checklist asks whether the paper’s claims, experiments, limitations, ethics, reproducibility, access, statistical reporting, and computational requirements are adequately documented.

  • The checklist requires the abstract and introduction to state claims and contributions that match the theoretical and experimental results and their expected generality.
  • The paper should discuss limitations, strong assumptions, robustness to assumption violations, and practical implications.
  • The checklist separately asks whether theoretical results provide complete assumptions and correct proofs, and whether the research conforms to the NeurIPS Code of Ethics.
  • Experimental reproducibility requires sufficient information about datasets, models, code or access, training and test details, and computational resources.
  • The checklist asks whether experiments report appropriate error bars, confidence intervals, or statistical significance information, with variability factors clearly specified.
Loading 2505.14359v6…