Deep forgery detection method based on fusion of camera fingerprint and self-attention mechanism

Through the deep forgery detection method that integrates camera fingerprints and self-attention mechanisms, PRNU features are extracted and long-distance dependencies are captured, which solves the problem of insufficient feature extraction capabilities and long-distance dependencies in the existing technology, and improves the ability to identify deep fake content. and detection performance.

CN118537651APending Publication Date: 2024-08-23YANGTZE DELTA REGION INST (QUZHOU) UNIV OF ELECTRONIC SCI & TECH OF CHINA +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410714830.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing deep forgery detection methods have insufficient feature extraction capabilities when the image synthesis method destroys the original image details and features, and the convolutional neural network has long-distance dependency problems, making it difficult to effectively learn the content of different scales and locations in the image, resulting in Insufficient attention is paid to the significant difference between fake content and real content.

Method used

A deep forgery detection method based on the fusion of camera fingerprint and self-attention mechanism is adopted. PRNU features are extracted through the camera fingerprint module and combined with the self-attention mechanism to capture long-distance dependencies in sequence data. The improved EfficientNet B4 network and block embedding module are integrated. Enhance counterfeit feature extraction and identification capabilities.

Benefits of technology

It improves the ability of deep neural networks to identify deep fake content, enhances detection performance and robustness, and can more accurately classify real and deep fake content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537651A
    Figure CN118537651A
Patent Text Reader

Abstract

The invention discloses a deep forgery detection method based on camera fingerprint and self-attention mechanism fusion, which is applied to the technical field of deep forgery detection and aims to solve the problem that forgery content is difficult to effectively detect in the prior art in a deep forgery image of which the details and features of an original image are damaged. In a training stage, an image is divided into small blocks with the same size through a block embedding module, graying is carried out to obtain a grayscale image, wavelet decomposition is carried out to decompose the image into different sub-bands, Wiener filtering is adopted to obtain a denoised wavelet coefficient, wavelet inverse transformation is carried out to regenerate an image, and then the generated image is subtracted from an original image to obtain a PRNU feature map. And finally, fusing the obtained self-attention map with the feature layer of the improved OfficientNet B4 network, and obtaining a detection result of the current input content through a global pooling layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image detection, and in particular relates to a deep fake detection technology. Background Art

[0002] The rapid advancement of mobile devices and the Internet has changed the way people obtain and share information from text and sound in the past to pictures and videos now. With the rapid development and maturity of deep learning technology, ordinary people can also easily access the technology of generating fake pictures and videos. These fake technologies are very convenient to use and their number is increasing rapidly. The abuse of these fake contents will bring huge risks to people's daily life and social security. Therefore, studying how to effectively identify these fake contents is a crucial research field.

[0003] At present, deep fake detection algorithms are mainly divided into detection algorithms based on spatial domain, temporal domain and frequency domain. Spatial domain detection algorithms aim to identify and classify images based on their spatial features. For example, the JPEG Ghost algorithm classifies original or forged images by extracting ghost boundaries, and the GAN fingerprint recognition algorithm effectively detects GAN-generated images by learning metadata. Temporal domain-based detection algorithms use temporal information to identify forged face videos. For example, the CAN algorithm extracts temporal information from videos and evaluates human heart rate through remote photoplethysmography as a criterion for identifying forged videos. Frequency domain-based detection algorithms effectively identify forged content by analyzing the frequency domain coefficients of an image. For example, the ELA algorithm uses the frequency domain coefficients of an image to detect forged content.

[0004] Although there have been many breakthroughs in deep fake detection research, there are still some problems:

[0005] (1) In deep fake tasks, there may be some image synthesis methods that destroy the details and features of the original image, such as noise, pixel deformation, etc. The existing deep fake detection methods are insufficient in feature extraction capabilities when facing deep fake detection tasks.

[0006] (2) The current mainstream convolutional neural network training process has the problem of long-distance dependency, which makes it difficult to effectively learn the content of different scales and positions in the image. The neural network cannot focus on important areas in the image and thus has difficulty learning the significant differences between forged content and real content. Summary of the invention

[0007] To solve the above technical problems, the present invention proposes a deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism. The present invention extracts PRNU features through the camera fingerprint module to enhance the forgery features, and better captures the long-distance dependencies in the sequence data through the self-attention mechanism module, ultimately achieving accurate classification of real and deep fake content.

[0008] The technical solution adopted by the present invention is: a deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism, comprising:

[0009] S1, cropping the original image to obtain a cropped image;

[0010] S2. The cropped images are sent to the improved EfficientNet B4 network and the block embedding module (PatchEmbedding) respectively. The improved EfficientNet B4 network extracts the feature map of the cropped images, and the block embedding module divides the cropped images into small blocks of equal size.

[0011] S3, grayscale each small block;

[0012] S4, performing multi-level wavelet decomposition on the grayscale image obtained in step S3, decomposing the image into a plurality of sub-bands of different scales, each sub-band representing information of the image at different frequencies;

[0013] S5, using Wiener filtering to adjust the wavelet coefficients according to the statistical characteristics of the noise to obtain the denoised wavelet coefficients;

[0014] S6, performing inverse wavelet transform on the denoised wavelet coefficients to regenerate the image, thereby obtaining the denoised image;

[0015] S7, extracting PRNU (photo response nonuniformity) features through the camera fingerprint module, specifically: subtracting the denoised image from the original image to obtain a PRNU feature map;

[0016] S8, sending the PRNU feature map to the self-attention mechanism module to obtain a self-attention map;

[0017] S9. The obtained self-attention map is fused with the feature map extracted by the improved EfficientNet B4 network. The fused image is passed through a global pooling layer to obtain the false confidence interval.

[0018] Beneficial effects of the present invention: The deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism of the present invention adopts the face detection network RetinaFace to pre-process the input portrait picture, reducing the interference of background information on the face area analysis. The improved EfficientNet B4 network is used as the backbone network to balance the depth, width and resolution of the network to achieve the effect of improving the efficiency of the model, and the improved EfficientNet B4 network is combined with the texture enhancement module to improve the model's ability to obtain long-range information. The PRNU feature is extracted by the camera fingerprint module to enhance the forged feature and improve the feature extraction ability of the neural network. The self-attention mechanism module is used to better capture the long-distance dependencies in the sequence data, and enhance the deep neural network's attention to the significant differences between the forged content and the real content. The method of the present invention enhances the recognition ability of the deep neural network for deep fake content by fusing the camera fingerprint and the self-attention mechanism, thereby improving the performance and robustness of deep fake detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a flow chart of a deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism of the present invention.

[0020] Figure 2 Schematic diagram of a texture enhancement module in an embodiment of the present invention.

[0021] Figure 3 Schematic diagram of a block embedding module in an embodiment of the present invention.

[0022] Figure 4 Schematic diagram of the self-attention mechanism in an embodiment of the present invention.

[0023] Figure 5 4 is a network framework diagram of PSAMDIS in an embodiment of the present invention.

[0024] Figure 6 These are pictures and heat maps that are correctly identified by PSAMDIS but incorrectly identified by EfficientNet B4 in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] To facilitate those skilled in the art to understand the technical content of the present invention, the present invention is further explained below with reference to the accompanying drawings.

[0026] like Figure 1 As shown, this embodiment takes a portrait picture as an example to illustrate the implementation process of the method of the present invention, which specifically includes the following steps:

[0027] S1. Given a color portrait image, use the face detection network RetinaFace to identify the face image and crop it to a size of 3*384*384 as system input;

[0028] S2: Send the image obtained in S1 to the EfficientNet B4 network combined with the texture enhancement module to obtain the feature map, and obtain the texture information of the image through the auxiliary network to improve the model's ability to obtain long-range information;

[0029] S3, send the image obtained in S1 to the Patch Embedding module to divide the image into small blocks of equal size;

[0030] S4, grayscale each small block of the image to eliminate color information, so that subsequent processing can focus more on the texture and noise characteristics of the image;

[0031] S5. Use the "db8" wavelet basis to perform four-level wavelet decomposition on the grayscale image, decomposing the image into multiple sub-bands of different scales, each sub-band represents the information of the image at different frequencies;

[0032] S6, using Wiener filtering to adjust the wavelet coefficients according to the statistical characteristics of the noise to obtain the denoised wavelet coefficients;

[0033] S7, performing inverse wavelet transform on the denoised wavelet coefficients to regenerate the image, thereby restoring the structure of the image and removing noise and some high-frequency details;

[0034] S8, subtracting the denoised image from the color portrait image given in step S1 to obtain a PRNU feature map, which highlights the unique noise pattern caused by the imperfection of the camera sensor and is a camera fingerprint;

[0035] S9, sending the PRNU feature map to the self-attention mechanism module to obtain a self-attention map;

