                                Few-Shot Learner Generalizes Across AI-Generated Image Detection


Table 2. Results of 10-shot cross-generator image classification on different subsets. Each classifier is trained on the dataset excluding the
subset from the first column. All classifiers are tested on the 6 synthetic classes, reporting accuracy/average precision (%).

                                                                           Test Subset
            Excluding Subset
                                    Midjourney        GLIDE            ADM             SD             VQDM            BigGAN
               Midjourney           80.9 / 84.6      99.9 / 99.9     98.5 / 99.3 97.1 / 98.7         99.5 / 99.9     88.0 / 92.9
                GLIDE               86.8 / 89.9      97.1 / 98.0     97.9 / 98.9 97.1 / 98.8         99.2 / 99.7     91.9 / 97.1
                 ADM                87.6 / 91.8      99.8 / 99.9     79.2 / 83.8 94.8 / 97.2         98.8 / 99.4     91.0 / 96.1
                  SD                86.1 / 89.7      99.9 / 99.9     97.4 / 98.8 88.8 / 92.5         96.6 / 98.5     89.5 / 95.4
                VQDM                82.4 / 85.9      99.9 / 99.9     97.3 / 98.6 95.6 / 98.0         76.2 / 79.4     83.5 / 89.1
                BigGAN              88.9 / 91.6      99.9 / 99.9     98.3 / 99.3 98.1 / 99.3         96.4 / 98.3     82.2 / 86.8

The compared group includes CNNSpot (Wang et al., 2020),                  ability to capture not only the intra-class characteristics but
Spec (Zhang et al., 2019b), F3Net (Qian et al., 2020), Gram-              also the common features across all classes. Another ob-
Net (Liu et al., 2020), DIRE (Wang et al., 2023) and LARE2                servation is that the discrepancy between zero-shot results
(Luo et al., 2024). The first four methods are model-agnostic,            and few-shot results remains notable, which indicates the
focusing on identifying synthetic artifacts within fake im-               necessity of gathering training data from a wider range of
ages. The last two methods leverage the reconstruction error              generative models.
of Stable Diffusion to differentiate between fake and real
images. To conduct a comprehensive comparison, we train 6                 4.4. Cross-generator Classification
classifiers on different training sets, each of which excludes
a specific test subset. However, previous studies typically               We evaluate the 10-shot performance of FSD on both seen
provide several classifiers, and each classifier is trained on            classes and unseen classes. We also train 6 classifiers for
one distinct subset and evaluated on the others. To mini-                 the cross-generator image classification task, in which each
mize the difference between our method and previous works,                classifier is trained on 6 out of 7 subsets in the dataset and
we report the average performance of 5 classifiers trained                subsequently tested on the remaining one. We report the
on non-test categories and evaluated on each test subset,                 accuracy and average precision across each scenario and
which can better represent their generalization ability on                summarize the results in Table 2.
each class.                                                               As shown in Table 2, each row presents the classification
As illustrated in Table 1, our FSD attains state-of-the-art               results for one classifier across all the 6 synthetic classes.
performance across 5 out of the 6 test classes, surpassing                The results show that it is easy for a classifier to detect
previous state-of-the-art by +11.6% accuracy on average.                  fake images from those classes encountered during training,
The suboptimal performance of our model on the VQDM                       which is consistent with the previous studies (Zhu et al.,
class can be attributed to the involvement of image quanti-               2023; Luo et al., 2024). When it comes to detecting the
zation in VQDM, which significantly differs from the other                unseen classes, as shown in the diagonal of Table 2, FSD
generative models in our experiments. Another reason is that              suffers from a slight decline in performance, demonstrating
LARE2 is specifically designed to detect synthetic images                 the generalization capability of our model. Another finding
generated by diffusion models, which enables it to achieve                is that FSD performs nearly perfectly on the VQDM class
unexpectedly high performance on the VQDM class. Al-                      when this class is included in the training set. However,
though our few-shot method may not be directly comparable                 the performance significantly declines when this class has
to other approaches due to accessing only a few samples                   been excluded. This fact shows that it is still challenging to
in the test class, we still regard this discrepancy as a signif-          generalize across vastly different unseen generative models,
icant strength of our model. The definite improvement in                  indicating that our approach remains inadequate in capturing
performance demonstrates FSD’s capability to effectively                  the discriminative features between classes.
leverage a limited number of unseen samples.                              We also observe the varying performance of FSD across
Based on Table 1, we find that FSD achieves notable per-                  different classes. For instance, images generated by GLIDE,
formance in zero-shot scenarios, in which the prototypical                ADM, SD and VQDM are relatively easy to detect by our
representations are calculated from samples in the training               model when these classes are included in the training set,
classes. These results show that our approach is also suitable            while those from Midjourney and BigGAN are a little chal-
for detecting synthetic images even when samples from the                 lenging to identify. Particularly, images from the GLIDE
same sources are not provided, thus broadening the appli-                 class can be distinguished with exceptional accuracy, even
cation scope of FSD. We attribute this advantage to FSD’s                 when not included in the training set. These facts indicate
                                                                          the necessity of treating images from different sources as

                                                                      6
