A deep fake image detection method and system combining multi-scale features

Through dual-stream prediction network and counterfactual causal reasoning data enhancement, combined with shallow and deep feature extraction, the problem of feature omission, redundancy and bias in the deep forgery detection model is solved, achieving higher detection accuracy and generalization ability. Ensure effective detection of forgery traces in different scenarios.

CN114724008BActive Publication Date: 2024-09-13NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210380766.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2024-09-13
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

Existing deepfake detection models suffer from feature omissions, redundancy, and bias problems, which lead to the neglect of important information when extracting key discriminative features and the risk of failure in new scenarios.

Method used

Using a deep fake image detection method that combines multi-scale features, through dual-stream prediction network and counterfactual causal inference data enhancement, combining shallow and deep feature extraction, using multi-feature fusion and majority-subject voting mechanism to ensure that the model learns unbiased features Represent and improve detection accuracy and generalization capabilities.

Benefits of technology

It effectively solves the problem of feature omission, redundancy and bias, improves detection accuracy and generalization ability, can effectively detect forgery traces at different scales and scenarios, and enhances the model's robustness and ability to resist attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114724008B
    Figure CN114724008B
Patent Text Reader

Abstract

The present invention discloses a method for detecting deep fake images by combining multi-scale features. Specifically, first, the data set is expanded based on counterfactual causal reasoning, and counterfactual and factual samples are generated to prevent the model from being disturbed by pseudo-correlated features and ensure that the model learns unbiased feature expressions. Subsequently, a two-stream prediction network is constructed, which uses sufficiently low-level and higher-level convolutional features to capture different types of fake traces. In each stream, a multi-scale feature extraction module based on a feature pyramid is used to enrich the feature representation, and a classifier is set at the end of each stream. After multi-feature fusion, a deeper convolutional module is used to learn higher-level semantic information from the previously learned combined features, and then a classifier is used for prediction. Finally, the results of the three classifiers set at different positions in the network are combined to obtain the final prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing technology, and specifically relates to a deep fake image detection method and system combining multi-scale features. Background Art

[0002] Face forgery, represented by deepfake technology, has attracted widespread attention from the society. Although deepfake detection has made significant progress in recent years, there is still a lack of a general-purpose fake face detector that can expose multiple forgery traces. In addition, due to the different resolutions of the input videos, the different proportions of the face area, and the different scales of the forgery traces, the use of a general processing flow and a standard form of CNN structure (stacking several consecutive convolutional layers followed by a classification module) will lead to the following problems when extracting key discriminative features:

[0003] (1) Feature omission. The model used focuses specifically on a certain type of forgery traces with similar distribution, while ignoring the importance of other key discriminative features.

[0004] (2) Feature redundancy. The extracted features contain not only the strongly relevant discriminative information learned from the operation traces, but also irrelevant factors such as image content.

[0005] (3) Feature bias. The model used relies on the association between features and labels rather than causal relationships, resulting in pseudo-correlation (non-causal relationship) between features and labels being often learned and used for prediction. Once this relationship is broken, such as in a new scenario, the model will face the risk of failure. Summary of the invention

[0006] In order to solve the above problems, the present invention proposes a deep fake image detection method combining multi-scale features, which can solve the problems of feature omission, redundancy and bias, and can further improve the detection accuracy and generalization ability. The method specifically includes:

[0007] Perform data preprocessing on the input video to obtain an input image, and perform data enhancement on the input image based on counterfactual causal reasoning to generate counterfactual and factual enhancement samples;

[0008] Construct a dual-stream prediction network, the dual-stream prediction network includes a shallow forged feature extraction and classification subnetwork and a deep forged feature extraction and classification subnetwork, the shallow forged feature extraction and classification subnetwork sequentially inputs the counterfactual and factual enhancement samples into a first convolution module, a global average pooling layer, and a first multi-scale feature extraction module to obtain a feature map f mul_tex , the feature map f mul_texThe first classifier is fed to obtain the predicted value S1; the deep fake feature extraction and classification sub-network sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the second convolution module, the third convolution module, and the second multi-scale feature extraction module to obtain the feature map f mul_sem , the feature map f mul_sem Feed it into the second classifier and get the predicted value S2;

[0009] Perform multi-feature fusion and classification, and transform the feature map f mul_tex And the feature map f mul_sem Connect them in series to get the feature expression f total , the f total The prediction value S3 is obtained by sequentially passing through the fourth convolution module, the fifth convolution module, and the third classifier;

