Face forgery detection method and device, electronic equipment and storage medium

By using multi-module collaborative processing in the pre-trained detection model, the problem of low accuracy in face forgery detection in existing technologies is solved. It achieves joint processing of local and global structures of face images, thereby improving the accuracy and robustness of detection.

CN121505671APending Publication Date: 2026-02-10CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511639287.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing face forgery detection technologies mainly focus on pixel-level information, making it difficult to capture the structural relationships between facial regions, resulting in low detection accuracy.

Method used

By acquiring a pre-trained detection model, and utilizing a facial keypoint detector, semantic segmentation map generator, feature extractor, global feature extraction branch, feature learning branch, and classifier, structured processing and discrimination are performed to achieve joint processing of the local and global structures of face images.

Benefits of technology

It improves the accuracy, robustness, and interpretability of face forgery detection, and enhances the ability to locate local forged areas and judge overall consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505671A_ABST
    Figure CN121505671A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a face forgery detection method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a pre-training detection model and a to-be-detected face image, and inputting the to-be-detected face image into the pre-training detection model, so that a face key point detector obtains a face key point graph according to the input to-be-detected face image; a semantic segmentation graph generator generates a semantic segmentation graph according to the face key point graph; the feature extractor performs basic feature extraction according to the to-be-detected face image to obtain basic features; the global feature extraction branch performs global feature extraction according to the basic features to obtain a global feature map; the feature learning branch obtains a region-level forgery confidence map according to the basic features and the semantic segmentation map; the feature fusion device carries out fusion processing according to the global feature map and the region-level forged confidence map to obtain classification features; and the classifier obtains a face forgery detection result according to the classification features. According to the invention, the accuracy of face forgery detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a face forgery detection method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the rapid development of artificial intelligence technology, especially the evolution of synthesis and editing technologies such as generative adversarial networks, the realism of face forgery is continuously improved. Face swapping and other methods can naturally integrate a target face with other images to generate highly realistic images.

[0003] Existing face forgery detection technologies mainly analyze image features and construct deep learning models to distinguish the authenticity of images or videos. The common approach is to extract discriminative features from texture, color, edge and other visual clues, and use deep networks to model and learn the differences between real and fake samples. Among them, convolution-based models and self-attention-based models are two commonly used frameworks, which are good at capturing local details and global associations, respectively.

[0004] However, traditional methods mainly focus on pixel-level information and are difficult to capture structural relationships between face regions, which can easily lead to misjudgment and reduce detection accuracy. SUMMARY

[0005] The embodiments of the present application provide a face forgery detection method, device, electronic equipment and storage medium to improve the accuracy of face forgery detection.

[0006] In a first aspect, the embodiments of the present application provide a face forgery detection method, comprising:

[0007] obtaining a pre-trained detection model and a face image to be detected, wherein the pre-trained detection model comprises a face key point detector, a semantic segmentation map generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion device and a classifier;

[0008] inputting the face image to be detected into the pre-trained detection model, so as to:

[0009] the face key point detector obtains a face key point map according to the input face image to be detected;

[0010] the semantic segmentation map generator generates a semantic segmentation map according to the face key point map;

[0011] the feature extractor extracts basic features from the face image to be detected to obtain basic features;

[0012] the global feature extraction branch extracts global features from the basic features to obtain a global feature map;

[0013] The feature learning branch obtains a region-level fake confidence map according to the base feature and the semantic segmentation map;

[0014] The feature fusioner performs fusion processing according to the global feature map and the region-level fake confidence map to obtain classification features;

[0015] The classifier obtains a face fake detection result according to the classification features.

[0016] In a possible implementation, the face key point detector adopts a face key point detection model in a detector in a face detection tool library or a deep neural network module in a computer vision library to obtain a face key point map containing a preset number of key points according to the face image to be detected.

[0017] The face key point detector adopts a face key point detection model in a detector in a face detection tool library or a deep neural network module in a computer vision library to obtain a face key point map containing a preset number of key points according to the face image to be detected.

[0018] In a possible implementation, the semantic segmentation map generator generates a semantic segmentation map according to the face key point map, including:

[0019] The semantic segmentation map generator adopts a preset face analysis tool to divide each pixel of the face into a corresponding semantic category according to the face key point map to generate a semantic segmentation map containing a mask of each region of the face.

[0020] In a possible implementation, the feature extractor includes a plurality of convolution layers and a pooling layer.

[0021] The feature extractor extracts base features according to the face image to be detected, including:

[0022] The convolution layer, the batch normalization layer after the convolution layer, and a preset activation function layer form an intermediate processing layer, and a plurality of intermediate processing layers and a pooling layer perform preliminary feature processing on the face image to be detected to obtain an intermediate feature tensor.

[0023] Element-wise addition processing is performed on the intermediate feature tensor and the face image to be detected to obtain base features.

[0024] In a possible implementation, the global feature extraction branch extracts global features according to the base features to obtain a global feature map, including:

[0025] The global feature extraction branch divides the base features into first part features and second part features of the same size according to a channel dimension.

[0026] The first part of the features is input into the channel attention block to obtain the first attention map, and the second part of the features is input into the spatial attention block to obtain the second attention map;

[0027] The first attention map and the first partial features are added together to obtain the first learned feature, and the second attention map and the second partial features are added together to obtain the second learned feature;

[0028] The second learning feature and the first learning feature are concatenated sequentially along the channel dimension to obtain the integrated feature;

[0029] The integrated features are processed sequentially through a convolutional layer and a batch normalization layer to obtain new basic features. The process is then repeated in the global feature extraction branch, where the basic features are divided into first and second parts of the same size according to the channel dimension, until a preset number of iterations is reached. The new basic features obtained in the last iteration are then used as the global feature map.

