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

By using the encoder and decoder network layers in the face image forgery detection model to perform noise frame iterative prediction processing and using random bounding boxes, the problem of insufficient accuracy in face image forgery detection in the existing technology is solved, and a higher level is achieved. detection accuracy and simplified process.

CN118629097APending Publication Date: 2024-09-10BEIJING YUANJIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410784009.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing face image forgery detection methods rely on fixed learnable query boxes. As a result, when the number of evaluated query boxes exceeds the number during training, the performance of the DETR algorithm decreases, making it difficult to improve the accuracy of forgery detection.

Method used

Iterative prediction processing of predicted noise boxes on face images through the encoder network layer and decoder network layer in the face image forgery detection model, using completely random noise bounding boxes, eliminating hand-designed components such as anchor boxes or learnable Query box to simplify the detection process.

Benefits of technology

It improves the precision and accuracy of face image forgery detection, avoids performance degradation, simplifies the detection process, and enhances the ability to identify forged faces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629097A
    Figure CN118629097A
Patent Text Reader

Abstract

The invention provides a face image forgery detection method and device, electronic equipment and a storage medium, and the method comprises the steps: inputting a target face image into an encoder network layer of a pre-trained face image forgery detection model, carrying out the coding processing of the target face image, and generating a noise bounding box, outputting face features of the target face image and a noise bounding box under the current time step; inputting the face features, the noise bounding box and the current time step into a decoder network layer of a face image forgery detection model, sequentially carrying out feature extraction processing and bounding box regression processing on the noise bounding box, and carrying out category prediction processing on the face features; and predicting coordinate information and category information of the faked face bounding box of the target face. The precision and accuracy of counterfeit detection are improved, a completely random noise bounding box is used, a manually designed component such as an anchor frame or a learnable query frame is eliminated, and the detection process of a counterfeit image is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of face forgery recognition, and in particular to a method, device, electronic device and storage medium for detecting face image forgery. Background Art

[0002] The development of forged face detection methods is from forged face detection methods based on artificial priors to forged face detection methods based on learnable query frames. These studies are simple and effective. However, they still rely on a fixed set of learnable query frames to detect forged faces. When a fixed set of learnable query frames is used to detect forged faces, the performance of the DETR algorithm will decrease when the number of query frames evaluated exceeds the number during training. Therefore, how to improve the accuracy of forged face image detection has become a technical issue that cannot be underestimated. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a facial image forgery detection method, device, electronic device and storage medium, which improves the precision and accuracy of forgery detection by performing iterative prediction processing of noise boxes on facial images through the encoder network layer and the decoder network layer in the facial image forgery detection model, and uses completely random noise bounding boxes to eliminate manually designed components such as anchor boxes or learnable query boxes, thereby simplifying the detection process of forged facial images.

[0004] The present invention provides a method for detecting forged facial images, the method comprising:

[0005] Get the target face image;

[0006] Input the target face image into the encoder network layer of the pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step;

[0007] The facial features, the noise bounding box and the current time step are input into the decoder network layer of the facial image forgery detection model, the noise bounding box is sequentially subjected to feature extraction processing and bounding box regression processing, and the facial features are subjected to category prediction processing to predict the coordinate information and category information of the forged facial bounding box of the target face.

[0008] In a possible implementation manner, the target face image is input into an encoder network layer of a pre-trained face image forgery detection model, encoding the target face image and generating a noise bounding box, and outputting the face features of the target face image and the noise bounding box at the current time step, including:

[0009] Performing encoding processing on the target face image based on the encoder network layer to extract facial features of the target face image;

[0010] The encoder network layer gradually adds facial noise to the facial features based on a forged diffusion model at each time step, separates the facial features after adding facial noise from the target facial image, and generates the noise bounding box at the current time step.

[0011] In a possible implementation manner, the facial features, the noise bounding box, and the current time step are input into the decoder network layer of the facial image forgery detection model, and the noise bounding box is subjected to feature extraction, bounding box regression processing, and category prediction processing in an iterative manner to predict the coordinate information and category information of the forged face bounding box of the target face, including:

[0012] Extracting bounding box features of the noise bounding box at the current time step based on the decoder network layer, and determining the extracted bounding box features;

[0013] Based on the decoder network layer, the bounding box feature is subjected to bounding box regression processing, and the facial feature is subjected to category prediction processing to predict a predicted noise box at the next time step and category information of the facial feature;

[0014] Continue to input the predicted noise frame and the facial features of the next time step into the decoder network layer until each predicted noise frame in the time step sequence is processed, and then output the coordinate information and category information of the forged facial boundary box of the target face.

[0015] In a possible implementation manner, after performing bounding box regression processing on the bounding box feature based on the decoder network layer and performing category prediction processing on the facial feature to predict the predicted noise box of the next time step and the category information of the facial feature, the facial image forgery detection method further includes:

[0016] Based on the forged face bounding box update strategy, the predicted noise boxes with scores below a threshold are eliminated, and the remaining predicted noise boxes and random noise boxes randomly sampled from a Gaussian distribution are iteratively updated so that among the remaining predicted noise boxes and the random noise boxes, the noise box that meets the facial features under the forged category information is determined as the forged face bounding box.

[0017] In a possible implementation manner, the face image forgery detection model is determined by the following steps:

[0018] Acquire multiple sample forged face images, a sample forged face bounding box of each of the sample forged face images, and sample category label information;

[0019] Inputting each of the sample forged face images into the encoder network layer of the neural network model, encoding each of the sample forged face images, and extracting sample face features of each of the sample forged face images;

[0020] Selecting a time step based on the encoder network layer and randomly generating a noise tensor with the same shape as the sample forged face bounding box, combining the noise tensor with the sample forged face bounding box according to the time step to generate a candidate bounding box;

[0021] Inputting the candidate bounding box and the sample face features into the decoder network layer of the neural network model for prediction, and outputting the predicted bounding box and predicted category label information of each sample forged face image;

[0022] The neural network model is iteratively trained based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information to determine the face image forgery detection model.

[0023] In a possible implementation manner, the iterative training of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box, and the sample category label information to determine the face image forgery detection model includes:

[0024] Determining a loss value of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box, and the sample category label information;

[0025] If the loss value is less than or equal to a preset loss threshold, determining the neural network model as the face image forgery detection model;

[0026] If the loss value is greater than the preset loss threshold, the network parameters of the neural network model are changed, and the neural network model is continuously trained until the loss value is less than or equal to the preset loss threshold, and the training is stopped.

[0027] The embodiment of the present application also provides a facial image forgery detection device, the facial image forgery detection device comprising:

[0028] An acquisition module is used to acquire a target face image;

[0029] A noisy module is used to input the target face image into the encoder network layer of a pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step;

[0030] The denoising module is used to input the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forgery detection model, perform feature extraction processing and bounding box regression processing on the noise bounding box in sequence, and perform category prediction processing on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face.

[0031] In a possible implementation manner, when the denoising module is used to input the target face image into the encoder network layer of the pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step, the denoising module is specifically used to:

[0032] Performing encoding processing on the target face image based on the encoder network layer to extract facial features of the target face image;

[0033] The encoder network layer gradually adds facial noise to the facial features based on a forged diffusion model at each time step, separates the facial features after adding facial noise from the target facial image, and generates the noise bounding box at the current time step.

[0034] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned facial image forgery detection method are performed.

[0035] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the facial image forgery detection method as described above are executed.

