Face deep counterfeit image detection method based on identity priori

By employing an identity-prior-based deepfake image detection method, utilizing a dual-channel encoder network and a cross-attention mechanism, the method addresses the shortcomings in generalization and robustness of existing technologies, achieving high accuracy and robustness in forgery detection of key individuals.

CN118968637APending Publication Date: 2024-11-15ZHEJIANG UNIV

Patent Information

Application Number
CN202411091606.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Existing deepfake detection technologies lack generalization and robustness when faced with unknown forgery methods and datasets, making it difficult to meet the real-world application requirements of high security and high accuracy, especially when detecting key individuals.

Method used

A deepfake image detection method based on identity prior is adopted. The feature extraction network is trained by acquiring real image sets of key figures, and identity features are extracted by using a dual-channel encoder network and cross-attention mechanism. The authenticity of the image is judged by cosine similarity, and the image is enhanced by depth estimation.

Benefits of technology

It improves the accuracy and generalization ability of detection, enhances robustness against interference such as image compression and noise, adapts to various complex forgery techniques, and meets the practical application requirements of high security and high precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968637A_ABST
    Figure CN118968637A_ABST
Patent Text Reader

Abstract

The invention discloses a face deep counterfeit image detection method based on identity priori, and the method comprises the steps: obtaining a priori image set which is a pre-collected real image of a to-be-protected target person; training a feature extraction network; extracting identity features of each image in the prior image set by using the trained feature extraction network to form a prior feature set; reading a to-be-detected image, inputting the to-be-detected image into the feature extraction network, and extracting to-be-detected identity features; comparing the to-be-detected identity features with the identity features of the priori true image in the priori feature set, and calculating the similarity; and taking the similarity as a confidence coefficient that a to-be-detected image output by the model is detected to be true, and judging the authenticity of the to-be-detected image according to a threshold value calculated on the verification set. According to the invention, the detection performance of the model can be improved, and the accuracy of forgery detection is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a method for detecting deep fake face images based on identity prior. Background Art

[0002] With the continuous advancement of artificial intelligence and deep learning technology, people have begun to widely apply them to the editing and creation of multimedia content. Some application software now provides powerful tools that allow users to easily modify facial attributes in images and videos, such as identity, expression, hair color, gender, and age. This type of technology is often called deepfake. For example, users can replace their own or someone else's face with a specific person to create a face-changing image that looks real but is actually completely fictional. In film production, deepfake technology is used for special effects processing, digital resurrection of deceased actors, etc., to enhance the production effect and creative expression of film and television works. In the field of advertising and marketing, brands use deepfake technology to create customized advertising content to enhance the interactive experience with the audience. However, this technology has also caused people's concerns and anxiety. On the one hand, people are worried that this technology may be used for malicious purposes, such as creating false information, fraud, or invading the privacy of others. On the other hand, because these fake contents are often difficult to distinguish the authenticity with the naked eye, the public has a deep concern about how to judge and verify the authenticity of information on the Internet.

[0003] Therefore, with the increasing development of social network media, the detection technology of deep fake content is particularly important. By using deep learning technology to identify and analyze abnormal features in fake data, the authenticity of media content can be relatively effectively distinguished, thereby reducing the spread of false information and privacy violations. In addition, by studying deep fake detection technology, people can also understand how to create more realistic fake data, thereby better understanding the working principle of deep fake generation.

[0004] At present, deep fake detection technology is developing rapidly, and many research results have been achieved. One of the important directions is to study the optimal deep neural network architecture, such as efficient shallow networks, multi-task autoencoders, and attention networks. These methods aim to explore network modules or frameworks that are adapted to deep fake detection tasks and have certain performance, so as to enhance the detection model's ability to capture information at different granularities (pixels, image blocks, full images, etc.). In addition, some studies have broken through the spatial domain and turned their attention to the frequency domain that is invisible to the naked eye. By utilizing methods such as frequency-aware image decomposition and local frequency statistics, these frequency-domain-based methods have achieved amazing performance on some deep fake datasets. However, the shallow textures on which these schemes rely are easily damaged when the image quality degrades, resulting in a sharp drop in performance.

