                                Few-Shot Learner Generalizes Across AI-Generated Image Detection




           (a) Test on Midjourney                           (b) Test on GLIDE                                (c) Test on ADM




        (d) Test on Stable Diffusion                        (e) Test on VQDM                               (f) Test on BigGAN

Figure 4. Visualization of network features for different classifiers over different classes using t-SNE. Each classifier is trained on those
subsets excluding the test one in each sub-figure. The features are extracted from the final layer of our model.

distinct categories, which has not been fully explored in                tifiable, which demonstrates that our method successfully
previous research. Moreover, it is essential to collect im-              captures the intra-category features of unseen data.
ages from representative generative models for training, as
                                                                         The results also support the validity of our approach that
generalization on similar generators is easier than on those
                                                                         categorizes samples from different generators as different
that are vastly different.
                                                                         classes. However, such categorization also introduces the
                                                                         issue of eliminating the significant differences between seen
4.5. Visualization                                                       data and unseen data. As illustrated in Figure 4(e), the
To further analyze the effectiveness of FSD, we utilize t-               distribution of the VQDM class in orange exhibits a large
SNE (van der Maaten & Hinton, 2008) visualization to                     overlap with that of the real class in gray, due to VQDM’s
illustrate the feature space of classifiers on different training        significant differences in image tokenization compared to
sets, as shown in Figure 4. Each classifier is trained on                other models. This also indicates that our method still faces
those subsets excluding the test one in each sub-figure. We              the challenge of detecting images from models that are
randomly selected 1024 samples from the test part of each                significantly different from those generative models used in
class for visualization. The features are extracted from the             training, which will be the main focus of our future work.
final layer of our model.
                                                                         4.6. Ablation Study
From Figure 4, we can see that features of images from
different generative models exhibit distinct distributions,              Impact of the number of shots. An important aspect is to
each of which is marked by a unique color. Most classes                  determine the minimum number of samples required by our
within the training set can be well-separated due to the large           approach to achieve satisfactory performance. We choose
margins among their distributions. However, the bound-                   different numbers of support samples in each class, ranging
ary of the Midjourney class represented in red is not as                 from 1 to 200. To present a comprehensive overview of this
clear as that of the others. This can be attributed to its API           aspect, we conduct the experiment across all the 6 classifiers
service, which may utilize multiple generative models for                described in Section 4.4. We evaluate each classifier on the
image generation as inferred from our analysis. Although                 corresponding test class with varying numbers of support
the boundary of the test class in each sub-figure is a little            samples. To maintain a consistent total number of test sam-
ambiguous, the distribution of this class still remains iden-            ples across different settings, we set a fixed ratio of 1 : 3


                                                                     7
