A method for face forgery detection and localization based on SSIM difference map

By using SSIM difference maps and multi-task training of neural networks, combined with adjacent layer aggregation and atrous convolution modules, the problems of inaccurate tampering positioning and artifact contamination in deepfake detection are solved, achieving higher detection and positioning accuracy. Spend.

CN114445891BInactive Publication Date: 2024-08-23HUNAN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210098425.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has the problem of inaccurate tampering positioning in deep forgery detection, especially artifact pollution caused by the lack of standard label maps and video compression, making it difficult to effectively distinguish real and fake faces, and in multi-scale tampered area and boundary identification. There are challenges.

Method used

The SSIM difference map is used as the label map for tampering location, features are extracted through the adjacent layer aggregation module and the atrous convolution module, combined with the lightweight Sobel flow to alleviate the artifact pollution problem, and a multi-task trained neural network is used to improve the detection results.

Benefits of technology

It is possible to accurately locate the tampered area while detecting fake faces, improving the accuracy of detection results, especially achieving higher accuracy on a variety of public Deepfake detection data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445891B
    Figure CN114445891B
Patent Text Reader

Abstract

The present invention discloses a method for detecting and locating a forged face based on an SSIM difference map, comprising: using a structural similarity (SSIM) difference map between an original face and a forged face as a label map for tampering location; determining a tampered area from a low-level to a high-level feature map through an adjacent layer aggregation module with residual attention, wherein the residual attention can help the network pay more attention to the tampered area to reduce the influence of background noise; processing multi-scale tampered areas through a dilated convolution module; alleviating the artifact pollution problem caused by video compression through a lightweight auxiliary Sobel flow, which is composed of three groups of image gradient enhancement modules. The present invention can locate the tampered area while detecting forged faces, and in addition, a neural network that uses the SSIM difference map for multi-task training can further improve the detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face forgery detection, and in particular to a face forgery detection and positioning method based on SSIM difference map. Background Art

[0002] Recently, the social problems caused by face-swapping videos have received widespread attention from people from all walks of life. With the development of deep learning, the visual effects of synthetic media have reached a point where they are difficult to distinguish with the naked eye. In addition, the rapid development of hardware, the massive growth of social media data, and the open source and commercialization of face editing software have also exacerbated the uncontrollability of deep fakes. Since deep fakes are highly deceptive, it is urgent to study corresponding countermeasures to avoid a series of social problems caused by them.

[0003] At present, some methods for distinguishing real videos from synthetic videos have been proposed one after another. According to the differences in the detection objects, they can be divided into data-driven detection methods, signal-level artifact-based detection methods, and abnormal biological signal-based detection methods. Although the above methods for deep fake detection have achieved good results, there are still obvious deficiencies in the tampering location of deep fakes. The main reasons include: First, not all data sets provide standard label maps, which makes it difficult to conduct quantitative evaluations between different methods. The difference-threshold method has been successfully used for tampering location, but it is very difficult to find a universal threshold suitable for different data sets, and it may destroy the integrity of the tampered area while enhancing unnecessary background noise; second, the high similarity of color and texture of tampered areas of different scales and inside and outside the boundaries of the tampered areas makes tampering location extremely challenging. This requires not only the network to understand the overall meaning of the image, but also the network to pay attention to local details. Since the existing tampering location network structure does not explicitly solve these problems, the predicted tampered area is inaccurate.

[0004] In view of the artifact pollution caused by video compression, it is difficult to effectively distinguish between real and fake faces by relying solely on spatial information. The current mainstream method is to obtain high-frequency information through the transform domain, such as discrete cosine transform, discrete Fourier transform, and SRM filter, and then combine the spatial domain for dual-stream learning. Usually, the two streams have the same number of parameters and require pre-processing, so how to extract high-frequency information with a small amount of calculation and within the convolutional network has not yet been explored. Summary of the invention

[0005] The purpose of the present invention is to provide a method for detecting and locating forged faces based on SSIM difference maps. The method can detect forged faces and locate tampered areas at the same time. In addition, a neural network trained with multi-tasks using SSIM difference maps can further improve the detection results.

[0006] The objective of the present invention is achieved through the following technical solutions:

[0007] A method for detecting and locating a forged face based on a SSIM difference map, comprising:

[0008] The structural similarity (SSIM) difference map between the original face and the forged face is used as the label map for tampering localization;