[0030] In one possible implementation, the semantic segmentation map includes masks for each region of the face;

[0031] The feature learning branch obtains a region-level forgery confidence map based on the basic features and the semantic segmentation map, including:

[0032] The feature learning branch scales the face region mask according to its size to obtain a set of face region masks;

[0033] The set of masks for each region of the face is multiplied element-wise with the basic features to obtain the set of features for each region of the face.

[0034] Based on the feature sets of each region of the face, a feature set of each region is obtained through multiple graph learning blocks for fine-grained forgery detection;

[0035] The forgery confidence of each region is calculated by passing the feature set of each region used for fine-grained forgery detection through a fully connected layer.

[0036] Based on the forgery confidence level of each region, the mask set of each region of the face, and the feature set of each region, a region-level forgery confidence map is obtained.

[0037] In one possible implementation, obtaining the pre-trained detection model includes:

[0038] Obtain real face image data and the first tag data corresponding to the real face image data, as well as fake face image data and the second tag data corresponding to the fake face image data;

[0039] The real face image data and the fake face image data are input into the pre-built detection model to obtain the model prediction results;

[0040] Calculate the cross-entropy loss function based on the model prediction results and the corresponding first or second label data;

[0041] The pre-built detection model is iteratively updated based on the preset model optimization algorithm until the cross-entropy loss function reaches the preset iteration stopping condition, and the pre-built detection model that meets the preset requirements is determined as the pre-trained detection model.

[0042] Secondly, embodiments of this application provide a face forgery detection device, comprising:

[0043] The information acquisition module is used to acquire a pre-trained detection model and a face image to be detected, wherein the pre-trained detection model includes a facial key point detector, a semantic segmentation map generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion unit, and a classifier;

[0044] The detection execution module is used to input the face image to be detected into the pre-trained detection model, so that: the facial key point detector obtains a facial key point map based on the input face image to be detected; the semantic segmentation map generator generates a semantic segmentation map based on the facial key point map; the feature extractor performs basic feature extraction based on the face image to be detected to obtain basic features; the global feature extraction branch performs global feature extraction based on the basic features to obtain a global feature map; the feature learning branch obtains a region-level forgery confidence map based on the basic features and the semantic segmentation map; the feature fusion unit performs fusion processing based on the global feature map and the region-level forgery confidence map to obtain classification features; and the classifier obtains the face forgery detection result based on the classification features.

[0045] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0046] The memory stores computer-executed instructions;

[0047] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0048] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0049] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0050] This application provides a face forgery detection method, detection device, electronic device, and storage medium. By inputting the face image to be detected into a pre-trained detection model containing multiple functional modules, it achieves structured processing and discrimination of face forgery images. Specifically, a facial keypoint detector extracts structural geometric information, providing a localization basis for subsequent semantic segmentation; a semantic segmentation map generator performs fine division of face regions, providing spatial semantic guidance for region-level feature modeling; a feature extractor uniformly acquires low-level visual features of the entire image, forming a multi-dimensional basic representation; a global feature extraction branch extracts macroscopic features across the entire image, enhancing the model's ability to discriminate overall consistency; a feature learning branch performs feature learning for each local region, improving the response to local anomalies; a feature fusion unit achieves information fusion of global and regional features, forming a fused representation that takes into account both macroscopic structure and detailed differences; and a classifier performs the final discrimination output based on the fused features, thereby achieving automated detection of the authenticity of the input image. In summary, this application achieves joint processing of local and global structures in face images, improving the accuracy, robustness, and interpretability of face forgery detection. Attached Figure Description

[0051] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0052] Figure 1 A flowchart illustrating the face forgery detection method provided in this application embodiment;

[0053] Figure 2 A schematic diagram of the processing flow of the regional feature learning branch provided in the embodiments of this application;

[0054] Figure 3 This is a schematic flowchart of a method for obtaining a pre-trained detection model provided in an embodiment of this application;

[0055] Figure 4 This is a schematic diagram of the structure of the face forgery detection device provided in the embodiments of this application;

[0056] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0057] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0058] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0059] In existing technologies, face forgery detection typically relies on low-level visual features of the entire image, such as texture, color distribution, or edge information, and uses deep neural network models to discriminate input images. Typical methods include using convolutional neural networks to extract full-image features and then directly classifying them. However, these methods are insufficient in analyzing local regions, and the full-image features are not effectively integrated with local features, causing clues to be obscured by global information and affecting the overall accuracy of the judgment.

[0060] Based on the aforementioned technical problems and needs, the inventive concept of this application is to provide a face forgery detection method that improves the detection accuracy of existing technologies. Specifically, by using a facial keypoint detector and a semantic segmentation map generator, the model possesses facial structure perception capabilities at the image input stage, providing semantic basis for subsequent region-level processing; by using a feature extractor and a global feature extraction branch to extract the macroscopic representation of the entire image, the model ensures that it has globally consistent judgment capabilities; by using a feature learning branch to construct explicit masks for local facial regions and perform region map processing, the model focuses on analyzing potentially forged regions; finally, a feature fusion unit integrates global and local information, and a classifier outputs the judgment result. Therefore, this application achieves joint processing of local and global structures in face images, improving the accuracy of face forgery detection.

[0061] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0062] Figure 1 This is a flowchart illustrating the face forgery detection method provided in the embodiments of this application, as shown below. Figure 1 As shown, the method includes:

[0063] S11, Obtain the pre-trained detection model and the face image to be detected, wherein the pre-trained detection model includes a facial keypoint detector, a semantic segmentation graph generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion unit, and a classifier.