[0010] The majority rule is adopted to decide whether the input image is real by voting on the predicted values ​​S1, S2, and S3.

[0011] Furthermore, the data enhancement based on counterfactual causal reasoning on the input image specifically includes generating counterfactual samples as follows:

[0012]

[0013] The generated fact samples are:

[0014]

[0015] where i is the input image with Ω pixels, is the causal-related region, 0 represents non-causal, 1 represents causal, represents the filled image in the causal region, ⊙ represents the element-wise dot product, Represents the filled image in the non-causal region.

[0016] Furthermore, the filled image uses grayscale filling, random filling and mixed filling. For the counterfactual samples, the labels of the images using grayscale filling and random filling are reset to random numbers 0 or 1, and the labels of the images using mixed filling are opposite to the labels of the original input images; for the factual samples, the labels of the images using grayscale filling, random filling and mixed filling are consistent with the original input.

[0017] Furthermore, the multi-scale feature extraction module is mainly composed of a downsampling path, an upsampling path and a vertical connection.

[0018] The total loss function for the method is:

[0019] L=α*L CE_A +βL CE_B +γLCE_C

[0020] Among them, L CE_A ,L CE_B and L CE_C Respectively represent the loss functions of the first classifier, the second classifier and the third classifier, α, β and γ are weight coefficients, α = β = γ = 1. The loss functions of the first classifier, the second classifier and the third classifier are:

[0021]

[0022] Among them, y j and p j They represent the label of the input image j and the probability value that the model predicts it to be a real image, and N represents the total number of training samples.

[0023] The present invention also proposes a deep fake image detection system combining multi-scale features, the system comprising:

[0024] The data preprocessing module performs data preprocessing on the input video to obtain the input image, and performs data enhancement on the input image based on counterfactual causal reasoning to generate counterfactual and factual enhancement samples;

[0025] A dual-stream prediction network module, the dual-stream prediction network module includes a shallow forged feature extraction and classification subnetwork and a deep forged feature extraction and classification subnetwork, the shallow forged feature extraction and classification subnetwork sequentially inputs the counterfactual and factual enhancement samples into a first convolution module, a global average pooling layer, and a first multi-scale feature extraction module to obtain a feature map f mul_tex , the feature map f mul_tex The first classifier is fed to obtain the predicted value S1; the deep fake feature extraction and classification sub-network sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the second convolution module, the third convolution module, and the second multi-scale feature extraction module to obtain the feature map f mul_sem , the feature map f mul_sem Feed it into the second classifier and get the predicted value S2;

[0026] Multi-feature fusion and classification module performs multi-feature fusion and classification, and transforms the feature map f mul_tex And the feature map f mul_sem Connect them in series to get the feature expression f total , the f total The prediction value S3 is obtained by sequentially passing through the fourth convolution module, the fifth convolution module, and the third classifier;

[0027] The discriminant module adopts the principle of majority rule and decides whether the input image is real by voting on the predicted values ​​S1, S2, and S3.

[0028] In order to solve the problem of feature omission and redundancy, the present invention proposes a dual-stream prediction network, which focuses on both shallow low-level features with small receptive fields and deep semantic features with large receptive fields. Multiple detectors are distributed on different layers of the backbone network to detect and expose forgery traces of different scales. The shallow stream, i.e., the shallow forgery feature extraction and classification subnetwork, discovers small-scale targets such as subtle noise artifacts by capturing low-level features with higher resolution and more details, while the deep branch, i.e., the deep forgery feature extraction and classification subnetwork, uses a larger receptive field to detect large-scale visible artifacts. At the same time, a multi-scale feature extraction module is designed to enrich the feature expression in different streams. In addition, in order to solve the feature bias problem and ensure that the model learns unbiased feature representation, a data enhancement method more suitable for this task is constructed by introducing counterfactual causal reasoning. The residual structure composed of the first convolution module and the global average pooling layer is used to suppress irrelevant factors and highlight forgery traces, solving the problem of feature redundancy. Counterfactual causal reasoning is introduced to force the model to learn unbiased feature representation, reduce the interference of false related factors, and solve the problem of feature bias. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0030] Figure 1 A framework diagram of a deep fake image detection method combining multi-scale features.

[0031] Figure 2 It is a multi-scale feature extraction module.

