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.
