Skip to content

Few-Shot Synthetic Image Attribution: Identifying Unseen Generators with Limited Samples

Conference: ECCV 2026
arXiv: 2509.25682
Code: https://github.com/teheperinko541/OmniDFA
Area: Image Generation
Keywords: Synthetic Image Attribution, Few-Shot Learning, Contrastive Learning, AI-Generated Image Detection, Open-Set Classification

TL;DR

This paper defines a brand-new task of "few-shot synthetic image attribution"—identifying unseen image generators with only 10 reference images per class. It introduces the OmniFake dataset containing 45 independent generators (excluding PEFT variants) and a dual-path contrastive learning baseline OmniDFA, which significantly outperforms prior methods in both attribution and detection.

Background & Motivation

AI-generated images (AIGIs) have passed the stage of "whether real or fake can be distinguished." The more pressing question now is: given a fake image, can its specific generator be identified? This is crucial for public opinion tracking, model vulnerability analysis, and forensics. Existing image attribution methods can be largely categorized into two paths: closed-set methods (e.g., DNA-Det, CPL) that can only identify generators seen during training and require retraining upon encountering new generators; and open-set methods that classify all unseen generators into a single "unknown" class—essentially solving "whether it is recognized" rather than "who did it." With new models like Midjourney V6, FLUX, Janus-Pro, and Hunyuan-DiT emerging rapidly, both paradigms are unsustainable in practical deployment: retraining the entire network every time a new model appears is neither realistic nor economical.

The key challenge is: attribution requires distinguishing much finer-grained category boundaries than simple "real/fake" detection. Each generator possesses unique artifact patterns, but new generators emerge constantly, making exhaustive training impossible. The ideal capability is to provide the model with a few sample images from a new generator, enabling it to rapidly locate the generator's features during testing and identify similar images without retraining. This is exactly where few-shot learning shines. However, existing AIGI datasets either contain too few categories (e.g., GenImage has only 8 classes, including homogenized variants) or prioritize detection over attribution, lacking labeled resources with structurally distinct categories designed specifically for multi-class attribution.

Core Idea: Reformulate synthetic image attribution as an open-set N-way K-shot few-shot classification problem. Train the model using supervised contrastive learning to pull features of the same generator closer and center loss to constrain real images into a tight cluster. During testing, identify unseen generators using only 10 support samples per category.

Method

Overall Architecture

The pipeline of OmniDFA consists of two phases. During the training phase, each input image passes through a dual-path encoder (low-level local cropping + high-level global resizing) to extract complementary features. These features are concatenated and projected by an MLP into a 128-dimensional normalized embedding, optimized jointly under a supervised contrastive loss and a spherical center loss. The contrastive loss pulls embeddings of the same generator closer while pushing different ones apart, while the center loss specifically aggregates real images toward a learnable spherical center. In the testing phase, attribution is performed via prototype classification: prototype centers for each class are computed from K support samples across N unseen generators, and query samples are attributed based on the minimum distance to each prototype. Detection is determined via an adaptive angular boundary based on Tukey's method with momentum update—images falling inside the boundary of the real center are classified as real, and those outside are classified as fake.

%%{init: {'flowchart': {'rankSpacing': 24, 'nodeSpacing': 28, 'padding': 6, 'wrappingWidth': 400}}}%%
flowchart TD
    A["Input Image"] --> B["Dual-Path Encoding"]
    B --> B1["Global Path<br/>Resize → Center Crop"]
    B --> B2["Local Path<br/>High-Resolution Direct Crop"]
    B1 --> C["Feature Concatenation + MLP"]
    B2 --> C
    C --> D["128-D Normalized Embedding"]
    D --> E["Training: Contrastive Loss + Center Loss"]
    D --> F["Testing: Prototype Classification<br/>(N-way K-shot)"]
    D --> G["Testing: Angular Boundary Detection<br/>(Tukey + Momentum Update)"]

Key Designs

1. Dual-Path Feature Extraction: Balancing Global Structure and Local Artifacts

High-resolution AIGI detection clues may exist at different scales: global composition style and white balance belong to high-level semantic information, while pixel-level aliasing artifacts and block boundary discontinuities often appear only in local high-resolution regions. Existing methods resize inputs to a fixed resolution, which either loses global structure or collapses local details. OmniDFA addresses this with two complementary paths: the global path resizes the shorter side to 224 pixels followed by a center crop to preserve the overall layout and semantics; the local path directly performs high-resolution cropping on the original image to maximize the integrity of texture-level artifacts. The features from both paths are concatenated along the channel dimension and projected into 128-dimensional embeddings via an MLP. Ablation studies show that the dual-path approach improves attribution accuracy by 5-8% compared to either single path, validating the necessity of multi-scale fusion.

