Organizations: Univ. Polytechnique Hauts-de-France, Valenciennes, France · Institute of Applied Sciences and Intelligent Systems – Lecce, Italy · Department of Innovation Engineering, University of Salento, Italy · Sorbonne Center for Artificial Intelligence, Sorbonne University Abu Dhabi
Detecting AI-generated images remains a significant challenge because detectors trained on specific generators often fail to generalize to unseen models; however, while pixel-level artifacts vary across models, frequency-domain signatures exhibit greater consistency, providing a promising foundation for cross-generator detection. To address this, we propose SPARK-IL, a retrieval-augmented framework that combines dual-path spectral analysis with incremental learning by utilizing a partially frozen ViT-L/14 encoder for semantic representations alongside a parallel path for raw RGB pixel embeddings. Both paths undergo multi-band Fourier decomposition into four frequency bands, which are individually processed by Kolmogorov-Arnold Networks (KAN) with mixture-of-experts for band-specific transformations before the resulting spectral embeddings are fused via cross-attention with residual connections. During inference, this fused embedding retrieves the k nearest labeled signatures from a Milvus database using cosine similarity to facilitate predictions via majority voting, while an incremental learning strategy expands the database and employs elastic weight consolidation to preserve previously learned transformations. Evaluated on the UniversalFakeDetect benchmark across 19 generative models -- including GANs, face-swapping, and diffusion methods -- SPARK-IL achieves a 94.6% mean accuracy, with the code to be publicly released at https://github.com/HessenUPHF/SPARK-IL.
Figures & tables
Figure 1: Comparison of detection accuracy and model efficiency on the UniversalFakeDetect benchmark. (a) Efficiency comparison in terms of number of parameters. (b) Mean accuracy across 19 generative models.
Figure 2: SPARK-IL architecture. Dual spectral paths process ViT features and RGB pixels through multi-band KAN-FFT blocks. Cross-attention fuses the spectral embeddings, which are used for classification during training and stored in Milvus for retrieval-based inference.
Figure 3: Multi-band KAN-FFT block. Input features are transformed via FFT, converted to log-magnitude spectrum, partitioned into four frequency bands, processed through dedicated KAN layers, and fused into a spectral embedding.
Methods
Ref
GAN
DeepFakes
Low level
Perceptual loss
LDM
GLIDE
DALL·E
mAcc
Pro- GAN
Cycle- GAN
Big- GAN
Style- GAN
Gau- GAN
Star- GAN
SITD
SAN
CRN
IMLE
200 steps
200 w/cfg
100 steps
100 27
50 27
100 10
Freq-spec
WIFS2019
49.90
99.90
50.50
49.90
50.30
99.70
50.10
50.00
48.00
50.60
50.10
50.90
50.40
50.40
50.30
51.70
51.40
50.40
50.00
55.45
Co-occurrence
Electr. Img
97.70
97.70
53.75
92.50
51.10
54.70
57.10
63.06
55.85
65.65
65.80
60.50
70.70
70.55
71.00
70.25
69.60
69.90
67.55
66.86
CNN-Spot
CVPR2020
99.99
85.20
70.20
85.70
78.95
91.70
53.47
66.67
48.69
86.31
86.26
60.07
54.03
54.96
54.14
60.78
63.80
65.66
55.58
69.58
Patchfor
ECCV2020
75.03
68.97
68.47
79.16
64.23
63.94
75.54
75.14
75.28
72.33
55.30
67.41
76.50
76.10
75.77
74.81
73.28
68.52
67.91
71.24
F3Net
ECCV2020
99.38
76.38
65.33
92.56
58.10
100.00
63.48
54.17
47.26
51.47
51.47
69.20
68.15
75.35
68.80
81.65
83.25
83.05
66.30
71.33
Table 1: Comparison across GAN, DeepFakes, low-level, perceptual-loss, and diffusion-based generators.
Figure 4: t-SNE visualization of SPARK-IL RAG embedding distributions for real (green) and fake (red) samples across different generative models.
Nb shots
GAN
DeepFakes
Low level
Perceptual
LDM
GLIDE
DALL·E
mAcc
ProGAN
CycleGAN
BigGAN
StyleGAN
GauGAN
StarGAN
SITD
SAN
CRN
IMLE
200
200
100
100
50
100
1
99.30
96.90
98.60
95.90
98.80
98.40
93.20
94.90
63.90
95.10
94.90
68.40
98.90
95.50
98.90
94.60
95.10
95.40
98.20
92.80
3
99.55
97.20
98.90
96.20
99.10
98.70
93.70
95.30
64.50
95.60
95.40
69.00
99.10
95.80
99.20
94.90
95.40
95.70
98.50
93.60
5
99.70
97.40
99.05
96.45
99.25
98.90
94.00
95.60
64.90
95.90
95.70
69.30
99.25
95.95
99.40
95.10
95.60
95.90
98.70
94.10
10
99.85
97.55
99.15
96.65
99.35
99.00
94.15
95.70
65.10
96.00
95.85
69.55
99.35
96.05
99.50
95.25
95.75
96.05
98.80
94.40
15
99.90
97.58
99.18
96.75
99.38
99.05
94.25
95.75
65.15
96.05
95.95
69.70
99.38
96.08
99.55
95.35
95.85
96.15
98.85
94.50
Table 2: Effect of the number of retrieved neighbors (Nb shots) on SPARK-IL performance across all generator families on the UniversalFakeDetect benchmark. Performance consistently improves with more retrieved samples and stabilizes beyond 10–15 shots.
Method
Backbone
Params (M)
GFLOPs
REVEAL
ViT-L/14 (partial)
303.0
45.00
C2P-CLIP
ViT-L/14 (partial)
304.0
46.00
RINE
ViT-L/14
434.0
52.00
FatFormer
ViT-L/14
493.0
58.00
SPARK-IL (Ours)
ViT-L/14 (partial)
315.0
60.33
Table 3: Comparison of computational complexity among recent methods, reporting the number of parameters and GFLOPs for a 224 × 224 input.
Model Variant
Pixel FFT
Feature FFT
Retrieval + Voting
KAN
mAcc (%)
(A) ViT Baseline
–
–
–
–
81.5
(B) + Pixel Spectral
✓
–
–
–
85.2
(C) + Dual Spectral
✓
✓
–
–
88.7
(D) + MLP Classifier
✓
✓
–
–
89.1
(E) + KAN (w/o Retrieval)
✓
✓
–
✓
90.3
(F) SPARK-IL (Full)
✓
✓
✓
✓
94.6
Table 4: Ablation study on the UniversalFakeDetect benchmark. The baseline corresponds to a standard Vision Transformer fine-tuned for synthetic image detection. Each row incrementally adds spectral modeling, classifier design, and retrieval-based reasoning.