[0032] Figure 3 Block diagram of a deep fake image detection system combining multi-scale features. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0034] Due to the different resolutions of the input videos, different proportions of the face area, and different scales of the forgery traces, it is not suitable to use the standard CNN structure to determine whether the face has been tampered with. The deep forgery image detection method with combined multi-scale features provided by the present invention detects forgery traces of different scales by using multiple classifiers distributed on different layers of the network. The overall design framework of the method is as follows: Figure 1 As shown. First, the dataset is expanded based on counterfactual causal reasoning, and counterfactual and factual samples are generated to prevent the model from being disturbed by pseudo-correlated features and ensure that the model learns unbiased feature expressions. Subsequently, a two-stream prediction network is constructed, which uses sufficiently low-level and higher-level convolutional features to capture different types of forgery traces. In each stream, a multi-scale feature extraction module based on a feature pyramid is used to enrich the feature representation, and a classifier is set at the end of each stream. After multi-feature fusion, a deeper convolutional module is used to learn higher-level semantic information from the previously learned combined features, and then the classifier is used for prediction. Finally, the results of the three classifiers set at different positions in the network are combined to obtain the final prediction result. The method is as follows:

[0035] In the first step, the input video is preprocessed to obtain the input image, and the input image is data enhanced based on counterfactual causal reasoning to generate counterfactual and factual enhanced samples.

[0036] Most of the currently public face forensics datasets are videos. Therefore, the input video needs to be decomposed into frames of images first. Then, for all true and false images, the Cascade Classifier in Opencv is used to detect and crop the face area. According to the complexity of the background, the face area is expanded outward to a certain extent in width and height. In the present invention, if the background is more complex, it is expanded outward by 1.3 times, and if the background is more simple, it is expanded by 1.1 times. Finally, the cropped face size is uniformly adjusted to 224×224.

[0037] Machine learning models usually rely on the association between features and labels rather than causal relationships, which leads to the pseudo-correlation (i.e., non-causal relationship) between features and labels being often learned and used for prediction. Once this relationship is broken, the model will face the risk of failure, which seriously limits the model's generalization and ability to resist attacks.

[0038] For the deep fake detection task, the input image contains both fake areas that have been forged (denoted as "M area", here refers to the entire face area), and real areas that have not been forged (denoted as "N area", here refers to other areas except the face). Among them, there is a strong causal relationship between the M area and the label, but there is no causal relationship between the N area and the label, but a pseudo-correlation relationship. In order to prevent the model from being interfered by pseudo-correlated features and learning biased feature expressions, the present invention designs a data enhancement method based on counterfactual causal reasoning. The first is to suppress the model from learning features that are related to the label but have no causal relationship, that is, the pseudo-correlation features in the N area; the second is to strengthen the model to learn features that are strongly correlated with the label, that is, the causal features in the M area. Counterfactual and factual enhanced samples are generated by changing causal features and intervening non-causal features to enhance the robustness and generalization of the model.

[0039] Generate counterfactual samples. In order to increase the model's attention to the features of the M region and strengthen the learning of causal features, counterfactual samples are created by retaining the N region but changing the M region. Define i as an input image with Ω pixels, causally related regions 0 means non-causal, 1 means causal), label y (y∈(0,1), 0 means false, 1 means true). The generated counterfactual sample can be described as:

[0040]

[0041] In the formula, represents the filled image in the causal region (i.e., region M). ⊙ represents the element-wise dot product.

[0042] Generate fact samples. In order to reduce the model's learning of non-causal features, that is, to reduce its dependence on features in the N region, fact samples are generated by retaining the M region and changing the N region. The generated fact samples can be described as:

[0043]

[0044] In the formula, represents the filled image in the non-causal region (i.e., N region).

[0045] Filling image selection. The present invention designs three methods to obtain filling images for generating counterfactual and factual samples, including grayscale filling Gray, random filling Shuffle and mixed filling Blend. Gray represents a grayscale image with a pixel value of 0.5 (0 represents black and 1 represents white). Shuffle means randomly disrupting the order of rows and columns in the coverage area. Blend refers to randomly selecting another image with an opposite label to the input image in the data set.

[0046] Reset labels. For the generated counterfactual samples, although grayscale padding (CF-Gray) and random padding (CF-Shuffle) change the M region of the original input image, it is impossible to determine the authenticity of the generated samples. Therefore, we reset their labels to random numbers 0 or 1. Mixed padding (CF-Blend) replaces the original N region with a new N region with the opposite label, so its label should be opposite to that of the original input image; for factual samples, grayscale padding (F-Gray), random padding (F-Shuffle) and mixed padding (F-Blend) only interfere with the N region without changing the M region, so their labels should be consistent with the original input.