[0064] In this embodiment, a pre-trained detection model and the face image to be detected are first acquired. The pre-trained detection model refers to a neural network structure that has been trained and possesses feature representation and forgery detection capabilities. This model achieves face authenticity discrimination through iterative optimization on a large-scale training set containing both real and forged faces. The pre-trained detection model integrates multiple collaborative components to extract structural information, detailed features, and spatial semantics of the face image in stages, thereby achieving high-precision forgery detection. Specifically, the pre-trained detection model includes a facial keypoint detector, a semantic segmentation map generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion unit, and a classifier. Through the collaboration of multiple modules, effective analysis and identification of different forgery types and forgery details in different regions are achieved, improving the accuracy and robustness of the detection results.

[0065] S12, input the face image to be detected into the pre-trained detection model.

[0066] The face images to be detected usually need to undergo standardized preprocessing, including size adjustment, format unification and pixel normalization, to ensure that the input image meets the input requirements of the model structure.

[0067] S13, the facial landmark detector obtains a facial landmark map based on the input face image to be detected.

[0068] S14, The semantic segmentation map generator generates a semantic segmentation map based on the facial key point map.

[0069] S15, the feature extractor extracts basic features from the face image to be detected to obtain basic features.

[0070] S16, the global feature extraction branch performs global feature extraction based on the basic features to obtain the global feature map.

[0071] S17, the feature learning branch obtains a region-level forgery confidence map based on the basic features and semantic segmentation map.

[0072] S18, the feature fusion processor performs fusion processing based on the global feature map and the regional fake confidence map to obtain classification features.

[0073] S19, the classifier obtains the face forgery detection result based on the classification features.

[0074] In this embodiment, after receiving the image, the model first uses a facial keypoint detector to perform structural recognition and localization of the face region in the image, extracting several facial keypoints and generating a facial keypoint map. This keypoint map serves as an intermediate representation, describing the spatial distribution characteristics of the main facial regions, which helps to improve the accuracy and stability of subsequent facial region segmentation. By performing structural annotation, a clear perception of facial spatial information is achieved, providing a foundation for subsequent region segmentation and region-level feature extraction. Next, the semantic segmentation map generator performs pixel-level region segmentation on the entire face image based on the facial keypoint map, generating a semantic segmentation map. Pixels belonging to different facial regions in the image are categorized and structured semantic masks are formed to provide the ability to perceive local facial regions. By semantically annotating the facial regions, the fusion of local structure and semantic priors is achieved, enhancing the model's response to local signals. Subsequently, the feature extractor performs deep convolution processing on the original face image to extract a basic feature map containing visual information such as color, texture, contour, and edges. This feature map preserves the spatial structure and visual cues of the image. By constructing feature representations, the encoding of static features in images is achieved, which is helpful for subsequent multi-scale fusion and difference analysis.

[0075] In the global processing path, the global feature extraction branch receives basic features and performs further processing to extract semantic patterns and feature distributions across the entire image, outputting a global feature map. This feature map encodes the overall contextual relationships through spatial compression or feature enhancement, aiding the model in analyzing cross-regional consistency, ontology occlusion, or low-frequency variations. In the local processing path, the feature learning branch combines basic features with semantic segmentation map information to analyze each facial region in the image separately, outputting a region-level forgery confidence map. This map, as a region-level prediction result, describes the probability of forgery in each facial semantic region, providing local support information for subsequent overall fusion and judgment. Through region subdivision analysis, explicit attention is paid to the features of various facial organs, thereby improving the ability to identify fine-grained forgeries.

[0076] Subsequently, the feature fusion unit receives the global feature map and the regional forgery confidence map, and integrates global information and local forgery signals through a feature fusion mechanism to obtain classification features. For example, fusion can be achieved through channel splicing, weighted overlay, attention mapping, etc., to fully integrate the overall consistency features and local heterogeneity features of the image. Finally, the classifier processes the fused classification features and outputs a discrimination result representing the authenticity of the image. The classifier outputs a confidence distribution to characterize the probability of the image being real or fake. Overall, this embodiment, through structural information and semantic region analysis, fusion of global context and local forgery clues, and the establishment of deep classification representation, achieves the identification of multiple types of forgery methods in forged images, improving the accuracy and robustness of detection.

[0077] In one embodiment, the facial key point map obtained in step S13 above is provided as a specific implementation. Based on the above embodiment, it includes:

[0078] S131, the facial key point detector uses a preset detector in the preset face detection tool library or a facial key point detection model in the deep neural network module of the preset computer vision library to obtain a facial key point map containing a preset number of key points based on the face image to be detected.

[0079] In this embodiment, the facial keypoint detector can be a preset detector (such as a 68-point detector) built based on a preset face detection toolkit, or a facial keypoint detection model based on a deep neural network module integrated into a computer vision library, to extract facial keypoints from the face image to be detected. The task of the facial keypoint detector is to perform structured processing on the face region contained in the input image, identify anatomically significant location points, and generate a keypoint map for subsequent region segmentation and semantic analysis. Keypoint detection typically involves first detecting and normalizing the face region on the input image, for example, cropping the face portion using a face detection algorithm and standardizing its size to a preset value, and then feeding it into the keypoint detection model for analysis. The output is a structure tensor composed of a fixed number of coordinate points, representing the facial structure distribution of the face in the image. This structure tensor is the facial keypoint map, which not only has spatial location representation capabilities but also reflects attributes such as face pose, structural integrity, and regional symmetry.

