Manuscript Offprint
arXiv:2610.29442Beyond Shortcut Learning: Hierarchical Spatial Prototype Regularization for Face Forgery Detection
Abstract
Recent advances in generative models have enabled highly realistic face forgeries, yet generalizing deepfake detectors to unseen manipulation pipelines remains a major challenge. One critical yet underexplored issue is that the learned forensic representation itself may fail to remain stable across different manipulation sources. In this paper, we provide new evidence that naively fine-tuned vision models suffer from severe forensic representation collapse: their extracted cues are often entangled with unstable, dataset-specific artifacts, resulting in structurally fragile representations and poor cross-domain generalization. Leveraging this insight, we propose Hierarchical Spatial Prototype (HSP) regularization, which explicitly models the forgery manifold by learning a structured prototype subspace over spatial features. We further introduce prototype orthogonality and second-order assignment balance, which jointly preserve the geometric independence of latent forgery factors and promote high-effective-rank utilization of the forensic representation, thereby reducing reliance on dataset-specific shortcuts. Empirical results demonstrate that our method substantially improves generalizability, yielding average frame-level AUC gains of 5.6% and 5.3% in the cross-dataset and cross-manipulation settings, respectively. Moreover, when used as a plug-in module, HSP boosts the average video-level AUC of existing state-of-the-art detectors to 95.3% (+1.8%). These results demonstrate the practical value of HSP as an easy-to-adopt regularization module for enhancing deepfake detectors.
1 Introduction
Deepfake faces are becoming increasingly photorealistic, posing growing risks to digital media security. By 2025, the number of deepfake files shared online had skyrocketed to 8 million, a 16-fold increase from 2023 (The Conversation 2025). Against this backdrop, deepfake detection has evolved from handcrafted cues and statistical artifact analysis to deep-learning-based detectors. Recent studies (Li et al. 2025; Han et al. 2025; Cai et al. 2025; Yan et al. 2025) increasingly adopt large-scale pretrained Vision Transformers (Dosovitskiy 2020), e.g., CLIP (Radford et al. 2021), achieving strong in-domain performance. However, these gains often transfer poorly to unseen manipulation pipelines, where performance degrades substantially. From a representation learning perspective, this limitation arises from shortcut learning: detectors tend to overfit volatile, dataset-specific cues rather than capturing stable forensic patterns.
Motivated by this, we shift the focus from detector design to probing the foundation model itself, and use CLIP, a widely used backbone in deepfake detection, to investigate how forgery evidence is represented. Our preliminary analysis reveals a simple yet overlooked phenomenon: replacing the global [CLS] representation with average pooling over spatial patch tokens improves cross-dataset detection accuracy on Celeb-DF-v2 (Li et al. 2020b) and DFDCP (Dolhansky et al. 2019), from 75.4% and 77.8% to 76.9% and 78.6%, respectively. This improvement motivates the hypothesis that forgery representations should be modeled as a structured feature space rather than compressed into a compact global representation. This hypothesis is consistent with prior work (Yan et al. 2024b), which shows that existing detectors often suffer from low-rank feature collapse, where forgery cues are concentrated along only a few dominant directions.
We further quantitatively analyze the representation structure of a CLIP-initialized ViT-L/14 (Dosovitskiy 2020; Radford et al. 2021) fine-tuned on FaceForensics++ (Rossler et al. 2019). The analysis reveals a clear generalization bottleneck: although fine-tuning enables the model to form discriminative forgery-related patterns in the feature space, the learned representation tends to concentrate on a few dominant source-specific artifacts, as detailed in Section 3. We term this phenomenon forensic representation collapse, where detectors capture a few high-confidence but narrow forgery directions that achieve strong source-domain discrimination but fail to remain stable under unseen manipulations. These observations motivate us to model forgery traces as a structured manifold composed of multiple latent forensic factors, as illustrated in Figure 1(b). In contrast, conventional detectors mainly enforce real-fake separability without explicitly constraining the internal organization of forgery representations, potentially causing heterogeneous forensic cues to remain entangled, as illustrated in Figure 1(a). We argue that real-world forgeries are intrinsically multi-factorial, where different manipulation processes introduce diverse yet complementary forensic traces. This view is supported by prior forensic studies that capture various manipulation cues,
Corresponding author.
including synthesis artifacts, blending boundaries, geometric inconsistencies, and post-processing traces (Shiohara and Yamasaki 2022; Qian et al. 2020; Dong et al. 2022).
Based on this intuition, we propose Hierarchical Spatial Prototype (HSP) regularization, a plug-in module that can be seamlessly integrated into both standard baselines and advanced ViT-based deepfake detectors. HSP models learnable prototypes as a structured basis for decomposing token-level features into latent forgery factors. Each spatial token is softly assigned to the prototypes and reconstructed from their weighted combination. Considering that real-world forgeries exhibit diverse and complementary forensic factors, we introduce two theoretically motivated regularization objectives. The prototype orthogonality constraint preserves the geometric decoupling of learned forgery factors, preventing multiple prototypes from collapsing into the same dataset-specific dominant directions. The second-order assignment-balance objective promotes diverse utilization of the prototype subspace, increasing the effective rank of the forensic representation and preventing token assignments from collapsing onto a limited set of dominant forgery factors. As visualized in Figure 1(c), the features learned by HSP not only form a clear decision boundary but also exhibit a pronounced multifactor organization within the forgery representation space. Our contributions can be summarized as follows:
• We systematically analyze a critical failure mode in deep-fake detection, termed forensic representation collapse. Our empirical findings show that naively fine-tuned models are overly dependent on limited and dataset-specific forgery factors and fragile under cross-domain shifts.
• We propose Hierarchical Spatial Prototype (HSP) regularization, a structured manifold learning framework for forgery detection. HSP introduces learnable spatial prototypes with soft token-to-prototype assignment to decompose forgery evidence into diverse latent forensic factors.
• We further introduce two theoretically motivated regularization objectives: prototype orthogonality prevents prototypes from collapsing toward the same source-specific directions, while assignment balance encourages diverse utilization of the prototype subspace and promotes a high-effective-rank forensic representation.
(a) Existing View
(b) Proposed View