[0005] In response to the above problems, researchers began to try to extract forgery traces at a higher semantic level. After deeply understanding and exploring the possible defects in the face-changing process, people used prior knowledge to guide the model to learn specific traces, thereby effectively improving the detection performance. However, once these detection methods that rely on specific traces are exposed, they are vulnerable to targeted processing by attackers, such as using advanced image editing techniques to cover up or eliminate these forgery traces, resulting in a decrease in the generalization performance of the model.

[0006] Existing technologies mainly include: Face recognition technology: In face recognition scenarios, computer vision technology is first used to detect and extract faces, and then the face image is converted into a vector representation through a deep learning model or a traditional feature extraction algorithm to extract the face identity features; finally, the identity relationship between different faces is determined by comparing the similarity of these vectors. Deep fake detection method based on image reconstruction: Through image reconstruction, the model learns the common features of real images, and uses contrast learning to increase the distance between real and fake images in the feature space; if the feature of an image is too far away from the center of the feature class of the real image, then it is a fake image, and there is no need to pay attention to complicated and unknown fake methods.

[0007] The prior art has the following problems:

[0008] 1. Generalization: Existing detection models perform well on training datasets, but when faced with unknown forgery methods and datasets, the detection performance drops significantly and it is difficult to adapt to various complex forgery techniques.

[0009] 2. Robustness: The detection model is unstable when facing common image processing operations such as image compression, resolution changes, and noise, resulting in reduced detection accuracy in practical applications.

[0010] 3. Real-world application requirements: Existing technologies are difficult to meet the high standards and strict requirements for key figures (such as politicians and celebrities) in real-world applications, especially in scenarios with high security and high precision requirements. There is still significant room for improvement. Summary of the invention

[0011] The purpose of the present invention is to provide a method for detecting deep fake face images based on identity priors in order to address the deficiencies of the prior art.

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

[0013] A method for detecting deep fake face images based on identity priors, comprising the following steps:

[0014] (1) obtaining a priori image set, wherein the priori image set is a set of real images of the target person to be protected collected in advance;

[0015] (2) training a feature extraction network; using the trained feature extraction network, extracting identity features from each image in the prior image set to form a prior feature set;

[0016] (3) reading the image to be tested, inputting the image to be tested into a feature extraction network, and extracting the identity features to be tested;

[0017] (4) Compare the identity features to be tested with the identity features of the prior true images in the prior feature set, and use cosine similarity to calculate the similarity between the identity features to be tested and the features in the prior feature set; use the similarity as the confidence level of the image to be tested output by the model to detect that it is true, and judge the authenticity of the image to be tested based on the threshold calculated on the verification set.

[0018] Furthermore, the feature extraction network is a dual-channel network consisting of two upper and lower Encoder networks; the features of the two channels are fused through a cross-attention mechanism.

[0019] Furthermore, the training process of the feature extraction network includes a pre-training process and a fine-tuning process.

[0020] Furthermore, the pre-training process is specifically as follows:

[0021] Data preparation: We use the WebFace600K large-scale face dataset and perform data augmentation operations, including random cropping, horizontal flipping, and color jittering.

[0022] Model initialization: Use the ResNet50 model for initialization and set the training parameters, including learning rate, batch size, and number of training cycles;

[0023] Optimizer and Scheduler: Use stochastic gradient descent optimizer and cosine annealing learning rate scheduler to dynamically adjust the learning rate;

[0024] Training process: In each training cycle, the data-augmented samples are input into the model, the output obtained by forward propagation is calculated, and then the loss is calculated using the ArcFace loss function; then, backpropagation is performed to calculate the gradient, and the model parameters are updated using the optimizer; during the training process, the model parameters are continuously adjusted so that it can learn feature vectors with distinguishing capabilities in the feature space.

[0025] Furthermore, the fine-tuning process is specifically as follows:

[0026] Data preparation: Collect a mixed dataset containing real faces and forged faces. The dataset contains images generated by various forgery methods and performs data augmentation operations, including random cropping, horizontal flipping, and color jittering.