2. Supervised Contrastive Learning + Spherical Center Loss: Joint Optimization of Attribution and Detection

The challenge of few-shot attribution lies in the fact that artifacts from different generators are subtle and highly overlapping, making it difficult to learn sufficiently separable embeddings using cross-entropy alone. OmniDFA employs a supervised contrastive loss to pull samples from the same generator closer (high cosine similarity) and push different generators apart within a batch. This loss is naturally suited for multi-class scenarios because it does not rely on a fixed classification layer, allowing seamless adaptation to unseen classes during testing. While the contrastive loss alone is sufficient for attribution, dealing with a massive number of real images (each making up half of the training set) would cause the real class to disperse in the embedding space, making it difficult to define a boundary for detection. Thus, a spherical center loss is introduced: a learnable, L2-normalized center vector is maintained for the real class to constrain all real image embeddings close to this center. The joint loss is formulated as \(\mathcal{L} = \mathcal{L}_{sup} + \lambda \mathcal{L}_{cen}\).

3. Adaptive Angular Boundary Threshold: Direct Binary Classification Using Attribution Embeddings

The typical approach adds an independent binary classification head on top of the feature extractor for detection, which introduces extra parameters and training coupling. OmniDFA elegantly reuses the learned embedding space: since real images are tightly clustered under the spherical center loss constraint, the angle of any real image to the center should be within a reasonable upper bound. This upper bound is estimated from the angular distribution of real images within the current batch using Tukey's method (boxplot interquartile range format): \(\gamma_b = Q_3 + 1.5 \times IQR\). During training, the global boundary is smoothly adjusted via momentum update \(\gamma \leftarrow \beta\gamma + (1-\beta)\gamma_b\) to avoid aggressive cropping caused by statistical fluctuations in a single batch. During testing, the angle between the query embedding and the real center is computed; values smaller than \(\gamma\) are classified as real, and larger ones as fake. This design services both attribution and detection within the same embedding space without an extra classification head. A drawback is occasional conservative misclassification on edge samples of real images (leading to a slightly lower F-Acc for the real class than mainstream detectors), but the overall detection AP reaches 96.97%, significantly outperforming prior works.

Loss & Training

Supervised Contrastive Loss $\(\mathcal{L}_{sup} = \sum_{i=1}^{N}\frac{-1}{|P(i)|}\sum_{p\in P(i)}\log\frac{e^{\mathbf{z}_i \cdot \mathbf{z}_p / \tau}}{\sum_{a \in P(i)\setminus\{p\}} e^{\mathbf{z}_i \cdot \mathbf{z}_a / \tau}}\)$

Spherical Center Loss $\(\mathcal{L}_{cen} = \frac{1}{|P_r|}\sum_{p \in P_r}(1 - \mathbf{z}_p \cdot \mathbf{c}_r)\)$

The joint loss is \(\mathcal{L} = \mathcal{L}_{sup} + \lambda \mathcal{L}_{cen}\), with temperature \(\tau=0.07\) and \(\lambda=0.01\). ConvNeXt-Small is used as the backbone, optimized with AdamW on 8 A100 GPUs. The batch size is 1152 (128 fake images + 16 real images per GPU), trained for 20 epochs with a cosine annealing learning rate scheduler.

Key Experimental Results

Main Results

Few-Shot Attribution (5-way / 15-way 10-shot):

Method 5-way Acc 5-way Macro-F1 15-way Acc 15-way Macro-F1
ComFor 59.86 58.82 38.75 37.40
FSD 73.31 72.52 52.28 51.07
OmniDFA 75.34 74.45 53.54 51.74

Open-Set Detection (OmniFake cross-fold average):

Method Acc AP
AIDE 88.01 94.10
ComFor 89.75 93.13
OmniDFA 95.58 96.97

Cross-Dataset Zero-Shot Detection:

Method GenImage Avg Acc Chameleon Acc Chameleon F1
PatchCraft 90.32 55.70 2.62
AIDE 90.53 65.77 40.19
OmniDFA 95.86 83.48 80.09

Ablation Study

Configuration 5-way Acc / Detection Acc Description
Full model 75.34 / 95.58 Full dual-path + contrastive + center loss
w/o Local branch ~67 / ~90 Only global resize used, losing local artifacts
w/o Global branch ~68 / ~89 Only local crop used, lacking global integration
w/o Contrastive learning (binary classifier) ~45 / ~86 Degenerates to normal classification, few-shot attribution capacity drops significantly
w/o Center loss 75.0 / ~92 Attribution remains largely unchanged, but detection AP drops markedly