[0036] The embodiment of the present application provides a method, device, electronic device and storage medium for detecting forged facial images. The method comprises: obtaining a target facial image; inputting the target facial image into the encoder network layer of a pre-trained facial image forged detection model, encoding the target facial image and generating a noise bounding box, and outputting the facial features of the target facial image and the noise bounding box at the current time step; inputting the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forged detection model, performing feature extraction and bounding box regression processing on the noise bounding box in turn, and performing category prediction processing on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face. The encoder network layer and the decoder network layer in the facial image forged detection model perform iterative prediction processing on the facial image to predict the noise box, thereby improving the precision and accuracy of forged detection, and using a completely random noise bounding box to eliminate manually designed components such as anchor boxes or learnable query boxes, thereby simplifying the detection process of forged facial images.

[0037] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A flowchart of a facial image forgery detection method provided in an embodiment of the present application;

[0040] Figure 2 This is one of the structural schematic diagrams of a facial image forgery detection device provided in an embodiment of the present application;

[0041] Figure 3 A second structural diagram of a facial image forgery detection device provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0044] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied to the field of face forgery recognition technology.

[0045] Research has found that the development of forged face detection methods is from forged face detection methods based on artificial priors to forged face detection methods based on learnable query frames. These studies are simple and effective. However, they still rely on a fixed set of learnable query frames to detect forged faces. When a fixed set of learnable query frames is used to detect forged faces, the performance of the DETR algorithm will decrease when the number of query frames evaluated exceeds the number during training. Therefore, how to improve the accuracy of forged face image detection has become a technical issue that cannot be underestimated.

[0046] Based on this, an embodiment of the present application provides a method for detecting forged facial images, which performs iterative prediction processing of noise boxes on facial images through the encoder network layer and the decoder network layer in the facial image forgery detection model, thereby improving the precision and accuracy of forgery detection, and using completely random noise bounding boxes to eliminate manually designed components such as anchor boxes or learnable query boxes, thereby simplifying the detection process of forged facial images.

[0047] See also Figure 1 , Figure 1 This is a flow chart of a method for detecting forged facial images provided in an embodiment of the present application. Figure 1 As shown in, the face image forgery detection method provided by the embodiment of the present application includes:

[0048] S101: Obtain target face image

[0049] In this step, the target face image can be acquired from the face acquisition device.

[0050] Here, in this solution, in addition to acquiring the target face image from the face acquisition device, images can also be acquired from other devices, and this part is not specifically limited.

[0051] S102: Input the target face image into the encoder network layer of a pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the facial features of the target face image and the noise bounding box at the current time step.

[0052] In this step, the target face image is input into the encoder network layer of the pre-trained face image forgery detection model, the target face image is encoded and the noise bounding box is generated, and the facial features of the target face image and the noise bounding box at the current time step are output.

[0053] Among them, the information of the input target face image includes an image tensor with a shape of [B,H,W,3], where B is the batch size, H and W are the height and width of the image respectively, and 3 represents the color channel.

[0054] Among them, the face image forgery detection model is obtained by iterative training of the neural network model.

[0055] Here, the noise boundary box is a box formed by boundary lines formed by different image noises in the target face image.

[0056] In a possible implementation manner, the target face image is input into an encoder network layer of a pre-trained face image forgery detection model, encoding the target face image and generating a noise bounding box, and outputting the face features of the target face image and the noise bounding box at the current time step, including:

[0057] A: Encode the target face image based on the encoder network layer to extract facial features of the target face image.

[0058] Here, the target face image is encoded according to the encoder network layer to extract the facial features of the target face image.

[0059] Among them, the encoder network layer uses convolutional neural networks such as ResNet and Transformer-based models to implement DiffusionDep.

[0060] B: The encoder network layer gradually adds facial noise to the facial features based on the forged diffusion model at each time step, separates the facial features after adding facial noise from the target face image, and generates the noise bounding box at the current time step.

[0061] Here, the encoder network layer gradually adds facial noise to the facial features according to the forged diffusion model at each time step, separates the facial features with added facial noise from the target face image, and generates a noise bounding box at the current time step.

[0062] Among them, the forged diffusion model is a model inspired by non-equilibrium thermodynamics. The Markov diffusion forward chain is defined by gradually adding noise to the face data. The process of adding face noise to the image is defined as:

[0063]

[0064] By adding noise to the target face image z0, z0 is converted into a latent image zt, where t∈{0,1,...,T}. where β s represents the noise variance, is a parameter given in advance to control the noise progress, and I is the sample variance.

[0065] S103: Input the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forgery detection model, perform feature extraction processing and bounding box regression processing on the noise bounding box in sequence, and perform category prediction processing on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face.

[0066] In this step, the facial features, noise bounding box and current time step are input into the decoder network layer of the facial image forgery detection model, the noise bounding box is subjected to feature extraction and bounding box regression in turn, and the facial features are subjected to category prediction to predict the coordinate information and category information of the forged facial bounding box of the target face.

[0067] The category information includes forged category information and non-forged category information. If it is determined that the target face category information is forged category information, the noise frame of the target face is predicted to be a forged face boundary frame.

[0068] In this paper, we propose a simpler method to detect fake faces directly from a set of random boxes. Starting from purely random boxes, which contain no learnable parameters that need to be optimized during the training phase, we gradually refine the positions and sizes of these boxes until they perfectly cover the fake object. This noise-to-target box approach requires neither heuristic prior boxes nor learnable query boxes.

[0069] In a possible implementation manner, the facial features, the noise bounding box, and the current time step are input into the decoder network layer of the facial image forgery detection model, and the noise bounding box is subjected to feature extraction, bounding box regression processing, and category prediction processing in an iterative manner to predict the coordinate information and category information of the forged face bounding box of the target face, including:

[0070] (1): Based on the decoder network layer, a bounding box feature is extracted for the noise bounding box at the current time step to determine the extracted bounding box feature.

[0071] Here, the bounding box features are extracted from the noise bounding box at the current time step according to the decoder network layer, and the extracted bounding box features are determined.

[0072] The decoder network layer consists of a fixed number of convolutional cascade layers. Each level further processes the input boxes and continuously optimizes and refines them through learned features. These stages include feature extraction, bounding box regression, category prediction, etc. Each stage uses the output of the previous stage as input.

[0073] (2): Based on the decoder network layer, bounding box regression processing is performed on the bounding box feature, and category prediction processing is performed on the facial feature to predict the predicted noise box of the next time step and the category information of the facial feature.

[0074] Here, the bounding box feature is subjected to bounding box regression processing according to the decoder network layer, and the facial feature is subjected to category prediction processing to predict the predicted noise box and category information of the facial feature at the next time step.

[0075] In a possible implementation manner, after performing bounding box regression processing on the bounding box feature based on the decoder network layer and performing category prediction processing on the facial feature to predict the predicted noise box of the next time step and the category information of the facial feature, the facial image forgery detection method further includes:

[0076] Based on the forged face bounding box update strategy, the predicted noise boxes with scores below a threshold are eliminated, and the remaining predicted noise boxes and random noise boxes randomly sampled from a Gaussian distribution are iteratively updated so that among the remaining predicted noise boxes and the random noise boxes, the noise box that meets the facial features under the forged category information is determined as the forged face bounding box.

[0077] Here, according to the forged face bounding box update strategy, the predicted noise boxes with scores below the threshold are eliminated, and the remaining predicted noise boxes and random noise boxes randomly sampled from the Gaussian distribution are iteratively updated, so that among the remaining predicted noise boxes and the random noise boxes, the noise boxes that meet the facial features under the forged category information are determined as forged face bounding boxes.

[0078] Among them, in each sampling step, the random box or predicted box in the previous sampling step is randomly sent to the decoder network layer to predict the forged category and the coordinates of the box. After each sampling step, the predicted box can be roughly divided into two types, namely the expected prediction box and the useless prediction box. The expected prediction contains the box that is correctly located on the forged face, while the useless prediction box is arbitrarily distributed. In order to make the reasoning better consistent with the training, a forged box update strategy is proposed to restore these unwanted boxes by replacing them with random boxes. Specifically, the unwanted boxes with scores below a certain threshold are filtered out. Then, the remaining boxes are updated with random boxes sampled from a Gaussian distribution.