[0027] Model initialization: Use the ResNet50 model trained in the pre-training process and load its weights;

[0028] Optimizer and Scheduler: Use stochastic gradient descent optimizer and cosine annealing learning rate scheduler to dynamically adjust the learning rate;

[0029] Training process: In each training cycle, data-augmented samples are input into the model, the output obtained by forward propagation is calculated, and then the loss is calculated using the contrastive learning loss function; then, backpropagation is performed to calculate the gradient and the model parameters are updated using the optimizer; during the training process, the model parameters are continuously adjusted so that it can better distinguish between real faces and fake faces in the feature space.

[0030] Furthermore, the reasoning process of the feature extraction network is as follows: after the input image enters the feature extraction network, the depth estimation model is used to extract the depth estimation map of the RGB image, and then the RGB image and the corresponding depth estimation image are respectively sent to the upper and lower encoder networks that do not share parameters, and the feature vectors f related to the facial features and face shape of the person contained therein are respectively extracted. rgb and f d , and then the upper and lower sets of features are fused through the cross-attention mechanism to obtain the final character identity feature vector f as the output of the entire feature extraction network.

[0031] Furthermore, the step (4) is specifically as follows: the identity feature f to be tested is compared with the identity feature f of the prior true image in the prior feature set. pre Compare and use cosine similarity cosine_similarity to calculate the similarity similarity between the identity feature to be tested and the features in the prior feature set; there is the following expression:

[0032]

[0033] Among them, a and b represent any two feature vectors whose similarity is to be calculated, n is the number of images in the prior feature set, is the feature vector numbered i in the prior feature set; the similarity is used as the confidence that the image to be tested output by the model is detected as true, and the authenticity of the image to be tested is judged according to the threshold calculated on the validation set; if the similarity is higher than the threshold, the output prediction result is true; otherwise, when the similarity is lower than or equal to the threshold, the prediction result is forged.

[0034] To achieve the above objectives, the present invention also provides a facial deep fake image detection device based on identity prior, comprising one or more processors for implementing the above-mentioned facial deep fake image detection method based on identity prior.

[0035] To achieve the above-mentioned purpose, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned identity prior-based deep fake face image detection method.

[0036] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for detecting deep fake facial images based on identity prior.

[0037] The beneficial effects of the present invention are:

[0038] 1. A forgery detection framework that introduces a priori information about the real images of key figures: Aiming at the requirements of high accuracy and high generalization in key figure scenarios, the present invention designs a forgery detection framework that introduces a priori information about the real images of key figures. By training a deep neural network to extract image identity features, and comparing the similarity between the image to be tested and the priori information, high-accuracy detection can be achieved. Since the extracted identity features belong to high-dimensional semantic information, they are not easily affected by image interference technologies such as compression and blurring, and have high robustness. In addition, the identity feature extraction network is only trained using real images to avoid overfitting to specific forgery traces, thereby enhancing the generalization ability of the model.

[0039] 2. Using deep neural network to extract face depth estimation map: The present invention extracts face depth estimation map from face image through deep neural network, and inputs it into identity feature extraction network simultaneously with RGB face image, so as to strengthen identity feature extraction, amplify artifacts of forged image, and increase the distance between identity vectors of true and false images, thereby improving detection performance.

[0040] 3. Cross-attention mechanism: The present invention introduces a cross-attention mechanism module, so that the weights of RGB image features and deep image features when they are fused are gradually learned through network training rather than manually set, thereby optimizing the feature fusion effect and further improving the accuracy of forgery detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a detection framework diagram of the present invention;

[0042] Figure 2 It is a feature extraction network framework diagram of the present invention;

[0043] Figure 3 is a schematic diagram of the cross attention mechanism of the present invention;

[0044] Figure 4 It is a structural schematic diagram of the device of the present invention;

[0045] Figure 5 It is a schematic diagram of an electronic device of the present invention. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0047] The present invention is described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the features of the following embodiments and implementations can be combined with each other.

