In this paper, we introduce Universal Generator-Agnostic Deepfake Detector (UniGADD), a novel method that employs supervised learning to achieve high accuracy on known deepfake generators, while maintaining robust performance on previously unseen ones. The proposed approach follows a two-stage optimisation process. In the first stage, a contrastive loss encourages the model to learn discriminative feature embeddings from real and known fake images, resulting in strong performance within the training domain. In the second stage, the embedding space is refined by promoting inter-cluster separation and intra-cluster compactness, applied exclusively to real samples. This refinement enhances generalisability, enabling the method to exhibit improved robustness against unseen deepfake generation techniques. UniGADD achieves accuracy on par with state-of-the-art methods for known generators, while significantly outperforming them on unseen cases, demonstrating its scalability and practical applicability for adversarial content detection.
Figures & tables
Figure 1: Overview of the proposed method, consisting of feature extraction, supervised contrastive prototype refinement and anomaly detection.
Figure 2: t-SNE projections of the embedding space after training. Light blue indicates the real samples. Real samples form compact clusters, while unseen generator samples (held out during training) remain distinct or peripheral.
Figure 3: Average accuracy per generator under leave-one-out evaluation. Subfigure (a) shows accuracy on seen generators; (b) shows accuracy on unseen ones. UniGADD maintains high performance across both, outperforming previous methods in generalisation.
Method →
Cozzolino et al. ↑
Ohja et al. ↑
Wang et al. ↑
DINOv2 + Linear ↑
Ours ↑
↓ Generator
Seen
Unseen
Seen
Unseen
Seen
Unseen
Seen
Unseen
Seen
Unseen
GANs
BigGAN
79.92
60.47
91.49
80.79
91.03
66.12
91.16
52.50
94.80
88.50
CycleGAN
79.84
60.18
91.55
73.79
89.48
71.86
89.97
50.17
91.58
89.10
Faces
79.77
59.82
91.59
55.05
86.27
62.10
90.20
48.04
94.24
88.00
GauGAN
79.96
60.60
91.69
79.74
90.76
74.95
97.16
51.92
95.03
87.06
ProGAN
79.22
60.60
91.39
67.09
87.42
56.47
90.04
45.06
91.47
82.50
Table 1: Detection performance by generator across different methods for Leave-One-Out, showing Seen and Unseen accuracy. Generators are grouped by model type (GANs vs Diffusion). Our (UniGADD) results are highlighted in green.
Figure 4: Average accuracy as the number of generators excluded from training increases. UniGADD generalises more robustly than prior methods.
Method →
Cozzolino et al. ↑
Ohja et al. ↑
Wang et al. ↑
DINOv2 + Linear ↑
Ours ↑
↓N Unseen
Seen
Unseen
Seen
Unseen
Seen
Unseen
Seen
Unseen
Seen
Unseen
3
79.455
75.35
90.92
86.79
89.3
76.5
90.6
62.5
94.20
86.04
5
79.10
78.86
90.44
86.88
88.5
75.5
90.0
63.0
93.79
87.42
7
76.32
73.86
90.10
83.68
87.3
74.2
89.4
62.0
93.00
89.46
9
78.65
71.79
89.17
83.26
86.6
73.0
88.8
58.5
91.94
83.30
11
76.62
68.35
90.10
72.29
86.0
72.0
88.2
57.0
90.87
84.63
Table 2: Detection performance by generator across different methods for Leave- N -Out, showing Seen and Unseen accuracy. Our (UniGADD) results are highlighted in green.
Backbone →
ViT-B-32 ↑
ViT-L-14 ↑
DINOv2-B/14 ↑
DINOv2-S/14 ↑
↓ Generator
Seen
Unseen
Seen
Unseen
Seen
Unseen
Seen
Unseen
GANs
BigGAN
89.54
62.00
96.55
88.50
91.02
91.25
81.91
65.75
CycleGAN
87.57
71.50
96.68
88.50
92.83
84.25
79.93
69.50
Faces
86.74
57.25
96.68
86.50
89.70
76.25
79.11
63.25
GauGAN
90.72
67.75
96.38
83.50
91.41
87.25
82.47
68.25
ProGAN
89.12
76.25
96.91
81.25
94.22
77.92
81.56
76.25
Table 3: Detection accuracy by backbone across GAN and Diffusion generators under Leave-One-Out setting.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Clusters
nreal
Ratio
Seen
Unseen
20
3
0.19
87.6
45.8
30
13
0.81
87.0
54.8
40
23
1.44
87.4
54.0
60
43
2.69
88.4
54.5
80
63
3.94
88.3
52.2
100
83
5.19
88.6
56.6
Appendix
Table 4: Cluster ablation showing the effect of varying the total number of clusters.
σ
Seen Acc
Unseen Acc
1.0
91.5
46.2
1.5
90.4
51.3
2.0
89.7
54.0
2.5
89.3
55.2
3.0
89.2
55.7
3.5
89.1
56.0
Appendix
Table 5: Threshold ablation showing the effect of varying σ on detection accuracy.