(c) Empirical Validation
Entangled Forgery Feature Space
Structured Forgery Manifold
t-SNE Visualization of HSP-CLIP
Figure 1: Structured-manifold modeling of forgery representations. (a) Existing methods separate real and fake samples within an entangled feature space. (b) Our approach instead organizes forgery traces into a structured manifold supported by multiple latent forgery factors. (c) The t-SNE visualization provides empirical support for this structured representation.
and LipForensics (Haliassos et al. 2021) captures high-level semantic irregularities in temporal mouth movements. Furthermore, some methods leverage diffusion guidance (Sun et al. 2024) or feature disentanglement (Ba et al. 2024; Yan et al. 2023a; Cao et al. 2022; Luo et al. 2023) to capture manipulation-invariant representations.
Recent deepfake detection methods adopt large-scale pretrained foundation models due to their strong representations. Existing approaches can be categorized into three paradigms: 1) Parameter-Efficient Adaptation aligns largely frozen backbones with forensic tasks using lightweight modules. Forensics Adapter (Cui et al. 2025) introduces learnable adapters into CLIP, while FCG (Han et al. 2025) and plug-and-play methods extend this idea to video detection with efficient spatiotemporal modeling. 2) Feature Disentanglement aims to reduce semantic bias in foundation-model representations. Effort (Yan et al. 2024b) separates semantic components from forgery-relevant residuals via SVD, while UDD (Fu et al. 2025) mitigates positional and content bias through transformer token perturbation. 3) Generalization and Explainability target open-set manipulation and interpretable detection. FakeRadar (Li et al. 2025) models feature-space distributions to distinguish real, known-fake, and unknown-fake samples, while DeepShield (Cai et al. 2025) and X2-DFD (Chen et al. 2024) explore local-global analysis and MLLM-assisted explanations, respectively. Our method differs from the existing methods in that it shifts the detection paradigm from learning a monolithic decision boundary to constructing a structured, multi-dimensional forgery subspace. HSP explicitly decomposes complex manipulation traces into independent, orthogonal dimensions, which ensures that the model captures a set of structurally invariant forgery patterns rather than dominant shortcuts.
3 Empirical Analysis of Generalization Bottlenecks
Understanding how deepfake detectors organize forgery evidence into latent forensic factors is crucial for improving cross-dataset generalization. To this end, we treat unsupervised feature clusters as temporary proxies for latent forensic factors and introduce three diagnostics to characterize the underlying representation structure. Our experiments show that modeling multiple forgery factors, as instantiated by HSP,
Table 1: Quantitative analysis of feature representations across three models: pretrained and naively finetuned variants of CLIP ViT-L/14, alongside HSP-CLIP.
| Methods | ACC | |||
|---|---|---|---|---|
| FaceForensics++ | ||||
| CLIP | 0.854 | |||
| CLIP-FT | 0.931 | |||
| HSP-CLIP-FT | 0.954 | |||
| Celeb-DF-v2 | ||||
| CLIP | 0.665 | |||
| CLIP-FT | 0.786 | |||
| HSP-CLIP-FT | 0.828 | |||
| DFDCP | ||||
| CLIP | 0.547 | |||
| CLIP-FT | 0.779 | |||
| HSP-CLIP-FT | 0.816 | |||
| DFDC | ||||
| CLIP | 0.529 | |||
| CLIP-FT | 0.725 | |||
| HSP-CLIP-FT | 0.775 | |||
provides an effective means of improving the cross-domain generalizability. A detailed analysis of these diagnostics is provided in Appendix A.
3.1 Feature-Centric Perspective Metrics
We denote the dataset as , where represents the input image space and denotes the binary label. Given an input image , we extract non-overlapping patch embeddings , where and denote the number of patches and feature dimension, respectively.
Cluster-level Fake Density . For patch-level features , we apply -means with clusters and compute the fake density of cluster as:
where denotes the patches assigned to cluster , and is the indicator function. Intuitively, measures the probability that a patch in cluster comes from a forged image. A higher value indicates that the cluster captures more forgery-related evidence while separating it from genuine visual patterns.
Cluster-Label Dependence . We employ mutual information (Kraskov, Stögbauer, and Grassberger 2004) between cluster assignments and ground-truth labels to quantify the discriminative structure of clusters. Let denote the cluster assignment variable, where indexes a cluster, and denotes the label. We define as

(a) CLIP trained with the average pooling
(b) HSP-CLIP
Figure 2: PCA-based analysis of forgery representations. HSP-CLIP requires more principal components to explain the same variance and produces broader cumulative spatial activations, suggesting that it captures more latent forensic factors within a structured subspace.
Here, is the empirical probability that a patch assigned to cluster belongs to class , while and denote the corresponding marginal probabilities. A higher indicates stronger alignment between the cluster structure and forensic labels, suggesting better separation between real and manipulated samples.
Cross-Dataset Fake Density Correlation . characterizes whether dominant fake clusters preserve their forensic relevance across domains. For a dataset , we define the fake density vector:
Let and denote the vectors computed on the training and test datasets using cluster centroids fixed from the training set. We select the top- fake-dominated clusters in as an index set , where , and compute the Pearson correlation coefficient:
where denotes the mean of the selected M elements. A higher P indicates that fake-dominated clusters in the training domain remain consistent in the test domain, suggesting reliance on transferable forgery patterns.
3.2 Empirical Analysis on Deepfake Benchmarks
Key Observation: Naive fine-tuning improves source-domain separability but induces a shortcut-dominated, low-rank forensic representation, whereas HSP improves cross-domain feature stability by modeling multiple forgery factors.
We apply the diagnostics to analyze state-of-the-art detectors trained on FaceForensics++ (Rossler et al. 2019) and evaluated on Celeb-DF-v2 (Li et al. 2020b), DFDCP (Dolhansky et al. 2019), and DFDC (Dolhansky et al. 2020). Our analysis centers on ViT-L/14 initialized with CLIP (Radford et al. 2021) weights. For each target dataset, we average results over five trials with 2,000 real and 2,000 fake images, using 64 cluster centroids from the training set and computing and over the top-10 fake-dominated clusters.
Results are summarized in Table 1, with additional results for different values of M provided in Appendix B. We observe that: 1) vanilla backbones (e.g., CLIP) yield nearly random scores (e.g., , ), indicating that generic visual pre-training lacks intrinsic sensitivity to forgery-specific evidence; 2) naive fine-tuning (CLIP-FT) achieves higher , suggesting that it captures forgery-related features and improves source-domain discrimination. However, and substantially degrade under OOD evaluation, revealing that the learned patterns are dominated by source-specific factors and lack stable cross-domain forensic structures; 3) in contrast, HSP-CLIP preserves high cluster-level fake density while consistently improving both and , indicating that our multi-factor forgery representation learning organizes forgery evidence into a more domain-stable representation and improves cross-domain generalization.
We further perform PCA on patch embeddings extracted from 5,000 test images and compare the number of principal components required to reach different explained-variance thresholds. We further visualize the cumulative activation maps of the leading principal components by accumulating their token-wise projection energy. Intuitively, if forgery evidence collapses into a few shortcut-dominated directions, the representation should be highly low-rank, requiring only a small number of principal components while producing spatial responses concentrated on limited patches. Conversely, a structured forgery manifold should require more principal components and exhibit broader spatial activation across complementary forensic regions. As shown in Figure 2, naively fine-tuned CLIP explains most of its variance with only a few principal directions, whereas HSP-CLIP requires substantially more principal components to reach the same explained-variance thresholds. The cumulative activation maps further reveal a clear geometric difference: CLIP mainly responds to a small number of localized patches, while HSP-CLIP distributes its responses across broader and more complementary spatial regions. These results suggest that HSP-CLIP organizes forgery evidence into a structured manifold rather than compressing it into a shortcut-dominated low-rank representation, providing empirical support for the structured forgery manifold proposed in Figure 1.
4 Methodology
The observations in Section 3 suggest that weak cross-domain performance stems from narrow, low-rank representations dominated by a few source-specific forgery cues. Accordingly, we formulate deepfake detection from the perspective of structured forgery manifold learning and propose a plug-in module termed Hierarchical Spatial Prototype (HSP), as illustrated in Figure 3. The core idea is to constrain intermediate spatial representations to be explained by a set of complementary forgery factors.
4.1 Prototype-Supported Forgery Manifold
How should we organize heterogeneous forgery evidence into a structured feature manifold that can accommodate multiple latent forgery factors? To address this question, given intermediate token embeddings from a ViT layer, we introduce learnable prototypes , where each prototype represents a latent spatial forgery factor. Since real-world manipulations typically involve multiple intertwined effects, such as blending, geometric inconsistency, and post-processing, assigning each token to a single prototype is overly restrictive. We therefore adopt temperature-scaled soft assignment, allowing each token to be reconstructed as a weighted combination of all prototypes:
where is the temperature parameter and denotes the soft assignment weight of token to prototype .
HSP is designed as a plug-in module that preserves the original representational capacity while imposing structured organization on intermediate features. We introduce prototype reconstruction as an auxiliary constraint rather than replacing original token representations. Direct replacement would force all tokens into a finite prototype-supported subspace and may discard subtle forensic cues beyond the learned prototypes. Instead, the reconstruction objective softly aligns features with shared forgery factors while retaining the flexibility of pretrained representations. Specifically, we adopt a dual-path reconstruction loss with stop-gradient:
where denotes the stop-gradient operator, and the weighting coefficient is set to 2 by default. Similar designs have been used to stabilize representation learning (Van Den Oord, Vinyals et al. 2017; Chen and He 2021).
4.2 Structured Forgery Manifold Regularization
Based on the learned forgery prototypes, we constrain both prototype geometry and assignment distribution to ensure complementary factor modeling and effective prototype utilization. We first impose an orthogonality regularization on the normalized prototype matrix:
where is the row-wise normalized prototype matrix, is the identity matrix, and denotes the Frobenius norm. Although orthogonality encourages diverse forgery factors, assignment collapse may still concentrate features on a few dominant prototypes, leaving the representation effectively low-rank. To this end, we model the second-order geometry of the assignment space. Let denote the assignment matrix of all tokens in a mini-batch. Since each row of is a probability vector, . We center the assignment matrix and introduce the assignment-