[0080] The 68 keypoints are a keypoint annotation system used in face recognition and analysis tasks. This system divides the face into multiple key structural regions, including eyebrows, eyes, bridge of the nose, nostrils, lip edges, inner lips, and chin contours. Each keypoint corresponds to a two-dimensional coordinate point in the image, forming a structured point set output. Based on this point set, the spatial positions and relative relationships of various facial features can be clearly defined, providing accurate reference boundaries for the subsequent semantic segmentation map generator. In implementation, if a 68-point detector from a pre-defined face detection toolkit is used, a pre-trained face annotation model integrated in the Dlib library can be selected. This model uses a structure based on regression trees or shallow convolutional networks, automatically detecting face bounding boxes and outputting keypoint coordinates after inputting an image. If a deep neural network module from a computer vision library (such as the OpenCV library) is used, such as MobileNet, ResNet, or other lightweight networks as the backbone, it has stronger adaptability to complex backgrounds and cross-domain robustness. In summary, this embodiment, through the use of a 68-point structure detection method, enables stable processing of facial structures under complex scenarios involving various expressions, angles, and occlusions. It boasts high interpretability and good compatibility, enhancing the ability to analyze the consistency of local facial structures during detection, and effectively improving the overall accuracy and robustness of the detection.

[0081] In one embodiment, the generation of the semantic segmentation map in step S14 above is further described below. Based on the above embodiment, it includes:

[0082] S141, the semantic segmentation map generator uses a preset facial analysis tool to divide each pixel of the face into the corresponding semantic category based on the facial key point map, so as to generate a semantic segmentation map containing the mask of each region of the face.

[0083] In this embodiment, the semantic segmentation map generator can employ a preset facial analysis tool to classify each pixel in the image corresponding to the face region into a corresponding semantic category based on the facial structure localization information contained in the facial keypoint map, ultimately outputting a semantic segmentation map. This semantic segmentation map is a structured two-dimensional mask map, its function being to clearly mark the location range of each sub-region of the face, including but not limited to the left eye, right eye, eyebrow, nose, mouth, chin, and facial contours, and to divide the corresponding regions in the image into independent semantic units with pixel-level precision, thereby providing spatial indication for subsequent local forgery feature modeling.

[0084] Specifically, semantic segmentation map generators can integrate open-source facial structure analysis tools, such as the OpenFace 2.0 tool integrated in the Dlib library, or adopt publicly available facial landmark localization and segmentation schemes such as Find Face Landmarks and HRNet Facial Landmark Detection. These tools perform geometric mapping on the input landmark map, combining the distribution characteristics of facial landmarks and facial anatomical structures to achieve semantic segmentation of facial region pixels in the entire image. Specifically, each pixel will be assigned to a specific facial semantic label based on its spatial relationship with 68 landmarks, corresponding to the corresponding organ region or structural region.

[0085] The result of semantic segmentation is usually represented as a set of binary or multi-valued mask matrices. The mask for each region of a face can be represented as follows: In this model, H represents the image height, W represents the image width, and each positional value in M ​​represents the facial semantic region corresponding to that pixel. The mask matrix can contain multiple channels, each corresponding to a facial region; alternatively, a single-channel multi-class representation can be used, with appropriate adaptation settings based on the model's output method. In summary, this embodiment achieves explicit spatial processing of facial regions by establishing a connection between structural key points and semantic regions, exhibiting strong adaptability under different expressions and lighting conditions. It improves the detection model's ability to locate local forgery regions and enhances the accuracy, interpretability, and robustness of forgery detection in identifying fine-grained forgery clues.

[0086] In one specific embodiment, the feature extractor includes multiple convolutional layers and a pooling layer.

[0087] Next, the basic features obtained in step S15 above will be further explained. Based on the above embodiments, it includes:

[0088] S151, the convolutional layer, the subsequent batch normalization layer, and a preset activation function layer form an intermediate processing layer. Multiple intermediate processing layers and a pooling layer perform preliminary feature processing on the face image to be detected to obtain an intermediate feature tensor.

[0089] S152, perform element-wise addition of the intermediate feature tensor and the face image to be detected to obtain the basic features.

[0090] In this embodiment, the convolutional layer, the subsequent batch normalization layer, and a preset activation function layer form an intermediate processing layer. The feature extractor includes multiple convolutional layers, i.e., multiple intermediate processing layers, each consisting of a convolutional layer, a batch normalization layer, and an activation function layer, to enhance the model's ability to express image details at different scales and textures. The intermediate processing layer is used to perform phased feature abstraction and nonlinear transformation on the input image to extract the low-level semantic representation of the image. The input image is the face image to be detected. Its channel dimension is typically 3 (representing RGB three channels), and the spatial resolution is a preset size (e.g., 256×256 pixels). The image first enters the first set of intermediate processing layers, where local features such as edges and contours are extracted through convolution operations. Then, batch normalization is used to eliminate distribution bias between samples. Finally, an activation function (e.g., ReLU) introduces nonlinear factors, making the feature space more expressive. The above process is repeated several times, for example, with four sets of structures, to extract image features from shallow to deep. After all intermediate processing layers are completed, the resulting feature tensor is input into a pooling layer for spatial compression. Max pooling is usually used to enhance the model's translation invariance and reduce the feature map size, while retaining the response values ​​of salient regions. This pooling process can effectively reduce computational cost while focusing on key information regions.

[0091] To further enhance the model's structure awareness and input response consistency, the intermediate feature tensor output by the pooling layer is finally added element-wise to the original input image to generate basic features. Where c represents the number of channels after convolution, h represents the height after convolution, and w represents the width after convolution. For example, this addition employs a residual connection mechanism, which can introduce low-level pixel-level information from the original image while preserving the expressive power of deep features, preventing the deep network from ignoring weak features. Residual compensation enhances the preservation of input content in the basic features, improving the model's sensitivity to image detail regions. This basic feature not only preserves the spatial structure of the image but also possesses strong local texture and edge response capabilities, serving as input for subsequent global feature extraction and feature learning branches. This embodiment constructs a stable and expressive image representation through multi-layer convolution extraction, nonlinear activation, normalization processing, and residual fusion, improving the forgery detection model's ability to distinguish between real and forged images at the detail level and its discrimination accuracy.

