                                 Few-Shot Learner Generalizes Across AI-Generated Image Detection

                                                                                                                  Prototypical
                                                                                     1024-dim Features           Representation

                                                                                                          Compute
                 Fake Samples


                                                      Prototypical
                                                                                                          Compute
                                                        Network
                 Real Samples
                                                                                                          Nearest
                                                                                                          Neighbor
                                                                                                                                  Real
                                                                                                                                  Fake
                  Test Samples


Figure 2. Detection pipeline of Few-Shot Detector. FSD first maps the real and fake images from the support set to the metric space by
the Prototypical Network and calculates the representation of each type. A test image is then mapped into the same space and classified
according to the nearest-neighbor principle.

(Zhang et al., 2019b; Qian et al., 2020; Chai et al., 2020).             BLIP (Li et al., 2022) to obtain a text description of the
They treat synthetic image detection as a binary classifica-             image for better reconstruction, which is capable of detect-
tion task, aiming to find synthetic clues in generated images.           ing unseen high-fidelity generated images. AEROBLADE
Numerous studies (Zhang et al., 2019a; Gragnaniello et al.,              (Ricker et al., 2024) evaluates autoencoder (AE) in different
2021) have found that classifiers often fail to generalize               latent diffusion models and presents a training-free method
across unseen generative models, bringing generalization                 for detecting fake images based on AE reconstruction errors.
ability to the primary research objective. Wang et al. (2020)            Although these approaches have achieved great success on
reveal that detectors for CNN-generated images can be sur-               open-source generative models, they still face challenges in
prisingly generalizable due to the common systematic flaws               detecting synthetic images from various inaccessible models
shared among CNNs. Based on this work, Liu et al. (2023)                 due to the substantial differences among them.
analyze multi-view features to learn a robust representation,
while Tan et al. (2024b) focus on high-frequency informa-                3. Method
tion to capture source-agnostic features.
                                                                         In this section, we first describe the few-shot classification
However, these common cues disappear when it comes to
                                                                         task for synthetic image detection. Then we elaborate on
diffusion models, leading to the poor performance of earlier
                                                                         our novel representation, namely Few-Shot Detector (FSD),
methods when applied to them. Therefore, more attention
                                                                         as illustrated in Figure 2.
has been paid to semantic level. For instance, Ojha et al.
(2023) prove that the informative image features from a
pretrained CLIP model (Radford et al., 2021) can be suc-                 3.1. Few-shot Synthetic Image Detection
cessfully used for detecting fake images. Other studies                  Few-shot classification is a specialized machine learning
(Liu et al., 2024; Tan et al., 2024a) deeply integrate tex-              task, where the classifier is challenged to generalize to en-
tual information with images, thereby further enhancing the              tirely new classes not present in the training set, using only
generalization capability. Moreover, a patch-based detec-                a limited number of examples from these novel classes. Dif-
tion method (Chen et al., 2024) extracts features from a                 ferent from end-to-end detection methods that aggregate
single patch rather than the entire image, which significantly           all synthetic images produced by different generative mod-
accelerates the detection speed.                                         els into a single fake class, we classify these images based
Diffusion-based detection method. The reconstruction                     on their generators. This means that we consider the pro-
capability of open-source diffusion models has opened a                  ductions of each model as an individual class. Conversely,
new technological pathway. DIRE (Wang et al., 2023) first                authentic images continue to be grouped into a single class.
uses the reconstruction loss to train a classifier, based on the         During detection, the support set comprises labeled images
observation that synthetic images can be reconstructed with              aiding in the classification task, while the query set contains
higher fidelity compared to real ones. SeDID (Ma et al.,                 unlabeled images to be classified. The objective of this task
2023) analyzes the loss errors between noised and denoised               is to determine the category of each image in the query set
features at specific steps of processing, while LARE2 (Luo               based on the support set.
et al., 2024) focuses on the single-step reconstruction re-              In detail, we are given a support set S = S1 ∪ S2 ∪ · · · ∪ SN ,
sult in latent space. Both of them improve the detection                 which comprises samples from N new classes. Each subset
speed by not fully completing the entire reconstruction pro-             Si = {(xi1 , yi1 ), (xi2 , yi2 ), . . . , (xiK , yiK )} denotes the
cess. FakeInversion (Cazenavette et al., 2024) employs                   collection of images from class i. K is the number of sam-


                                                                     3