Figure 3: Overview of the proposed Hierarchical Spatial Prototype (HSP) module for structured-manifold modeling. HSP introduces K learnable spatial prototypes to model latent forgery factors. A soft assignment matrix A decomposes each token into a combination of multiple prototypes and enables heterogeneous forgery traces to be modeled within a prototype-supported manifold. Prototype orthogonality keeps these forgery factors geometrically decoupled, while second-order assignment balance encourages diverse utilization of the prototype space and prevents the representation from collapsing into a few dominant factors.
balance regularizer:
The matrix is the rank- projector onto the centered assignment subspace. Therefore, encourages the forgery manifold to exploit all admissible prototype-assignment directions instead of collapsing onto a few source-specific prototypes.
4.3 Effective Rank of the Forensic Representation
Prototype orthogonality preserves non-redundant forgery directions, while assignment balance distributes feature variation over the full subspace permitted by soft assignments; together, they drive the forensic representation toward its maximum admissible effective rank.
Proposition. Let denote the row-normalized prototype matrix, and let be the centered reconstructed forensic features. Assume . If and , then the trace-normalized Gram matrix of converges to a rank- spectrum with equal nonzero eigenvalues. Consequently, its effective rank converges to the maximum admissible value, i.e., .
Proof. Because each row of A is a probability vector, . Moreover, from , we have . Therefore,
which implies .
As , the trace-normalized assignment covariance converges to the normalized projector onto the centered assignment subspace:
The matrix on the right has one zero eigenvalue along and equal nonzero eigenvalues, each equal to . Meanwhile, implies , so the rows of become orthonormal. The Gram matrix of the centered reconstructed features is .
Because has orthonormal rows, this transformation preserves the nonzero eigenvalues of . Therefore, the trace-normalized Gram matrix of also has equal nonzero eigenvalues, each converging to . By the definition of effective rank,
(12)
The reconstruction objective encourages to remain close to its prototype-based reconstruction . Let denote the reconstruction error. We have
By Weyl's eigenvalue perturbation inequality (Horn and Johnson 2012), the eigenvalue deviation between and is bounded by Eq. (13). Therefore, with small reconstruction error, the Gram spectra remain close, allowing the high-effective-rank structure of to be approximately inherited by .
4.4 Integration and Training Objective
Finally, HSP is implemented as a lightweight plug-in module and inserted at the 1/4 and 1/2 depths of the transformer.
Table 2: Comparison of video- and frame-level AUC (%) on cross-dataset benchmarks. † denotes results from official models or our reproduction; other results are from (Yan et al. 2024b; Chen et al. 2024) and original papers.
| Methods | Video-level AUC | Methods | Frame-level AUC | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CDF-v2 | CDF-v1 | DFDC | DFDCP | DFD | Avg. | CDF-v2 | CDF-v1 | DFDC | DFDCP | DFD | Avg. | ||
| F3Net (ECCV'20) | 78.9 | - | 71.8 | 74.9 | 84.4 | 77.5 | Efficient-b4† (ICML'19) | 74.9 | 70.5 | 69.6 | 72.8 | 81.5 | 73.9 |
| LaV (MM'23) | 92.2 | 84.7 | 82.0 | 89.7 | 96.8 | 89.1 | Face X-Ray (CVPR'20) | 67.9 | 70.9 | 63.3 | 69.4 | 76.7 | 70.0 |
| IID (CVPR'23) | 83.8 | - | 70.0 | 68.9 | 93.9 | 79.2 | RECCE (CVPR'22) | 73.2 | - | 71.3 | 74.2 | 74.2 | 73.2 |
| CFM (TIFS'23) | 89.7 | - | 70.6 | 80.2 | 95.2 | 83.9 | UCF† (ICCV'23) | 82.4 | 77.9 | 80.5 | 75.9 | 87.8 | 80.9 |
| SBIs (CVPR'22) | 90.6 | - | 75.2 | 87.7 | 88.2 | 85.4 | ICT (CVPR'23) | 85.7 | 81.4 | - | - | 84.1 | 83.7 |
| ProDe† (NeurIPS'24) | 92.6 | 95.7 | 70.7 | 82.8 | 95.4 | 87.4 | ProDe† (NeurIPS'24) | 84.5 | 90.9 | 72.4 | 81.2 | - | 82.3 |
| CDFA† (ECCV'24) | 93.8 | 92.1 | 83.0 | 88.1 | 95.4 | 90.5 | DFFake (NeurIPS'24) | 80.5 | - | - | 81.0 | 90.4 | 84.0 |
| FakeRadar (ICCV'25) | 91.7 | - | 84.1 | 88.5 | 96.2 | 90.1 | ExposDe† (AAAI'24) | 86.4 | 81.8 | 72.1 | 85.1 | 89.8 | 83.0 |
| VbSaT (CVPR'25) | 94.7 | - | 84.3 | 90.9 | 96.5 | 91.6 | DAID (NeurIPS'25) | 84.4 | - | 66.9 | - | 91.2 | 80.8 |
| DeepShield (ICCV'25) | 92.2 | - | 82.8 | 93.2 | 96.1 | 91.1 | UDD (AAAI'25) | 86.9 | - | 75.8 | 85.6 | 91.0 | 84.8 |
| FCG (CVPR'25) | 95.0 | - | 81.8 | - | - | 88.4 | FSgD (NeurIPS'25) | 86.7 | 90.1 | - | 81.8 | 82.1 | 85.2 |
| -DFD (NeurIPS'25) | 95.5 | - | 85.3 | 91.2 | 95.7 | 91.9 | LSDA (CVPR'24) | 83.0 | 86.7 | 73.6 | 81.5 | 88.0 | 82.6 |
| Effort† (ICML'25) | 95.6 | 91.8 | 84.3 | 90.9 | 96.5 | 91.8 | FreqDebias (CVPR'25) | 83.6 | 87.5 | 74.1 | 82.4 | 86.8 | 82.9 |
| HSP-CLIP | 92.2 | HSP-CLIP | |||||||||||
Table 3: Video-level and frame-level AUC (%) comparison on unseen manipulation methods. Results are reported on six representative face-swapping methods selected from DF40, where all samples are generated based on the FF++ domain.
| Methods | Video-level AUC | Methods | Frame-level AUC | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| UniFace | e4s | FaceDancer | FSGAN | InSwap | SimSwap | Avg. | UniFace | e4s | FaceDancer | FSGAN | InSwap | SimSwap | Avg. | ||
| RECCE (CVPR'22) | 89.8 | 68.3 | 84.8 | 94.9 | 84.8 | 76.8 | 83.2 | RECCE (CVPR'22) | 84.2 | 65.2 | 78.3 | 88.4 | 79.5 | 73.0 | 78.1 |
| SBIs (CVPR'22) | 72.4 | 75.0 | 59.4 | 80.3 | 71.2 | 70.1 | 71.4 | IID (CVPR'23) | 79.5 | 71.0 | 79.0 | 86.4 | 74.4 | 64.0 | 75.7 |
| UCF (ICCV'23) | 83.1 | 73.1 | 86.2 | 93.7 | 80.9 | 64.7 | 80.3 | SBIs (CVPR'22) | 64.4 | 69.0 | 44.7 | 87.9 | 63.3 | 56.8 | 64.4 |
| IID (CVPR'23) | 83.9 | 76.6 | 84.4 | 92.7 | 78.9 | 64.4 | 80.2 | UCF (ICCV'23) | 78.7 | 69.2 | 80.0 | 88.1 | 76.8 | 64.9 | 77.5 |
| LSDA (CVPR'24) | 87.2 | 69.4 | 72.1 | 93.9 | 85.5 | 69.3 | 79.6 | LSDA (CVPR'24) | 85.4 | 68.4 | 75.9 | 83.2 | 81.0 | 72.7 | 77.8 |
| ProDe (NeurIPS'24) | 90.8 | 77.1 | 74.7 | 92.8 | 83.7 | 84.4 | 83.9 | CDFA (ECCV'24) | 76.5 | 67.4 | 75.4 | 84.8 | 72.0 | 76.1 | 75.9 |
| CDFA (ECCV'24) | 76.2 | 63.1 | 80.3 | 94.2 | 77.2 | 75.7 | 77.8 | ProDe (NeurIPS'24) | 84.5 | 71.0 | 73.6 | 86.5 | 78.8 | 77.8 | 78.7 |
| VbSaT (CVPR'25) | 96.0 | 98.0 | 91.6 | 96.4 | 93.7 | 93.1 | 94.8 | FSgD (NeurIPS'25) | 91.8 | 87.5 | 83.0 | 86.3 | 87.4 | 91.0 | 87.8 |
| Effort (ICML'25) | 96.2 | 98.3 | 92.6 | 95.7 | 93.6 | 92.6 | 94.8 | -DFD (NeurIPS'25) | 85.2 | 91.2 | 83.8 | 89.9 | 78.4 | 84.9 | 85.6 |
| HSP-CLIP | HSP-CLIP | 88.7 | |||||||||||||
The plug-in formulation allows HSP to be integrated into both standard ViT architectures and recent ViT-based deepfake detectors, such as Effort (Yan et al. 2024b), with minimal modification, as demonstrated in Figure 4(a). The overall loss function for training the model combines the classification loss , the reconstruction loss , the structural regularization terms and ,
where and are hyperparameters that balance the importance of the corresponding terms.
5 Experiments
5.1 Experimental Setting
We train all models on the c23 version of FaceForensics++ (Rossler et al. 2019), consistent with the standard detection protocol in DeepfakeBench (Yan et al. 2023b). We evaluate generalization along two dimensions: Cross-Dataset Evaluation and Cross-Manipulation Evaluation. We use CLIP ViT-L/14 (Radford et al. 2021) as the default backbone and evaluate other ViT-based backbones in Table 5. Following DeepfakeBench, we sample 8/32 frames for training/inference. AdamW (Loshchilov and Hutter 2017) is used with learning rates of for CLIP and for HSP, and batch sizes of 128/256. We apply standard augmentations (Yan et al. 2023b) and report video-level AUC and frame-level AUC/ACC. The default setting uses prototypes, with loss weights (1, 1, 1) and (0.5, 0.5, 0.5) for the first and second HSP modules, respectively. More details on the compared baselines are provided in Appendix C.
5.2 Cross-Paradigm Generalization Ability
Cross-Dataset Evaluation. We conduct cross-dataset evaluation to assess the generalization capability of HSP-CLIP, as summarized in Table 2. HSP-CLIP consistently outperforms all state-of-the-art baselines, achieving the highest average AUC at both video and frame levels. At the video level, HSP-CLIP achieves an average AUC of , surpassing the strongest competitor (-DFD) by , with notable improvements on challenging datasets such as DFDC (). At the frame level, HSP-CLIP further achieves an average AUC of , outperforming FSgD () by and obtaining consistent gains on Celeb-DF-v2 (), DFDC (), and DFDCP ().
Cross-Manipulation Evaluation. We also conduct cross-manipulation evaluation on DF40, as shown in Table 3. HSP-CLIP consistently achieves state-of-the-art performance across six representative face-swapping methods. It reaches an average video-level AUC of , outperforming Effort and VbSaT by . At the frame level, HSP-CLIP further achieves an average AUC of , exceeding FSgD by , with substantial improvements on challenging manipulations such as FaceDancer and e4s .
These results demonstrate that HSP-CLIP effectively organizes complex forgery evidence into a diverse and structurally decoupled prototype space, reducing reliance on dataset-specific shortcuts and preserving transferable forensic patterns across diverse manipulation strategies.
5.3 Ablation Study
Impact of the HSP Module Placement. We compare different HSP placement strategies, as summarized in Figure 4(b).
Table 4: Ablation studies (ACC, %) regarding the proposed HSP-CLIP with loss constraints.
| CDF-v2 | DFDCP | DFDC | InSwap | |||
|---|---|---|---|---|---|---|
| ✘ | ✘ | ✘ | 78.6 | 77.9 | 72.8 | 79.8 |
| ✓ | ✘ | ✘ | 81.3 | 80.3 | 76.2 | 81.5 |
| ✓ | ✓ | ✘ | 82.1 | 81.0 | 77.1 | 82.1 |
| ✓ | ✓ | ✓ | 82.8 | 81.6 | 77.5 | 82.9 |