[0048] Terminology explanation:

[0049] Convolutional Neural Network: Convolutional Neural Network (CNN) is a deep learning model specially designed for processing gridded data (such as images and videos). Its main feature is to gradually extract the features of input data through convolutional layers and pooling layers, and gradually improve the level of abstraction through multi-layer stacking. The convolution operation performs local perception on the input data through filters (convolution kernels). This local connection and weight sharing method enables CNN to efficiently learn the spatial hierarchical structure features of the input data, thereby performing well in tasks such as image classification, object detection, and semantic segmentation.

[0050] Cross-attention mechanism: The cross-attention mechanism is a variant of the attention mechanism in deep learning models, which aims to enhance the model's ability to understand and model the relationship between different input parts. It is usually applied to scenarios of multimodal data fusion or multi-level feature interaction. It dynamically adjusts the importance of different parts of the features by introducing attention weights, thereby improving the model's representation and generalization capabilities. This mechanism is particularly suitable for tasks that require cross-modal or cross-level information interaction, such as image-text association learning or multi-level feature fusion.

[0051] Pre-training and fine-tuning: Pre-training and fine-tuning are commonly used strategies in deep learning to improve model performance and adapt to specific tasks. The pre-training phase is usually performed on large-scale datasets, aiming to pre-learn model parameters through unsupervised or weakly supervised learning to obtain general feature representations. The pre-trained model can be adapted to specific tasks or smaller datasets through fine-tuning. The fine-tuning process readjusts the model parameters on the target task data to learn more specific and relevant features, thereby improving the performance and generalization ability of the model on the target task.

[0052] The present invention provides a method for detecting deep fake face images based on identity prior, comprising:

[0053] 1. Deep fake image detection framework for key figures based on identity priors:

[0054] The following will elaborate on the key person deep fake image detection framework based on identity prior, such as Figure 1 As shown:

[0055] When used in practice, the framework is divided into a preparation phase and a detection phase.

[0056] In the preparatory stage, in order to provide reliable protection for videos, images and other media content related to key figures, a priori image set was introduced, which contained 10 to 20 real images of the target person to be protected. Then, the trained feature extraction network E θ , for each image I in the prior image set p Extract identity features f pre , forming a priori feature set.

[0057] In the detection phase, the image to be tested I is read and input into the feature extraction network E. θ , extract the identity feature f to be tested.

[0058] Then, the identity feature f to be tested is compared with the identity feature f of the prior true image in the prior feature set. pre Compare and use cosine similarity cosine_similarity:

[0059]

[0060] Calculate the similarity between the identity feature to be tested and the features in the prior feature set:

[0061]

[0062] Among them, a and b represent any two feature vectors whose similarity is to be calculated, n is the number of images in the prior feature set, is the feature vector numbered i in the prior feature set.

[0063] Finally, the similarity is used as the confidence that the image to be tested output by the model is true, and the authenticity of the image to be tested is judged according to the threshold calculated on the validation set. The validation set here is a sub-dataset divided from the original training data set in the experiment, and when used in real scenarios, a special validation set can be constructed based on the key figures to be protected. The threshold value range is generally between 0.5 and 0.6. If the similarity is higher than the threshold, the output prediction result is true; conversely, when the similarity is lower than or equal to the threshold, the prediction result is forged.

[0064] 2. 3D information-assisted feature extraction network:

[0065] The following will introduce the feature extraction network in the framework in detail. Figure 2 As shown in the figure, the design of the 3D information-assisted feature extraction network mainly considers the complex scenes in the real world. For the input image, on the basis of the traditional RGB image extraction feature, a 3D information presentation and feature extraction module is added to further amplify the artifacts caused by the forged image while strengthening the identity feature extraction, and increase the distance between the true and false image identity vectors. Therefore, the upper and lower Encoder networks (Backbone1, Backbone2) form a dual-channel feature extraction network.

[0066] When fusing the features of two channels, a cross attention mechanism is used, such as Figure 3 As shown, the network can autonomously learn the best feature fusion method during the training process.