[0079] (3): Continue to input the predicted noise frame of the next time step and the facial features into the decoder network layer until each predicted noise frame in the time step sequence is processed, and then output the coordinate information and category information of the forged facial boundary box of the target face.

[0080] Here, the predicted noise frame and facial features of the next time step continue to be input into the decoder network layer until each predicted noise frame in the time step sequence is processed, and the coordinate information and category information of the forged face bounding box of the target face are output.

[0081] The forged face boundary box is a noise box that best matches the forged face features among multiple predicted noise boxes and random noise boxes.

[0082] In a specific embodiment, input images: image tensor of shape [B, H, W, 3], where B is the batch size, H and W are the height and width of the image, and 3 represents the color channel. T: total number of time steps. The image is encoded through the encoder network layer to extract the forged features, and a set of noise bounding boxes are initialized at the same time, with a shape of (B, N, 4), and then a sequence of a pair of time steps is created. For each time step pair (t_now, t_next): using the current noise bounding box, facial features and current time step, the decoder network layer is used for detection, and the predicted noise box at the next time step t_next is predicted and inferred, and the bounding box is updated to prepare for the next iteration, until the iteration ends and the final predicted forged face bounding box is returned.

[0083] In a possible implementation manner, the face image forgery detection model is determined by the following steps:

[0084] a: Obtain multiple sample forged face images, a sample forged face bounding box of each of the sample forged face images, and sample category label information.

[0085] Here, the learning goal of fake face detection is to input a target pair (x, b, c), where x is a sample fake face image, b and c are a set of bounding boxes and sample category label information of the face in image x. The i-th box is expressed as in is the center coordinate of the sample forged face bounding box, (ω i ,h i ) are the width and height of the face frame respectively.

[0086] b: Input each of the sample forged facial images into the encoder network layer of the neural network model, encode each of the sample forged facial images, and extract the sample facial features of each of the sample forged facial images.

[0087] Here, the sample forged face images are input into the encoder network layer of the neural network model, each sample forged face image is encoded, and the sample face features of each sample forged face image are extracted.

[0088] c: selecting a time step based on the encoder network layer and randomly generating a noise tensor with the same shape as the sample forged face bounding box, combining the noise tensor with the sample forged face bounding box according to the time step to generate a candidate bounding box.

[0089] Here, a time step is selected according to the encoder network layer and a noise tensor with the same shape as the sample forged face bounding box is randomly generated, and the noise tensor is combined with the sample forged face bounding box according to the time step to destroy the face forged bounding box to obtain a damaged candidate bounding box.

[0090] Among them, the forged face data sample is a set of forged face bounding boxes z0=b, where is a set of N boxes. Neural network f θ (z t ,t,x) is trained to predict z0 from the noise box zt, conditioned on the corresponding image x to produce the corresponding class label c.

[0091] d: Input the candidate bounding box and the sample facial features into the decoder network layer of the neural network model for prediction, and output the predicted bounding box and predicted category label information of each sample forged facial image.

[0092] Here, the candidate bounding box and the sample facial features are input into the decoder network layer of the neural network model for prediction, and the predicted bounding box and predicted category label information of each sample forged facial image are output.

[0093] Here, the process of predicting the candidate bounding box and sample facial features is consistent with the prediction process of the facial features and noise bounding box described above, and will not be described in detail in this section.

[0094] e: Iteratively train the neural network model based on the predicted bounding box, the predicted category label information, the sample forged face bounding box and the sample category label information of each sample forged face image to determine the face image forgery detection model.

[0095] Here, the neural network model is iteratively trained based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information to determine the face image forgery detection model.

[0096] In a possible implementation manner, the iterative training of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box, and the sample category label information to determine the face image forgery detection model includes:

[0097] I: Determine the loss value of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information.

[0098] Here, the loss value of the neural network model is determined based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information.

