FiSeR: Fine-Grained Source Representations for Cross-Domain AI Image Detection
Abstract
Real-world synthetic image detectors often generalize poorly under domain shift despite strong in-domain performance. Using unsupervised UMAP projections, we find that natural and synthetic features remain partially separable on unseen datasets, yet performance still drops, suggesting that the classification head overfits to training-domain artifacts. Therefore, the key is to learn more transferable representations so that the decision criterion is more stable and robust to domain shifts. Based on the structural fact that synthetic images are produced by diverse generators, we propose a hierarchical contrastive learning framework that improves the separability between natural and synthetic images while preserving generator identity information. It jointly optimizes (i) a coarse contrastive objective between natural and synthetic images and (ii) a fine contrastive objective among synthetic images using generator identities. Trained on WildFake, our method achieves an average AUROC gain of +10.22 on cross-domain evaluation over Chameleon, AIGIBench, Community Forensics, and GenImage under the same settings as the strong baseline DIRE. For few-shot adaptation, we freeze the backbone and fit an SVM head on 10 labeled samples per class, improving AUROC by +10.64 on AIGIBench and +17.41 on Chameleon, averaged over 12 widely used detectors. Our code is publicly available at: https://github.com/heyongxin233/FiSeR.
Lay Summary
AI tools can now create images that look very real, so it is becoming harder to know whether an image was taken by a camera or made by AI. A detector is a tool that tries to answer this question by checking an image and deciding whether it is real or AI-generated. Many current detectors work well on familiar images, but they often make mistakes when they see images from new websites, cameras, or AI tools. We found that this does not mean real and AI-generated images are impossible to tell apart. Instead, many detectors seem to rely on small clues that are useful for the images they learned from, but do not hold up well in new situations. We built a new way to train detectors so that they learn more reliable clues. Rather than only teaching a detector to answer “real” or “AI-generated,” we also teach it to notice that different AI tools leave different kinds of traces. This helps the detector work better on new image collections and adapt to new settings with only a few examples.