A general deepfake detection method based on joint space-frequency domain debiasing
By employing a detection method that combines spatial and frequency domain bias removal, and utilizing a dual-branch architecture and feature fusion technology, the problem of insufficient generalization ability of deepfake detection technology when facing unknown forgery algorithms and real-world variations is solved, achieving higher detection accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF INFORMATION SCI & TECH
- Filing Date
- 2026-03-06
- Publication Date
- 2026-05-15
AI Technical Summary
Existing deepfake detection technologies lack generalization ability when faced with unknown forgery algorithms and real-world changes, and fail to effectively utilize frequency domain information, resulting in decreased detection performance.
A detection method that combines spatial and frequency domain debiasing is adopted. By constructing a dual-branch architecture, features are extracted in the spatial and frequency domains respectively. The feature fusion is achieved by using a teacher-student debiasing framework and a cross-attention module, thus realizing non-destructive debiasing learning.
It significantly improves the detection generalization ability and robustness against unknown forgery techniques, maintains high performance on diverse datasets, and solves the problem of poor generalization ability in existing technologies.
Smart Images

Figure CN121810669B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence security technology, specifically to a general deepfake detection method based on joint spatial and frequency domain debiasing. Background Technology
[0002] In recent years, with the rapid development of deep learning, especially Generative Adversarial Networks (GANs), digital content generation and tampering technologies have made groundbreaking progress. Among these, deepfake technologies, such as face replacement, expression-driven techniques, and face synthesis, can create extremely realistic forged images and videos that are difficult for the human eye to distinguish. Therefore, developing technologies that can automatically, accurately, and reliably detect various types of deepfake content has become a crucial research topic in the field of information security.
[0003] Early forgery detection methods primarily focused on identifying fixed patterns of artifacts introduced by specific forgery algorithms, such as analyzing color inconsistencies, splicing boundaries, or unique noise patterns in images. However, with the continuous iteration of forgery techniques, these fixed-pattern-based methods quickly became ineffective due to improvements in forgery quality. Modern detection methods mainly rely on data-driven deep learning models, particularly Convolutional Neural Networks (CNNs). These models learn discriminative features to distinguish between real and forged images by training on a large number of real and forged images. However, these methods generally face a core bottleneck: severely insufficient generalization ability. Specifically, a model trained on a specific dataset often experiences a catastrophic drop in detection performance when used to detect data generated by novel, unseen forgery algorithms, or when faced with real-world images subjected to varying compression, lighting changes, and pose variations.
[0004] The root cause of this generalization deficiency lies in the fact that deep learning models tend to seek "shortcuts" to complete classification tasks during training, thereby learning spurious correlations. In deepfake detection tasks, this manifests as the model potentially failing to learn to recognize the universal physical or semantic traces left by the forgery techniques themselves, instead relying excessively on:
[0005] 1. Dataset bias: For example, in a particular dataset, the background texture of fake faces may be relatively uniform, or the lighting conditions of real faces may be more regular. The model may incorrectly use "specific background" or "specific lighting" as the basis for judging fakes.
[0006] 2. Artifact Overfitting: The model may overfit to the unique, subtle imperfections produced by a particular forgery algorithm. When faced with an image generated by another algorithm, the model may fail to recognize the imperfection patterns due to their different characteristics.
[0007] To improve generalization ability, researchers have explored various approaches. One approach leverages the powerful prior knowledge of large pre-trained visual models. However, simple fine-tuning or adapter strategies still cannot fundamentally solve the problem of spurious associations in high-level semantic learning. Another approach uses data augmentation to force the model to focus on more robust features, such as input perturbations. A representative work disrupts the global structure of an image by randomly shuffling image patches, forcing the model to learn local inconsistencies within the patches. However, this destructive operation is a double-edged sword: while disrupting spurious associations, it also destroys the structural continuity of forgery traces. For example, a smooth face-swapping boundary spanning multiple image patches will lose its semantic continuity after being shuffled, which is extremely detrimental to the model's learning and judgment.
[0008] Furthermore, most existing methods primarily analyze data in the spatial domain, neglecting crucial information hidden in the frequency domain. The processes of image generation, alteration, and compression often leave unique, spatially imperceptible traces in their frequency spectrum. This failure to effectively utilize frequency domain information also limits the capabilities of existing detection methods. In conclusion, despite some progress in deepfake detection technology, designing a detection method that effectively suppresses spurious associations, fully utilizes multimodal information (especially frequency domain information), and maintains the structural integrity of forged features during bias removal remains a pressing technical challenge in this field. Summary of the Invention
[0009] The purpose of this invention is to provide a general deepfake detection method based on joint spatial and frequency domain debiasing. This method can overcome the shortcomings of existing deepfake detection technologies, such as insufficient generalization ability, inadequate information utilization, and damage to feature integrity. By performing independent and non-destructive debiasing learning on the dual-branch features in the spatial and frequency domains, the method significantly improves the model's generalization ability and robustness in detecting unknown sources and novel forgery techniques.
[0010] To achieve the above functions, this invention designs a general depth forgery detection method based on joint spatial and frequency domain de-biasing, which executes the following steps S1-S6 to complete the detection of forged videos:
[0011] Step S1: Collect a preset number of real videos and fake videos containing human faces to construct a training set;
[0012] Step S2: Extract a fixed number of frame images for each video, perform face localization on the frame images to determine the location of the face, and obtain the face image by cropping;
[0013] Step S3: Construct a dual-branch architecture that includes a spatial branch and a frequency branch. Input the face image into the spatial branch and the frequency branch in parallel. The spatial branch and the frequency branch are based on the visual encoder, and output spatial features and frequency features respectively.
[0014] Step S4: Construct a teacher-student debiasing framework that includes a teacher model and a student model. Construct loss functions for each model to minimize the difference between the outputs of the teacher model and the student model in the spatial and frequency domains. Perform debiasing training on the two branches to obtain the debiased spatial and frequency domain features.
[0015] Step S5: Input the bias-reduced spatial and frequency domain features output by the teacher model into the cross-attention module for fusion to obtain fused features;
[0016] Step S6: Input the fused features into a classifier, output the frame image as the detection result of real or fake, calculate the classification loss and update the model parameters.
[0017] Beneficial effects: Compared with the prior art, the advantages of the present invention include:
[0018] This invention provides a general deepfake detection method based on joint spatial and frequency domain bias removal. By independently and non-destructively learning the bias removal of features in both the spatial and frequency domains, the model is guided to master more essential and transferable forgery features, while deeply integrating the complementary advantages of multimodal information. The detection model constructed by this invention significantly improves the generalization ability and robustness against forgery techniques from unknown sources and novel techniques, solving the core pain point of poor generalization ability in existing technologies. Attached Figure Description
[0019] Figure 1 This is a flowchart of a general deepfake detection method based on joint spatial and frequency domain debiasing according to an embodiment of the present invention;
[0020] Figure 2 This is a structural diagram of the spatial and frequency domain dual-branch architecture provided in an embodiment of the present invention;
[0021] Figure 3 This is a structural diagram of a frequency enhancement module provided according to an embodiment of the present invention;
[0022] Figure 4 This is a structural diagram of the teacher-student bias removal framework provided in an embodiment of the present invention;
[0023] Figure 5 This is a structural diagram of the cross-attention module provided according to an embodiment of the present invention. Detailed Implementation
[0024] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0025] This invention provides a general deepfake detection method based on joint spatial and frequency domain depolarization, referring to... Figure 1 Perform the following steps S1-S6 to complete the detection of the fake video:
[0026] Step S1: Collect a preset number of real videos and fake videos containing human faces to construct a training set;
[0027] In this embodiment, a large-scale deepfake video dataset, publicly released internationally and widely adopted by the academic community, was utilized. These datasets were constructed to simulate diverse forgery scenarios that might be encountered in the real world, providing a foundation for developing robust and generalizable detection models. A representative dataset is FaceForensics++, which contains videos generated by various mainstream and continuously evolving forgery techniques, such as early Deepfakes and FaceSwap techniques, which primarily achieve pixel-level replacement of face regions through autoencoders; and later techniques like Face2Face based on graphics rendering and NeuralTextures based on texture synthesis. This dataset not only provides a large number of high-quality forged video samples but also corresponding original real videos shot in the same scenarios, enabling the model to learn to distinguish subtle differences between real and forged videos under controlled conditions. Furthermore, to simulate the quality degradation that videos may encounter during internet transmission, the FaceForensics++ dataset also provides versions with different compression levels (such as high-quality C23 and low-quality C40), which is crucial for training models capable of handling artifacts in real-world network environments. Besides FaceForensics++, other challenging datasets with different characteristics exist in this field, such as Celeb-DF and DFDC. The fake videos in these datasets are visually more realistic and the forgery traces are more subtle, placing higher demands on the discrimination capabilities of detection models. The method of this invention aims to learn generalized forgery features that can be generalized to more challenging, unknown datasets such as Celeb-DF by training on diverse datasets like FaceForensics++.
[0028] Step S2: Extract a fixed number of frame images for each video, perform face localization on the frame images to determine the location of the face, and obtain the face image by cropping;
[0029] The specific steps of step S2 are as follows:
[0030] Step S2.1: For each video in the training set, sample from each video at fixed time intervals to extract a preset number of content-differentiated frame images;
[0031] Step S2.2: Process the frame image using the DLIB model to locate the face region, and crop the frame image based on the face region location result to obtain the initial face image;
[0032] Step S2.3: Scale the initial face image to a preset fixed resolution. In this embodiment, the fixed resolution is 224x224 pixels to obtain face image X.
[0033] Step S3: Construct a dual-branch architecture that includes a spatial branch and a frequency branch. Input the face image into the spatial branch and the frequency branch in parallel. The spatial branch and the frequency branch are based on the visual encoder, and output spatial features and frequency features respectively.
[0034] The specific method for step S3 is as follows:
[0035] Reference Figure 2 A two-branch architecture is constructed, comprising a spatial branch and a frequency branch. In the spatial branch, a linear projection layer is used. The face image X is converted into an image patch embedding sequence and then input into the first visual encoder. To obtain spatial characteristics , ;
[0036] Reference Figure 3 In the frequency domain branch, the face image X is processed by the frequency enhancement module. Convert to frequency-enhanced image The specific steps are as follows:
[0037] Step S3.1: Transfer the face image Input to a spatially rich model Layers are used to extract high-frequency residual feature maps. ;
[0038] Step S3.2: Extract the high-frequency residual feature map The input is fed in parallel to the first and second processing paths; in the first processing path, it passes sequentially through a convolutional layer, a batch normalization layer, an activation layer, and then through a coordinate attention module. The process is performed to obtain the output features of the first processing path. In the second processing path, the data is processed sequentially through convolutional layers, batch normalization layers, and activation layers to obtain the output features of the second processing path. ;in, This represents the activation function of the activation layer. This indicates batch normalization layer processing. Indicates convolutional layer processing;
[0039] Step S3.3: Output features of the first path Slicing along the channel dimension yields the first feature subset used for summation. and the first feature subset used for splicing Output features of the second path Slicing along the channel dimension yields a second feature subset used for summation. and the second feature subset used for splicing ; through the and Perform element-wise summation to calculate the summation characteristics. By along the channel dimension and The splicing is performed, and the splicing features are calculated. ,in, Indicates a splicing operation;
[0040] Step S3.4: Add the features splicing features The features are then concatenated again along the channel dimension to obtain the interactive features. Finally, the interactive features are... The data is sequentially fed into a convolutional layer, a batch normalization layer, and an activation layer, outputting a frequency-enhanced image. ,in, This represents the activation function of the activation layer. This indicates batch normalization layer processing. This indicates convolutional layer processing.
[0041] In the frequency domain branch, the face image X is first processed through a frequency enhancement module. Convert to frequency-enhanced image The frequency-enhanced image is then enhanced through a linear projection layer. Convert to image patch embedding sequence Finally Input to the second visual encoder Frequency domain features are obtained. , ,in, and The two CLIP models have built-in image encoders and linear projection layers. This is a linear mapping layer that comes with the CLIP model.
[0042] Step S4: Construct a teacher-student debiasing framework TSDF containing a teacher model and a student model. Construct loss functions to minimize the differences between the outputs of the teacher model and the student model in the spatial and frequency domains. Perform debiasing training on the two branches to obtain the debiased spatial and frequency domain features.
[0043] The specific method for step S4 is as follows:
[0044] Step S4.1: Refer to Figure 4 A teacher-student debiasing framework is constructed, comprising a teacher model T and a student model S. Teacher model T and student model S share the architecture of step S3, and spatial features are... and frequency domain features The prediction results output by teacher model T are obtained by using the classifier heads of teacher model T and student model S respectively. And the prediction results output by the student model S. The prediction result is logits, which is the linear output of the model for each class; the loss of the teacher model T is calculated for both the spatial and frequency domain branches. The loss of the student model S The specific formula is as follows:
[0045] ;
[0046] ;
[0047] in, Indicates loss due to imitation. The classification loss is represented by the Softmax function. ; This represents the probability distribution calculated using the Softmax function. Represents the true category label of the image. Represents a real human face. Represents fake faces, To balance the hyperparameters;
[0048] Step S4.2: Simulate Loss The KL divergence between the probability distributions of the teacher model T and the student model S in the corresponding branches is obtained by calculating the following formula:
[0049] ;
[0050] in, and Let T and S represent the prediction results output by the teacher model T and student model S, respectively. This represents the probability distribution calculated using the Softmax function, and KL represents the KL divergence calculation. This indicates that the gradient of the objective term is truncated when calculating the loss.
[0051] Step S5: Input the bias-reduced spatial and frequency domain features output by the teacher model into the cross-attention module for fusion to obtain fused features;
[0052] Reference Figure 5 The specific processing steps of the cross-attention module in step S5 are as follows:
[0053] Step S5.1: Debiased spatial features As a query, the bias-free frequency domain features As keys and values; and through three independent linear projection layers , , The query matrix is calculated separately. Key matrix and value matrix ;
[0054] Step S5.2: Calculate the attention score matrix as follows. First, calculate the query matrix. AND key matrix transpose The dot product is then calculated, and the result is scaled as follows:
[0055] ;
[0056] in, Key matrix Feature dimensions;
[0057] Through attention score matrix Log-value matrix Perform a weighted summation to obtain the single-head attention output. ;
[0058] Step S5.3: Perform the attention calculation in step S5.2 in parallel 8 times to obtain 8 independent single-head attention outputs. Concatenate all single-head attention outputs along the feature dimension to obtain multi-head concatenated features. in, This indicates a splicing operation; then it passes through an output linear projection layer. Multi-head splicing features The data is then integrated to obtain the final attention-weighted representation. ;
[0059] Step S5.4: Weighted representation of attention Spatial features from the original input to step S5.1 Element-wise summation is performed to form residual connections; finally, the summed result is normalized through a layer. Operations are performed to obtain the final fusion features. .
[0060] Step S6: Input the fused features into a classifier, output the frame image as the detection result of real or fake, calculate the classification loss and update the model parameters.
[0061] Step S6 updates the model parameters using a two-stage alternating optimization strategy, the specific steps of which are as follows:
[0062] Step S6.1: First, perform bias-free learning of the dual-branch architecture. Within a training batch, simultaneously update the parameters of the spatial and frequency domain branches of the teacher model T and the student model S.
[0063] Step S6.2: Perform spatial and frequency domain feature fusion and classifier tuning. Within the same training batch, freeze the parameters of the spatial and frequency domain branches of the teacher model T, and only update the parameters of the cross-attention module and the classifier.
[0064] In the dual-branch architecture, both the spatial and frequency domain branches are based on a pre-trained visual model, and their parameters are tuned using the low-rank adaptive LoRA method.
[0065] In steps S3 to S6, this embodiment uses the AdamW optimizer to optimize the trainable parameters of the model. In each training round, the model calculates its predicted results (logits) on the current batch of data through forward propagation and calculates the loss value based on a predefined loss function (such as a combined loss including classification loss and imitation loss). Subsequently, the gradient of the loss value with respect to the model parameters is calculated through the backpropagation algorithm, and the AdamW optimizer updates the parameters based on this gradient. This training process continues for multiple rounds until the model's performance on the validation set converges or meets a preset stopping condition. The parameters obtained at this point are the optimal parameters, thus obtaining a trained, deployable, general-purpose deepfake detection model.
[0066] To objectively evaluate the generalization ability of the final deepfake detection model, this embodiment employs a rigorous cross-dataset testing strategy. Specifically, the model is trained solely on the FaceForensics++ dataset, while performance evaluation is conducted on a series of publicly available test sets that the model had never seen during training, such as Celeb-DF, DFDC, and DFD. During evaluation, the image data from the test sets undergoes the same preprocessing steps as during training before being input into the trained model to obtain its predicted forgery probability for each frame. Finally, the AUC (Area Under the Curve) performance metric is calculated by comparing all predicted values with the true labels in the test set. AUC measures the model's ability to distinguish between real and fake samples independently of the classification threshold; a higher AUC value indicates stronger predictive performance and generalization ability.
[0067] The performance of the method of the present invention is verified in a specific and challenging cross-dataset generalization scenario to demonstrate its significant advantages over the prior art.
[0068] To conduct an objective and rigorous performance evaluation, this embodiment strictly adheres to academically recognized guidelines for testing generalization capabilities across datasets. In its experimental setup, this embodiment uses only a single, diverse, large-scale public dataset—a high-quality compressed version (c23) of FaceForensics++ (FF++)—as the sole training data source. This dataset was chosen because it contains fake videos generated using four different techniques (Deepfakes, FaceSwap, Face2Face, and NeuralTextures), providing the model with a rich set of fakery patterns to learn. Throughout the training process, the model does not access information from any other datasets to ensure fairness in the testing. To comprehensively examine the model's generalization ability—its performance when faced with unknown fakery algorithms and data distributions—this embodiment selects four publicly available test sets widely used in academia as "litmus tests" that the model has never encountered during the training phase. These test sets include Celeb-DF (v1 and v2 versions, abbreviated as CDF1 and CDF2 respectively), renowned for its extremely high-quality, highly realistic fake videos. The forgery traces in this dataset are extremely subtle, posing a significant challenge to the detection model's ability to distinguish them. DFDC contains a large number of videos from real internet environments, subjected to various unknown compression and post-processing techniques, used to test the model's robustness in complex real-world scenarios. DFD is another dataset commonly used for generalization benchmark testing. The core performance evaluation metric is frame-level AUC (Area Under the Curve), which comprehensively measures the model's ability to distinguish real samples from fake samples independently of the classification threshold. A higher AUC value indicates stronger overall model performance and generalization ability. To demonstrate the advancement of this invention, several representative existing techniques are selected for performance comparison. These methods range from classic CNN-based methods (such as Xception), to frequency domain analysis-based methods (such as SRM), and to the latest state-of-the-art methods based on CLIP pre-trained models (such as Fadapter), forming a comprehensive and convincing comparative benchmark.
[0069] The model trained according to the method of this invention was evaluated on the four independent test sets and rigorously compared with the baseline model. The experimental results clearly demonstrate the significant superiority of the method of this invention. Specifically, the method of this invention achieved an average AUC of 90.25% across the four test sets. This achievement not only significantly surpasses classic methods such as Xception (76.0%) and SRM (76.5%), but also outperforms the latest state-of-the-art method, Fadapter (89.8%), by a considerable margin, fully demonstrating the leading position of the method of this invention in overall generalization performance. More notably, the method of this invention demonstrates a breakthrough ability in identifying high-quality, high-difficulty forged samples. For example, it achieved an AUC of 95.6% on the CDF1 dataset and 93.5% on the DFD dataset. Both of these metrics represent state-of-the-art performance, showing a significant improvement over all compared methods. Furthermore, the method of this invention maintained high and stable performance on all four unseen test sets, without exhibiting significant weaknesses on specific datasets (e.g., some methods show a sharp performance drop on DFDC). This balanced and robust performance strongly demonstrates that the method of this invention, through its unique spatial-frequency joint debiasing mechanism, truly learns more essential and universal spoofing features, rather than relying on spurious associations specific to a particular dataset, and thus possesses greater robustness.
[0070] In summary, through direct and quantitative performance comparisons with various existing technologies covering different technical approaches under strictly controlled cross-dataset experimental conditions, the experimental results irrefutably demonstrate that the spatial-frequency domain joint debiasing method proposed in this invention can effectively suppress the learning of spurious associations and instead grasp more generalizable essential features of forgery. Its accuracy, stability, and robustness in cross-dataset deepfake detection tasks are significantly higher than existing technologies, successfully and in a superior manner solving the core technical problem of insufficient generalization ability mentioned in the background art.
[0071] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A general deepfake detection method based on joint spatial and frequency domain debiasing, characterized in that, Perform the following steps S1-S6 to complete the detection of the fake video: Step S1: Collect a preset number of real videos and fake videos containing human faces to construct a training set; Step S2: Extract a fixed number of frame images for each video, perform face localization on the frame images to determine the location of the face, and obtain the face image by cropping; Step S3: Construct a dual-branch architecture that includes a spatial branch and a frequency branch. Input the face image into the spatial branch and the frequency branch in parallel. The spatial branch and the frequency branch are based on the visual encoder, and output spatial features and frequency features respectively. Step S4: Construct a teacher-student debiasing framework that includes a teacher model and a student model. Construct loss functions for each model to minimize the difference between the outputs of the teacher model and the student model in the spatial and frequency domains. Perform debiasing training on the two branches to obtain the debiased spatial and frequency domain features. The specific method for step S4 is as follows: Step S4.1: Construct a teacher-student bias removal framework comprising a teacher model T and a student model S. The teacher model T and student model S share the architecture of step S3, and spatial features are... and frequency domain features The prediction results output by teacher model T are obtained by using the classifier heads of teacher model T and student model S respectively. And the prediction results output by the student model S. Calculate the loss of the teacher model T for both the spatial and frequency domain branches. The loss of the student model S The specific formula is as follows: ; ; in, Indicates loss due to imitation. The classification loss is represented by the Softmax function. ; This represents the probability distribution calculated using the Softmax function. Represents the true category label of the image. Represents a real human face. Represents fake faces, To balance the hyperparameters; Step S4.2: Calculate the imitation loss As shown in the following formula: ; in, and Let T and S represent the prediction results output by the teacher model T and student model S, respectively. This represents the probability distribution calculated using the Softmax function, and KL represents the KL divergence calculation. This indicates that the gradient of the objective term is truncated when calculating the loss; Step S5: Input the bias-reduced spatial and frequency domain features output by the teacher model into the cross-attention module for fusion to obtain fused features; Step S6: Input the fused features into a classifier, output the frame image as the detection result of real or fake, calculate the classification loss and update the model parameters.
2. The general deepfake detection method based on joint spatial and frequency domain debiasing as described in claim 1, characterized in that, The specific steps of step S2 are as follows: Step S2.1: For each video in the training set, sample from each video at fixed time intervals to extract a preset number of content-differentiated frame images; Step S2.2: Process the frame image using the DLIB model to locate the face region, and crop the frame image based on the face region location result to obtain the initial face image; Step S2.3: Scale the initial face image to a preset fixed resolution to obtain face image X.
3. The general deepfake detection method based on joint spatial and frequency domain debiasing as described in claim 2, characterized in that, The specific method for step S3 is as follows: Construct a two-branch architecture including a spatial domain branch and a frequency domain branch. In the spatial domain branch, a linear projection layer is used. The face image X is converted into an image patch embedding sequence and then input into the first visual encoder. To obtain spatial characteristics : ; In the frequency domain branch, the face image X is first processed through a frequency enhancement module. Convert to frequency-enhanced image The frequency-enhanced image is then enhanced through a linear projection layer. Convert to image patch embedding sequence Finally Input to the second visual encoder Frequency domain features are obtained. : ,in, and The two CLIP models have built-in image encoders and linear projection layers. This is a linear mapping layer that comes with the CLIP model.
4. The general deepfake detection method based on joint spatial and frequency domain debiasing according to claim 3, characterized in that, In the frequency domain branch, the face image X is processed through a frequency enhancement module. Convert to frequency-enhanced image The specific steps are as follows: Step S3.1: Transfer the face image Input to a spatially rich model Layers are used to extract high-frequency residual feature maps. ; Step S3.2: Extract the high-frequency residual feature map The input is fed in parallel to the first and second processing paths; in the first processing path, it passes sequentially through a convolutional layer, a batch normalization layer, an activation layer, and then through a coordinate attention module. The process is performed to obtain the output features of the first processing path. ; In the second processing path, the data is processed sequentially through convolutional layers, batch normalization layers, and activation layers to obtain the output features of the second processing path. ;in, This represents the activation function of the activation layer. This indicates batch normalization layer processing. Indicates convolutional layer processing; Step S3.3: Output features of the first path Slicing along the channel dimension yields the first feature subset used for summation. and the first feature subset used for splicing Output features of the second path Slicing along the channel dimension yields a second feature subset used for summation. and the second feature subset used for splicing ; through the and Perform element-wise summation to calculate the summation characteristics. By along the channel dimension and The splicing is performed, and the splicing features are calculated. ,in, Indicates a splicing operation; Step S3.4: Add the features splicing features The features are then concatenated again along the channel dimension to obtain the interactive features. Finally, the interactive features are... The data is sequentially fed into a convolutional layer, a batch normalization layer, and an activation layer, outputting a frequency-enhanced image. ,in, This represents the activation function of the activation layer. This indicates batch normalization layer processing. This indicates convolutional layer processing.
5. A general deepfake detection method based on joint spatial and frequency domain debiasing according to claim 4, characterized in that, The specific processing steps of the cross-attention module in step S5 are as follows: Step S5.1: Debiased spatial features As a query, the bias-free frequency domain features As keys and values; and through three independent linear projection layers , , The query matrix is calculated separately. Key matrix and value matrix ; Step S5.2: Calculate the attention score matrix according to the following formula. : ; in, Key matrix Feature dimensions; Through attention score matrix Log-value matrix Perform a weighted summation to obtain the single-head attention output. ; Step S5.3: Perform the attention calculation in step S5.2 in parallel 8 times to obtain 8 independent single-head attention outputs. Concatenate all single-head attention outputs along the feature dimension to obtain multi-head concatenated features. in, This indicates a splicing operation; then it passes through an output linear projection layer. Multi-head splicing features The data is then integrated to obtain the final attention-weighted representation. ; Step S5.4: Weighted representation of attention Spatial features from the original input to step S5.1 Element-wise summation is performed to form residual connections; finally, the summed result is normalized through a layer. Operations are performed to obtain the final fusion features. .
6. The general deepfake detection method based on joint spatial and frequency domain debiasing according to claim 5, characterized in that, The specific steps for updating the model parameters in step S6 are as follows: Step S6.1: First, perform bias-free learning of the dual-branch architecture. Within a training batch, simultaneously update the parameters of the spatial and frequency domain branches of the teacher model T and the student model S. Step S6.2: Perform spatial and frequency domain feature fusion and classifier tuning. Within the same training batch, freeze the parameters of the spatial and frequency domain branches of the teacher model T, and only update the parameters of the cross-attention module and the classifier.
7. A general deepfake detection method based on joint spatial and frequency domain debiasing as described in claim 6, characterized in that, In the dual-branch architecture, both the spatial and frequency domain branches are based on a pre-trained visual model, and their parameters are tuned using the low-rank adaptive LoRA method.