[0092] In one embodiment, in step S16 above, the global feature extraction branch performs global feature extraction based on the basic features to obtain a global feature map, which will be further explained here. Based on the above embodiment, it includes:

[0093] S161, the global feature extraction branch divides the basic features into a first part feature and a second part feature of the same size from the channel dimension;

[0094] S162, input the first part of the features into the channel attention block to obtain the first attention map, and input the second part of the features into the spatial attention block to obtain the second attention map;

[0095] S163, add the first attention map and the first part of the features to obtain the first learned feature, and add the second attention map and the second part of the features to obtain the second learned feature;

[0096] S164, the second learned feature and the first learned feature are concatenated sequentially along the channel dimension to obtain the integrated feature;

[0097] S165 processes the integrated features sequentially through a convolutional layer and a batch normalization layer to obtain new basic features. It then returns to the global feature extraction branch and repeats the steps of dividing the basic features into first and second parts of the same size according to the channel dimension until the preset number of iterations is reached. The new basic features obtained in the last iteration are then used as the global feature map.

[0098] In this embodiment, the global feature extraction branch aims to perform multi-level semantic enhancement on the basic features, constructing a feature representation structure with full-image perception capabilities. Specifically, the global feature extraction branch first receives the basic features as input. These basic features are multi-channel tensors containing spatial semantic information extracted from the image through preliminary convolution. In each iteration, the basic features are first divided into two equal parts along the channel dimension, denoted as the first part and the second part, respectively. Both parts maintain consistency in the number of channels and spatial size, ensuring symmetry in information processing and feature consistency. For example, the basic feature F... b Divide into channels of equal size The first part of the feature F b1 With the second part feature F b2 .

[0099] Subsequently, the first set of features is input to the channel attention block, which analyzes the importance of the channel dimension to generate a first attention map. Specifically, the channel attention block contains one global average pooling layer, two fully connected layers, and one deconvolutional layer, concatenated in this order, to mine the contribution strength of different channels in the overall image discrimination. Simultaneously, the second set of features is input to the spatial attention block, which enhances the response to the spatial location dimension to generate a second attention map. The spatial attention block contains one 1×1 convolutional layer, one 3×3 convolutional layer, one 1×1 convolutional layer, and one deconvolutional layer, concatenated in this order.

[0100] Next, the first attention map and the first part of feature F b1 By adding elements one by one, we obtain the first learned feature F. b3 This is used to enhance salient features along the channel dimension; the second attention map and the second part of the feature F b2 By adding elements one by one, we obtain the second learned feature F. b4 This is used to enhance spatial structure information. Subsequently, the second learned feature F b4 With the first learned feature F b3 The features are concatenated along the channel dimension to form an integrated feature. The concatenation order can be fixed as "second feature first, first feature last" to ensure structural consistency. This integrated feature is then processed by a convolutional layer and a batch normalization layer to complete channel fusion and feature smoothing, resulting in a new base feature.

[0101] The process of obtaining new basic features described above is encapsulated as a structural unit and repeated several times in the global feature extraction branch. Each iteration uses the latest basic features as input, sequentially performing channel-spatial attention fusion, integration, and transformation. Finally, after reaching a preset number of iterations (e.g., 3 times), the basic features output from the last iteration are taken as the output of this branch, i.e., the global feature map F. g .

[0102] This embodiment reduces the attention bias or blind spots that may occur with a single attention mechanism by alternately setting attention modeling for channel and spatial dimensions. Simultaneously, multiple rounds of iteration enhance the model's comprehensive analytical capabilities for cross-regional semantic consistency and local anomalies in the image. The resulting global feature map not only encodes the structural semantic information of the original image but also possesses strong context awareness, effectively supporting the forgery detection requirements of subsequent fusion and discrimination modules.

[0103] Specifically, the semantic segmentation map includes masks for each region of the face.

[0104] In this embodiment, the semantic segmentation map includes masks for various facial regions. Each mask corresponds to a specific facial region, such as the left eye, right eye, nose, mouth, eyebrows, and chin. Each mask is encoded in binary form, where a pixel value of 1 indicates a valid facial structure within that region, and a value of 0 indicates a portion of the image that does not belong to that region.

[0105] Next, regarding the regional-level forged confidence map obtained in step S17 above, an implementation method is provided here. Based on the above embodiment, it includes:

[0106] S171, the feature learning branch scales the size of each face region mask to obtain a set of face region masks;

[0107] S172, Multiply the set of masks for each region of the face with the basic features element by element to obtain the set of features for each region of the face;

[0108] S173, based on the feature sets of each region of the face, multiple graph learning blocks are used to obtain the feature sets of each region for fine-grained forgery detection;

[0109] S174, the feature sets of each region used for fine-grained forgery detection are processed by a fully connected layer to calculate the forgery confidence of each region;

[0110] S175. Based on the forgery confidence level of each region, the mask set of each region of the face, and the feature set of each region, a region-level forgery confidence map is obtained.

[0111] In this embodiment, the feature learning branch scales the face region masks based on the spatial resolution difference between the masks and the base feature map, ensuring that each mask maintains spatial consistency with the base features. This scaling process can be achieved through bilinear interpolation or nearest-neighbor interpolation to ensure dimensional alignment for subsequent element-wise operations. After size alignment, the scaled set of face region masks is multiplied element-wise with the base features to obtain the corresponding set of face region features. Each region feature retains only the portion of the base features corresponding to that region mask, setting the rest to zero, thus achieving spatial region isolation of features. In this way, the features of the entire image can be decomposed into several semantic region features, enabling subsequent models to process each structural region separately.