[0036] S10. The obtained self-attention map is fused with the feature map of the EfficientNet B4 network, and the false confidence score of the current input content is obtained through the global pooling layer.

[0037] The size of the cropped image in step S1 is determined according to the size of the block embedding module in actual application. For example, the size of the block in the block embedding module is 16*16, so the length and width of the cropped size must be a multiple of 16. In this embodiment, the size of 384*384 can just contain the face area of ​​the cropped portrait in the experimental data set.

[0038] S2 is specifically:

[0039] The current identification models based on convolutional neural networks have the problem of not being able to capture long-range information well due to their small receptive fields, which makes the identification effect of the model worse when facing low-resolution images. The present invention obtains the global texture features of the image by calculating the Gram matrix on multiple different semantic layers in the shallow and deep layers of the backbone network, thereby improving the model's ability to obtain long-range information, thereby further improving the model's robustness and generalization ability.

[0040] The Gram matrix is ​​a matrix formed by the inner product of any x vectors in n-dimensional space. This matrix is ​​the Gram matrix of these x vectors, as shown in the formula:

[0041]

[0042] The calculation method of the Gram matrix in this embodiment is shown in the formula:

[0043]

[0044] in, represents the image texture features of the lth layer extracted by the Gram matrix, F l represents the feature map of layer l, represents the kth element of the i-th feature map of the l-th layer, Represents the kth element of the jth feature map of the lth layer.

[0045] Figure 2 This is the structural diagram of the texture enhancement module. The module first has a convolution layer to connect the feature dimensions of different layers in the backbone network, then a Gram matrix calculation layer to extract the global image texture features, and then two convolution layers as well as regularization and activation layers to further optimize the texture feature representation. Finally, a global pooling layer is used to align the features with the dimensions of the backbone network.

[0046] S3 is specifically:

[0047] The schematic diagram of the block embedding module is as follows Figure 3 As shown in the figure, it first divides the image into small blocks of equal size 16*16, and then converts the pixel values ​​of these small blocks into a vector, while reducing the complexity of the image and retaining the key local information in the image.

[0048] S4 is specifically:

[0049] The pixel values ​​of each small block of the image are converted into a grayscale image at a ratio of 1:1:1 to RGB. Although the grayscale image will lose a lot of image information, the grayscale image is less sensitive to changing interference in the subsequent denoising process and can retain more useful adversarial information.

[0050] S6 is specifically:

[0051] When processing a subband, a W*W (W=3, 5, 7, 9) neighborhood window N is used to slide on each wavelet coefficient, and the maximum a posteriori probability estimate is used to estimate the local variance of the wavelet coefficient of the noise-free image at each wavelet coefficient. Take a subband as an example:

[0052]

[0053] Where J is the size of the corresponding wavelet subband, h(i,j) is the value of a horizontal subband component at (i,j), and the horizontal subband is the wavelet coefficient generated by convolution in the row direction with a low-pass wavelet filter and then convolution in the column direction with a high-pass wavelet filter, which represents the horizontal specificity of the image, and max(·) finds the maximum value. Assume that the noise part in the image is Gaussian white noise and obeys a normal distribution is the variance of the normal distribution.

[0054] Select the smallest value in the neighborhood window of four sizes as the final estimation result:

[0055]

[0056] Among them, min(·) is the minimum value.

[0057] Use Wiener filtering to obtain the denoised wavelet coefficients:

[0058]

[0059] Among them, M i+1 represents the wavelet coefficients after denoising, represents the Wiener correction factor.

[0060] S9 is as follows:

[0061] Self-attention mechanism Figure 4 As shown, it is mainly composed of some attention modules, each of which is composed of the following f(i), g(i) and h(i):

[0062] f(i)=W f ·i

[0063] g(i)=W g ·i

[0064] h(i)=W h ·i

[0065] R = Softmax(f(i) T g(i))

[0066] Where i is the input feature map obtained from the previous network layer, W f , W g , W h are the linear transformation coefficients of each space. i is divided into three feature spaces f(i), g(i), and h(i) by the above formula. All feature spaces are obtained by 1*1 convolution. The attention map R is the Softmax output of the matrix multiplication of f(i) and g(i).

[0067] The attention map R is used to obtain the final self-attention map B through the following formula:

[0068] B=λRh(i)+i

[0069] Where λ is a scalar coefficient, and the gradient is updated according to the back propagation of the loss function during training.