[0047] The second step is to construct a dual-stream prediction network, which includes a shallow forged feature extraction and classification subnetwork and a deep forged feature extraction and classification subnetwork. The shallow forged feature extraction and classification subnetwork sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the global average pooling layer, and the first multi-scale feature extraction module to obtain a feature map f mul_tex , the feature map f mul_tex The first classifier is fed to obtain the predicted value S1; the deep fake feature extraction and classification sub-network sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the second convolution module, the third convolution module, and the second multi-scale feature extraction module to obtain the feature map f mul_sem , the feature map f mul_sem Feed it into the second classifier and get the predicted value S2.

[0048] The present invention selects VGG16 as the backbone network and uses only the convolutional layer of the network as the feature extractor. According to Table 1, the network is divided into 5 groups of convolutional modules, among which the fourth and fifth convolutional modules add two maximum pooling layers on the basis of the original structure to reduce the dimension of the feature space. The backbone network is denoted as f, the face image input to the network is denoted as I, and the feature map extracted from the i-th convolutional module of the network is denoted as f i (I).

[0049] Table 1 Backbone network and grouping

[0050]

[0051]

[0052] The shallow features of the shallow forgery feature extraction and classification subnetwork contain rich texture structure information of the input image. When an image is attacked by a forgery algorithm, its texture information will change significantly due to the appearance of forgery traces. These texture information contain both subtle noise traces and the content information of the image itself. If these shallow features are directly used for decision-making, it will lead to feature redundancy, because the image content is an irrelevant factor, and their appearance will affect the model from making correct decisions. Therefore, in order to force the model to make full use of these low-level features for decision-making, the present invention designs a residual form to highlight subtle noise artifacts from the shallow network while suppressing the image content. First, the input image f is input into the first convolution module to extract the feature map f1(I). Then, a global average pooling layer is used to smooth the noise and retain the content of the image. The pooled feature is defined as f p Finally, the shallow forged feature is defined as the following residual structure:

[0053] f tex =f1(I)-f p

[0054] The feature map f obtained from the above formula tex It can effectively reflect subtle tampering traces because it contains most of the texture information while suppressing the content of the image. In order to enrich the feature expression and take the multi-scale characteristics of the feature into account, f tex The first multi-scale feature extraction module is used to further enrich and enhance its feature expression, and the obtained feature map is represented as f mul_tex The obtained feature f mul_tex Feed it into the first classifier C1 and get the predicted value S1. The purpose of setting C1 here is to force the network to make decisions directly using these low-level forgery features to achieve the detection of small-scale subtle noise artifacts. C1 consists of a global average pooling layer for dimensionality reduction, followed by a fully connected layer with 300 neurons, and finally a fully connected layer with 2 neurons (softmax as activation function), whose output corresponds to the probability value (between 0-1) of real faces and fake faces.

[0055] The deep fake feature extraction and classification sub-network passes the shallow feature map f1(I) extracted above to the second and third convolution modules to obtain the deep fake feature f3(I). Next, f3(I) uses the second multi-scale feature extraction module to aggregate the information extracted at different scales to enrich and enhance its feature representation. The obtained feature map is denoted as f mul_sem . With shallow features f mul_tex In contrast, the deep mul_sem Contains high-level artifacts to expose artifacts of semantic inconsistency. Next, the obtained feature f mul_semFeed it into the second classifier C2 to get the predicted value S2. The structure of C2 is the same as C1, and its purpose is to force the network to directly use these high-level forgery features to make decisions, so as to achieve the detection of large-scale artifacts.

[0056] The purpose of the multi-scale feature extraction module is to obtain the multi-scale feature expression of the target layer from the multi-receptive field of the network. The designed multi-scale feature extraction module mainly consists of a downsampling path, an upsampling path and a vertical connection. Its structure is as follows Figure 2 This module allows features from different internal layers of the network to be used as input, and after multiple scale transformations and a series of merging operations, the output is an enhanced multi-scale feature expression.