[0112] Building upon this foundation, each region's features are processed by inputting them into multiple graph learning blocks. This enhances the interactive expressive power between different regions, enabling the model to detect potential anomalies even in areas where forgery is not obvious, through analysis of adjacent structures. After graph learning, the features of each region are classified, and a fully connected layer is used to calculate the forgery confidence score for that region. This confidence score represents the probability that the current region is considered forged by the model; a higher value indicates a higher likelihood of forgery. Subsequently, a region-level forgery confidence map is constructed based on the obtained forgery confidence scores for each region, the mask sets for each face region, and the feature sets for each region. Specifically, firstly, the forgery confidence score of each region is multiplied element-wise by the corresponding region mask and then summed to generate an overall confidence score map; then, the features of each region are multiplied element-wise by the corresponding mask and then summed to form an overall forgery feature map; finally, the confidence score map and the forgery feature map are concatenated along the channel dimension to obtain the final region-level forgery confidence map. In summary, the feature learning branch achieves explicit spatial partitioning of local features by combining basic features with structural masks, introduces graph structure representation between regions in feature modeling, and improves the local accuracy and interpretability of forgery detection through confidence output, which helps to enhance the local sensitivity and recognition robustness of overall detection.

[0113] Figure 2 This is a schematic diagram illustrating the processing flow of the region-level feature learning branch provided in this application embodiment. Specifically, each region mask is scaled to obtain a set of face region masks. ; Set of face region masks M n The area masks M1 to M in N Respectively with basic feature F b Element-wise multiplication yields the feature sets of each region of the face. .

[0114] Facial feature set F n The feature sets of each region are obtained through multiple graph learning blocks for fine-grained forgery detection. The graph learning block contains multiple graph convolutional layers. Its principle is to use the features of each region of the face as vertices v of the graph, then use a cross-attention mechanism to calculate the correlation between the features of each region, obtaining edge features e, and finally constructing a feature relationship graph. The feature relationship graph G, through graph learning blocks, yields the features of each region used for fine-grained forgery detection. .

[0115] Features of each region used for fine-grained forgery detection The forgery confidence level for each region is calculated using a single fully connected layer. ; Confidence level W for forgery in each region n With the corresponding area mask Mn Multiply and then add, then combine with the characteristics of each region. With the corresponding area mask M n The features obtained by multiplying and then adding are concatenated in order along the channel dimension, as shown in the following formula:

[0116]

[0117] Finally, a regional-level forged confidence map was obtained. .

[0118] Furthermore, the input to the feature fusion unit is the global feature map F. g and regional-level forged confidence graph F r From the channel dimension, according to F g After F r By splicing together, we can obtain comprehensive features. F gr After passing through one 1×1 convolutional layer, one batch normalization layer, and one ReLU activation function layer, classification features are obtained. .

[0119] In one specific embodiment, the classifier comprises one global average pooling layer and one fully connected layer, concatenated in this order. The input to the classifier is the classification features output by the feature fusion unit in the previous stage, whose data dimension is a multi-channel feature map, with a spatial size similar to the original image features. Figure 1 To transform two-dimensional spatial features into a fixed-length vector representation, the global average pooling layer first performs a spatial averaging operation on each input channel, extracting channel-level information across the entire image. This process preserves the response intensity of each channel across the entire image while compressing the spatial dimension, transforming the feature tensor from a three-dimensional structure into a one-dimensional channel vector, effectively reducing the number of model parameters and improving discrimination efficiency. Subsequently, this channel vector is input to the fully connected layer for final category discrimination. In this embodiment, the output dimension of the fully connected layer is 2, corresponding to two categories of discrimination results: one is that the input image is a real face, and the other is that the input image is a fake face. The output consists of two real numbers, which can usually be transformed into a probability distribution form through a subsequent normalization function (such as Softmax), representing the probability of the image being judged as real or fake. This structure can be directly used for binary classification tasks in fakeness detection scenarios, and the result format is intuitive and clear, facilitating subsequent processing or user understanding. By setting the classifier structure, the model complexity can be reduced while maintaining discrimination accuracy. In addition, the global average pooling layer improves the model's robustness to image location perturbations, which helps to improve the overall detection stability and generalization ability.

[0120] Figure 3 This is a schematic flowchart illustrating a method for obtaining a pre-trained detection model provided in an embodiment of this application. Based on the above embodiments, as follows...Figure 3 As shown, it includes:

[0121] S31, obtain real face image data and the first label data corresponding to the real face image data, as well as fake face image data and the second label data corresponding to the fake face image data;

[0122] S32, input real face image data and fake face image data into the pre-built detection model to obtain the model prediction results;

[0123] S33, calculate the cross-entropy loss function based on the model prediction results and the corresponding first label data or second label data;

[0124] S34. The pre-built detection model is iteratively updated based on the preset model optimization algorithm until the cross-entropy loss function reaches the preset iteration stopping condition, and the pre-built detection model that meets the preset requirements is determined as the pre-trained detection model.

[0125] In this embodiment, a training dataset is first prepared, consisting of two parts: real face image data and fake face image data. Real face image data can come from naturally captured images, publicly available face recognition datasets, or authorized images from actual users, and each image is assigned a first label, typically set to "0," indicating a real sample. Fake face image data can be generated using image generation tools or deepfake algorithms (such as face swapping, expression transfer, semantic editing, etc.), and the corresponding second label is set to "1," indicating a fake sample. The label data serves as a supervisory signal for target guidance during the training process.

[0126] Subsequently, the aforementioned real face image data and fake face image data are input into the pre-built detection model to obtain the model's prediction results. Based on the prediction results and label data, the cross-entropy loss function is used to calculate the error value between the model output and the true label. The specific formula used is:

[0127]