[0070] In step S10, for example, a 3*384*384 image is input, and a tensor with a shape of [1,1792] is obtained through the improved EfficientNet B4 network of the upper branch. A tensor with a shape of [1,1792] is obtained through the fusion module of the camera fingerprint and self-attention mechanism of the lower branch. These two tensors are added and fused, and a confidence score between 0 and 1 is obtained through the global pooling layer and the sigmoid function. The closer to 0, the more real the model thinks the picture is, and the closer to 1, the more fake the model thinks the picture is.

[0071] In actual application, the authenticity of the image is determined based on the set confidence threshold. For example, when the threshold is 0.6, when the confidence score is 0.7 or other values ​​greater than 0.6 and less than 1, the image is judged to be true. If the confidence score is less than or equal to the judgment threshold of 0.6, the image is judged to be false. The specific threshold can be set according to actual needs.

[0072] The deep fake detection system based on PRNU and self-attention mechanism fusion of the present invention is denoted as PSAMDIS, which is PRNU and Self Attention Mechanism based Deepfake Identification System. Figure 5 As shown, it is a network framework diagram of PSAMDIS, in a specific embodiment:

[0073] In this embodiment, three different portrait forgery datasets are used, including the public dataset FaceForensics++, the public dataset CelebDF, and the self-built dataset SAMGAN. As shown in Table 1, the FaceForensics++ dataset has about 443,000 real pictures and 2,200,000 forged pictures; the CelebDF dataset contains about 28,000 real pictures and 180,000 forged pictures, and each GAN forgery method of the SAMGAN dataset provides 13,000 real pictures and 13,000 forged pictures respectively. For the division of the dataset, FaceForensics++ and CelebDF use the standard distribution method of training and test sets, while the SAMGAN dataset distributes the training set, validation set, and test set in a ratio of 8:1:1.

[0074] Table 1 Number of images used in the fake portrait dataset

[0075] Number of images (*1k) FaceForensics++ CelebDF SAMGAN Number of real images 443 28 39 Number of forged images 2200 180 39

[0076] This embodiment is performed on two NVIDIA 3090 GPUs, each GPU has 24 GB of onboard memory, and uses two Intel Xeon Silver 4210 CPUs and four 32 GB memory sticks. The hardware and software environment is shown in Table 2.

[0077] Table 2 Example configuration environment

[0078] Environmental Configuration details operating system Ubuntu 20.04 Graphics driver version 515.76 CUDA Version 11.7 Python Version Python 3.11 Deep Learning Frameworks Pytorch 1.10.1 Graphics Nvidia RTX 3090 24G*2 Memory DDR4 2933MHz 32G*4 processor Intel(R)Xeon(R)Silver 4210R CPU@2.40GHz*2

[0079] This embodiment uses the pre-trained EfficientNet B4 model, the image input resolution of the model training is 384*384, cross loss entropy is used as the loss function, Adam is used as the optimizer, the learning rate is set to 0.001, the number of iterations is 30, the batch size during data training is set to 38, and the model training parameter details are shown in Table 3. The model of this embodiment takes about 8 hours to complete one iteration of training on the FaceForensics++ subset. When the input is a 384*384 resolution image, the inference speed is about 30 images per second.

[0080] Table 3 Model training parameter details

[0081] explain Parameter setting value GPU Number 0,1 Input image resolution 384*384 Loss Function CrossEntropyLoss Optimizer Adam Learning Rate 0.001 Iterations 30 Batch size 38

[0082] The PSAMDIS network of the present invention is compared with the traditional backbone network EfficientNet B4 (abbreviated as EffB4 in the table) on five performance indicators: accuracy (ACC), recall (Recall), precision (Precision), F1 score and AUC, as shown in Table 4.

[0083] Table 4 Comparison of PSAMDIS and EffB4 on three datasets (%)

[0084]

[0085] From the comparative experiments in Table 4, it can be seen that the PSAMDIS algorithm of the present invention is higher than the EfficientNet B4 algorithm in all indicators except that the Precision is 0.07% lower on the Face2Face subset of the FaceForensics++ dataset and 0.02% lower on the StyleGAN subset of the SAMGAN dataset.

[0086] Figure 6 Four true and false samples that the EfficientNet B4 model in the prior art failed to classify accurately, but the PSAMDIS model of the present invention can accurately classify, and their heat maps are presented. Figure 6 It can be clearly seen that the EfficientNet B4 model in the prior art pays more attention to the corners of the image, which are far from the actual forged face areas. In contrast, the PSAMDIS model of the present invention can accurately focus on the parts of the face area where forgery traces are most likely to appear, thus achieving a better detection effect.