[0057] like Figure 2 As shown in the figure, for the input features, three consecutive downsampling operations are first performed, that is, a 2×2 maximum pooling layer is used to reduce the feature space size, which will obtain three different scales of the input features. The convolution layer with a convolution kernel size of 1×1 is used to adjust the number of channels of each scale feature. Then, the feature map is gradually restored to the original spatial size through three consecutive 2-fold upsampling operations. Next, the vertical connection merges the features of the same spatial size from the recovery path and the downsampling path by element addition. After each merger, a 3×3 convolution kernel is used to convolve the fused features to eliminate the aliasing effect of the upsampling process. In fact, the downsampling path enhances the semantic information of the input features, while the upsampling path enriches the details of the features, so the output features are naturally endowed with diverse contextual information and texture information. Finally, the features of different scales obtained by the upsampling path are upsampled by 2, 4, and 8 times respectively. The adjusted features have the same spatial size, and then the features are connected in series.

[0058] The third step is to perform multi-feature fusion and classification, and transform the feature map f mul_tex And the feature map f mul_sem Connect them in series to get the feature expression f total , the f total The prediction value S3 is obtained by passing through the fourth convolution module, the fifth convolution module, and the third classifier in sequence.

[0059] In the second step, shallow and deep forged features are extracted from the two-stream prediction network to expose forged traces at different scales. In order to prevent subtle noise artifacts from gradually weakening or even disappearing in the deep network and to alleviate the lack of semantic information of shallow features, the shallow forged features f mul_tex and the deep fake feature f mul_sem Connect them in series to get a richer feature expression containing various forgery traces, denoted as f total . totalContinue to input into the fourth and fifth convolution modules to learn more advanced feature expressions, and then feed into the third classifier C3 to obtain the predicted value S3. The classifier consists of three fully connected layers. The first two layers learn the association between deep features, with 500 and 300 neurons respectively, and the last layer contains 2 neurons and uses the softmax activation function.

[0060] In the fourth step, the majority rule is adopted to decide whether the input image is real by voting on the predicted values ​​S1, S2, and S3.

[0061] In the second and third steps, three binary classifiers were constructed, namely C1, C2 and C3. Each classifier made corresponding predictions based on different feature levels, and the results were S1, S2 and S3 respectively. In order to improve the detection accuracy, for the input face image, the principle of minority obeys majority is adopted, that is, the prediction results of these three classifiers are voted to decide whether the input image is real. Specifically, if 2 or more classifiers predict that the input image is a real image, the input image is considered to be real. On the contrary, if 2 or more classifiers predict that the input image is a false image, the input image is considered to be false.

[0062] For the objective function, each classifier adopts binary cross entropy loss, which is expressed as:

[0063]

[0064] In the above formula, y j and p j They represent the label of the input image j and the probability value of the model predicting that it is a real image. N represents the total number of training samples. The total loss function is a combination of 3 terms, namely:

[0065] L=α*L CE_A +βL CE_B +γL CE_C

[0066] In the above formula, L CE_A ,L CE_B and L CE_C They represent the loss functions of C1, C2 and C3 respectively. α, β and γ are the balance weights of these three items, and α=β=γ=1 is set.

[0067] The present invention also proposes a deep fake image detection system combining multi-scale features, such as Figure 3 As shown, the system comprises:

[0068] The data preprocessing module performs data preprocessing on the input video to obtain the input image, and performs data enhancement on the input image based on counterfactual causal reasoning to generate counterfactual and factual enhancement samples;

[0069] A dual-stream prediction network module, the dual-stream prediction network module includes a shallow forged feature extraction and classification subnetwork and a deep forged feature extraction and classification subnetwork, the shallow forged feature extraction and classification subnetwork sequentially inputs the counterfactual and factual enhancement samples into a first convolution module, a global average pooling layer, and a first multi-scale feature extraction module to obtain a feature map f mul_tex , the feature map f mul_tex The first classifier is fed to obtain the predicted value S1; the deep fake feature extraction and classification sub-network sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the second convolution module, the third convolution module, and the second multi-scale feature extraction module to obtain the feature map f mul_sem , the feature map f mul_sem Feed it into the second classifier and get the predicted value S2;

[0070] Multi-feature fusion and classification module performs multi-feature fusion and classification, and transforms the feature map f mul_tex And the feature map f mul_sem Connect them in series to get the feature expression f total , the f total The prediction value S3 is obtained by sequentially passing through the fourth convolution module, the fifth convolution module, and the third classifier;

[0071] The discrimination module adopts the principle of majority rule and decides whether the input image is real by voting on the prediction values ​​S1, S2 and S3. The embodiments of the present invention are described above. These embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. According to the above description, many modifications and changes can be made. This specification selects and describes these embodiments in detail in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can make good use of the present invention and the modified use based on the present invention. The present invention is only limited by the claims and their full scope and equivalents.

Claims