Key Findings

  • Supervised contrastive loss is the core source of few-shot attribution capability: removing it to degenerate into a binary classifier drops the 5-way accuracy sharply from 75% to 45%.
  • The accuracy increases fastest when the number of support samples goes from 1-shot to 10-shot (about +20%), and gains diminish after 10-shot—validating the rationality of the "attribution with limited samples" setup.
  • Regarding robustness to JPEG compression, OmniDFA performs stably within the range of training augmentation; outstanding performance is maintained beyond the range compared to most baselines, though Gaussian blur beyond the range causes a noticeable drop, indicating a need for broader data augmentation strategies.
  • Cross-dataset zero-shot detection on Chameleon exceeds the runner-up by 17.71%, indicating that multi-generator hybrid training learns truly generalized artifact representations rather than overfitting to specific dataset styles.

Highlights & Insights

  • Excellent Task Formulation: Conceptualizing "attribution" as an N-way K-shot open-set few-shot classification problem offers both practical deployment value and clear technical metrics, filling the gap between AIGI detection and attribution.
  • Note-worthy Dataset Structure Design: OmniFake intentionally excludes all PEFT / LoRA variants, keeping only 45 generators with fundamentally different architectures—ensuring that inter-class differences reflect genuine "distinct artifacts" rather than "parameter fine-tuning." This design philosophy goes against intuition (where datasets typically pursue maximum size) but avoids false generalization caused by homogenized classes in attribution evaluations.
  • Reusing Embedding Space for Detection: Reusing the same embedding space to derive detection boundaries via Tukey's method with momentum update eliminates the need for an extra classification head and its associated training complexity, presenting a lightweight and elegant design.
  • Combination of Contrastive Learning + Center Loss: Contrastive learning excels at separating different classes but does not enforce intra-class compactness, whereas center loss provides compactness constraints specifically for the real class—both share a clear division of labor, serving attribution and detection respectively.

Limitations & Future Work

  • Real image detection accuracy is slightly lower than fake image detection (R-Acc ~94% vs F-Acc ~97%), which the authors attribute to conservative boundary decisions on edge samples. Future work could investigate more adaptive boundary mechanisms (such as dynamic boundaries based on density estimation).
  • Performance drops significantly when Gaussian blur exceeds the training augmentation range, showing that the current augmentation strategy does not sufficiently cover blur. Future iterations could incorporate stronger blur augmentations.
  • The current method relies on a ConvNeXt-Small backbone; larger backbones (such as ViT-L) might further improve few-shot generalization but at a heavily increased computational cost.
  • Although the dataset excludes PEFT variants, different fine-tuned versions of the same base model also generate images in practical applications. The fine-grained distinction of these "same-family" variants remains an open question.
  • vs ComFor: ComFor naturally possesses good feature extraction capability due to pre-training on large-scale diffusion model sets, but constrained by its binary classification framework, it still lags behind OmniDFA by about 15% in few-shot multi-class attribution.
  • vs FSD: FSD also uses metric learning for open-set detection, but only performs binary classification instead of multi-class attribution; OmniDFA's contrastive learning + dual-path features outperform FSD in both detection and attribution.
  • vs DNA-Det / CPL / UnivAttr: These pure closed-set/open-set methods perform poorly under few-shot settings (~50% 5-way) because they optimize for known classes and lack generalization mechanisms for unseen classes.
  • vs AIDE / PatchCraft: Traditional detectors perform decently on datasets with fewer categories like GenImage, but skew heavily on real-world scenarios like Chameleon (F1 as low as 2-40%), whereas OmniDFA achieves more balanced bidirectional detection through multi-generator training.

Rating

  • Novelty: ⭐⭐⭐⭐ [Task-level innovation—introducing few-shot learning to synthetic image attribution for the first time, making it one of the earliest papers to define and systematically solve this problem]
  • Experimental Thoroughness: ⭐⭐⭐⭐⭐ [3-fold cross-validation × 2 tasks × cross-dataset zero-shot × thorough ablation, representing a systematic and rigorous experimental design]
  • Writing Quality: ⭐⭐⭐⭐ [Clear structure, convincing motivation, and well-organized methodology and experimental results]
  • Value: ⭐⭐⭐⭐⭐ [Provides a completely new paradigm, a high-quality open-source dataset (45 independent generators), and a strong baseline for AIGI attribution, driving significant progress for both academic research and practical deployment]