[0009] The tampered area is determined from the low-level to the high-level feature map through the adjacent layer aggregation module with residual attention, and the residual attention can help the network pay more attention to the tampered area to reduce the influence of background noise; the multi-scale tampered area is processed through the hollow convolution module; the artifact pollution problem caused by video compression is alleviated through the lightweight auxiliary Sobel flow, which consists of three groups of image gradient enhancement modules.

[0010] It can be seen from the technical solution provided by the present invention that, on the one hand, it is possible to locate the tampered area while detecting the forged face. On the other hand, through careful design, the neural network using SSIM difference map for multi-task training can further improve the detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0012] Figure 1 A network overall structure diagram of a face forgery detection and positioning method based on SSIM difference map provided by an embodiment of the present invention;

[0013] Figure 2 A schematic diagram of an adjacent layer aggregation module and residual attention provided in an embodiment of the present invention;

[0014] Figure 3 A schematic diagram of an image gradient enhancement module provided by an embodiment of the present invention;

[0015] Figure 4 A visual comparison of the tampering localization map predicted by the method provided in the embodiment of the present invention and other methods using SSIM difference maps through supervised learning. DETAILED DESCRIPTION

[0016] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0017] The embodiment of the present invention provides a face forgery detection and positioning method based on SSIM difference map. Compared with the traditional method, the method proposed by the present invention uses SSIM difference map as a label for tampering positioning. SSIM difference map has more complete tampering area signal, and through multi-task supervised learning, the network can distinguish the difference between tampered area and non-tampered area. Figure 1 As shown in the figure, the method mainly includes: using the SSIM difference map between the original face and the forged face as the label map for tampering positioning; determining the tampered area from the low-level to the high-level feature map through the adjacent layer aggregation module with residual attention, and the residual attention can help the network pay more attention to the tampered area to reduce the influence of background noise; processing multi-scale tampered areas through the hollow convolution module; restoring the tampered area from the bottom to the top through the decoder; alleviating the artifact pollution problem caused by video compression through a lightweight auxiliary Sobel flow, which consists of three groups of image gradient enhancement modules.

[0018] The above-mentioned scheme provided by the embodiment of the present invention can be combined with the existing neural network to further improve the detection and positioning results; and the SSIM difference map is used to guide the network to learn the structural distortion semantics. Compared with the existing technology, this method has achieved higher accuracy in a variety of public Deepfake detection data sets.

[0019] For ease of understanding, the above solution of the embodiment of the present invention is introduced in detail below.

[0020] 1. Label graph generation method based on SSIM

[0021] A typical Deepfake generation process first includes the target face A, and then obtains the tampered face B according to different tampering operations, such as face identity replacement, face attribute editing, and lip synchronization. The real face A and the forged face B are consistent with each other except the tampered area for images A and B. Compared with the previous use of the difference-threshold method to generate the label map for tampering location, the embodiment of the present invention calculates the structural similarity difference map between the target face and the real face as the label for tampering location, which mainly includes:

[0022] Step 1: Use a face detector to extract the face bounding box coordinates of all frames in the original video and crop the original face image. Set the pixel values ​​of the tampered positioning label map of the original face image to all zeros;

[0023] Step 2: Based on the face bounding box coordinates obtained in step 1, apply them to the forged video corresponding to the original video and crop the forged face image. The pixel value of the forged face image tampering positioning label map is the structural similarity difference value between the forged face image and the original face image. For images A and B, the pixel-by-pixel SSIM calculation formula is:

[0024] SSIM(x,y)=(l(x,y)) α (c(x,y)) β (s(x,y)) γ

[0025] Where l, c, and s are brightness, contrast, and structure, respectively, and a>0, β>0, and γ>0 are parameters used to adjust the importance of these three components. In order to calculate the mean, variance, and covariance within a pixel neighborhood, a Gaussian filter with σ=1.5 is also used. The pixel values ​​of the image generated by the above formula are SSIM(x, y)∈[0, 1], and when SSIM(x, y)=1, they are the same, and when SSIM(x, y)=0, they are different. In order to obtain a positioning map with a pixel value of 1 in the tampered area and a pixel value of 0 in the non-tampered area, the image generated by the above formula needs to be contrast inverted, which is expressed as:

[0026]

[0027] At this time, SSIM is a three-channel image. In order to obtain a single-channel label map, it needs to be converted into a grayscale image, which is formally expressed as:

[0028]