(a) Performance gain of HSP over effort
(b) Ablation on HSP insertion positions
Figure 4: Performance gains of HSP over Effort and ablation study of HSP insertion positions. Figure (a) and (b) report video-level AUC (%) and frame-level ACC (%).
We denote the positions at one-quarter, one-half, and three-quarters of the backbone depth as , , and , respectively. Applying HSP at generally outperforms single placement at or , while the configuration achieves the weakest performance. Applying HSP at all three positions () also provides no further improvement, whereas the configuration achieves the best overall results. These results suggest that HSP is most effective on shallow-to-intermediate features that preserve fine-grained forensic cues, such as texture inconsistencies, blending boundaries, and geometric distortions. In contrast, early features at contain substantial low-level variations, while deeper features at encode more global semantics and are less suitable for fine-grained forgery-factor modeling. We therefore adopt as the default placement strategy.
Incremental Improvement of the Proposed Designs. We progressively introduce prototype reconstruction , prototype orthogonality , and assignment balance . As shown in Table 4, substantially improves the baseline, while further improves performance by encouraging factor independence. Adding achieves the best results across all benchmarks, confirming that balanced prototype utilization promotes a higher-effective-rank representation and improves cross-domain generalization.
Compatibility with Various Vision Foundation Models. We evaluate HSP on three representative backbones: ViT-Base (Dosovitskiy 2020), SigLIP (Zhai et al. 2023), and CLIP (Radford et al. 2021). As shown in Table 5, HSP consistently improves both ACC and AUC across all backbones and datasets, demonstrating its compatibility with different vision foundation models.
Compatibility with Existing Detectors. We further integrate it into Effort (Yan et al. 2024b), a strong recent generalizable deepfake detector, and report video-level AUC results in Figure 4(a). HSP improves the average AUC from to and brings consistent gains across the benchmarks. These results indicate that HSP can serve as a general plug-in regularization module for the advanced detectors.
Table 5: Ablation studies (%) of HSP integrated into different vision foundation models (VFMs).
| Method | CDF-v2 | CDF-v1 | FSGAN | |||
|---|---|---|---|---|---|---|
| ACC | AUC | ACC | AUC | ACC | AUC | |
| ViT-Base | 70.3 | 79.3 | 68.8 | 76.4 | 76.9 | 84.9 |
| +Ours | ||||||
| SigLIP | 69.9 | 82.8 | 72.8 | 82.4 | 85.3 | 90.7 |
| +Ours | ||||||
| CLIP | 78.6 | 84.5 | 79.2 | 87.4 | 88.7 | 93.9 |
| +Ours | ||||||