[0099] Here, the loss value calculation formula may be any loss value calculation function in the prior art.

[0100] II: If the loss value is less than or equal to the preset loss threshold, the neural network model is determined as the face image forgery detection model. If the loss value is greater than the preset loss threshold, the network parameters of the neural network model are changed, and the neural network model is continuously trained until the loss value is less than or equal to the preset loss threshold, and the training is stopped.

[0101] Here, if the loss value is less than or equal to the preset loss threshold, the neural network model is determined as a face image forgery detection model. If the loss value is greater than the preset loss threshold, the network parameters of the neural network model are changed, and the neural network model is continuously trained until the loss value is less than or equal to the preset loss threshold, and the training is stopped.

[0102] In this application, since the forgery diffusion model generates data samples iteratively, it is necessary to run the face image forgery detection model f multiple times in the inference stage. θ , in the inference stage, the facial feature z 0 From the noise z T Reconstruction, face image forgery detection model f θ Update the rules iteratively, i.e. z T →z T-Δ →…→z 0 During the training process, the fake diffusion model is used to solve the fake face detection task. In each iteration step, f θ The application is calculated on the original face image.

[0103] The embodiment of the present application provides a method for detecting forged facial images, which comprises: obtaining a target facial image; inputting the target facial image into the encoder network layer of a pre-trained facial image forged detection model, encoding the target facial image and generating a noise bounding box, and outputting the facial features of the target facial image and the noise bounding box at the current time step; inputting the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forged detection model, performing feature extraction and bounding box regression processing on the noise bounding box in turn, and performing category prediction processing on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face. The encoder network layer and the decoder network layer in the facial image forged detection model perform iterative prediction processing on the facial image to predict the noise box, thereby improving the precision and accuracy of forged detection, and using a completely random noise bounding box to eliminate manually designed components such as anchor boxes or learnable query boxes, thereby simplifying the detection process of forged facial images.

[0104] See also Figure 2 , Figure 3 , Figure 2 This is one of the structural schematic diagrams of a facial image forgery detection device provided in an embodiment of the present application; Figure 3 This is a second structural diagram of a facial image forgery detection device provided in an embodiment of the present application. Figure 2 As shown in , the facial image forgery detection device 200 comprises:

[0105] An acquisition module 210 is used to acquire a target face image;

[0106] A noise adding module 220 is used to input the target face image into the encoder network layer of the pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step;

[0107] The denoising module 230 is used to input the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forgery detection model, perform feature extraction processing and bounding box regression processing on the noise bounding box in sequence, and perform category prediction processing on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face.

[0108] Furthermore, when the denoising module 220 is used to input the target face image into the encoder network layer of the pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step, the denoising module 220 is specifically used to:

[0109] Performing encoding processing on the target face image based on the encoder network layer to extract facial features of the target face image;

[0110] The encoder network layer gradually adds facial noise to the facial features based on a forged diffusion model at each time step, separates the facial features after adding facial noise from the target facial image, and generates the noise bounding box at the current time step.

[0111] Further, when the denoising module 230 is used to input the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forgery detection model, and iteratively performs feature extraction, bounding box regression processing and category prediction processing on the noise bounding box in turn, and predicts the coordinate information and category information of the forged face bounding box of the target face, the denoising module 230 is specifically used to:

[0112] Extracting bounding box features of the noise bounding box at the current time step based on the decoder network layer, and determining the extracted bounding box features;

[0113] Based on the decoder network layer, the bounding box feature is subjected to bounding box regression processing, and the facial feature is subjected to category prediction processing to predict a predicted noise box at the next time step and category information of the facial feature;

[0114] Continue to input the predicted noise frame and the facial features of the next time step into the decoder network layer until each predicted noise frame in the time step sequence is processed, and then output the coordinate information and category information of the forged facial boundary box of the target face.

[0115] Furthermore, the denoising module 230 is also used for:

[0116] Based on the forged face bounding box update strategy, the predicted noise boxes with scores below a threshold are eliminated, and the remaining predicted noise boxes and random noise boxes randomly sampled from a Gaussian distribution are iteratively updated so that among the remaining predicted noise boxes and the random noise boxes, the noise box that meets the facial features under the forged category information is determined as the forged face bounding box.

[0117] Further, such as Figure 3 As shown, the facial image forgery detection device 200 further includes a model training module 240, which is used to determine the facial image forgery detection model through the following steps:

[0118] Acquire multiple sample forged face images, a sample forged face bounding box of each of the sample forged face images, and sample category label information;

[0119] Inputting each of the sample forged face images into the encoder network layer of the neural network model, encoding each of the sample forged face images, and extracting sample face features of each of the sample forged face images;

[0120] Selecting a time step based on the encoder network layer and randomly generating a noise tensor with the same shape as the sample forged face bounding box, combining the noise tensor with the sample forged face bounding box according to the time step to generate a candidate bounding box;

[0121] Inputting the candidate bounding box and the sample face features into the decoder network layer of the neural network model for prediction, and outputting the predicted bounding box and predicted category label information of each sample forged face image;

[0122] The neural network model is iteratively trained based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information to determine the face image forgery detection model.

[0123] Further, when the model training module 240 is used to iteratively train the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information to determine the face image forgery detection model, the model training module 240 is specifically used to:

[0124] Determining a loss value of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box, and the sample category label information;

[0125] If the loss value is less than or equal to a preset loss threshold, determining the neural network model as the face image forgery detection model;

[0126] If the loss value is greater than the preset loss threshold, the network parameters of the neural network model are changed, and the neural network model is continuously trained until the loss value is less than or equal to the preset loss threshold, and the training is stopped.

[0127] The embodiment of the present application provides a facial image forgery detection device, which includes: an acquisition module for acquiring a target facial image; a noise adding module for inputting the target facial image into the encoder network layer of a pre-trained facial image forgery detection model, encoding the target facial image and generating a noise bounding box, and outputting the facial features of the target facial image and the noise bounding box at the current time step; a denoising module for inputting the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forgery detection model, performing feature extraction and bounding box regression on the noise bounding box in turn, and performing category prediction on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face. The encoder network layer and the decoder network layer in the facial image forgery detection model perform iterative prediction of the noise box on the facial image, thereby improving the precision and accuracy of forgery detection, and using a completely random noise bounding box to eliminate manually designed components such as anchor boxes or learnable query boxes, simplifying the detection process of forged facial images.

[0128] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0129] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of the facial image forgery detection method in the method embodiment shown, and the specific implementation methods can be found in the method embodiment, which will not be repeated here.

[0130] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the facial image forgery detection method in the method embodiment shown, and the specific implementation methods can be found in the method embodiment, which will not be repeated here.

[0131] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0132] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

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

[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0135] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0136] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for detecting forged facial images, characterized in that: The facial image forgery detection method comprises: Get the target face image; Input the target face image into the encoder network layer of the pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step; The facial features, the noise bounding box and the current time step are input into the decoder network layer of the facial image forgery detection model, the noise bounding box is sequentially subjected to feature extraction processing and bounding box regression processing, and the facial features are subjected to category prediction processing to predict the coordinate information and category information of the forged facial bounding box of the target face.

2. The facial image forgery detection method according to claim 1, characterized in that: The step of inputting the target face image into the encoder network layer of the pre-trained face image forgery detection model, performing encoding processing and noise bounding box generation processing on the target face image, and outputting the face features of the target face image and the noise bounding box at the current time step includes: Performing encoding processing on the target face image based on the encoder network layer to extract facial features of the target face image; The encoder network layer gradually adds facial noise to the facial features based on a forged diffusion model at each time step, separates the facial features after adding facial noise from the target facial image, and generates the noise bounding box at the current time step.