[0128] Where y is the true label ("0" or "1"), and p is the probability that the model predicts it to be a real face image (i.e. the model prediction result).

[0129] During model optimization, a pre-defined model optimization algorithm (such as the Adam algorithm) is used to iteratively update all parameters of the pre-built detection model. Through multiple rounds of parameter adjustment, the loss function is gradually reduced. The training process continues until the value of the cross-entropy loss function reaches a pre-defined iteration stopping condition, such as the loss falling below a threshold, the validation set accuracy stabilizing, or reaching the maximum number of training rounds. Once the iteration stopping condition is met, the detection model with the best performance at that point is confirmed as the final pre-trained detection model.

[0130] Furthermore, datasets can be obtained by directly downloading public datasets or constructing private datasets. Public and private datasets can be divided into training and testing sets, with a ratio of 70% and 30% respectively. The training set is used for model training, and the testing set is used for final analysis of the model's robustness and generalization ability. Public datasets include CelebFacesAttributes (CelebA), FaceForensics++ (FF++), and DeepFake Detection Challenge (DFDC), etc. Constructing a private dataset involves the following steps: collecting real face images, such as personal images; selecting qualified real face images from some open-source face datasets that allow secondary use, such as the Labeled Faces in the Wild (LFW) dataset; generating fake face images using face synthesis tools, such as DeepFake Generator and FaceSwap; and using Generative Adversarial Networks (GANs) to generate fake face images, etc. Data annotation uses image annotation tools such as LabelImg and RectLabel to label each image as a real face or a fake face, with "0" representing a real face and "1" representing a fake face.

[0131] Figure 4 This is a schematic diagram of the structure of the face forgery detection device provided in the embodiments of this application, as shown below. Figure 4 As shown, the face forgery detection device 40 provided in this embodiment includes:

[0132] The information acquisition module 401 is used to acquire a pre-trained detection model and a face image to be detected. The pre-trained detection model includes a facial key point detector, a semantic segmentation map generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion unit, and a classifier.

[0133] The detection execution module 402 is used to input the face image to be detected into the pre-trained detection model, so that: the facial key point detector obtains a facial key point map based on the input face image to be detected; the semantic segmentation map generator generates a semantic segmentation map based on the facial key point map; the feature extractor performs basic feature extraction based on the face image to be detected to obtain basic features; the global feature extraction branch performs global feature extraction based on the basic features to obtain a global feature map; the feature learning branch obtains a region-level forgery confidence map based on the basic features and the semantic segmentation map; the feature fusion unit performs fusion processing based on the global feature map and the region-level forgery confidence map to obtain classification features; and the classifier obtains the face forgery detection result based on the classification features.

[0134] In an optional embodiment of this application, the detection execution module 402 is specifically used to: use a 68-point detector in a preset face detection tool library or a facial key point detection model in a deep neural network module of a preset computer vision library to obtain a facial key point map containing 68 key points based on the face image to be detected.

[0135] In an optional embodiment of this application, the detection execution module 402 is specifically used for:

[0136] The semantic segmentation map generator uses a preset facial analysis tool to divide each pixel of the face into the corresponding semantic category based on the facial key point map, so as to generate a semantic segmentation map containing the mask of each region of the face.

[0137] The feature extractor consists of multiple convolutional layers and one pooling layer.

[0138] In an optional embodiment of this application, the detection execution module 402 is specifically used for:

[0139] The convolutional layer, the subsequent batch normalization layer, and a preset activation function layer form an intermediate processing layer. Multiple intermediate processing layers and a pooling layer perform preliminary feature processing on the face image to be detected to obtain an intermediate feature tensor.

[0140] The basic features are obtained by adding the intermediate feature tensor and the face image to be detected element by element.

[0141] In an optional embodiment of this application, the detection execution module 402 is specifically used for:

[0142] The global feature extraction branch divides the basic features into a first part and a second part of the same size based on the channel dimension.

[0143] The first part of the features is input into the channel attention block to obtain the first attention map, and the second part of the features is input into the spatial attention block to obtain the second attention map;

[0144] The first attention map and the first part of the features are added together to obtain the first learned feature, and the second attention map and the second part of the features are added together to obtain the second learned feature;

[0145] The second and first learned features are concatenated sequentially along the channel dimension to obtain the integrated feature;

[0146] The integrated features are processed sequentially through a convolutional layer and a batch normalization layer to obtain new basic features. The process is then repeated in the global feature extraction branch, which divides the basic features into first and second parts of the same size based on the channel dimension, until a preset number of iterations is reached. The new basic features obtained in the last iteration are then used as the global feature map.

[0147] The semantic segmentation map includes masks for each region of the face.

[0148] In an optional embodiment of this application, the detection execution module 402 is specifically used for:

[0149] The feature learning branch scales the size of each face region mask to obtain a set of face region masks;

[0150] The set of masks for each region of the face is multiplied element-wise with the basic features to obtain the set of features for each region of the face.

[0151] Based on the feature sets of each region of the face, multiple graph learning blocks are used to obtain the feature sets of each region for fine-grained forgery detection;

[0152] The feature sets of each region used for fine-grained forgery detection are passed through a fully connected layer to calculate the forgery confidence of each region.

[0153] Based on the forgery confidence level of each region, the mask set of each region of the face, and the feature set of each region, a region-level forgery confidence map is obtained.

[0154] In an optional embodiment of this application, the information acquisition module 401 is specifically used for:

[0155] Obtain real face image data and the first label data corresponding to the real face image data, as well as fake face image data and the second label data corresponding to the fake face image data;

[0156] Real face image data and fake face image data are input into a pre-built detection model to obtain the model's prediction results;

[0157] Calculate the cross-entropy loss function based on the model prediction results and their corresponding first-label data or second-label data;