[0029] Through observation and analysis on multiple data sets, SSIM has achieved good visual effects without setting additional thresholds, so the integrity of the tampered area is guaranteed. Although some background noise will be introduced, the attention mechanism can greatly weaken these originally not obvious interferences.

[0030] Step 3: Use the face images obtained in steps 1 and 2 as training sets, and use the tampered location label map for end-to-end supervised training.

[0031] 2. Network Architecture Overview

[0032] Figure 1 The entire network structure is shown, which mainly includes:

[0033] 1. Adjacent layer aggregation module.

[0034] In the embodiment of the present invention, in order to reduce the number of decoder parameters while retaining the spatial structure of the input image and strengthening the global context information, the features extracted from multiple layers of the backbone network are further divided into three levels: low, medium, and high. The low-level, medium-level, and high-level features are fused through their respective adjacent layer aggregation modules and transferred to the decoder. Figure 2 As shown in the figure, the adjacent layer aggregation module mainly consists of two steps. In the first step, the features from two adjacent layers of the backbone network are and It is sent to the adjacent layer aggregation module and aggregated, which can be formally expressed as:

[0035]

[0036] Where δ represents a convolution layer consisting of a convolution kernel, batch normalization, and a ReLU activation function, and the subscript is the size of the convolution kernel. Up represents two-dimensional bilinear upsampling, and the subscript represents the scaling factor. Cat represents concatenating the two input feature maps in the channel dimension. After feature aggregation, in order to make the network pay more attention to the tampered area and reduce the influence of background noise, the adjacent layer aggregation module introduces bottom-up and top-down attention residual learning, such as Figure 2 The second step is shown. The advantage of bottom-up and top-down is that they can obtain a larger receptive field while adding a small number of parameters, which is conducive to the network obtaining more global information at a low level. The second step can be expressed as

[0037]

[0038] where M(·) represents the branch that generates the attention map.

[0039] 2. Dilated convolution module.

[0040] In the embodiment of the present invention, a dilated convolution module is used to process multi-scale tampered regions. The dilated convolution module firstly additively fuses the features of the Sobel flow and the backbone network, and then processes the feature map through four parallel dilated convolutions of different proportions, where the dilated convolution proportions are set to {1, 3, 6, 9}.

[0041] 3. Sobel flow and image gradient enhancement module.

[0042] In the embodiment of the present invention, in order to alleviate the artifact pollution problem caused by video compression, compared with the previous method of converting the image from the spatial domain to the frequency domain, this paper starts from the perspective of image gradient enhancement and extracts features by combining the Sobel filter and the convolution layer. The Sobel filter calculates the gradient of the image in the vertical and horizontal directions respectively, which is expressed as

[0043]

[0044] Among them, * represents the depth of convolution, and f represents the input feature. Figure 1 As shown in , the Sobel stream receives the low, medium and high-level features of the backbone network and is composed of three groups of image gradient enhancement modules. Figure 3 As shown, a set of image gradient enhancement modules includes a depth convolution layer, a Sobel filter layer, a point-by-point convolution layer, and a residual operation connecting the depth convolution layer and the point-by-point convolution layer.

[0045] 4. Decoder.

[0046] In the embodiment of the present invention, Figure 1 As shown in Figure 1, the decoder uses the feature set output by the adjacent layer aggregation module and the hole convolution module to restore the tampered area from the bottom up. In order to reduce the number of parameters of the decoder, in the decoder, the dimension reduction of the feature map is completed by the 1×1 convolution layer, and only bilinear interpolation is used to complete the upsampling.

[0047] 3. Loss Function

[0048] In the embodiment of the present invention, Figure 1 The loss function of the network model shown in the training consists of two parts: cross entropy loss and tampering localization loss.

[0049] Among them, the cross entropy loss is the loss used for forgery detection, which can be implemented by referring to conventional technologies and will not be described here. The tampering localization loss is the loss of auxiliary prediction of tampering localization map. It is expressed as:

[0050]

[0051] Where H = {H hi , H mid , H lo , H DCM} represents the set of feature maps output by high, medium, low levels and the dilated convolution module, D(·) represents the decoder, and S represents the label map.

[0052] In the embodiment of the present invention, Figure 1The backbone network of the network model shown is EfficientNet-B4 pre-trained on ImageNet. The entire network is trained end-to-end using stochastic gradient descent. The optimizer is Adam, the learning rate is 0.0002, the batch size is set to 32, and the maximum number of training iterations is set to 20. The proposed network architecture is implemented based on the PyTorch software library. Two GTX 1080Ti GPUs are used to accelerate the training. As mentioned above, the method is frame-based, and faces are extracted every 10 frames for each video. The face detector used is MTCNN. Since the width and height of the extracted face images are not consistent, the longer side of the input image is scaled to 256 before training and testing, and the shorter side is zero-padded.