[0067] Assume that the feature output by Backbone1 is f rgb , the feature output by Backbone2 is f d First, perform linear transformation on the two inputs to obtain the query Q d , key K rgb Sum value V rgb .

[0068] Q d =f a ·W Q

[0069] K rgb =f rgb ·W K

[0070] V rgb =f rgb ·W V

[0071] Among them, W Q , W K , W V are learnable weights.

[0072] Then, use the query Q d and key K rgb Calculate the attention weights and apply them to the value V rgb The formula is as follows:

[0073]

[0074] in, Key K rgb Transpose of the matrix, d kFor query Q d and key K rgb , softmax is an activation function that transforms the input vector into a probability distribution so that all output values ​​are between 0 and 1 and sum to 1.

[0075] Finally, the fused feature Output is used as the final output result f of the 3D information-assisted feature extraction network.

[0076] 2.1 Training Process

[0077] The following will introduce in detail the training process of the 3D information-assisted feature extraction network, which can be divided into a pre-training process and a fine-tuning process.

[0078] 2.1.1 Pre-training process

[0079] During the pre-training stage, only real faces are used for training. The purpose is to let the network learn to extract only high-dimensional semantic features related to face shape, facial features and other identity appearances, rather than fitting to forged traces generated by some forgery algorithm.

[0080] First, we collected a diverse real face dataset, WebFace600K, to ensure that it contains face images of various ages, genders, races, and lighting conditions. The dataset has been rigorously cleaned and annotated to ensure data quality.

[0081] Next, we selected a powerful and widely used convolutional neural network architecture, ResNet50, and used the WebFace600K dataset processed in the previous step for training. In this stage of training, the loss function used was the ArcFace loss function L.

[0082]

[0083] Where N is the number of samples, θ yi Represents the feature vector of the i-th sample and its category y i The angle of the feature vector (cosine similarity), θ j The ArcFace loss adds a boundary in the angular space, which increases the similarity of the feature vectors of the same sample while increasing the angular interval between the feature vectors of different classes, thereby generating feature vectors with excellent separation in the feature space.

[0084] The specific training process is as follows:

[0085] ① Data preparation: We use the WebFace600K large-scale face dataset to ensure data diversity and high quality. In order to increase the effectiveness of training data, we perform data augmentation operations such as random cropping, horizontal flipping, and color jittering.

[0086] ②Model initialization: Use the ResNet50 model for initialization and set the training parameters, including learning rate, batch size, and number of training cycles.

[0087] ③Optimizer and Scheduler: Use Stochastic Gradient Descent (SGD) optimizer and use Cosine Annealing Learning Rate Scheduler to dynamically adjust the learning rate.

[0088] ④ Training process: In each training cycle, the data-enhanced samples are input into the model, the output obtained by forward propagation is calculated, and then the loss is calculated using the ArcFace loss function. Next, backpropagation is performed to calculate the gradient and the model parameters are updated using the optimizer. During the training process, the model parameters are continuously adjusted so that it can learn feature vectors with distinguishing capabilities in the feature space.

[0089] Through the above training steps, the model can extract high-quality feature vectors when facing real faces, laying a solid foundation for the subsequent fine-tuning process. The ArcFace loss function plays a key role in this process, improving the recognition performance of the model by increasing the inter-class distance and reducing the intra-class distance.

[0090] 2.1.2 Fine-tuning process

[0091] After pre-training is completed, the model will be fine-tuned to further optimize the model on a dataset containing real and fake faces, so that it can better distinguish real face images from fake generated images. In this stage of training, the loss function used is Contrastive Learning Loss.

[0092]

[0093] Where N is the number of sample pairs, f p and f q are the feature vectors of data points p and q respectively, m is the margin hyperparameter, which controls the distance between negative sample pairs, and y p,q is a sample pair label, indicating whether data points p and q are similar. For real and fake face image pairs y p,q = 0, for the same type of face image pair y p,q =1. D(fp ,f q ) is the eigenvector f p and f q The distance metric between them is the cosine distance used in the pre-training stage.