3. The facial image forgery detection method according to claim 1, characterized in that: The facial features, the noise bounding box and the current time step are input into the decoder network layer of the facial image forgery detection model, and the noise bounding box is subjected to feature extraction, bounding box regression processing and category prediction processing in an iterative manner to predict the coordinate information and category information of the forged face bounding box of the target face, including: Extracting bounding box features of the noise bounding box at the current time step based on the decoder network layer, and determining the extracted bounding box features; Based on the decoder network layer, the bounding box feature is subjected to bounding box regression processing, and the facial feature is subjected to category prediction processing to predict a predicted noise box at the next time step and category information of the facial feature; Continue to input the predicted noise frame and the facial features of the next time step into the decoder network layer until each predicted noise frame in the time step sequence is processed, and then output the coordinate information and category information of the forged facial boundary box of the target face.

4. The method for detecting facial image forgery according to claim 3, characterized in that: After performing bounding box regression processing on the bounding box feature based on the decoder network layer and performing category prediction processing on the facial feature to predict the predicted noise box of the next time step and the category information of the facial feature, the facial image forgery detection method further includes: Based on the forged face bounding box update strategy, the predicted noise boxes with scores below a threshold are eliminated, and the remaining predicted noise boxes and random noise boxes randomly sampled from a Gaussian distribution are iteratively updated so that among the remaining predicted noise boxes and the random noise boxes, the noise box that meets the facial features under the forged category information is determined as the forged face bounding box.

5. The method for detecting facial image forgery according to claim 1, characterized in that: The face image forgery detection model is determined by the following steps: Acquire multiple sample forged face images, a sample forged face bounding box of each of the sample forged face images, and sample category label information; Inputting each of the sample forged face images into the encoder network layer of the neural network model, encoding each of the sample forged face images, and extracting sample face features of each of the sample forged face images; Selecting a time step based on the encoder network layer and randomly generating a noise tensor with the same shape as the sample forged face bounding box, combining the noise tensor with the sample forged face bounding box according to the time step to generate a candidate bounding box; Inputting the candidate bounding box and the sample face features into the decoder network layer of the neural network model for prediction, and outputting the predicted bounding box and predicted category label information of each sample forged face image; The neural network model is iteratively trained based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information to determine the face image forgery detection model.

6. The method for detecting forgery of facial images according to claim 5, characterized in that: The iterative training of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box and the sample category label information to determine the face image forgery detection model includes: Determining a loss value of the neural network model based on the predicted bounding box of each sample forged face image, the predicted category label information, the sample forged face bounding box, and the sample category label information; If the loss value is less than or equal to a preset loss threshold, determining the neural network model as the face image forgery detection model; If the loss value is greater than the preset loss threshold, the network parameters of the neural network model are changed, and the neural network model is continuously trained until the loss value is less than or equal to the preset loss threshold, and the training is stopped.

7. A facial image forgery detection device, characterized in that: The facial image forgery detection device comprises: An acquisition module is used to acquire a target face image; A noisy module is used to input the target face image into the encoder network layer of a pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step; The denoising module is used to input the facial features, the noise bounding box and the current time step into the decoder network layer of the facial image forgery detection model, perform feature extraction processing and bounding box regression processing on the noise bounding box in sequence, and perform category prediction processing on the facial features to predict the coordinate information and category information of the forged facial bounding box of the target face.

8. The facial image forgery detection device according to claim 7, characterized in that: When the noise adding module is used to input the target face image into the encoder network layer of the pre-trained face image forgery detection model, perform encoding processing and noise bounding box generation processing on the target face image, and output the face features of the target face image and the noise bounding box at the current time step, the noise adding module is specifically used to: Performing encoding processing on the target face image based on the encoder network layer to extract facial features of the target face image; The encoder network layer gradually adds facial noise to the facial features based on a forged diffusion model at each time step, separates the facial features after adding facial noise from the target facial image, and generates the noise bounding box at the current time step.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the facial image forgery detection method as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the facial image forgery detection method according to any one of claims 1 to 6 are executed.