Figure 5: Impact of different numbers of prototypes (K).
Impact of the Number of Prototypes K. We evaluate five prototype settings as shown in Figure 5. DFDCP and FaceDancer achieve their best overall performance at K = 128 and K = 32, respectively. Complete results are provided in Appendix E. Cross-dataset evaluation entails broader shifts in identities and generation pipelines, benefiting from a larger prototype space that more finely models diverse forgery ProDe. In contrast, cross-manipulation evaluation mainly varies the manipulation algorithm while preserving similar facial content, for which moderate capacity is sufficient; larger K may instead introduce redundant directions and weaken generalization. This observation is consistent with our theoretical analysis that increasing K enlarges the maximum effective dimensionality supported by HSP and mitigates collapse into a few source-specific shortcut directions. We adopt K = 128 as the default setting, prioritizing the more challenging cross-dataset generalization.
Additional Analysis. Appendices D and E analyze robustness and loss-weight configurations, respectively, while Appendix F provides further evidence of balanced prototype utilization, high effective rank, and factor diversity.
6 Conclusion
In this paper, we identify a critical bottleneck in generalizable deepfake detection: forensic representation collapse, a failure mechanism where detectors over-index on volatile, dataset-specific shortcuts. To address this, we propose Hierarchical Spatial Prototype (HSP), a novel framework that explicitly models the forgery manifold via a set of learnable orthogonal prototypes. This design increases the effective capacity of the forensic representation from an information-bottleneck perspective, enabling the model to capture a diverse and structurally independent set of forensic cues. It achieves state-of-the-art generalization on prominent benchmarks, advancing the reliability of face forgery detection and helping mitigate the growing risks posed by generative AI.
References
Ba, Z.; Liu, Q.; Liu, Z.; Wu, S.; Lin, F.; Lu, L.; and Ren, K. 2024. Exposing the deception: Uncovering more forgery clues for deepfake detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, 719–728.
Cai, Y.; Li, J.; Li, Z.; Chen, W.; Lan, R.; Xie, X.; Luo, X.; and Li, G. 2025. DeepShield: Fortifying Deepfake Video Detection with Local and Global Forgery Analysis. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 12524–12534.
Cao, J.; Ma, C.; Yao, T.; Chen, S.; Ding, S.; and Yang, X. 2022. End-to-end reconstruction-classification learning for face forgery detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 4113–4122.
Chen, L.; Zhang, Y.; Song, Y.; Liu, L.; and Wang, J. 2022. Self-supervised learning of adversarial example: Towards good generalizations for deepfake detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 18710–18719.
Chen, X.; and He, K. 2021. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 15750–15758.
Chen, Y.; Yan, Z.; Cheng, G.; Zhao, K.; Lyu, S.; and Wu, B. 2024. X2-dfd: A framework for explainable and extendable deepfake detection. arXiv preprint arXiv:2410.06126.
Cheng, H.; Liu, M.-H.; Guo, Y.; Wang, T.; Nie, L.; and Kankanhalli, M. 2025. Fair Deepfake Detectors Can Generalize. arXiv preprint arXiv:2507.02645.
Cheng, J.; Yan, Z.; Zhang, Y.; Luo, Y.; Wang, Z.; and Li, C. 2024. Can we leave deepfake data behind in training deepfake detector? Advances in Neural Information Processing Systems, 37: 21979–21998.
Cozzolino, D.; Rössler, A.; Thies, J.; Nießner, M.; and Verdoliva, L. 2021. Id-reveal: Identity-aware deepfake video detection. In Proceedings of the IEEE/CVF international conference on computer vision, 15108–15117.
Cui, X.; Li, Y.; Luo, A.; Zhou, J.; and Dong, J. 2025. Forensics adapter: Adapting clip for generalizable face forgery detection. In Proceedings of the Computer Vision and Pattern Recognition Conference, 19207–19217.
Dang, H.; Liu, F.; Stehouwer, J.; Liu, X.; and Jain, A. K. 2020. On the detection of digital face manipulation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern recognition, 5781–5790.
Das, S.; Seferbekov, S.; Datta, A.; Islam, M. S.; and Amin, M. R. 2021. Towards solving the deepfake problem: An analysis on improving deepfake detection using dynamic face augmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 3776–3785.
Davies, D. L.; and Bouldin, D. W. 1979. A Cluster Separation Measure. IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-1(2): 224–227.
Dolhansky, B.; Bitton, J.; Pflaum, B.; Lu, J.; Howes, R.; Wang, M.; and Ferrer, C. C. 2020. The deepfake detection challenge (dfdc) dataset. arXiv preprint arXiv:2006.07397.
Dolhansky, B.; Howes, R.; Pflaum, B.; Baram, N.; and Ferrer, C. C. 2019. The deepfake detection challenge (dfdc) preview dataset. arXiv preprint arXiv:1910.08854.
Dong, X.; Bao, J.; Chen, D.; Zhang, T.; Zhang, W.; Yu, N.; Chen, D.; Wen, F.; and Guo, B. 2022. Protecting celebrities from deepfake with identity consistency transformer. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 9468–9478.
Dosovitskiy, A. 2020. An image is worth words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929.
Frank, J.; Eisenhofer, T.; Schönherr, L.; Fischer, A.; Kolossa, D.; and Holz, T. 2020. Leveraging frequency analysis for deep fake image recognition. In International conference on machine learning, 3247–3258. PMLR.
Fu, X.; Yan, Z.; Yao, T.; Chen, S.; and Li, X. 2025. Exploring unbiased deepfake detection via token-level shuffling and mixing. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, 3040–3048.
Haliassos, A.; Vougioukas, K.; Petridis, S.; and Pantic, M. 2021. Lips don't lie: A generalisable and robust approach to face forgery detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 5039–5049.
Han, Y.-H.; Huang, T.-M.; Hua, K.-L.; and Chen, J.-C. 2025. Towards More General Video-based Deepfake Detection through Facial Component Guided Adaptation for Foundation Model. In Proceedings of the Computer Vision and Pattern Recognition Conference, 22995–23005.
Horn, R. A.; and Johnson, C. R. 2012. Matrix analysis. Cambridge university press.
Huang, B.; Wang, Z.; Yang, J.; Ai, J.; Zou, Q.; Wang, Q.; and Ye, D. 2023. Implicit identity driven deepfake face swapping detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 4490–4499.
Jiang, L.; Li, R.; Wu, W.; Qian, C.; and Loy, C. C. 2020. Deeperforensics-1.0: A large-scale dataset for real-world face forgery detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2889–2898.
Kashiani, H.; Talemi, N. A.; and Afghah, F. 2025. Freqdebias: Towards generalizable deepfake detection via consistency-driven frequency debiasing. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 8775–8785. IEEE.
Kraskov, A.; Stögbauer, H.; and Grassberger, P. 2004. Estimating mutual information. Physical Review E—Statistical, Nonlinear, and Soft Matter Physics, 69(6): 066138.
Li, L.; Bao, J.; Zhang, T.; Yang, H.; Chen, D.; Wen, F.; and Guo, B. 2020a. Face x-ray for more general face forgery detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 5001–5010.
Li, Y.; and Lyu, S. 2019. Exposing deepfake videos by detecting face warping artifacts. In IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2–5, 14.
Li, Y.; Yang, X.; Sun, P.; Qi, H.; and Lyu, S. 2020b. Celeb-df: A large-scale challenging dataset for deepfake forensics. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 3207–3216.
Li, Z.; Li, J.; Cai, Y.; Chen, J.; Luo, X.; Li, G.; and Lan, R. 2025. FakeRadar: Probing Forgery Outliers to Detect Unknown Deepfake Videos. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 13382–13392.
Lin, Y.; Song, W.; Li, B.; Li, Y.; Ni, J.; Chen, H.; and Li, Q. 2024. Fake it till you make it: Curricular dynamic forgery augmentations towards general deepfake detection. In European conference on computer vision, 104–122. Springer.
Loshchilov, I.; and Hutter, F. 2017. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101.
Luo, A.; Kong, C.; Huang, J.; Hu, Y.; Kang, X.; and Kot, A. C. 2023. Beyond the prior forgery knowledge: Mining critical clues for general face forgery detection. IEEE Transactions on Information Forensics and Security, 19: 1168–1182.
Luo, Y.; Zhang, Y.; Yan, J.; and Liu, W. 2021. Generalizing face forgery detection with high-frequency features. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 16317–16326.
Ma, L.; Yan, Z.; Xu, J.; Chen, Y.; Guo, Q.; Bi, Z.; Liao, Y.; and Lin, H. 2025. From specificity to generality: Revisiting generalizable artifacts in detecting face deepfakes. arXiv preprint arXiv:2504.04827.
Ni, Y.; Meng, D.; Yu, C.; Quan, C.; Ren, D.; and Zhao, Y. 2022. Core: Consistent representation learning for face forgery detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 12–21.
Qian, Y.; Yin, G.; Sheng, L.; Chen, Z.; and Shao, J. 2020. Thinking in frequency: Face forgery detection by mining frequency-aware clues. In European conference on computer vision, 86–103. Springer.
Radford, A.; Kim, J. W.; Hallacy, C.; Ramesh, A.; Goh, G.; Agarwal, S.; Sastry, G.; Askell, A.; Mishkin, P.; Clark, J.; et al. 2021. Learning transferable visual models from natural language supervision. In International conference on machine learning, 8748–8763. PmLR.
Rossler, A.; Cozzolino, D.; Verdoliva, L.; Riess, C.; Thies, J.; and Nießner, M. 2019. Faceforensics++: Learning to detect manipulated facial images. In Proceedings of the IEEE/CVF international conference on computer vision, 1–11.
Shiohara, K.; and Yamasaki, T. 2022. Detecting deepfakes with self-blended images. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 18720–18729.
Shuai, C.; Zhong, J.; Wu, S.; Lin, F.; Wang, Z.; Ba, Z.; Liu, Z.; Cavallaro, L.; and Ren, K. 2023. Locate and verify: A two-stream network for improved deepfake detection. In Proceedings of the 31st ACM International Conference on Multimedia, 7131–7142.
Sun, K.; Chen, S.; Yao, T.; Liu, H.; Sun, X.; Ding, S.; and Ji, R. 2024. Diffusionfake: Enhancing generalization in deepfake detection via guided stable diffusion. Advances in Neural Information Processing Systems, 37: 101474–101497.
Sun, K.; Yao, T.; Chen, S.; Ding, S.; Li, J.; and Ji, R. 2022. Dual contrastive learning for general face forgery detection. In Proceedings of the AAAI conference on artificial intelligence, volume 36, 2316–2324.
The Conversation. 2025. Deepfakes leveled up in 2025 — here’s what’s coming next.
Van Den Oord, A.; Vinyals, O.; et al. 2017. Neural discrete representation learning. Advances in neural information processing systems, 30.
Vinh, N. X.; Epps, J.; and Bailey, J. 2010. Information Theoretic Measures for Clusterings Comparison: Variants, Properties, Normalization and Correction for Chance. Journal of Machine Learning Research, 11: 2837–2854.
Wang, H.; Shen, Z.; et al. 2021. Towards Out-of-Distribution Generalization: A Survey. arXiv preprint arXiv:2108.13624.
Yan, Z.; Luo, Y.; Lyu, S.; Liu, Q.; and Wu, B. 2024a. Transcending forgery specificity with latent space augmentation for generalizable deepfake detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 8984–8994.
Yan, Z.; Wang, J.; Wang, Z.; Jin, P.; Zhang, K.-Y.; Chen, S.; Yao, T.; Ding, S.; Wu, B.; and Yuan, L. 2024b. Effort: Efficient orthogonal modeling for generalizable ai-generated image detection. arXiv preprint arXiv:2411.15633, 2.
Yan, Z.; Zhang, Y.; Fan, Y.; and Wu, B. 2023a. Ucf: Uncovering common features for generalizable deepfake detection. In Proceedings of the IEEE/CVF international conference on computer vision, 22412–22423.
Yan, Z.; Zhang, Y.; Yuan, X.; Lyu, S.; and Wu, B. 2023b. Deepfakebench: A comprehensive benchmark of deepfake detection. arXiv preprint arXiv:2307.01426.
Yan, Z.; Zhao, Y.; Chen, S.; Guo, M.; Fu, X.; Yao, T.; Ding, S.; Wu, Y.; and Yuan, L. 2025. Generalizing deepfake video detection with plug-and-play: Video-level blending and spatiotemporal adapter tuning. In Proceedings of the Computer Vision and Pattern Recognition Conference, 12615–12625.
Zhai, X.; Mustafa, B.; Kolesnikov, A.; and Beyer, L. 2023. Sigmoid loss for language image pre-training. In Proceedings of the IEEE/CVF international conference on computer vision, 11975–11986.
Zhao, H.; Zhou, W.; Chen, D.; Wei, T.; Zhang, W.; and Yu, N. 2021. Multi-attentional deepfake detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2185–2194.
Zhuang, W.; Chu, Q.; Tan, Z.; Liu, Q.; Yuan, H.; Miao, C.; Luo, Z.; and Yu, N. 2022. UIA-ViT: Unsupervised inconsistency-aware method based on vision transformer for face forgery detection. In European conference on computer vision, 391–407. Springer.
A Theoretical Interpretation of the Diagnostic Metrics
• Cluster-level Fake Density (H) quantifies the concentration of fake samples within each local region of the feature space. It is conceptually related to cluster purity, but is designed to capture whether forgery evidence forms locally coherent and label-enriched forensic regions rather than merely geometrically compact clusters (Davies and Bouldin 1979).
• Cluster–Label Dependence (I) measures how strongly the discovered feature regions are associated with manipulation labels at the global level. It is closely related in spirit to mutual-information-based dependence measures (Vinh, Epps, and Bailey 2010), and reveals the extent to which the learned cluster structure contributes to the final discrimination between real and fake samples.
• Cross-Dataset Fake Density Correlation (P) evaluates whether the same forgery-enriched regions remain salient across datasets with different manipulation pipelines and distribution shifts. This metric is intended to quantify structural invariance of forensic patterns across domains (Wang, Shen et al. 2021), thereby connecting representation analysis to cross-dataset generalization.
Taken together, H, I, and P capture three complementary aspects of forgery representations. We further provide formal interpretations of each metric and discuss why none is sufficient in isolation.
Notation. Let denote the forensic label, where represents a fake sample, and let denote the cluster assignment of a spatial token. We denote the global fake prior by . For class-balanced evaluation, . For the c-th feature cluster, its population-level fake density is
The empirical definition used in the main paper is the corresponding sample estimate of Eq. (15).
A.1 Local Concentration Measured by H
We first establish the interpretation of H as a measure of local label enrichment.
Lemma 1 (Fake density under label-independent clustering). If the cluster assignment C is statistically independent of the forensic label Y, then for every cluster c with .
Proof. By statistical independence,
Lemma 1 provides a natural reference level for interpreting fake density. If the learned feature partition contains no label-relevant structure, every nonempty cluster has the same fake proportion as the global class prior , which equals 0.5 under balanced evaluation. Thus, clusters with correspond to local feature regions enriched with forged samples. This interpretation is further supported by
showing that, for a fixed prior, a larger provides stronger local evidence for the fake class. However, does not account for cluster probability mass. A small cluster may attain a high fake density while contributing little to the global decision, motivating the complementary use of .
A.2 Global Discriminability Measured by I
The Cluster–Label Dependence is defined as the mutual information between C and Y:
The following standard identities clarify its diagnostic meaning:
(19)
Lemma 2 (Characterization of zero cluster–label dependence). The following statements are equivalent:
-
-
C and Y are statistically independent;
-
for every cluster with .
Proof. Mutual information can be written as
The non-negativity of the Kullback–Leibler divergence gives , with equality if and only if
almost everywhere. This is exactly the definition of statistical independence and is equivalent to for all clusters with nonzero probability.
Equation (19) also shows why I complements H. The fake density of cluster c determines the conditional Bernoulli distribution . Consequently,
Thus, I aggregates the deviation of cluster-specific fake densities from the global class prior, weighted by the occurrence probability . A small but highly fake-enriched cluster has limited influence, whereas sufficiently populated real-and fake-enriched regions contribute to stronger global dependence. Moreover, since , larger I indicates that feature-region assignments reduce uncertainty about forensic labels. Therefore, I measures the global discriminative relevance of the learned partition rather than the purity of individual regions.
A.3 Cross-Domain Stability Measured by P
Let and denote the source and target domains, respectively. The cluster centroids are estimated only from and are then fixed when assigning target-domain tokens. This produces aligned fake-density profiles
Because both domains use the same source-derived centroids, each entry corresponds to the same source-defined feature region. Let denote the top- clusters with the largest source-domain fake densities. We define and . When both vectors have nonzero variance, their Pearson correlation is
Proposition 1 (Affine structural invariance). Suppose the target-domain fake-density profile satisfies , where and has nonzero variance. Then , i.e., for and for .
Proof. The centered target vector satisfies
Substituting into Eq. (25) yields .
Proposition 1 shows that P measures the preservation of the relative organization of forgery-enriched regions rather than identical density magnitudes across domains. A target domain may exhibit lower fake densities due to increased difficulty, yet P remains high if source-dominant fake-enriched clusters preserve their relative ordering. Conversely, a low or negative P indicates that source-domain forgery regions lose their association with fake samples after domain shift, suggesting reliance on unstable domain-specific shortcuts. The top-M restriction further focuses the analysis on the most forgery-relevant regions. Computing correlation over all clusters may be dominated by semantic or label-neutral regions with , which provide limited forensic information. Selecting M from the source domain therefore highlights source-derived forgery evidence while avoiding target-domain information leakage.
A.4 The Complementarity of Three Diagnostics
We then show through counterexamples that no individual diagnostic is sufficient to characterize a transferable forensic representation.
Proposition 2 (Non-sufficiency of individual diagnostics). Each of H, I, and P can attain a high value while the representation fails to satisfy at least one other desirable property of a transferable forensic representation.
Proof. We consider three constructions.
High H but low I. Suppose one cluster contains only fake tokens but has probability mass , where . Then its fake density satisfies . However, its contribution to Eq. (22) is weighted by and therefore vanishes as . Hence, a locally pure fake cluster need not induce globally discriminative structure.
High H and I but low P. Suppose the source domain contains an artifact that perfectly separates fake and real samples, producing highly label-enriched and sufficiently populated clusters. Both and can then be high. If the artifact is absent or reverses its label association in the target domain, the source-enriched clusters will not remain target-enriched, resulting in a low or negative P. This construction corresponds to source-domain shortcut learning.
High P but low H and I. Consider nonconstant vectors and satisfying for some , and define
where is arbitrarily small. Proposition 1 gives . However, as , all cluster-specific fake densities converge to the class prior . By Eq. (22), , and the clusters become nearly label-neutral. Thus, high correlation alone does not imply useful forensic discrimination.
These cases motivate the following joint interpretation.
Proposition 3 (Joint diagnostic interpretation). Jointly high values of H, I, and P indicate three complementary representation properties:
-
high H indicates locally fake-enriched feature regions;
-
high I indicates strong dependence between the feature partition and forensic labels;
-
high P indicates stable cross-domain organization of forgery-enriched regions.
High H, I, and P do not guarantee low target-domain classification error. Instead, they capture complementary and theoretically interpretable properties expected in transferable forensic representations: local label enrichment (H), global discriminability (I), and cross-domain structural stability (P). Together, these diagnostics distinguish stable forgery-related structures from fragile dataset-specific shortcuts.
B The Impact of Different M on Diagnostic Metrics
We further evaluate the robustness of the proposed diagnostics by varying the number of selected fake-dominated clusters as . As shown in Table 6, HSP-CLIP consistently achieves higher cluster-level fake density and cross-dataset fake density correlation than CLIP-FT across all target datasets and values of M, indicating more discriminative and cross-domain-stable forensic structures. The improvement in is most pronounced at small M and gradually narrows as more clusters are included. This behavior is consistent with the different representation structures learned by the two methods. CLIP-FT concentrates forgery evidence along a few dominant directions, making its most fake-enriched clusters more likely to encode source-specific