1. A deep fake image detection method combining multi-scale features, It is characterized in that The method comprises: Perform data preprocessing on the input video to obtain an input image, and perform data enhancement on the input image based on counterfactual causal reasoning to generate counterfactual and factual enhancement samples; Construct a dual-stream prediction network, the dual-stream prediction network includes a shallow forged feature extraction and classification subnetwork and a deep forged feature extraction and classification subnetwork, the shallow forged feature extraction and classification subnetwork sequentially inputs the counterfactual and factual enhancement samples into a first convolution module, a global average pooling layer, and a first multi-scale feature extraction module to obtain a feature map f mul_tex , the feature map f mul_tex The first classifier is fed to obtain the predicted value S1; the deep fake feature extraction and classification sub-network sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the second convolution module, the third convolution module, and the second multi-scale feature extraction module to obtain the feature map f mul_sem , the feature map f mul_sem Feed it into the second classifier and get the predicted value S2; Perform multi-feature fusion and classification, and transform the feature map f mul_tex And the feature map f mul_sem Connect them in series to get the feature expression f total , the f total The prediction value S3 is obtained by sequentially passing through the fourth convolution module, the fifth convolution module, and the third classifier; The majority rule is adopted to decide whether the input image is real by voting on the predicted values ​​S1, S2, and S3; The data enhancement based on counterfactual causal reasoning on the input image specifically includes generating counterfactual samples as follows: The generated fact samples are: where i is the input image with Ω pixels, is the causal-related region, 0 represents non-causal, 1 represents causal, represents the filled image in the causal region, ⊙ represents the element-wise dot product, Represents the filled image in the non-causal region.

2. The method according to claim 1, It is characterized in that The filled image adopts grayscale filling, random filling and mixed filling. For the counterfactual sample, the label of the image using grayscale filling and random filling is reset to a random number 0 or 1, and the label of the image using mixed filling is opposite to the label of the original input image; for the factual sample, the label of the image using grayscale filling, random filling and mixed filling is consistent with the original input.

3. The method according to claim 1, It is characterized in that The multi-scale feature extraction module is mainly composed of a downsampling path, an upsampling path and a vertical connection.

4. The method according to any one of claims 1 to 3, It is characterized in that The total loss function is: L=α*L CE_A +βL CE_B +γL CE_C Among them, L CE_A ,L CE_B and L CE_C Represent the loss functions of the first classifier, the second classifier and the third classifier respectively, α, β and γ are weight coefficients, α=β=γ=1.

5. The method according to claim 4, It is characterized in that The loss functions of the first classifier, the second classifier and the third classifier are: Among them, y j and p j They represent the label of the input image j and the probability value that the model predicts it to be a real image, and N represents the total number of training samples.

6. A deep fake image detection system combining multi-scale features, It is characterized in that The system comprises: The data preprocessing module performs data preprocessing on the input video to obtain the input image, and performs data enhancement on the input image based on counterfactual causal reasoning to generate counterfactual and factual enhancement samples; A dual-stream prediction network module, the dual-stream prediction network module includes a shallow forged feature extraction and classification subnetwork and a deep forged feature extraction and classification subnetwork, the shallow forged feature extraction and classification subnetwork sequentially inputs the counterfactual and factual enhancement samples into a first convolution module, a global average pooling layer, and a first multi-scale feature extraction module to obtain a feature map f mul_tex , the feature map f mul_tex The first classifier is fed to obtain the predicted value S1; the deep fake feature extraction and classification sub-network sequentially inputs the counterfactual and factual enhancement samples into the first convolution module, the second convolution module, the third convolution module, and the second multi-scale feature extraction module to obtain the feature map f mul_sem , the feature map f mul_sem Feed it into the second classifier and get the predicted value S2; Multi-feature fusion and classification module performs multi-feature fusion and classification, and transforms the feature map f mul_tex And the feature map f mul_sem Connect them in series to get the feature expression f total , the f total The prediction value S3 is obtained by sequentially passing through the fourth convolution module, the fifth convolution module, and the third classifier; The discrimination module adopts the principle of majority rule and decides whether the input image is real by voting on the predicted values ​​S1, S2, and S3; The data enhancement based on counterfactual causal reasoning on the input image specifically includes generating counterfactual samples as follows: The generated fact samples are: where i is the input image with Ω pixels, is the causal-related region, 0 represents non-causal, 1 represents causal, represents the filled image in the causal region, ⊙ represents the element-wise dot product, Represents the filled image in the non-causal region.