Adapting CLIP has emerged as a promising direction for generalizable face forgery detection. Recent methods typically design spatial adapters to identify forgery traces within individual frames or temporal adapters to detect inconsistencies across frames. As this line is still in its early stages, how to jointly model spatiotemporal cues with CLIP remains an open challenge. In this paper, we propose the Spatiotemporal Message Flow Adapter (STFlow), a framework that integrates spatial and temporal forgery evidence through bidirectional message flow between CLIP and its adapters. Our method contains three key designs: 1) a Spatial Adapter that uses two groups of learnable queries to provide precise guidance toward facial components and capture diverse forgery traces. 2) a Temporal Adapter that captures inter-frame inconsistencies by applying self-attention along the temporal dimension. 3) a Bidirectional Message Flow mechanism that allows both adapters to exchange information with CLIP and thereby enables indirect communication between adapters. We evaluate our method on five widely used datasets and compare it with recent representative detectors. Experimental results demonstrate its effectiveness in improving generalization. We have released the code at https://github.com/OUC-VAS/STFlow.
Figures & tables
Figure 1: Comparison of STFlow with existing CLIP-based face forgery detectors. (a) Existing methods either use only a spatial adapter or allow limited information exchange with CLIP. (b) STFlow enables bidirectional message flow between CLIP and the spatial and temporal adapters, allowing CLIP to integrate complementary forgery cues within and across frames.
Figure 2: Pipeline of the proposed STFlow. The Spatial Adapter(SA) absorbs CLIP features and generates spatial guidance for CLIP. The Temporal Adapter(TA) models dependencies across frames and feeds the resulting temporal features back into CLIP. The outputs of the component, forgery, and visual heads are combined into the final prediction.
Figure 3: Attention bias.
Method
Venue
Input Type
CDF-v2
DFDC
DFDCP
DFD
WDF
Avg.
Recce [ 3 ]
CVPR’22
Frame
68.71
69.06
-
-
64.31
-
Recce [ 3 ]
CVPR’22
Frame
80.07
68.98
71.46
89.37
76.70
77.32
SBI [ 36 ]
CVPR’22
Frame
93.18
72.42
86.15
97.56
-
SBI [ 36 ]
CVPR’22
Frame
79.45
62.70
76.86
76.35
73.67
73.81
UCF [ 45 ]
ICCV’23
Frame
82.40
80.50
-
94.50
-
-
UCF [ 45 ]
ICCV’23
Frame
83.74
75.11
70.63
95.03
79.08
80.72
Table 1: Cross-dataset evaluation results (video-level AUC). All methods are trained on FF++ (c23) and evaluated on five unseen datasets. The upper and lower blocks list frame-level and video-level methods. Numbers without shading are taken from the original papers, cells with a blue background report results obtained by testing the authors’ released weights, and cells with a yellow background report results obtained with our own trained weights. The best results are indicated in bold and the second-best results are underlined. The first and second rows of Ours correspond to batch sizes of 8 and 16.
SA
TA
CDF-v2
DFDC
DFDCP
DFD
WDF
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
×
×
76.54
87.11
29.46
74.24
75.94
32.74
74.80
86.15
31.05
87.83
98.48
19.78
71.37
78.93
35.40
✓
×
91.15
94.72
16.81
78.14
79.53
29.29
84.03
91.04
24.61
96.77
99.62
8.41
82.39
87.29
27.41
×
✓
83.26
91.55
25.72
76.47
80.96
30.97
80.09
88.87
28.97
92.97
99.15
16.95
73.89
82.82
33.38
✓
✓
95.34
97.64
11.21
84.97
87.55
23.89
91.63
95.10
18.17
98.74
99.85
4.65
89.12
89.73
17.49
Table 2: Effect of the spatial and temporal adapters. Evaluation metrics are video-level AUC, AP, and EER.
SA
CDF-v2
DFDCP
DFD
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
(w/o) com query
93.14
96.28
14.08
90.31
94.92
18.79
96.88
99.63
9.29
(w/o) for query
94.17
96.86
12.21
88.67
93.79
20.66
96.11
99.52
13.06
2 BLOCKs
95.30
97.67
11.21
90.86
95.02
18.07
98.03
99.77
6.84
6 BLOCKs
94.81
97.26
12.93
89.77
94.00
19.11
95.65
99.47
10.99
Ours
95.34
97.64
11.21
91.63
95.10
18.17
98.74
99.85
4.65
Table 3: Effect of the component-query and forgery-query branches and the number of spatial adapter blocks.
TA
CDF-v2
DFDCP
DFD
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
(w/o)shallow layer
87.72
93.36
22.27
88.03
92.89
20.77
95.01
99.41
13.62
(w/o) deep layer
94.68
96.70
10.91
84.30
91.15
25.03
97.05
99.63
10.73
Ours
95.34
97.64
11.21
91.63
95.10
18.17
98.74
99.85
4.65
Table 4: Effect of the temporal adapter depth.
Lcag
Lfag
Lloc
Lcl
CDF-v2
DFDCP
DFD
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
×
✓
✓
✓
94.66
97.25
13.93
88.90
93.70
21.29
97.58
99.71
9.04
✓
×
✓
✓
93.77
96.42
13.08
88.90
93.76
21.18
97.48
98.82
6.96
✓
✓
×
✓
93.56
96.00
13.64
87.44
93.33
22.01
97.18
99.34
6.16
✓
✓
✓
×
92.99
96.23
14.66
90.26
94.01
19.42
97.68
99.72
10.86
✓
✓
✓
✓
95.34
97.64
11.21
91.63
95.10
18.17
98.74
99.85
4.65
Table 5: Effect of the four loss terms.
Backbone
CDF-v2
DFDCP
DFD
BLIP ViT-L/16 [ 22 ]
81.64
68.62
75.26
CLIP ViT-B/16 [ 32 ]
86.97
84.68
93.61
CLIP ViT-L/14 [ 32 ]
95.34
91.63
98.74
Table 6: Effect of the visual backbone.
Figure 4: Visualization of the CLIP encoder on CDF-v2.
Figure 5: Visualization of the spatial adapter on CDF-v2.
Figure 6: T-SNE Visualizations. The feature distribution before (top) and after (bottom) using the TA. Features are extracted from the last three layers of the TA and their corresponding layers in CLIP.
Figure 7: video-level AUC on CDF-v2, DFD, and DFDCP as the fusion weight varies from 0.05 to 0.30. The orange curve shows the average over the three datasets.
SA
DFDC
WDF
AUC
AP
EER
AUC
AP
EER
(w/o) com query
84.37
86.82
23.65
85.14
88.47
23.15
(w/o) for query
81.59
85.06
26.72
84.69
89.36
24.49
2 BLOCKs
85.20
87.74
23.75
85.35
89.20
23.73
6 BLOCKs
84.00
86.99
23.73
87.80
90.96
19.79
Ours
84.97
87.55
23.89
89.12
89.73
17.49
Table 7: Effect of the component-query and forgery-query branches and the number of spatial adapter blocks.
TA
DFDC
WDF
AUC
AP
EER
AUC
AP
EER
(w/o) shallow layer
82.12
84.45
35.88
83.61
88.10
25.44
(w/o) deep layer
81.48
84.73
26.72
85.70
88.38
20.68
Ours
84.97
87.55
23.89
89.12
89.73
17.49
Table 8: Effect of the temporal adapter depth.
Lcag
Lfag
Lloc
Lcl
DFDC
WDF
AUC
AP
EER
AUC
AP
EER
×
✓
✓
✓
84.17
86.86
24.11
87.08
90.90
22.02
✓
×
✓
✓
83.17
85.88
25.76
86.88
90.62
22.78
✓
✓
×
✓
83.22
85.02
24.51
86.84
90.80
21.89
✓
✓
✓
×
84.63
86.65
23.93
87.17
90.59
18.92
✓
✓
✓
✓
84.97
87.55
23.89
89.12
89.73
17.49
Table 9: Effect of the four loss terms.
Backbone
DFDC
WDF
BLIP ViT-L/16 [ 22 ]
69.14
60.95
CLIP ViT-B/16 [ 32 ]
77.69
81.05
CLIP ViT-L/14 [ 32 ]
84.97
89.12
Table 10: Effect of the visual backbone.
Figure 8: Visualization of the spatial adapter on CDF-v2.
SA
CDF-v2
DFDC
DFDCP
DFD
WDF
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
AUC
AP
EER
(w/o) eyes
91.87
95.39
17.24
82.02
84.88
26.70
85.55
91.66
23.68
97.15
99.66
8.79
83.32
87.67
25.26
(w/o) nose
95.36
97.58
12.64
83.91
86.28
25.08
88.87
93.36
20.15
98.09
99.77
8.79
86.13
90.19
21.08
(w/o)mouth
94.82
97.39
13.51
85.56
87.81
22.65
90.52
94.66
19.52
98.21
99.74
8.16
86.54
89.65
19.42
(w/o) skin
93.76
96.60
15.08
84.72
87.20
24.87
91.11
95.03
16.82
97.54
99.70
8.66
84.07
87.78
23.47
Ours
95.34
97.64
11.21
84.97
87.55
23.89
91.63
95.10
18.17
98.74
99.85
4.65
89.12
89.73
17.49
Table 11: Effect of the components.
Method
CDF-v2
DFDCP
DFD
LoRA [ 19 ]
86.92
86.73
91.74
subset fine-tuning [ 16 ]
86.14
85.62
92.31
Ours
95.34
91.63
98.74
Table 12: Effect of using various fine-tuning methods.
State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China · National University of Singapore, Singapore · South China University of Technology, Guangzhou, China