A deep fake face detection method and system based on deep perception
By using a deep-perception multi-task learning framework, combined with a shared feature encoder and a deep collaborative attention module, the problem of insufficient generalization ability of existing technologies is solved, achieving efficient detection of unseen forgery techniques and improving the accuracy and robustness of detection.
Patent Information
- Application Number
- CN202511620604.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-07
AI Technical Summary
Existing deepfake detection technologies lack generalization ability and struggle to effectively handle face images generated by different forgery techniques, leading to performance degradation of detection models when faced with unfamiliar forgery algorithms.
We employ a deep perception-based multi-task learning framework, combining a shared feature encoder and a deep collaborative attention module with multi-scale feature extraction and asymmetric supervision signals to enhance the model's understanding and detection capabilities of 3D geometric structures. We also construct a multi-task loss function to optimize model parameters.
It significantly improves the model's ability to generalize and its robustness in detecting unknown forgery techniques, enabling it to more accurately capture geometric flaws and forgery traces in face images, thereby improving the accuracy and efficiency of detection.
Smart Images

Figure CN121074992B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and computer vision security technology, specifically to a method and system for detecting deepfake faces based on depth perception. Background Technology
[0002] With the rapid development of artificial intelligence technologies, particularly deep learning, especially Generative Adversarial Networks (GANs), the generation and manipulation of digital content have become unprecedentedly convenient and realistic. Deepfake technologies, such as face swapping, facial reenactment, and face synthesis, can create forged facial images and videos that are virtually indistinguishable to the human eye. While these technologies have shown great potential in film production and virtual social networking, they also pose serious social risks. For example, they can be used to create fake news, commit identity fraud, and infringe on personal reputation and privacy rights, posing a severe challenge to social trust systems and public safety. Summary of the Invention
[0003] To address the aforementioned issues, this invention provides a method and system for detecting deepfake faces based on depth perception, overcoming the shortcomings of insufficient generalization ability in existing deepfake detection technologies, and providing a deepfake face detection scheme capable of uncovering more essential and universal forgery clues.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] On one hand, embodiments of the present invention provide a method for detecting deepfake faces based on depth perception, the method comprising the following steps:
[0006] Acquire a face image and generate a classification label and depth map label for that face image;
[0007] A model for deepfake face detection is constructed, which includes a shared feature encoder, a main depth estimation module, a deep collaborative attention module, and a classification prediction module. The shared feature encoder extracts multi-scale feature maps from face images. The main depth estimation module performs regression on the multi-scale feature maps to generate the final depth map. The deep collaborative attention module generates enhanced feature maps based on high-level feature maps in the multi-scale feature maps. The classification prediction module generates logical values representing the true or false prediction based on the enhanced features.
[0008] A multi-task loss function is constructed for the model. By minimizing the value of the multi-task loss function, all learnable parameters in the model are optimized to obtain a trained model. The multi-task loss function includes a classification loss calculated based on the classification label and logistic value, a main depth estimation loss calculated based on the depth map label and the final depth map, and an auxiliary depth estimation loss calculated based on the intermediate depth representation and the depth map label.
[0009] The face image to be detected is sequentially passed through the shared feature encoder, deep collaborative attention module and classification prediction module in the trained model to obtain the prediction logic value. Based on the prediction logic value, a classification result is generated to determine whether the face image is a real face or a fake face.
[0010] Optionally, the step of acquiring a face image and generating a classification label and depth map label for the face image includes:
[0011] Acquire a facial image and determine whether it is a real or fake facial image;
[0012] If the face image is determined to be a real face image, its classification label is set to zero, and the teacher model predicts the depth map label for the real face image.
[0013] If the face image is determined to be a fake face image, its classification label is set to one, and the source real face image corresponding to the fake face image is obtained. Then, the teacher model predicts the depth map label of the source real face image.
[0014] Optionally, the step of generating enhanced feature maps based on high-level feature maps in multi-scale feature maps using a deep collaborative attention module includes:
[0015] High-level feature maps from the multi-scale feature maps are fed into a supervised lightweight depth estimator, which regresses to generate intermediate depth representations.
[0016] The intermediate depth representation is fed into the spatial attention generation network to generate a spatial attention map with the same size as the high-level feature map.
[0017] The enhanced feature map is obtained by fusing the high-level feature map with the high-level feature map weighted by the spatial attention map through residual connection.
[0018] Optionally, the multi-task loss function for constructing the model includes:
[0019] The classification loss, main depth estimation loss, and auxiliary depth estimation loss are weighted and fused to obtain the multi-task loss function of the model.
[0020] Optionally, the classification loss is calculated in the following manner:
[0021] The classification loss is obtained by calculating the binary cross-entropy loss of the classification label and the logical value.
[0022] Optionally, the depth estimation loss is calculated in the following manner:
[0023] Calculate the pixel-level L1 loss and structural similarity loss between the depth map label and the final depth map, and then weight and combine the pixel-level L1 loss and structural similarity loss to obtain the main depth estimation loss.
[0024] Optionally, generating a classification result based on the logical value to determine whether the face image is a real face or a fake face includes:
[0025] The Softmax function is used to map the logical values output by the classification prediction module to probabilities between zero and one.
[0026] If the probability is greater than a preset threshold, the face image to be detected is determined to be a fake face; otherwise, it is a real face.
[0027] On the other hand, embodiments of the present invention provide a depth-sensing-based deepfake face detection system, comprising:
[0028] At least one processor;
[0029] At least one memory for storing at least one program;
[0030] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0031] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.
[0032] The beneficial effects of this invention are as follows: This invention discloses a method and system for detecting deepfake faces based on depth perception. By introducing a depth perception mechanism and combining multi-scale feature extraction with a deep collaborative attention module, this invention can more accurately capture geometric flaws and forgery traces in face images. Compared with traditional methods, the proposed solution significantly improves generalization ability and can effectively handle face images generated by different forgery techniques, providing a more efficient and accurate solution for the field of deepfake detection. Simultaneously, the multi-task loss function design of this invention allows the model to simultaneously optimize classification and depth estimation tasks during training, further enhancing the model's robustness and detection performance. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart illustrating a method for detecting deepfake faces based on depth perception, according to an embodiment of the present invention.
[0035] Figure 2 This is an overall architecture diagram of the deepfake face detection model used in the training phase in this embodiment of the invention;
[0036] Figure 3 This is a schematic diagram of the asymmetric supervision mechanism for counterfeit faces in an embodiment of the present invention;
[0037] Figure 4 This is a schematic diagram of the multi-task loss calculation process in an embodiment of the present invention;
[0038] Figure 5 This is a schematic diagram of the structure of the deep collaborative attention module in an embodiment of the present invention;
[0039] Figure 6 This is a simplified architectural flowchart of the deepfake face detection model used in the inference (detection) stage in an embodiment of the present invention;
[0040] Figure 7 This is a schematic diagram of the structure of a depth-sensing-based deepfake face detection system according to an embodiment of the present invention. Detailed Implementation
[0041] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0042] To address the technical challenges in the background technology, academia and industry have proposed various deepfake detection methods. Existing technical approaches can be broadly categorized as follows:
[0043] The first type of method focuses on detecting artifacts at specific signal levels introduced during the forgery process. Since generator networks typically include operations such as upsampling, they leave patterns in the frequency domain of the image that differ from those of the real image. Therefore, some methods attempt to capture these fixed frequency artifacts by transforming the image to the frequency domain using Discrete Fourier Transform (DFT) or Discrete Cosine Transform (DCT). However, the fatal weakness of this type of method is that its detection cues are highly coupled to the specific generator architecture. Once the forgery technique is updated, such as by adopting a new network structure or adding slight post-processing operations such as noise, blurring, or compression after generation, these specific frequency features will disappear or be masked, causing the detection model to fail.
[0044] The second category of methods focuses on detecting inconsistencies at the biological or physiological level. For example, early forged videos often exhibited unnatural blinking frequencies or missing blinking movements; some methods judge authenticity by analyzing subtle inconsistencies between head posture and other body parts; and some even distinguish between genuine and fake videos by analyzing subtle color changes in facial skin areas caused by heartbeats (i.e., photoplethysmography, PPG signals). While this type of method takes a more macroscopic approach, its effectiveness is often limited by the quality and length of the video, and it is ineffective for static images. Meanwhile, with advancements in forgery models, these physiological characteristics can be increasingly simulated with greater precision.
[0045] The third type of method focuses on the inconsistencies in the laws of the physical world. For example, it examines whether the direction of illumination is consistent in different areas of a face, or whether the reflections of highly reflective areas such as glasses and eyeballs match the environment. Although this type of method utilizes more fundamental physical laws, it usually requires making strong assumptions about scene lighting and environment, making it difficult to apply stably in complex or unknown scenarios.
[0046] In summary, existing technologies generally suffer from a core bottleneck: insufficient generalization ability. The discriminative features they learn are mostly "surface symptoms" produced by specific forgery algorithms under specific conditions, rather than the "intrinsic pathology" of forgery behavior. When faced with novel forgery algorithms not present in the training data, the performance of these models often suffers a catastrophic decline. Therefore, there is an urgent need for a generalized approach that can uncover deeper, more fundamental, and more difficult-to-evade clues by future forgery techniques, thereby constructing a deepfake detection scheme with high generalization capabilities.
[0047] The core technical concept of this invention is based on a key insight: no matter how advanced the forgery technology, its essence is still operating on a two-dimensional pixel plane. This process is extremely difficult to perfectly reproduce the geometric consistency that a three-dimensional object in the real world should have. Therefore, three-dimensional geometric flaws are more fundamental and more difficult for future forgery algorithms to conceal than surface texture artifacts.
[0048] To achieve the above objectives, this invention proposes an innovative multi-task learning framework centered on three-dimensional geometric understanding. The logical progression of its technical solutions is as follows:
[0049] 1. Building the foundation of geometry perception: Training a shared encoder through a master depth estimation task.
[0050] This invention reconstructs forgery detection as a multi-task learning problem. The core of the model is a shared feature encoder, which is forced to simultaneously support two tasks: a primary depth estimation task (auxiliary task) and a true / false classification task (primary task). By introducing the primary depth estimation task and designing unique supervision signals for it, we force the shared encoder to understand the 3D structure of the face (represented as a depth map) during the learning process. This "sharing" mechanism is key to this invention; it ensures that the strong geometric representation learned for the depth estimation task can be seamlessly transferred and applied to the classification task, laying a solid foundation for subsequent accurate discrimination.
[0051] 2. Innovate the depth estimation of supervision signals to improve generalization ability.
[0052] To fundamentally avoid the model learning erroneous geometric information from the forged image itself, this invention designs an asymmetric supervision strategy for the aforementioned main depth estimation task:
[0053] For real human faces, the model is required to predict its own depth map;
[0054] For fake faces, the model is required to "see through" the fake surface to predict the depth map of the original real face behind it.
[0055] This unique supervision mechanism forces the model to learn an essential geometric feature intrinsically linked to identity and unaffected by the forgery process, rather than memorizing superficial flaws produced by a specific forgery algorithm. This is a powerful regularization applied to the model and is key to improving its ability to generalize to unknown forgery algorithms.
[0056] 3. Focusing on geometric weaknesses: Refined targeting of deep collaborative attention modules.
[0057] After establishing the powerful geometric perception capabilities of the shared encoder, this invention designs a deep collaborative attention module to apply these capabilities to classification in a more intelligent and focused manner. This module includes a lightweight depth estimator that quickly generates an intermediate depth representation from the feature map. Unlike existing technologies, this invention also applies direct supervision to this intermediate depth representation to ensure it stably captures geometric contours. Subsequently, this intermediate depth map is used to generate a spatial attention map, dynamically assigning weights to different regions of the feature map. Intuitively, regions with drastic depth changes, such as facial contours and feature boundaries, or those with geometric discontinuities due to forgery, will be given higher attention weights. In this way, the model can adaptively focus its "attention" on the geometrically most suspicious regions, achieving a "refined strike" against potential forgeries.
[0058] refer to Figure 1 and Figure 2 ,like Figure 2 The image shows a method for detecting deepfake faces based on depth perception, according to an embodiment of the present invention. The method includes the following steps:
[0059] S100: Acquire a face image and generate a classification label and depth map label for the face image;
[0060] S200, construct a model for deepfake face detection. The model includes a shared feature encoder, a main depth estimation module, a deep collaborative attention module, and a classification prediction module. The shared feature encoder extracts multi-scale feature maps from the face image. The main depth estimation module performs regression on the multi-scale feature maps to generate the final depth map. The deep collaborative attention module generates enhanced feature maps based on high-level feature maps in the multi-scale feature maps. The classification prediction module generates logical values representing true / false predictions based on the enhanced features.
[0061] S300, construct the multi-task loss function of the model, optimize all learnable parameters in the model by minimizing the value of the multi-task loss function, and obtain the trained model; the multi-task loss function includes the classification loss calculated based on the classification label and the logistic value, the main depth estimation loss calculated based on the depth map label and the final depth map, and the auxiliary depth estimation loss calculated based on the intermediate depth representation and the depth map label;
[0062] S400, the face image to be detected is sequentially passed through the shared feature encoder, deep collaborative attention module and classification prediction module in the trained model to obtain the prediction logic value, and the classification result of whether the face image is a real face or a fake face is generated based on the prediction logic value.
[0063] This invention discloses a depth-perception-based method and system for detecting deepfake faces, aiming to fundamentally address the core pain point of existing detection technologies' weak generalization ability to unknown forgery algorithms. The core idea of this invention lies in forcing the model to deeply understand and utilize the three-dimensional geometric structure of the face while performing real / fake face classification through an innovative multi-task learning framework. Its technical solution mainly includes: First, constructing a neural network containing a shared feature encoder, designed to simultaneously serve a main depth estimation task and a final classification task; during the training phase, through a unique asymmetric supervision strategy (i.e., requiring the model to predict the depth map of the source real face for fake faces), the shared encoder is forced to learn identity-related, essential geometric feature representations. Second, this invention designs a deep collaborative attention module, which includes a lightweight depth estimator under auxiliary supervision, capable of quickly generating an intermediate depth map and generating spatial attention based on it, thereby dynamically guiding the model to focus computational resources on the areas most likely to contain flaws in the geometric structure. Finally, the geometrically enhanced features are fed into the classifier for discrimination. This invention, through the organic combination of "the ability to construct the geometric foundation through the main depth estimation task" and "the collaborative attention module to focus on geometric flaws," shifts the detection basis from surface forgery artifacts to more fundamental three-dimensional geometric inconsistencies, thereby greatly improving the detection generalization ability and robustness against novel and unknown forgery techniques.
[0064] In some embodiments, S100, acquiring a face image and generating a classification label and depth map label for the face image includes:
[0065] S110, acquire a face image and determine whether the face image is a real face image or a fake face image;
[0066] S120, If the face image is determined to be a real face image, its classification label is set to zero, and the teacher model predicts the depth map label for the real face image.
[0067] S130, if it is determined that the face image is a fake face image, then its classification label is set to one, and after obtaining the source real face image corresponding to the fake face image, the teacher model predicts the depth map label of the source real face image.
[0068] In this embodiment, by clarifying the classification label setting rules for real and fake face images, and by using a teacher model to predict the depth map labels of real face images or their corresponding source real face images, accurate and crucial label information is provided for subsequent model training.
[0069] In some embodiments, S200, the generation of enhanced feature maps based on high-level feature maps in multi-scale feature maps via a deep collaborative attention module includes:
[0070] S210 feeds the high-level feature maps from the multi-scale feature maps into a supervised lightweight depth estimator, which then regresses to generate intermediate depth representations.
[0071] S220 feeds the intermediate depth representation into the spatial attention generation network to generate a spatial attention map with the same size as the high-level feature map.
[0072] S230 uses residual connections to fuse the high-level feature map with the high-level feature map weighted by the spatial attention map, resulting in an enhanced feature map.
[0073] In this embodiment, a supervised lightweight depth estimator is used to mine depth information from high-level feature maps. A spatial attention generation network dynamically focuses on key geometric regions, and feature enhancement is achieved through residual connections. This approach preserves the rich information of the original feature maps while strengthening the feature representation of geometrically flawed regions through spatial attention, enabling the model to more accurately capture the 3D structural inconsistencies of fake faces.
[0074] In some embodiments, in S200, the multi-task loss function for constructing the model includes:
[0075] The classification loss, main depth estimation loss, and auxiliary depth estimation loss are weighted and fused to obtain the multi-task loss function of the model.
[0076] In this embodiment, by weighting and fusing the classification loss, main depth estimation loss, and auxiliary depth estimation loss, the contributions of different tasks to model training can be comprehensively considered. The classification loss directly reflects the model's performance on the real / fake face classification task and is one of the main objectives for model optimization. The main depth estimation loss ensures the model's accurate prediction of depth maps for real faces and fake faces (and their source real faces), which is the foundation for the model's understanding of 3D geometric structures. The auxiliary depth estimation loss supervises the intermediate depth representation, further enhancing the model's ability to capture geometric contours. By reasonably setting the weights of each loss term, the model can achieve a better performance balance within a multi-task learning framework, thereby improving its generalization ability and robustness in detecting deepfake faces.
[0077] In some embodiments, in S200, the classification loss is calculated in the following manner:
[0078] The classification loss is obtained by calculating the binary cross-entropy loss of the classification label and the logical value.
[0079] In this embodiment, the classification loss is calculated using binary cross-entropy loss, which effectively measures the difference between the model's predicted logistic value and the true classification label, guiding the model to optimize towards correct classification. In the deepfake face detection task, by minimizing the classification loss, the model can continuously improve its ability to distinguish between real and fake faces, thereby enhancing overall detection performance.
[0080] In some embodiments, in S200, the depth estimation loss is calculated in the following manner:
[0081] Calculate the pixel-level L1 loss and structural similarity loss between the depth map label and the final depth map, and then weight and combine the pixel-level L1 loss and structural similarity loss to obtain the main depth estimation loss.
[0082] In this embodiment, the principal depth estimation loss is calculated by weighting a pixel-level L1 loss and a structural similarity loss. This approach provides a more comprehensive and accurate measure of the difference between the final depth map predicted by the model and the depth map label. Pixel-level L1 loss directly reflects the absolute error between the predicted and true depth maps at each pixel, helping the model focus on the accuracy of depth prediction in detail. Structural similarity loss, on the other hand, considers the similarity in brightness, contrast, and structure from the perspective of the overall image structure, better capturing structural information in the depth map. By weighting these two losses, the model can simultaneously optimize depth prediction in both detail and overall structure during training, thereby improving the accuracy of predicting depth maps of real and fake faces and providing more reliable geometric information support for subsequent real / fake face classification tasks.
[0083] In some embodiments, S400, generating a classification result based on the logical value to determine whether the face image is a real face or a fake face includes:
[0084] S410, use the Softmax function to map the logical values output by the classification prediction module to probabilities between zero and one;
[0085] S420, if the probability is greater than a preset threshold, the face image to be detected is determined to be a fake face; otherwise, it is a real face.
[0086] In this embodiment, by mapping the logical value using the Softmax function, it can be transformed into a probability value. This probability value intuitively represents the likelihood that the face image to be detected is a fake face. By preset a reasonable threshold, the model can automatically and accurately classify face images as real or fake. This classification method is not only simple and effective but also highly operable in practical applications. Furthermore, the preset threshold can be adjusted according to the needs of specific application scenarios to adapt to the requirements of detection accuracy and recall in different scenarios.
[0087] The following is a specific embodiment provided by the present invention:
[0088] The deepfake face detection method proposed in this invention mainly relies on a carefully designed end-to-end deep neural network model. Its complete implementation process can be divided into four stages: data preprocessing, model architecture design, model training, and model inference.
[0089] I. Data Preprocessing and Monitoring Signal Generation:
[0090] Before training the model, the data needs to be standardized and ground truth signals need to be prepared for subsequent multi-task learning.
[0091] 1. Input data processing: Perform face detection, cropping, alignment, and scaling to a fixed size (e.g., 224×224 pixels) on the RGB image containing the face, and finally normalize it to obtain the face image.
[0092] 2. Supervisory signal generation: This process is as follows Figure 3 As shown. The supervision signals include classification labels and depth map labels;
[0093] Category Tags This is a binary label, with 0 for real faces and 1 for fake faces.
[0094] Depth map tags This is the core of the geometric supervision in this invention. We use a pre-trained, state-of-the-art "teacher model" to generate baseline depth maps; the teacher model can be MiDaS (monocular depth estimation model). The key improvement lies in the fact that its generation method varies depending on the image type:
[0095] For real facial images Its depth map label The teacher model directly uses this real face image The prediction is as follows: ;
[0096] Forging facial images First, find the corresponding source real face image. Its depth map labels Then the teacher model will analyze this source real face image. The prediction yielded the following: This asymmetric supervision strategy is key to improving generalization ability.
[0097] II. Model Architecture Design:
[0098] The complete model architecture of this invention during the training phase is as follows: Figure 2 As shown, it mainly consists of four core modules: a shared feature encoder, a main depth estimation module, a deep collaborative attention module, and a classification prediction module. These modules work together to achieve the technical objectives of this invention.
[0099] 101. Shared Feature Encoder:
[0100] like Figure 2 As shown, this is the starting point and backbone of the entire model. It typically uses a powerful network (such as the Convnext network or Vit network) pre-trained on large datasets like ImageNet, responsible for extracting multi-scale, hierarchical feature maps from the input face image. , , , Its "shared" characteristic means that the features it extracts will be used by both the subsequent main depth estimation module and the deep collaborative attention module, serving as a bridge connecting the two tasks.
[0101] 102. Main Depth Estimation Decoder:
[0102] exist Figure 2 In this module, the classification path runs in parallel. It is a standard decoder architecture (such as the U-Net decoder) that receives feature maps of all scales from the shared feature encoder. Through a series of upsampling and skip connections, it regresses to generate a high-quality final depth map of the same size as the input face image. The core function of this module is to "force" the shared feature encoder to learn robust and refined geometric feature representations during the training phase through a complex depth estimation task.
[0103] 103. Deep-Collaborative Attention Module (Dcam):
[0104] This module is a structural innovation of this invention; its position in the overall architecture is shown below. Figure 2Its detailed internal structure is in Figure 5 The text describes a feature map, specifically a high-level feature map within a multi-scale feature map. and perform the following operations:
[0105] 103a. Supervised lightweight depth estimators: such as Figure 5 As shown, high-level feature map First, the data is fed into a lightweight network consisting of a small number of convolutional layers, which quickly regresses a coarse intermediate depth representation. .
[0106] 103b. Spatial Attention Generation: Next, intermediate depth representation It is fed into a simple network consisting of convolutional layers and a sigmoid activation function to generate a feature map that is consistent with the high-level feature maps. Spatial attention maps of the same size Spatial attention map The numerical distribution represents the model's assessment of geometric significance at different spatial locations.
[0107] 103c. Feature Fusion: Finally, the high-level feature maps are fused using residual connections. Fuse with attention-weighted feature maps: , The enhanced feature map after fusion. This is an element-wise multiplication operation. This operation can adaptively enhance the feature representation of geometrically questionable regions while preserving the original information flow.
[0108] 104. Classification Prediction Head:
[0109] like Figure 6 As shown, this module is the final decision-making unit of the model. It receives enhanced feature maps from the deep collaborative attention module. It outputs a logical value (Prediction) representing the true or false prediction through global average pooling and fully connected layers.
[0110] III. Model Training:
[0111] The model training process adopts an end-to-end approach, and its detailed loss calculation process is as follows: Figure 4 As shown. By minimizing a multi-task loss function To optimize all learnable parameters in the model.
[0112] ;
[0113] The calculations for each loss are as follows:
[0114] Classification loss The logical value Prediction and the classification label output by the classification prediction module. The calculation between them is usually performed using binary cross-entropy loss.
[0115] Main depth estimation loss The final depth map output by the main depth estimation module. With monitoring signals The calculation is performed between these parameters. To ensure the quality of the depth map, a weighted combination of pixel-level L1 loss and structural similarity Ssim loss is typically used.
[0116] Auxiliary depth estimation loss This is a key improvement of the present invention, such as... Figure 3 , Figure 4 and Figure 5 As shown. It generates an intermediate deep representation within the deep collaborative attention module. With the downsampled supervisory signal The calculation is performed between these parameters. This loss directly supervises the geometric prediction capability of the attention module, ensuring that the generation of the attention map is based on reliable geometric information, thus making the entire logic chain more robust.
[0117] also, , and These are three weighting coefficients, which are predefined hyperparameters.
[0118] IV. Model Reasoning:
[0119] Once the model training is complete, it enters the inference (i.e., actual detection) phase, where its architecture is simplified to improve efficiency, such as... Figure 6 As shown.
[0120] Architecture simplification: The main depth estimation module and its associated loss calculations, being used only for training, have been completely removed during inference. Similarly, auxiliary loss calculations within the deep collaborative attention module have also been disabled.
[0121] Forward propagation: For a face image to be detected, the data flow becomes very direct and efficient. The image passes sequentially through a shared feature encoder, a deep collaborative attention module, and a classification prediction module to finally obtain the detection result.
[0122] Result determination: The logical value output by the classification prediction module is converted into a probability between 0 and 1 using the Sigmoid function. If the probability is greater than a preset threshold (e.g., 0.5), the image is determined to be a deepfake face; otherwise, it is a real face.
[0123] In summary, the present invention achieves this through... Figure 2 The complete training architecture shown Figure 3 and Figure 4 The unique training mechanism shown Figure 5 The core attention module shown and Figure 6 The efficient reasoning process shown demonstrates a logically rigorous and high-performance deepfake detection solution.
[0124] Compared with related technologies, the beneficial effects of the present invention are reflected in:
[0125] 1. Excellent generalization performance: Based on general 3D geometric inconsistencies rather than surface artifacts specific to a particular algorithm, this method demonstrates strong detection capabilities against unseen forgery techniques.
[0126] 2. Higher detection accuracy: The synergistic effect of "geometric foundation construction" and "geometric flaw focusing" enables the model to form a more comprehensive and robust feature representation, thereby improving detection accuracy.
[0127] 3. Logically consistent and stable training mechanism: The innovative asymmetric supervision signal and direct supervision of the attention module together ensure that the model optimizes in the right direction (learning the essential geometry), solving the problem of overfitting in traditional methods.
[0128] 4. Enhanced interpretability: By visualizing the attention map, the geometric regions that the model focuses on when making decisions can be seen intuitively, improving the model's credibility.
[0129] refer to Figure 7 This invention also provides a depth-sensing-based deepfake face detection system, comprising:
[0130] At least one processor;
[0131] At least one memory for storing at least one program;
[0132] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0133] The content of the above method embodiments is applicable to this embodiment. The specific functions implemented in this embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments. Therefore, they will not be repeated here.
[0134] Furthermore, one embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions for performing the above-described method.
[0135] It is worth noting that, since the computer-readable storage medium of the present invention is capable of executing the methods of any of the above embodiments, the specific implementation methods and technical effects of the computer-readable storage medium of the present invention can be referred to the specific implementation methods and technical effects of the methods of any of the above embodiments.
[0136] Although the description of this disclosure has been quite detailed and particularly focused on several of the described embodiments, it is not intended to limit itself to any of these details or embodiments or any particular embodiment, but should be considered as effectively covering the intended scope of this disclosure by referring to the appended claims and taking into account the broad possible interpretations of these claims provided by the prior art. Furthermore, the foregoing description of this disclosure with respect to embodiments foreseeable by the inventors is intended to provide a useful description, and non-substantial modifications to this disclosure that have not yet been foreseen may still represent equivalent modifications.
Claims
1. A method for detecting deepfake faces based on depth perception, characterized in that, The method includes the following steps: Acquire a face image and generate a classification label and depth map label for that face image; A model for deepfake face detection is constructed, comprising a shared feature encoder, a main depth estimation module, a deep collaborative attention module, and a classification prediction module. The shared feature encoder extracts multi-scale feature maps from the face image; the main depth estimation module regresses these multi-scale feature maps to generate a final depth map; the deep collaborative attention module generates an enhanced feature map based on high-level feature maps within the multi-scale feature maps; and the classification prediction module generates logical values representing true / false predictions based on the enhanced features. The generation of the enhanced feature map based on the high-level feature maps within the multi-scale feature maps by the deep collaborative attention module includes: feeding the high-level feature maps into a supervised lightweight depth estimator to regress and generate intermediate depth representations; feeding the intermediate depth representations into a spatial attention generation network to generate a spatial attention map with the same size as the high-level feature maps; and fusing the high-level feature maps with the weighted high-level feature maps obtained through residual connections to obtain the enhanced feature map. A multi-task loss function is constructed for the model. By minimizing the value of the multi-task loss function, all learnable parameters in the model are optimized to obtain a trained model. The multi-task loss function includes a classification loss calculated based on the classification label and logistic value, a main depth estimation loss calculated based on the depth map label and the final depth map, and an auxiliary depth estimation loss calculated based on the intermediate depth representation and the depth map label. The face image to be detected is sequentially passed through the shared feature encoder, deep collaborative attention module and classification prediction module in the trained model to obtain the prediction logic value. Based on the prediction logic value, a classification result is generated to determine whether the face image is a real face or a fake face.
2. The method according to claim 1, characterized in that, The process of acquiring a face image and generating a classification label and depth map label for that face image includes: Acquire a facial image and determine whether it is a real or fake facial image; If the face image is determined to be a real face image, its classification label is set to zero, and the teacher model predicts the depth map label for the real face image. If the face image is determined to be a fake face image, its classification label is set to one, and the source real face image corresponding to the fake face image is obtained. Then, the teacher model predicts the depth map label of the source real face image.
3. The method according to claim 1, characterized in that, The multi-task loss function for constructing the model includes: The classification loss, main depth estimation loss, and auxiliary depth estimation loss are weighted and fused to obtain the multi-task loss function of the model.
4. The method according to claim 1, characterized in that, The classification loss is calculated in the following way: The classification loss is obtained by calculating the binary cross-entropy loss of the classification label and the logical value.
5. The method according to claim 1, characterized in that, The principal depth estimation loss is calculated in the following manner: Calculate the pixel-level L1 loss and structural similarity loss between the depth map label and the final depth map, and then weight and combine the pixel-level L1 loss and structural similarity loss to obtain the main depth estimation loss.
6. The method according to claim 1, characterized in that, The step of generating a classification result based on the predicted logical value to determine whether the face image is a real face or a fake face includes: The Softmax function is used to map the logical values output by the classification prediction module to probabilities between zero and one. If the probability is greater than a preset threshold, the face image to be detected is determined to be a fake face; otherwise, it is a real face.
7. A depth-sensing-based deepfake face detection system, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Face anti-counterfeiting model training method and device and electronic equipment
CN113553904A
False face detection method and device and storage medium
CN117877086A