[0087] In summary, the deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism of the present invention uses the face detection network RetinaFace to preprocess the input portrait picture to reduce the interference of background information on the face area analysis. The improved EfficientNet B4 network is used as the backbone network to balance the depth, width and resolution of the network to achieve the effect of improving the efficiency of the model. The PRNU features are extracted by the camera fingerprint module to enhance the forged features and improve the feature extraction ability of the neural network. The self-attention mechanism module is used to better capture the long-distance dependencies in the sequence data and enhance the deep neural network's attention to the significant differences between the forged content and the real content. The method of the present invention enhances the recognition ability of the deep neural network for deep fake content by fusing the camera fingerprint and the self-attention mechanism, thereby improving the performance and robustness of deep fake detection.

[0088] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism, characterized in that: include: S1, crop the original image; Get the cropped image; S2. The cropped image is sent to the improved EfficientNet B4 network and the patch embedding module respectively. The improved EfficientNet B4 network extracts the feature map of the cropped image, and the Patch Embedding divides the cropped image into small patches of equal size. The improved EfficientNet B4 network specifically comprises: obtaining the global texture features of the image through the corresponding Gram modules at multiple different semantic layers of the shallow and deep layers of the EfficientNet B4 network; Each Gram module first connects the feature dimensions of different layers in the EfficientNet B4 network through a convolutional layer, then a Gram matrix calculation layer to extract global image texture features, and then further optimizes the texture feature representation through two convolutional layers and regularization and activation layers. Finally, a global pooling layer is used to align the extracted global image texture features with the dimensions of the backbone network; S3, grayscale each small block; S4, performing multi-level wavelet decomposition on the grayscale image obtained in step S3, decomposing the image into a plurality of sub-bands of different scales, each sub-band representing information of the image at different frequencies; S5, using Wiener filtering to adjust the wavelet coefficients according to the statistical characteristics of the noise to obtain the denoised wavelet coefficients; S6, performing inverse wavelet transform on the denoised wavelet coefficients to regenerate the image, thereby obtaining the denoised image; S7, extracting PRNU features through the camera fingerprint module, specifically: subtracting the denoised image from the original image to obtain a PRNU feature map; S8, sending the PRNU feature map to the self-attention mechanism module to obtain a self-attention map; S9. The obtained self-attention map is fused with the feature map extracted by the improved EfficientNet B4 network. The fused image is passed through a global pooling layer to obtain the false confidence interval.

2. According to claim 1, a deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism is characterized in that: Step S4 specifically uses the "db8" wavelet basis to perform four-level wavelet decomposition on the grayscale image.

3. According to claim 2, a deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism is characterized in that: The processing process of step S5 is: When processing subbands, four neighborhood windows N of different sizes are used to slide on each wavelet coefficient, and the local variance of the wavelet coefficient of the noise-free image at each wavelet coefficient is estimated using the maximum a posteriori probability estimate: in, represents the local variance of the wavelet coefficients of the noise-free image, W is the neighborhood window size, W = 3, 5, 7, 9, J is the size of the corresponding wavelet subband, h(i, j) is the value of a horizontal subband component at (i, j), max(·) finds the maximum value, is the variance of the normal distribution; Select the smallest value in the neighborhood window of four sizes as the final estimation result: Among them, min(·) is the minimum value; Use Wiener filtering to obtain the denoised wavelet coefficients: Among them, M i+1 represents the wavelet coefficients after denoising, represents the Wiener correction factor.

4. A deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism according to claim 3, characterized in that: The self-attention mechanism module in step S8 includes multiple attention modules, and the process of each attention module obtaining its own attention map is as follows: f(i)=W f ·i g(i)=W g ·i h(i)=W h ·i R=Softmax(f(i) T g(i)) Among them, i is the input feature map, f(i), g(i), h(i) are three feature spaces, W f , W g , W h are the linear transformation coefficients of f(i), g(i), and h(i); The final self-attention map B is calculated as: B=λRh(i)+i Where λ is a scalar coefficient.

5. A deep fake detection method based on the fusion of camera fingerprint and self-attention mechanism according to claim 4, characterized in that: f(i), g(i), and h(i) are all obtained through 1*1 convolution.