Ours Face X-ray SBI LipForensics F3Net UCF CORE FWA
Figure 6: Robustness evaluation under various unseen perturbations. The grouped bar charts illustrate the video-level AUC (%) performance of our method versus competing approaches across five different perturbation types: Color Saturation, JPEG Compression, Color Contrast, Block Wise, and Gaussian Blur. Performance is plotted against increasing severity levels from 0 to 5. Overall, our method demonstrates the strongest comprehensive robustness, achieving highly competitive performance across different unseen perturbation types.
Table 6: Quantitative comparison of the feature representations learned by CLIP-FT and HSP-CLIP under different values of , measured by cluster-level fake density and cross-dataset fake density correlation .
| Method | ||||||
|---|---|---|---|---|---|---|
| Celeb-DF-v2 | ||||||
| CLIP-FT | 0.996 | 0.973 | 0.907 | 0.483 | 0.853 | 0.914 |
| HSP-CLIP-FT | 0.998 | 0.985 | 0.936 | 0.832 | 0.960 | 0.934 |
| DFDCP | ||||||
| CLIP-FT | 0.965 | 0.950 | 0.861 | 0.544 | 0.914 | 0.942 |
| HSP-CLIP-FT | 0.993 | 0.968 | 0.883 | 0.917 | 0.976 | 0.979 |
| DFDC | ||||||
| CLIP-FT | 0.970 | 0.940 | 0.857 | 0.523 | 0.748 | 0.913 |
| HSP-CLIP-FT | 0.993 | 0.957 | 0.876 | 0.817 | 0.977 | 0.959 |
shortcuts. Because a small primarily evaluates these core clusters, CLIP-FT exhibits relatively weak cross-domain stability. In contrast, HSP reduces reliance on a few source-specific directions through multi-factor forgery-space modeling, substantially improving the consistency of dominant forensic regions across domains. As increases, additional clusters with weaker discriminative relevance or generic visual content are included, which may dilute the sensitivity of to shortcut-induced instability and narrow the gap between HSP-CLIP and CLIP-FT.
C Evaluation Benchmarking
To provide a comprehensive benchmark, we evaluate our approach against a diverse array of competitive baselines, including F3Net (Qian et al. 2020), Face X-Ray (Li et al. 2020a), RECCE (Cao et al. 2022), and SBIs (Shiohara and Yamasaki 2022), LaV (Shuai et al. 2023), CFM (Luo et al. 2023), IID (Huang et al. 2023), UCF (Yan et al. 2023a), FakeRadar (Li et al. 2025), LSDA (Yan et al. 2024a), FCG (Han et al. 2025), ProDet (Cheng et al. 2024), VbSaT (Yan et al. 2025), DeepShield (Cai et al. 2025), -DFD (Chen et al. 2024), FreqDebias (Kashiani, Talemi, and Afghah 2025), ExposDe (Ba et al. 2024), FSgD (Ma et al. 2025), RAID (Cheng et al. 2025), UDD (Fu et al. 2025), DFFake (Sun et al. 2024), ICT (Dong et al. 2022), CDFA (Lin et al. 2024), and Effort (Yan et al. 2024b). For a fair and rigorous comparison, all models are trained on the FaceForensics++ (c23) dataset and evaluated across multiple unseen datasets and manipulation techniques to assess their cross-domain generalization.
D Robustness to Image Degradations
To evaluate the robustness of HSP against common image degradations, we adopt the evaluation protocols from previous studies (Haliassos et al. 2021; Yan et al. 2024b,a; Jiang et al. 2020). Specifically, we examine five distinct types of perturbations: Color Saturation Change, JPEG Compression, Color Contrast Change, Block-wise Distortion, and Gaussian Blur. For each perturbation, severity levels ranging from 0 (clean) to 5 are applied to assess model stability under varying degrees of degradation. All models are trained on
Table 7: Performance comparison across different numbers of prototypes. Results are reported in frame-level ACC and AUC (%). The best result for each dataset and metric is shown in bold. Blue cells highlight the selected high-performance region.
| K | Metric | CD2 | CD1 | DFDCP | DFD | DFDC | SimSwap | UniFace | e4s | FaceDancer | FSGAN | InSwap |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 8 | ACC | 79.1 | 78.9 | 78.4 | 91.2 | 76.8 | 83.0 | 87.2 | 90.3 | 83.1 | 89.1 | 83.2 |
| AUC | 89.5 | 90.6 | 87.8 | 94.1 | 87.2 | 89.2 | 93.9 | 96.8 | 90.4 | 95.5 | 90.3 | |
| 16 | ACC | 81.6 | 81.3 | 79.5 | 90.9 | 76.3 | 85.0 | 87.7 | 90.1 | 84.6 | 90.2 | 84.2 |
| AUC | 89.8 | 91.3 | 87.0 | 94.1 | 86.2 | 91.9 | 95.1 | 97.0 | 92.3 | 95.9 | 91.6 | |
| 32 | ACC | 82.0 | 82.9 | 80.3 | 90.9 | 76.7 | 83.6 | 89.1 | 93.1 | 85.1 | 90.4 | 82.4 |
| AUC | 90.3 | 89.7 | 87.9 | 94.2 | 85.6 | 90.2 | 94.7 | 97.7 | 92.4 | 96.3 | 90.4 | |
| 64 | ACC | 82.3 | 82.7 | 80.8 | 89.5 | 76.9 | 81.1 | 87.6 | 91.4 | 83.2 | 90.1 | 80.9 |
| AUC | 89.8 | 91.2 | 89.2 | 93.9 | 85.4 | 90.0 | 94.3 | 97.0 | 92.1 | 95.9 | 90.7 | |
| 128 | ACC | 82.8 | 83.5 | 81.6 | 90.1 | 77.5 | 81.6 | 86.0 | 91.1 | 83.5 | 90.7 | 82.9 |
| AUC | 90.9 | 91.9 | 90.0 | 94.3 | 86.7 | 88.7 | 93.4 | 97.2 | 91.8 | 95.8 | 91.4 |
Table 8: Ablation study on layer-wise loss weighting. Uniform Weighting assigns identical loss weights to both HSP layers, whereas Hierarchical Weighting reduces the loss weights of the second HSP layer by half. Results are reported in frame-level ACC and AUC (%), with the best result for each dataset and metric shown in bold.
| Weighting Strategy | Metric | CD2 | CD1 | DFDCP | DFD | DFDC | SimSwap | UniFace | e4s | FaceDancer | FSGAN | InSwap |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Uniform | ACC | 82.2 | 83.8 | 81.8 | 92.2 | 76.8 | 80.7 | 85.1 | 89.8 | 83.5 | 90.6 | 82.1 |
| AUC | 90.6 | 91.8 | 88.9 | 93.7 | 85.9 | 87.9 | 92.7 | 97.0 | 91.7 | 95.5 | 90.2 | |
| Hierarchical | ACC | 82.8 | 83.5 | 81.6 | 90.1 | 77.5 | 81.6 | 86.0 | 91.1 | 83.5 | 90.7 | 82.9 |
| AUC | 90.9 | 91.9 | 90.0 | 94.3 | 86.7 | 88.7 | 93.4 | 97.2 | 91.8 | 95.8 | 91.4 |
FaceForensics++ (c23) and evaluated based on video-level AUC scores. We compare our method against several state-of-the-art approaches, including Face X-ray (Li et al. 2020a), SBI (Shiohara and Yamasaki 2022), LipForensics (Haliassos et al. 2021), and FWA (Li and Lyu 2019). Additionally, for a strictly fair comparison, we reproduce F3Net (Qian et al. 2020), UCF (Yan et al. 2023a), and CORE (Ni et al. 2022), ensuring they utilize the same data augmentation scheme as our proposed method. The quantitative results under these unseen perturbations are illustrated in Figure 6. As observed, while most competing methods suffer significant performance drops under severe perturbations, particularly in JPEG compression and Gaussian blur where high-frequency details are lost, our method maintains consistently high performance across all severity levels. Even compared to the reproduced baselines (Qian et al. 2020; Yan et al. 2023a; Ni et al. 2022) trained with identical data augmentation, HSP-CLIP demonstrates superior stability, validating that its robustness stems from the learned generalized features rather than merely data augmentation.
E Additional Ablation Studies
E.1 Impact of the Number of Prototypes
We vary the number of prototypes within , and the results are shown in Table 7. On cross-dataset benchmarks (e.g., CD2, CD1, DFDCP, and DFDC), performance generally improves with a larger prototype space, achieving the best results at K = 128. In contrast, under cross-manipulation evaluation (e.g., DF40), performance peaks at K = 32 and slightly decreases with further expansion. This trend is consistent with the experimental conclusions reported in the main text.
E.2 Impact of Hierarchical Loss Weighting
To examine whether different HSP layers require different regularization strengths, we compare two loss-weighting strategies. Uniform Layer-wise Weighting assigns identical weights to all HSP layers, while Hierarchical Layer-wise Weighting reduces the loss weights of the second layer by half. As shown in Table 8, hierarchical weighting achieves more consistent performance across most benchmarks, while uniform weighting is only beneficial on a few datasets. This behavior stems from the hierarchical nature of forensic representations. Earlier layers preserve fine-grained forgery cues, such as texture inconsistencies and blending boundaries, and are therefore more suitable for factor modeling and decoupling. In contrast, deeper layers encode more global semantic information, where excessive reconstruction and decoupling constraints may restrict their discriminative capacity. Reducing the regularization strength of the second HSP layer thus preserves high-level semantics while maintaining structured modeling of fine-grained cues. This observation is consistent with the layer-placement results in Figure 4(b), where deeper features are less suitable for fine-grained factor decoupling.
F Analysis of Internal Properties Explaining HSP Effectiveness
F.1 Prototype Diversity Analysis.
We assess the diversity of the learned spatial prototypes under the dual-layer HSP configuration with . For each module, we compute the cosine similarity matrix , where is obtained by row-wise normalization. As shown in Figure 7(a,b), both similarity matrices exhibit clear identity-like structures, with diagonal entries