[0094] D(f p ,f q )=1-cosine_similarity(f p ,f q )

[0095] The specific fine-tuning process is as follows:

[0096] ① Data preparation: Collect mixed datasets containing real faces and forged faces, such as FaceForensics++, CelebDF, DFDC, etc., ensure that the dataset contains images generated by various different forgery methods to enhance the generalization ability of the model, and perform data augmentation operations such as random cropping, horizontal flipping, and color jittering.

[0097] ②Model initialization: Use the ResNet50 model trained in the pre-training phase and load its weights.

[0098] ③Optimizer and Scheduler: Use Stochastic Gradient Descent (SGD) optimizer and use Cosine Annealing Learning Rate Scheduler to dynamically adjust the learning rate.

[0099] ④ Training process: In each training cycle, the data-augmented samples are input into the model, the output obtained by forward propagation is calculated, and then the loss is calculated using the contrastive learning loss function. Next, backpropagation is performed to calculate the gradient and the optimizer is used to update the model parameters. During the training process, the model parameters are continuously adjusted so that it can better distinguish between real faces and fake faces in the feature space.

[0100] Through the above fine-tuning steps, the model will further optimize its feature extraction capabilities and be able to effectively distinguish between real faces and forged face images, thereby improving the accuracy and robustness of the model in various practical applications.

[0101] 2.2 Reasoning Process

[0102] During inference, the input image enters the 3D information-assisted feature extraction network, which first uses the depth estimation model to extract the depth estimation map of the RGB image. Then, the RGB image and the corresponding depth estimation image are sent to the upper and lower backbone networks that do not share parameters, respectively, to extract the feature vectors f related to the facial features, face shape, etc. of the person. rgb and f d , and then the upper and lower sets of features are fused through the cross-attention mechanism to obtain the final character identity feature vector f as the output of the entire feature extraction network.

[0103] Implementation examples:

[0104] 1. Experimental Dataset:

[0105] The method proposed by the present invention is pre-trained on the WebFace600K dataset:

[0106] ①WebFace600K dataset, also known as WebFace12M, is a subset of the larger WebFace260M dataset, which contains cleaned images for deep face recognition research. The dataset includes 600,000 identities and a total of 12 million images, which is very suitable for training and evaluating deep face recognition models.

[0107] The proposed method is evaluated on four datasets: FaceForensics++ (FF++), Celeb-DF (CDF), and DeepFake Detection (DFD):

[0108] ①FF++ is the most widely used deep fake dataset for evaluation, which mainly includes four types of fakes: DeepFakes, Face2Face (F2F), FaceSwap (FS) and Neural Texture (NT). FF++ is often used to train detection models in evaluation experiments. In addition to the original video set raw, FF++ also contains two videos with different compression qualities, namely low-quality c40 and high-quality c23.

[0109] ②Celeb-DF is another widely used deepfake dataset, which contains 590 real videos and 5639 high-quality fake videos generated using an improved Deepfake forging algorithm.

[0110] ③DFD contains 363 real videos and 3068 forged videos from 28 actors in various scenes. It is a dataset that is more difficult to detect, with high forgery quality and some side faces.

[0111] 2. Experimental methods:

[0112] In the training phase, according to the method and loss function introduced in the previous section, 150 rounds of pre-training were performed on the WebFace600K dataset, and 20 rounds of fine-tuning training were performed on the FF++ dataset.

[0113] During the testing phase, for each character ID in each data set, 15 images were randomly selected from the image frames extracted from its real video as the prior image set, and then the effectiveness of the present invention in predicting the remaining real and forged images was tested. Finally, the index of a single data set took the average of all character ID indicators.

[0114] 3. Experimental indicators:

[0115] ①AUC (Area Under the Curve): AUC is the area under the ROC curve, which is used to evaluate the classifier's ability to distinguish between positive and negative samples. The closer the value is to 1, the better the model performance.

[0116] ②Acc (Accuracy): Acc is the ratio of the number of samples correctly predicted by the model to the total number of samples. It is used to evaluate the overall classification accuracy. The closer the value is to 1, the better the model performance.