[0158] The pre-built detection model is iteratively updated based on the preset model optimization algorithm until the cross-entropy loss function reaches the preset iteration stopping condition, and the pre-built detection model that meets the preset requirements is determined as the pre-trained detection model.

[0159] The face forgery detection device 40 provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0160] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the electronic device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0161] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.

[0162] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0163] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0164] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0165] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0166] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0167] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0168] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0169] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0170] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0171] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0172] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0173] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0174] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0175] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for detecting face forgery, characterized in that, include: Acquire a pre-trained detection model and a face image to be detected, wherein the pre-trained detection model includes a facial keypoint detector, a semantic segmentation map generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion unit, and a classifier; The face image to be detected is input into the pre-trained detection model so that: The facial landmark detector obtains a facial landmark map based on the input face image to be detected; The semantic segmentation map generator generates a semantic segmentation map based on the facial key point map; The feature extractor performs basic feature extraction based on the face image to be detected to obtain basic features; The global feature extraction branch performs global feature extraction based on the basic features to obtain a global feature map; The feature learning branch obtains a region-level forgery confidence map based on the basic features and the semantic segmentation map; The feature fusion processor performs fusion processing based on the global feature map and the regional forged confidence map to obtain classification features; The classifier obtains the face forgery detection result based on the classification features.

2. The method according to claim 1, characterized in that, The step of obtaining a facial key point map based on the input face image to be detected includes: The facial landmark detector uses a detector from the face detection tool library or a facial landmark detection model from the deep neural network module of the computer vision library to obtain a facial landmark map containing a preset number of landmarks based on the face image to be detected.

3. The method according to claim 2, characterized in that, The semantic segmentation map generator generates a semantic segmentation map based on the facial key point map, including: The semantic segmentation map generator uses a preset facial analysis tool to divide each pixel of the face into a corresponding semantic category based on the facial key point map, so as to generate a semantic segmentation map containing the masks of each region of the face.

4. The method according to claim 1, characterized in that, The feature extractor includes multiple convolutional layers and one pooling layer; The feature extractor performs basic feature extraction based on the face image to be detected, obtaining basic features, including: A convolutional layer, a batch normalization layer, and a preset activation function layer form an intermediate processing layer. Multiple intermediate processing layers and a pooling layer perform preliminary feature processing on the face image to be detected to obtain an intermediate feature tensor. The basic features are obtained by adding the intermediate feature tensor and the face image to be detected element by element.

5. The method according to claim 1, characterized in that, The global feature extraction branch performs global feature extraction based on the basic features to obtain a global feature map, including: The global feature extraction branch is divided into a first part of features and a second part of features of the same size from the channel dimension based on the basic features; The first part of the features is input into the channel attention block to obtain the first attention map, and the second part of the features is input into the spatial attention block to obtain the second attention map; The first attention map and the first partial features are added together to obtain the first learned feature, and the second attention map and the second partial features are added together to obtain the second learned feature; The second learning feature and the first learning feature are concatenated sequentially along the channel dimension to obtain the integrated feature; The integrated features are processed sequentially through a convolutional layer and a batch normalization layer to obtain new basic features. The process is then repeated in the global feature extraction branch, where the basic features are divided into first and second parts of the same size according to the channel dimension, until a preset number of iterations is reached. The new basic features obtained in the last iteration are then used as the global feature map.

6. The method according to claim 1, characterized in that, The semantic segmentation map includes masks for each region of the face; The feature learning branch obtains a region-level forgery confidence map based on the basic features and the semantic segmentation map, including: The feature learning branch scales the face region mask according to its size to obtain a set of face region masks; The set of masks for each region of the face is multiplied element-wise with the basic features to obtain the set of features for each region of the face. Based on the feature sets of each region of the face, a feature set of each region is obtained through multiple graph learning blocks for fine-grained forgery detection; The forgery confidence of each region is calculated by passing the feature set of each region used for fine-grained forgery detection through a fully connected layer. Based on the forgery confidence level of each region, the mask set of each region of the face, and the feature set of each region, a region-level forgery confidence map is obtained.

7. The method according to any one of claims 1 to 6, characterized in that, The acquisition of the pre-trained detection model includes: Obtain real face image data and the first tag data corresponding to the real face image data, as well as fake face image data and the second tag data corresponding to the fake face image data; The real face image data and the fake face image data are input into the pre-built detection model to obtain the model prediction results; Calculate the cross-entropy loss function based on the model prediction results and the corresponding first or second label data; The pre-built detection model is iteratively updated based on the preset model optimization algorithm until the cross-entropy loss function reaches the preset iteration stopping condition, and the pre-built detection model that meets the preset requirements is determined as the pre-trained detection model.

8. A face forgery detection device, characterized in that, include: The information acquisition module is used to acquire a pre-trained detection model and a face image to be detected, wherein the pre-trained detection model includes a facial key point detector, a semantic segmentation map generator, a feature extractor, a global feature extraction branch, a feature learning branch, a feature fusion unit, and a classifier; The detection execution module is used to input the face image to be detected into the pre-trained detection model, so that: the facial key point detector obtains a facial key point map based on the input face image to be detected; the semantic segmentation map generator generates a semantic segmentation map based on the facial key point map; the feature extractor performs basic feature extraction based on the face image to be detected to obtain basic features; and the global feature extraction branch performs global feature extraction based on the basic features to obtain a global feature map. The feature learning branch obtains a region-level forgery confidence map based on the basic features and the semantic segmentation map; the feature fusion unit performs fusion processing based on the global feature map and the region-level forgery confidence map to obtain classification features; The classifier obtains the face forgery detection result based on the classification features.

9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Foreign certificate identification method and system based on multi-modal fusion

    CN122135187A