Face forgery detection method based on watermark feature assistance and cross-task distillation
By introducing watermark feature assistance and cross-task distillation techniques into face forgery detection, watermarked image samples are constructed and fine-grained feature knowledge is transferred, solving the accuracy and generalization problems of existing models in detecting diverse forgery samples, and achieving higher detection accuracy and recognition capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-28
- Publication Date
- 2026-03-27
AI Technical Summary
Existing deepfake detection models lack sufficient accuracy and generalization ability when faced with diverse and high-quality forgery samples, and lack effective cross-task knowledge guidance, making it difficult to identify fine-grained tampering traces in the forgery process.
A face forgery detection method based on watermark feature assistance and cross-task distillation is adopted. By constructing watermarked image samples and introducing a knowledge distillation mechanism, the fine-grained feature knowledge of the watermark extraction module is transferred to the forgery detection module, and dual-task collaborative optimization is performed.
It improves the accuracy of face forgery detection, enhances the ability to identify potential tampering traces, and improves the model's generalization ability and detection accuracy.
Smart Images

Figure CN121747207A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of face forgery detection, and particularly relates to a face forgery detection method based on watermark feature assistance and cross-task distillation. BACKGROUND
[0002] With the rapid iteration of deep learning technology, the fidelity and spread of deepfake content continue to improve, posing a serious challenge to information security and social trust systems, and therefore efficient and accurate deepfake detection technology has become a research hotspot. However, traditional single-task detection models are generally limited in feature learning, and can only capture superficial visual differences in forged content. When faced with diverse and high-quality forged samples, the detection accuracy and generalization ability are difficult to meet the practical standards.
[0003] At present, although the deepfake detection technology has made some progress, the inherent bottleneck of the traditional single-task detection model has not been broken through. The feature learning is limited to the superficial visual information of the image, and can only capture the dominant differences in the forged content. It is difficult to dig out the fine-grained and deep-level tampering traces in the forging process, resulting in that when faced with diverse and high-quality new forged samples, the detection accuracy and generalization ability are difficult to meet the practical application standards. Moreover, the single-task training mode lacks effective cross-task knowledge guidance, and the model cannot strengthen its discrimination ability by using the feature learning experience of other related tasks, resulting in insufficient recognition sensitivity to potential tampering traces, and making it difficult to achieve high-precision authenticity identification. The existing technology based on double-task cooperation of Deepfake detection model, the core is to build a double-task model of forgery detection and facial attribute recognition, to realize knowledge transfer through sharing ResNet series feature extractor and weighted fusion of double-task loss. However, the existing scheme has obvious shortcomings. The correlation of double-task features is low, the facial attribute recognition cannot provide effective feature supplement for the detection task, and there is no special knowledge transfer mechanism, which is easy to cause negative transfer. At the same time, there is no design of capturing mechanism for fine-grained tampering features, and the generalization ability is weak when faced with high-fidelity forged samples. SUMMARY
[0004] Therefore, the present application provides a face forgery detection method based on watermark feature assistance and cross-task distillation to improve the accuracy of detection.
[0005] In the first aspect, the present application provides a face forgery detection method based on watermark feature assistance and cross-task distillation, which comprises:
[0006] Step 1, constructing a data set of face image samples, and embedding watermarks in the preprocessed face image samples to obtain watermarked images; Step 2, inputting the watermarked images into the joint training model of the constructed watermark extraction and forgery detection double-task branch to obtain image fine-grained feature knowledge; Step 3, introducing knowledge distillation, transferring image fine-grained feature knowledge to the forgery detection branch to perform double-task collaborative optimization to detect face forgery.
[0007] Optionally, the step 1 comprises: Based on the Celeba dataset, a dataset of face image samples is constructed, 30000 face images are selected from the Celeba dataset, and are uniformly cropped to images with a resolution of 256x256; the face image samples are divided into a training set, a validation set and a test set in a ratio of 26:2:2 to make the distribution of the face image samples uniform; The joint training model of the double-task branch comprises a watermark embedding module; the robust watermark embedding based on the quaternion radial harmonic Fourier moment QRHFMs embeds 256-bit binary structured watermarks in each preprocessed image, and the process is as follows: Step 11, polar coordinate conversion and QRHFMs calculation; the original image is converted into a polar coordinate form , and the QRHFMs coefficients of the maximum order and the maximum repetition are calculated, and the formula is: ; wherein, is the order of the moment, is the repetition of the moment, is the differential element of the polar radius , is the differential element of the polar angle , is a unit pure quaternion, is a radial basis function, is a complex exponential term, is an integral symbol; Step 12, accurate moment extraction; from the QRHFMs coefficients , the coefficients of the non-integer multiple of 4 order are selected to form an accurate moment set , which is used to ensure the stability of the embedded carrier, wherein , is an integer set; Step 13, quantization watermark embedding; 256 original moment coefficients are randomly selected from the accurate moment set S, and are coefficient indexes; 256-bit binary structured watermarks are embedded in the coefficient amplitude by quantization, and the formula is: ; wherein, is the magnitude of the watermarking image is the magnitude of the watermarking image is the magnitude of the watermarking image is the quantization step, taking the value of 0.02, is the dot product, is the rounding operation, is the watermark bit; Step 14, image reconstruction; based on the original moment coefficient and the watermarking image respectively reconstruct the image and , and obtain the watermarking image by residual superposition, the formula is: .
[0008] Optionally, the step 2 comprises: a joint training model with a dual-task branch, which further comprises a hybrid attack module, a feature extraction module, a watermark extraction module and a forgery detection module; Step 21, in the hybrid attack module, two types of attacks are applied to the watermarking image , ordinary attacks include JPEG compression, salt and pepper noise, Gaussian blur and hue adjustment; Deepfake attacks include face swapping, face anonymization and wearing glasses; after the two types of attacks, the attacked watermarking image is obtained; Step 22, feature extraction module: VMamba is selected as the feature extraction network to strengthen the cooperative capture of local and global features and adapt to face tampering feature detection; the attacked watermarking image is input, and the channel number is adjusted to 64 through a 3×3 convolution layer to obtain an initial feature map ; the is input into the VMamba network architecture, and an enhanced feature map is output; the feature is reduced in dimension, and the enhanced feature map is reduced in channel number to 256 to obtain a final enhanced feature map , which takes into account the feature expression ability and computational efficiency; Step 23, the target of the watermark extraction module is to provide image clues for the forgery detection branch through watermark extraction effect, and the structure comprises: a, a feature refinement layer, which compresses the final enhanced feature map in channel number to 64 to obtain watermark-specific features ; b, a QRHFMs moment decoding layer, which performs polar coordinate conversion and QRHFMs moment calculation on the watermark-specific features , extracts the medium and high frequency coefficients and maps them into a 256-dimensional vector, and obtains a watermark prediction value through an activation function sigmoid wherein the formula of the activation function sigmoid is: ; wherein, x is the input of the function, and e is a natural constant; c, a composite loss function, the designed composite loss function is used to ensure accurate extraction of the watermark of the real image and complete failure of the watermark of the Deepfake image, and the formula is: ; wherein, is the extraction result of the watermark of the real image, is the extraction result of the watermark of the Deepfake image, is an interval term, represents a positive value operation, represents the Euclidean norm; Step 24, the core goal of the forgery detection module is to identify whether the image is a Deepfake attack, and the structure includes: e, a feature adaptation layer, and 1 1x1 convolutional layer is used to adjust the channel number of the final enhanced feature map to 128 to obtain detection-specific features ; f, a classification head, 2 fully connected layers are used to output the label prediction probability of the sample ; g, a classification loss, a cross-entropy loss is used to optimize the detection task, and the formula is: ; wherein, is the cross-entropy loss, N is the number of batch samples, is a summation operator, is a natural logarithm function, is a sample real single label 1 or 0, the prediction probability of the i-th sample by the detection branch, .
[0009] Optionally, the step 3 comprises: The core of knowledge distillation is to migrate the image fine-grained feature knowledge learned by the watermark extraction module in the watermark extraction task to the forgery detection module, so as to strengthen the feature capture ability of the forgery detection module to the inherent properties and tampering traces of the image; Step 31, image fine-grained feature knowledge migration; To realize feature alignment, a 1x1 convolutional layer is added after the feature adaptation layer of the forgery detection module, which is used to reduce the dimension of the detection-specific features to 64 channels to obtain the adapted features ; The adapted features of the forgery detection module are constrained by the cosine similarity loss, and the adapted features of the forgery detection module are obtained Watermark-specific features of the watermark extraction module Aligning to make the counterfeit detection module learn the feature capture logic of the watermark extraction module, formula: ; Wherein, is the feature distillation loss, is the Euclidean norm, and the smaller the loss is, the closer the feature representation of the counterfeit detection module is to the watermark extraction module, that is, the image fine-grained feature knowledge is learned; Step 32, feature structure consistency constraint; The watermark-specific features and the adapted features are all divided into a plurality of local feature blocks with a size of 3*3, and are respectively denoted as and ; The structure consistency of the local feature blocks at the corresponding positions is constrained by L2 norm, and the formula is: ; Wherein, is the local structure constraint loss, K is the total number of local feature blocks, and is used to ensure that the features learned by the counterfeit detection module have the effectiveness of global distribution and local structure.
[0010] Optionally, it comprises: Total loss function pre-training strategy: weightedly fusing the classification loss of the counterfeit detection module, the composite loss of the watermark extraction module and the loss of knowledge distillation, constructing a total loss function according to the double-task cooperative optimization goal of watermark extraction and counterfeit detection, and the formula is: ; Wherein, is the cross-entropy loss; is the composite loss of the watermark extraction module; is the feature distillation loss; is the local structure constraint loss; , , The weights of the corresponding losses are 0.6, 0.5 and 0.3 respectively.
[0011] In the technical scheme provided by the application, the method comprises constructing a data set of face image samples, embedding a watermark in the preprocessed face image samples to obtain a watermark-embedded image, inputting the watermark-embedded image into the constructed joint training model of the watermark extraction and counterfeit detection double-task branch to obtain image fine-grained feature knowledge, introducing knowledge distillation to transfer the image fine-grained feature knowledge to the counterfeit detection branch for double-task cooperative optimization to detect face forgery, and the method improves the detection accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described in the following are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative effort based on these drawings.
[0013] Figure 1 The flowchart of the face forgery detection method based on watermark feature auxiliary and cross-task distillation provided by the embodiments of the present application is shown in the figure. Figure 2 The flowchart of the watermark embedding provided by the embodiments of the present application is shown in the figure. Figure 3 The joint training model schematic diagram of the double-task branch provided by the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION
[0014] In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.
[0015] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms “a”, “an” and “the” used in the embodiments of the present application are also intended to include plural forms, unless the context clearly indicates otherwise.
[0016] It should be understood that the term “and / or” used herein is only to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character “ / ” in this paper generally represents that the front and rear associated objects are a “or” relationship.
[0017] Depending on the context, the word “if” as used herein can be interpreted as “when” or “upon” or “in response to determining” or “in response to detecting”. Similarly, depending on the context, the phrase “if it is determined” or “if (a stated condition or event) is detected” can be interpreted as “when it is determined” or “in response to determining” or “when (a stated condition or event) is detected” or “in response to detecting (a stated condition or event)”.
[0018] Figure 1The flowchart of the face forgery detection method based on watermark feature assistance and cross-task distillation provided in the embodiments of the present invention is as follows: Figure 1 As shown, the method includes: Step 1: Construct a dataset of face image samples and embed watermarks into the preprocessed face image samples to obtain watermarked images.
[0019] In this embodiment of the invention, step 1 includes: A dataset of face image samples was constructed based on the Celeba dataset. This dataset contains 202,599 face images, covering 101 face attributes. The data processing workflow revolves around watermark embedding and attack simulation. The core issue is that the watermark extraction effect differs after an attack; that is, the watermark can be perfectly extracted after a normal attack, but the watermark is destroyed after a deepfake attack. 30,000 face images were selected from the Celeba dataset and uniformly cropped to a resolution of 256×256. The images were then divided into training, validation, and test sets in a 26:2:2 ratio to ensure a uniform distribution of face image samples and reduce the impact of background interference on model training. A joint training model employing a dual-task branching approach is used, which includes a watermarking module; such as... Figure 2 As shown, robust watermark embedding based on quaternion radial harmonic Fourier moments (QRHFMs) embeds a 256-bit binary structured watermark into each preprocessed image. The embedding process requires no model training, balancing imperceptibility and attack resistance. The process is as follows: Step 11, Polar coordinate transformation and QRHFMs calculation; transform the original image Convert to polar coordinates Calculate its maximum order. Maximum number of repetitions QRHFMs coefficients The formula is: ; in, Let be the order of the moment. Let be the number of repetitions of the moment. Polar radius Differential elements, Polar angle Differential elements, For a unit pure quaternion, For radial basis functions, For a complex exponential term, The integral symbol is used. Step 12, Exact Moment Extraction; from QRHFMs coefficients By selecting coefficients that are not integer multiples of 4, a set of exact moments is constructed. This is used to ensure the stability of the embedded carrier, where , is an integer set; Step 13, quantizing the embedded watermark; 256 original matrix coefficients are randomly selected from the accurate matrix set S , and is a coefficient index; a 256-bit binary structured watermark is embedded in the coefficient amplitude by quantization, and the formula is: ; wherein, is a matrix coefficient after embedding the watermark, is an amplitude of , is a quantization step length, and the value is 0.02, is a dot product, is an integral operation, is a watermark bit, and the visual quality of the image is ensured after the watermark is embedded; Step 14, image reconstruction; based on the original matrix coefficients and the matrix coefficients after embedding the watermark , the images and are reconstructed respectively, and the residual superposition is obtained to obtain the embedded watermark image , and the formula is: .
[0020] Step 2, inputting the embedded watermark image into the joint training model of the constructed watermark extraction and forgery detection double-task branch to obtain image fine-grained feature knowledge.
[0021] In the embodiment of the application, step 2 comprises: The joint training model of the double-task branch is adopted, as shown in Figure 3 , and the joint training model further comprises a hybrid attack module, a feature extraction module, a watermark extraction module and a forgery detection module; Step 21, two types of attacks are applied to the embedded watermark image in the hybrid attack module, the ordinary attacks include JPEG compression (the quality factor is 0.7), salt and pepper noise (the noise density is 0.01), Gaussian blur (the convolution kernel is 3*3) and hue adjustment; the deep forgery Deepfake attack includes face changing (based on StyleGAN2, the face fusion degree is 0.9), face anonymization and wearing glasses; after the two types of attacks, the attacked embedded watermark image is obtained; Step 22, the feature extraction module: VMamba is selected as the feature extraction network to strengthen the cooperative capture of local and global features and adapt to face tampering feature detection; the attacked embedded watermark image , the channel number is adjusted to 64 through a 3x3 convolution layer, and an initial feature map is obtained ; the input VMamba network architecture outputs an enhanced feature map ; the feature dimension is reduced, and the enhanced feature map is compressed to 256 channels to obtain the final enhanced feature map , which balances feature expression ability and computational efficiency; Step 23, the goal of the watermark extraction module is to provide image clues for the forgery detection branch through watermark extraction, and the structure includes: a, the feature refinement layer, the final enhanced feature map is compressed to 64 channels to obtain watermark-specific features ; b, the QRHFMs matrix decoding layer, the watermark-specific features are subjected to polar coordinate conversion and QRHFMs matrix calculation, the medium-high frequency coefficients are extracted and mapped into a 256-dimensional vector, and the watermark prediction value is obtained through the activation function sigmoid , wherein the formula of the activation function sigmoid is: ; wherein, x is the input of the function, and e is the natural constant; c, the composite loss function, the designed composite loss function is used to ensure accurate extraction of the watermark of the real image and complete failure of the watermark of the deepfake image, and the formula is: ; wherein, is the watermark extraction result of the real image, is the watermark extraction result of the Deepfake image, is the interval term, represents the positive value operation, represents the Euclidean norm; Step 24, the core goal of the forgery detection module is to identify whether the image is a deepfake attack, and the structure includes: e, the feature adaptation layer, a 1x1 convolution layer is used to adjust the channel number of the final enhanced feature map to 128 to obtain detection-specific features ; f, the classification head, 2 fully connected layers, output the label prediction probability of the sample ; g, the classification loss, cross-entropy loss is used to optimize the detection task, and the formula is: ; wherein, is the cross-entropy loss, N is the number of batch samples, is the summation operator, ln(x) is a natural logarithm function, is a sample true single label 1 or 0, detecting branch prediction probability of the i-th sample, .
[0022] Step 3, introducing knowledge distillation, transferring image fine-grained feature knowledge to the forgery detection branch for double-task collaborative optimization to detect face forgery.
[0023] In the embodiment of the application, step 3 comprises: The core of knowledge distillation is to transfer the image fine-grained feature knowledge learned by the watermark extraction module in the watermark extraction task to the forgery detection module, so as to strengthen the feature capturing ability of the forgery detection module to the inherent properties and tampering traces of the image, and realize efficient transmission and double-task collaborative optimization of cross-task feature knowledge. Step 31, image fine-grained feature knowledge transfer; the purpose is to let the forgery detection branch learn the pattern of capturing image deep features of the watermark extraction branch, master the representation mode of medium-high frequency fine-grained features, and make up for the limitations of feature learning of single-task model; To realize feature alignment, a 1x1 convolution layer is added after the feature adaptation layer of the forgery detection module, which reduces the dimension of the detection-specific feature to 64 channels to obtain the adapted feature , so as to ensure that the feature dimensions are consistent and no core information is lost; Through cosine similarity loss constraint, the adapted feature of the forgery detection module is aligned with the watermark-specific feature of the watermark extraction module , so that the forgery detection module learns the feature capturing logic of the watermark extraction module, and the formula is: ; Wherein, is the feature distillation loss, is the Euclidean norm, and the smaller the loss is, the closer the feature representation of the forgery detection module is to the watermark extraction module, that is, the image fine-grained feature knowledge is learned; Step 32, feature structure consistency constraint; the purpose is to strengthen the learning of the forgery detection branch to the local structure of the feature, so as to ensure that it can not only capture the global feature distribution, but also identify the damaged local feature correlation in the forged image; The watermark-specific feature and the adapted feature are both divided into multiple local feature blocks according to the size of 3x3, and are respectively denoted as and ; The structure consistency of the local feature blocks at the corresponding positions is constrained by L2 norm, and the formula is: ; wherein, is a local structure constraint loss, K is the total number of local feature blocks, and is used to ensure that the features learned by the forgery detection module are effective in both global distribution and local structure.
[0024] In the embodiments of the present application, the following are included: The total loss function pre-training strategy: the classification loss of the forgery detection module, the composite loss of the watermark extraction module and the loss of knowledge distillation are weighted and fused, the total loss function is constructed according to the double-task cooperative optimization goal of watermark extraction and forgery detection, and the formula is: ; wherein, is a cross-entropy loss; is a composite loss of the watermark extraction module; is a feature distillation loss; is a local structure constraint loss; , , are the weights of the corresponding losses, respectively taking values of 0.6, 0.5 and 0.3.
[0025] In the embodiments of the present application, the Adam optimizer is selected, and the area under the ROC curve (Area Under Curve, AUC) and the accuracy (Accuracy, ACC) are used as the core evaluation indicators, which are used to quantify the distinguishing performance of the model for real images and fake images. The AUC value ranges from 0 to 1: AUC=0.5 represents that the model has no distinguishing ability, and the closer the AUC is to 1, the stronger the distinguishing ability of the model for real and fake images; the closer the AUC is to 0, the weaker the distinguishing ability of the model; ACC directly reflects the degree of agreement between the predicted results of the model and the true labels, and the higher the value, the better the distinguishing performance of the model.
[0026] The present application utilizes the capturing demand of the watermark extraction task for medium-high frequency fine-grained features and the natural compatibility of the feature target of the forgery detection task to form an effective supplement, simultaneously innovatively designs a double-branch fine-grained feature knowledge distillation mechanism, realizes precise and efficient transmission of cross-task knowledge through double constraints of feature distribution alignment and local structure constraint, and collaborates with a robust watermark embedding strategy based on the orthogonal matrix of QRHFMs, taking into account imperceptibility and attack resistance, and selects the VMamba network as the core feature extractor, which is adjusted in channel and optimized in dimension after convolution layer, to strengthen the collaborative capture of local and global tampering features.
[0027] The application constructs a joint training model of deepfake detection and watermark extraction dual-task branches, on the one hand, the image fine-grained feature knowledge learned by the watermark extraction task is transferred to the forgery detection task to help improve the detection accuracy, on the other hand, the dual-branch fine-grained feature knowledge distillation method is innovatively introduced to strengthen the cross-task knowledge transfer efficiency, realize the dual-task collaborative optimization, make the model more accurately identify the potential tampering traces, further improve the detection accuracy, and provide a new technical path for coping with the security challenges brought by the constantly upgrading deepfake technology.
[0028] Compared with the prior art, the application has the following beneficial effects: Firstly, the dual-task collaboration is better, the watermark extraction is selected as the auxiliary task, the medium-high frequency fine-grained features required to be captured are highly consistent with the forgery and tampering features, which can provide accurate and effective feature supplement for the forgery detection task, and the feature correlation of the auxiliary task and the detection task in the prior art is low, and it is difficult to form a synergistic gain. Secondly, the knowledge transfer is accurate and efficient, the knowledge distillation mechanism designed innovatively optimizes the knowledge transfer path through double constraints, effectively avoiding the negative transfer problem easily occurring in traditional cross-task transfer, and the prior art lacks a special transfer mechanism, and the knowledge transfer efficiency is low. Thirdly, the watermark embedding strategy has strong robustness, the specific order accurate matrix is selected as the watermark carrier based on QRHFMs, the imperceptibility and attack resistance of the watermark are considered, and a stable and reliable strong supervision signal can be provided for the detection task. Fourthly, the feature capture capability is more comprehensive, the VMamba network is selected as the core feature extractor, which can strengthen the collaborative capture of local and global tampering features, and compared with the feature extraction network in the prior art, it is more suitable for the detection requirements of face tampering traces. Fifthly, the generalization ability is better, through the joint optimization of dual-task collaboration and knowledge distillation, the model can better adapt to diversified forgery attack scenes, and still has stable detection performance for unseen forgery samples, and the practicability is stronger.
[0029] In the technical scheme provided by the application, the method comprises the following steps: constructing a data set of face image samples, and embedding a watermark in the preprocessed face image samples to obtain a watermark-embedded image; inputting the watermark-embedded image into the constructed joint training model of watermark extraction and forgery detection dual-task branches to obtain image fine-grained feature knowledge; introducing knowledge distillation to transfer the image fine-grained feature knowledge to the forgery detection branch for dual-task collaborative optimization to detect face forgery, which improves the detection accuracy.
[0030] The above only describes the preferred embodiments of the application and is not intended to limit the application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. A face forgery detection method based on watermark feature auxiliary and cross-task distillation, characterized in that, The method comprises: Step 1, constructing a data set of face image samples, and embedding a watermark in the preprocessed face image samples to obtain an embedded watermark image; Step 2, inputting the embedded watermark image into the joint training model of the constructed watermark extraction and forgery detection double-task branch to obtain image fine-grained feature knowledge; Step 3, introducing knowledge distillation to migrate the image fine-grained feature knowledge to the forgery detection branch for double-task collaborative optimization to detect face forgery.
2. The method of claim 1, wherein, The step 1 comprises: Based on the Celeba data set, a data set of face image samples is constructed, 30000 face images are selected from the Celeba data set, and the images are uniformly cropped to 256x256 resolution; the training set, the verification set and the test set are divided in the proportion of 26:2:2 to make the face image sample distribution uniform; The joint training model of the double-task branch comprises an embedded watermark module; the robust watermark embedding based on the quaternion radial harmonic Fourier moment QRHFMs embeds 256-bit binary structured watermark for each preprocessed image, and the process is as follows: Step 11, Polar Coordinate Conversion and QRHFMs Calculation; Convert the original image to polar coordinate form , and calculate its maximum order , maximum repetition of QRHFMs coefficients , formula is: ; wherein is the order of the moment, is the repetition of the moment, is the polar radius is the differential element of polar angle is the differential element of polar angle is the differential element of polar angle is the unit pure quaternion, is the radial basis function, is the complex exponential term, is the integral sign; Step 12, exact moment extraction; from the QRHFMs coefficients selecting coefficients of non-4 integer multiple order from the QRHFMs coefficients to form the exact moment set for ensuring stability of the embedded carrier, wherein , is a set of integers; Step 13, quantize the embedded watermark; randomly select 256 original matrix coefficients from the accurate matrix set S , and For the coefficient index; 256-bit binary structured watermark , embedded in the coefficient amplitude by quantization, the formula is: ; wherein, is the watermarked matrix coefficient, is the amplitude of is the amplitude of is the quantization step, which is 0.02, is the dot product, is the rounding operation, is the watermark bit; Step 14, image reconstruction; based on original moment coefficients and the moment coefficients after embedding watermark reconstruct the image respectively and get the image with embedded watermark by superimposing the residual , the formula is: 。 3. The method of claim 2, wherein, The step 2 comprises: The joint training model of the double-task branch further comprises a hybrid attack module, a feature extraction module, a watermark extraction module and a forgery detection module; Step 21, in the mixed attack module for the embedded watermark image Two types of attacks are applied, normal attacks including JPEG compression, salt and pepper noise, Gaussian blur and hue adjustment; Deepfake attacks including face swapping, face anonymization and wearing glasses; After two types of attacks, the embedded watermark image after attack is obtained ; Step 22, Feature Extraction Module: VMamba is selected as the feature extraction network to enhance the collaborative capture of local and global features and adapt to face tampering feature detection; input the watermarked image after the attack. The number of channels was adjusted to 64 using a 3×3 convolutional layer to obtain the initial feature map. ;Will Input VMamba network architecture, output enhanced feature map Feature dimensionality reduction, using 1×1 convolution to enhance the feature map. The number of channels was reduced to 256, resulting in the final enhanced feature map. It balances feature representation capability and computational efficiency; Step 23, the goal of the watermark extraction module is to provide image clues for the forgery detection branch through watermark extraction effect, the structure includes: a, feature refinement layer, the final enhanced feature map The number of channels is compressed to 64 to obtain watermark special features ; b, QRHFMs matrix decoding layer, the watermark special features Perform polar coordinate conversion and QRHFMs matrix calculation, extract the medium-high frequency coefficients and map them into 256-dimensional vectors, and obtain the watermark prediction value through the activation function sigmoid , wherein the formula of the activation function sigmoid is: ; wherein x is the input of the function, e is the natural constant; c, a composite loss function, the designed composite loss function is used to ensure accurate extraction of the watermark of the real image and complete failure of the watermark of the deepfake image, and the formula is: ; wherein is a real image watermark extraction result, is a Deepfake image watermark extraction result, is a spacer term, denotes a taking positive values operation, denotes the Euclidean norm; Step 24, the core goal of the forgery detection module is to identify whether the image is a deepfake attack, the structure includes: e, a feature adaptation layer, a 1x1 convolutional layer to the final enhanced feature map The number of channels is adjusted to 128 to obtain detection-specific features ; f, classification head, 2 layers of fully connected layers, output the label prediction probability of the sample ; g, classification loss, cross-entropy loss is used to optimize the detection task, the formula is: ; wherein, is the cross-entropy loss, N is the number of batch samples, is the summation operator, is the natural logarithm function, is the sample true single label 1 or 0, detects the prediction probability of the branch for the i-th sample, .
4. The method of claim 3, wherein, The step 3 comprises: The core of knowledge distillation is to migrate the image fine-grained feature knowledge learned by the watermark extraction module in the watermark extraction task to the forgery detection module to strengthen the feature capturing ability of the forgery detection module to the inherent properties and tampering traces of the image; Step 31, image fine-grained feature knowledge migration; To realize feature alignment, a 1x1 convolution layer is added after the feature adaptation layer of the forgery detection module, and the detection-specific features are reduced to 64 channels to obtain the adapted features ; By cosine similarity loss constraint, the adapted feature of the forgery detection module is aligned with the watermark-specific feature of the watermark extraction module to make the forgery detection module learn the feature capturing logic of the watermark extraction module, formula: ; wherein, is a characteristic distillation loss, is a Euclidean norm, the smaller the loss is, indicating that the feature representation of the forgery detection module is closer to the watermark extraction module, i.e., learning the image fine-grained feature knowledge; Step 32, feature structure consistency constraint; Watermark-specific features Adapted features are divided into multiple local feature blocks with size 3x3, respectively denoted as and ; The structure consistency of the local feature block at the corresponding position is constrained by the L2 norm, and the formula is: ; wherein, is a local structure constraint loss, K is the total number of local feature blocks, and is used to ensure that the features learned by the forgery detection module are effective in both global distribution and local structure.
5. The method of claim 4, wherein, It comprises: Total loss function pre-training strategy: weighted fusion of the classification loss of the forgery detection module, the composite loss of the watermark extraction module and the loss of knowledge distillation; according to the double-task collaborative optimization target of watermark extraction and forgery detection, a total loss function is constructed, and the formula is: ; wherein, is a cross-entropy loss; is a compound loss of the watermark extraction module; is a feature distillation loss; is a local structure constraint loss; , , is a weight of the corresponding loss, respectively taking values 0.6, 0.5, 0.3.
Citation Information
Patent Citations
Double-task cascade active Deepfake detection method based on QPCET watermark
CN118333830A
Active Deepfake detection method based on watermark image difference value
CN118799163A
Face forgery detection method based on feature enhancement Mama framework
CN120088838A
Video transformer for deepfake detection with incremental learning
US20230401824A1
Robust hologram watermarking system based on artificial intelligence
US20240214648A1
Cited By
A face forgery detection method, device and equipment based on knowledge distillation
CN122369127A