[0053] In order to verify the effect of the above solution of the embodiment of the present invention, the following is a description combined with experimental results.

[0054] To evaluate the performance of the proposed method, experiments are conducted on four widely used benchmark datasets, namely FaceForensics++, FaceShifter, Celeb-DF and DFDC.

[0055] Here, the AUC indicator is used to evaluate the forgery detection performance of different methods, and the IoU indicator is used to evaluate the performance of different methods in tampering localization.

[0056] Table 1 shows the accuracy of this method in FaceForensics++, Faceshifter, Celeb-DF and DFDC video tests. From the results shown in Table 1, it can be seen that this method has achieved higher detection and positioning accuracy.

[0057]

[0058] Table 1 IoU and AUC of this method on FaceForensics++, Faceshifter, Celeb-DF and DFDC datasets compared with other methods

[0059] Figure 4 The visualization results of tampering location of the method provided by the present invention on four benchmark data sets are shown, and it can be seen that the method provided by the present invention can predict the tampering area more accurately.

[0060] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0061] Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.

[0062] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A face forgery detection and positioning method based on SSIM difference map, the method comprising: using the structural similarity SSIM difference map of the original face and the forged face as a label map for tampering positioning; determining the tampered area from the low-level to the high-level feature map through an adjacent layer aggregation module with residual attention, and the residual attention can help the network pay more attention to the tampered area to reduce the influence of background noise; processing multi-scale tampered areas through a hollow convolution module; alleviating the artifact pollution problem caused by video compression through a lightweight auxiliary Sobel flow, and the Sobel flow consists of three groups of image gradient enhancement modules; 1.1 The SSIM difference map between the original face and the forged face is used as the label map for tampering positioning. The implementation steps include: (1.1.1) Use a face detector to extract the face bounding box coordinates of all frames in the original video, crop the original face image, and set the pixel values ​​of the tampered positioning label map of the original face image to all zeros; (1.1.2) applying the face bounding box coordinates obtained in step (1.1.1) to the forged video corresponding to the original video to crop out a forged face image, wherein the pixel value of the forged face image tampering positioning label image is the structural similarity difference value between the forged face image and the original face image; (1.1.3) The face images obtained in step (1.1.1) and step (1.1.2) are used as training sets, and end-to-end supervised training is performed using the tampered positioning label map; 1.2 Determine the tampered area from the low-level to the high-level feature map through the adjacent layer aggregation module with residual attention, and the residual attention can help the network pay more attention to the tampered area to reduce the influence of background noise. The implementation steps include: (1.2.1) The features of two adjacent layers of the backbone network and Transport to the adjacent layer aggregation module and aggregate; (1.2.2) The aggregated feature map is output to the decoder after residual attention learning; 1.3 Processing multi-scale tampered areas through the dilated convolution module, which first additively fuses the features of the Sobel flow and the backbone network, and then processes the feature map through four parallel dilated convolutions of different scales, with the dilated convolution scales set to {1, 3, 6, 9}; 1.4 The artifact pollution problem caused by video compression is alleviated by a lightweight auxiliary Sobel flow. The Sobel flow consists of three groups of image gradient enhancement modules, which include a depth convolution layer, a Sobel filter layer, a point-by-point convolution layer, and a residual operation connecting the depth convolution layer and the point-by-point convolution layer. 1.5 The decoder uses the feature set output by the adjacent layer aggregation module and the hole convolution module to restore the tampered area from the bottom up. In order to reduce the number of parameters of the decoder, in the decoder, the dimension reduction of the feature map is completed by the 1×1 convolution layer, and only bilinear interpolation is used to complete the upsampling; 1.6 The loss function of the network model corresponding to this method in training consists of two parts: cross entropy loss and tampering localization loss; Among them, the tampering localization loss is the loss of auxiliary prediction of tampering localization map, and the tampering localization loss L Mask express Where H = {H hi ,H mid ,H lo ,H DCM } represents the set of feature maps output by high, medium, low-level and dilated convolution modules, x represents the input image, D(·) represents the decoder, and S represents the label map.

Citation Information

Cited By

  • Face counterfeit image detection method based on difference SSIM features

    CN120071414A