Table of Contents
Fetching ...

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

TL;DR

The paper targets the generalization gap in AIGI detectors caused by dataset biases that spuriously correlate with authenticity. It introduces Dual Data Alignment (DDA), a three-step pipeline that achieves pixel-level alignment via VAE reconstruction, frequency-level alignment through JPEG-based matching, and pixel-level mixup to tightly couple synthetic and real images in both domains, with the synthetic sample expressed as $x_{mix} = r_{pixel} x_{real} + (1 - r_{pixel}) x_{syn}$ where $r_{pixel} \sim \mathcal{U}(0, R_{pixel})$. It also presents two benchmarks, DDA-COCO and EvalGEN, to evaluate detectors under aligned data and across recent generative architectures. Across eleven benchmarks, a detector trained on DDA-aligned MSCOCO achieves substantial gains and improved robustness, including notable improvements on in-the-wild datasets, demonstrating stronger generalization to unseen generators. The work highlights frequency-level misalignment as a key leakage path and argues that dual-domain alignment mitigates reliance on non-causal cues, offering practical implications for building unbiased, generalizable AIGI detectors.

Abstract

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.

Dual Data Alignment Makes AI-Generated Image Detector Easier Generalizable

TL;DR

The paper targets the generalization gap in AIGI detectors caused by dataset biases that spuriously correlate with authenticity. It introduces Dual Data Alignment (DDA), a three-step pipeline that achieves pixel-level alignment via VAE reconstruction, frequency-level alignment through JPEG-based matching, and pixel-level mixup to tightly couple synthetic and real images in both domains, with the synthetic sample expressed as where . It also presents two benchmarks, DDA-COCO and EvalGEN, to evaluate detectors under aligned data and across recent generative architectures. Across eleven benchmarks, a detector trained on DDA-aligned MSCOCO achieves substantial gains and improved robustness, including notable improvements on in-the-wild datasets, demonstrating stronger generalization to unseen generators. The work highlights frequency-level misalignment as a key leakage path and argues that dual-domain alignment mitigates reliance on non-causal cues, offering practical implications for building unbiased, generalizable AIGI detectors.

Abstract

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.

Paper Structure

This paper contains 46 sections, 3 equations, 13 figures, 13 tables.

Figures (13)

  • Figure 1: Illustration of dataset bias. Top row: Real/synthetic images show disparities in format, content, and size. Real images are typically in JPEG, with varying sizes and centered semantics. Bottom row: Detectors trained on datasets containing these discrepancies are prone to learning biased features, incorrectly associating authenticity with format, image size, or semantics.
  • Figure 2: Overall comparison between detection methods on 11 benchmarks. Our model is exclusively trained on DDA-aligned MSCOCO data. The consistent outperformance of DDA on 4 in-the-wild (Chameleon, WildRF, BFree-Online and SynthWildx) and 7 manually-crafted benchmarks validates the generalizability. Detailed results are provided in Section \ref{['sec:experiments']}.
  • Figure 3: Visual illustration of how dataset bias affects decision boundaries. Left three panels: Detectors trained on biased data—where synthetic images (e.g., Syn.1–3) differ from real images in format, content, or resolution—tend to learn spurious decision boundaries. Right: When synthetic images are carefully aligned with real images across multiple aspects, the model can learn a tighter decision boundary that more accurately encompasses the real data.
  • Figure 4: Visualization of frequency domain energy using 2D DCT. The left column shows a real image, while the remaining columns display images reconstructed by VAEs from various Stable Diffusion models. The grids represent frequency components, with the top-left and bottom-right indicating low- and high-frequency regions, respectively. Lighter areas correspond to higher energy. Real images in JPEG format exhibit darker high-frequency regions compared to VAE reconstructions, indicating weaker high-frequency content in real images.
  • Figure 5: Evidence for the existence of biased frequency-based features to discriminate reconstructed images. We apply a binary mask to the DCT coefficients, systematically nullifying high-frequency components where either the horizontal or vertical frequencies exceed 95%, 90%, 85% and 80% of their respective spectral ranges to generate High-Freq. Masked VAE Rec.
  • ...and 8 more figures