[0117] 4. Experimental results:

[0118] Table 1 Experimental results of pre-training model

[0119] FF++(raw) FF++(c23) FF++(c40) CDF DFD AUC 0.9516 0.9509 0.9274 0.9498 0.9250 Acc 0.9217 0.9242 0.8965 0.9221 0.8903

[0120] As can be seen from Table 1, in the experiment of the pre-trained model, the AUC of the present invention on multiple data sets is higher than 0.9, and the Acc is also around 0.9, showing high accuracy and generalization ability. At the same time, focusing on the results of the model on three data sets with different compression levels of FF++, it can be seen that with the increase of compression level, the accuracy of the model decreases slightly, showing good robustness.

[0121] Table 2 Experimental results of fine-tuning training model

[0122] FF++(raw) FF++(c23) FF++(c40) CDF DFD AUC 0.9945 0.9933 0.9865 0.9851 0.9591 Acc 0.9632 0.9625 0.9402 0.9521 0.9416

[0123] As can be seen from Table 2, in the experiment of fine-tuning the training model, the present invention has achieved better detection capabilities. On the data sets of various compression levels of FF++, the AUC of the model is close to 1.0, and the Acc is about 0.95, showing extremely high accuracy and robustness. At the same time, on the CDF and DFD data sets, the performance indicators of the model are also improved, showing better generalization ability.

[0124] Corresponding to the aforementioned embodiment of the method for detecting deep fake facial images based on identity prior, the present invention also provides an embodiment of a device for detecting deep fake facial images based on identity prior.

[0125] See also Figure 4 The apparatus for detecting deep fake facial images based on identity prior provided in an embodiment of the present invention comprises one or more processors for implementing the method for detecting deep fake facial images based on identity prior in the above-mentioned embodiment.

[0126] The embodiment of the face deep fake image detection device based on identity prior of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capability in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution. From the hardware level, if Figure 4 As shown, it is a hardware structure diagram of any device with data processing capability where the face deep fake image detection device based on identity prior of the present invention is located, except Figure 4 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.

[0127] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0128] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0129] Corresponding to the embodiment of the above-mentioned method for detecting deep fake face images based on identity prior, the embodiment of the present application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for detecting deep fake face images based on identity prior. Figure 5 As shown, it is a hardware structure diagram of any device with data processing capability where the method for detecting deep fake face images based on identity prior provided in the embodiment of the present application is located, except Figure 5 In addition to the processor, memory, DMA controller, disk, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, which will not be described in detail, generally based on the actual functions of the device with data processing capabilities.

[0130] Corresponding to the embodiment of the aforementioned method for detecting deep fake facial images based on identity prior, an embodiment of the present invention also provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for detecting deep fake facial images based on identity prior in the above embodiment is implemented.

[0131] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.

[0132] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

[0133] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A method for detecting deep fake face images based on identity prior, characterized in that: The following steps are involved: (1) obtaining a priori image set, wherein the priori image set is real images of the target person to be protected collected in advance; (2) Train the feature extraction network; Using the trained feature extraction network, the identity features are extracted from each image in the prior image set to form a prior feature set; (3) reading the image to be tested, inputting the image to be tested into a feature extraction network, and extracting the identity features to be tested; (4) Compare the identity features to be tested with the identity features of the prior true image in the prior feature set, and use cosine similarity to calculate the similarity between the identity features to be tested and the features in the prior feature set; The similarity is used as the confidence level of the image under test output by the model to be detected as true, and the authenticity of the image under test is judged according to the threshold calculated on the validation set.

2. The method for detecting deep fake face images based on identity prior according to claim 1, characterized in that: The feature extraction network is a dual-channel network consisting of two upper and lower Encoder networks; the features of the two channels are fused through a cross-attention mechanism.

3. The method for detecting deep fake face images based on identity prior according to claim 1, characterized in that: The training process of the feature extraction network includes a pre-training process and a fine-tuning process.