Figure 7: Cosine similarity analysis of the learned spatial prototypes in the two HSP modules ( ). (a,b) Prototype cosine similarity matrices, where the off-diagonal entries are concentrated near zero. (c) Distributions of off-diagonal cosine similarities, with mean absolute values of and for Modules 1 and 2, respectively. These near-zero similarities demonstrate that HSP learns geometrically decoupled prototypes with minimal redundancy.
of 1.0 and off-diagonal values concentrated near zero. Figure 7(c) further quantifies this behavior: the mean absolute off-diagonal cosine similarities are only and for Modules 1 and 2, respectively. These results confirm that the orthogonality constraint learns nearly independent prototype directions with minimal redundancy, effectively preventing prototype collapse.
F.2 Prototype Assignment Analysis
To validate the assignment balance constraint, we randomly sample 2,000 real and 2,000 fake images from CDF-v2 and extract token-to-prototype soft assignments from the two HSP modules with K = 128. We evaluate assignment balance from two complementary perspectives. First, we average the assignments over all tokens to obtain the marginal prototype-usage distribution and measure its uniformity using Perplexity:
whose maximum is under perfectly uniform usage. Second, we center the assignment matrix as and compute the normalized eigenvalues of as . We then quantify the diversity of assignment variations using the effective rank:
Because each assignment vector sums to one, the centered assignments lie in a -dimensional subspace, yielding a maximum admissible effective rank of .
As shown in Figure 8, the prototype-usage frequencies of both modules closely follow the uniform baseline 1/K. Module 1 and Module 2 achieve Perplexity scores of 125.97 and 126.44, respectively, approaching the theoretical maximum of 128 and indicating broad prototype utilization. Their effective ranks reach 95.09 and 103.87, corresponding to 74.8% and 81.8% of the admissible maximum, respectively. Both values approach the theoretical maximum of 127, particularly for Module 2, indicating that assignment variations span a broad set of valid directions, thereby enabling the model to learn a richer set of latent forgery-feature directions.
F.3 Visualization of Spatial Prototype Activation Maps
To understand the representations learned by HSP, we visualize the spatial activation maps of optimized prototypes. Specifically, we extract token-to-prototype assignment maps from the second HSP module, select 8 representative prototypes, and upsample their assignment weights to the original resolution. As shown in Figure 9, different prototypes exhibit distinct spatial preferences across images, with some focusing on localized artifacts around the eyes or mouth and others capturing global facial structures or blending boundaries. This spatial disentanglement validates that orthogonality and balance constraints encourage the decomposition of complex forgery evidence into diverse and independent structural patterns.
G Limitation
Our method improves cross-domain generalization by using learnable spatial prototypes to model forgery representations through multiple latent factors. However, this factorization is driven by representation-level constraints rather than explicit supervision for specific forensic cues. Consequently, the learned prototype factors are not guaranteed to align with physically interpretable manipulation traces, such as blending boundaries, frequency inconsistencies, or rendering artifacts. Future work could introduce finer-grained supervision over different dimensions of the prototype space, for example, through manipulation-specific auxiliary objectives or forgery-region localization (Shuai et al. 2023; Li et al. 2020a), to improve the interpretability and semantic alignment of the learned factors.

HSP Module 1 | Perp: 125.97
HSP Module 2 | Perp: 126.44

HSP Module 1 | Effective Rank: 95.09
HSP Module 2 | Effective Rank: 103.87
Figure 8: Prototype assignment balance across the two HSP modules ( ) on CDF-v2. The left panel shows the prototype-usage frequencies, with the red dashed line denoting the uniform baseline (1/K); both modules achieve Perplexity scores close to the theoretical maximum of 128. The right panel shows the normalized eigenvalue spectra of the centered assignment covariance, where the effective ranks reach 95.09 and 103.87 and approach the maximum admissible value of 127, indicating broad utilization of the admissible assignment subspace.

Figure 9: Visualization of spatial prototype activation maps. We visualize the bilinearly upsampled token-to-prototype soft assignments for 8 selected prototypes (columns) across various input faces (rows). Notably, each prototype isolates distinct and consistent localized regions (e.g., eyes, mouth, or blending boundaries) regardless of the subject's identity. This demonstrates that the HSP framework successfully disentangles forgery artifacts into diverse, independent structural patterns, mitigating over-reliance on localized shortcuts.