4. The method for detecting deep fake face images based on identity prior according to claim 3, characterized in that: The pre-training process is specifically as follows: Data preparation: We use the WebFace600K large-scale face dataset and perform data augmentation operations, including random cropping, horizontal flipping, and color jittering. Model initialization: Use the ResNet50 model for initialization and set the training parameters, including learning rate, batch size, and number of training cycles; Optimizer and Scheduler: Use stochastic gradient descent optimizer and cosine annealing learning rate scheduler to dynamically adjust the learning rate; Training process: In each training cycle, the data-augmented samples are input into the model, the output obtained by forward propagation is calculated, and then the loss is calculated using the ArcFace loss function; then, backpropagation is performed to calculate the gradient, and the model parameters are updated using the optimizer; during the training process, the model parameters are continuously adjusted so that it can learn feature vectors with distinguishing capabilities in the feature space.

5. The method for detecting deep fake face images based on identity prior according to claim 3, characterized in that: The fine-tuning process is specifically as follows: Data preparation: Collect a mixed dataset containing real faces and forged faces. The dataset contains images generated by various forgery methods and performs data augmentation operations, including random cropping, horizontal flipping, and color jittering. Model initialization: Use the ResNet50 model trained in the pre-training process and load its weights; Optimizer and Scheduler: Use stochastic gradient descent optimizer and cosine annealing learning rate scheduler to dynamically adjust the learning rate; Training process: In each training cycle, data-augmented samples are input into the model, the output obtained by forward propagation is calculated, and then the loss is calculated using the contrastive learning loss function; then, backpropagation is performed to calculate the gradient and the model parameters are updated using the optimizer; during the training process, the model parameters are continuously adjusted so that it can better distinguish between real faces and fake faces in the feature space.

6. The method for detecting deep fake face images based on identity prior according to claim 2, characterized in that: The reasoning process of the feature extraction network is as follows: after the input image enters the feature extraction network, the depth estimation model is used to extract the depth estimation map of the RGB image, and then the RGB image and the corresponding depth estimation image are respectively sent to the upper and lower encoder networks that do not share parameters, and the feature vectors f related to the facial features and face shape contained therein are respectively extracted. rgb and f d , and then the upper and lower sets of features are fused through the cross-attention mechanism to obtain the final character identity feature vector f as the output of the entire feature extraction network.

7. The method for detecting deep fake face images based on identity prior according to claim 1, characterized in that: The step (4) is specifically as follows: compare the identity feature f to be tested with the identity feature f of the prior true image in the prior feature set pre Compare and use cosine similarity cosine_similarity to calculate the similarity similarity between the identity feature to be tested and the features in the prior feature set; There are the following expressions: Among them, a and b represent any two feature vectors whose similarity is to be calculated, n is the number of images in the prior feature set, is the feature vector numbered i in the prior feature set; the similarity is used as the confidence that the image to be tested output by the model is detected as true, and the authenticity of the image to be tested is judged according to the threshold calculated on the validation set; if the similarity is higher than the threshold, the output prediction result is true; otherwise, when the similarity is lower than or equal to the threshold, the prediction result is forged.

8. A deep fake face image detection device based on identity prior, characterized in that: It includes one or more processors for implementing the method for detecting deep fake facial images based on identity prior as described in any one of claims 1 to 7.

9. An electronic device, comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the identity prior-based deep fake face image detection method described in any one of claims 1-7 above.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for detecting deep fake facial images based on identity priors as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Human face anti-counterfeiting detection method of double-channel convolutional neural network based on attention model

    CN110414350A

  • In-vivo detection method and device, electronic equipment and computer readable storage medium

    CN112766162A

  • Deep fake face detection method, system and equipment based on identity invariant feature

    CN115457622A

  • Laser stripe semantic segmentation method used under multi-reflection interference

    CN117315250A

  • Face deep false detection method based on edge feature collection

    CN117636421A

Cited By

  • Counterfeit face identification method and system

    CN120220256A

  • Deep pseudo detection method and device based on feature decoupling and double-branch enhancement

    CN121838281A

  • Deep fake detection method and device based on feature decoupling and double-branch enhancement

    CN121838281B