Face detection method and device supporting artificial intelligence generation and synthesis portrait identification
By employing a feature extraction structure that alternates between depthwise separable convolution and LA-MViT-Block, combined with wavelet transform and CEIB network optimization, the problem of accuracy and efficiency in face detection in deep fakery scenarios is solved, achieving high-precision pre-evaluation of the degree of forgery, and is suitable for edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAMEN MEIYABAIKE INFORMATION SECURITY RES INST CO LTD
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-17
AI Technical Summary
Existing lightweight face detection models suffer from insufficient accuracy, low efficiency, lack of pre-assessment strategies for the degree of forgery in deepfake scenarios, and inadequate feature learning, making it impossible to effectively distinguish between natural noise and potential forgery noise.
We employ a stacked structure of depthwise separable convolutional and LA-MViT-Block feature extraction units, combined with wavelet transform and channel attention mechanisms to enhance high-frequency artifact features. We optimize feature selection through the CEIB network and introduce a pre-evaluation module for the degree of forgery to output multi-dimensional detection results.
It significantly improves the accuracy of deep fake face detection to over 92%, reduces the false negative rate to below 8%, and the lightweight model is adapted for edge deployment. It has a pre-assessment function for the degree of forgery, which improves the efficiency and generalization ability of subsequent identification processes.
Smart Images

Figure CN121884403A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of face detection technology, specifically relating to a face detection method and apparatus that supports the identification of artificial intelligence-generated synthetic human images. Background Technology
[0002] Face detection is a crucial preliminary step in identifying AI-generated synthetic faces. Its core task is to accurately locate facial regions from images, providing high-quality information input for subsequent forgery detection models and directly impacting the accuracy of the entire detection system. With the rapid development of deepfake technology, AI-generated synthetic faces differ significantly from natural faces in pixel distribution and texture features, exposing numerous problems for traditional face detection algorithms in this scenario.
[0003] 1. Insufficient detection accuracy: Common forgery traces in deep fake images, such as abnormal edges, unstructured noise, edge blurring, and color overflow, make traditional algorithms prone to false detection, false negatives, and inaccurate detection box localization. For example, the AttentionFace algorithm improves the false negative rate in deep fake scenes by 18% compared to natural image scenes.
[0004] 2. Low detection efficiency: Existing face detection models optimized for natural scenes often require a larger number of parameters and computational resources when processing deep fake images, making it difficult to meet the lightweight deployment requirements of edge devices;
[0005] 3. Lack of pre-assessment of forgery level: Existing algorithms can only output face region coordinates and confidence level, and cannot quantitatively assess the probability of face forgery, which makes it difficult for subsequent identification models to prioritize high-risk samples and affects the efficiency of the overall identification process;
[0006] 4. Insufficient feature learning: Deep fake images have diverse forgery methods, and the stability of forgery features is insufficient. Traditional models have difficulty effectively distinguishing between natural noise and potential fake noise, and the detection accuracy of high-quality deep fake images is less than 60% (such as the GAN-FaceDet model).
[0007] Among existing related technologies, the DLFace algorithm addresses the trade-off problem of low-resolution face detection by introducing a Lambda layer, but it is not optimized for deep fake image scenarios. The method proposed by Ge,T. et al., which adjusts the sample distribution based on image quality, ignores the problems of the diversity of forgery methods and the insufficient stability of deep fake features. The feature fusion strategy of the MultiScale algorithm is not adapted to the feature inconsistency of deep fake images, resulting in large fluctuations in detection accuracy. None of these technologies solve the core pain points of face detection in deep fake image scenarios and cannot meet the actual needs of AI-generated synthetic portrait identification. Summary of the Invention
[0008] This invention aims to address the technical problems of existing lightweight face detection models in deepfake scenarios, such as decreased detection accuracy, low efficiency, lack of pre-evaluation strategies for the degree of forgery, and insufficient feature learning. It provides a face detection method that combines high accuracy, high efficiency, and quantitative evaluation capabilities for the degree of forgery.
[0009] In a first aspect, this invention proposes a face detection method that supports the identification of artificial intelligence-generated synthetic human images, the method comprising the following steps:
[0010] S1. Model backbone construction steps: Construct a stacked structure of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Blocks. The LA-MViT-Blocks enhance local correlation by calculating the cosine similarity between each patch and its 3×3 neighboring patches. The first computational unit of the model backbone is a high-frequency enhanced convolution, and the feature extraction satisfies the formula F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3)), where k is the kernel size, F is the feature extraction, and DepthConv is the depthwise separable convolution.
[0011] S2, High-frequency channel enhancement steps: Decompose the convolution kernel into low-frequency blocks and high-frequency blocks through wavelet transform, apply channel attention mechanism to calculate weights and dynamically weight and fuse them, and convert them into spatial domain convolution kernels through reparameterization;
[0012] S3, CEIB network optimization steps: Insert causal enhancement variational information bottleneck during the training phase, compress the mutual information between input and features through KL divergence, maximize the mutual information between features and labels, and combine non-causal association filtering to optimize feature selection;
[0013] S4. Forgery Probability Pre-evaluation Steps: Based on feature stability evaluation, distilled annotation embedding, and L2 norm optimization, a normalized forgery probability score is calculated. The training of high-forgery-probability samples is then strengthened using a loss function.
[0014] S5. Integration and Output Steps: Multi-source features are fused through 1×1 convolution, and the coordinates of the detection box are fine-tuned by combining the forgery probability score. After NMS suppresses redundant boxes, the output includes multi-dimensional results containing coordinates, face confidence, and forgery probability score.
[0015] Preferably, in step S1, the patch similarity calculation of the LA-MViT-Block includes: for each patch P i Calculate its relationship with the neighboring patch P j Similarity: Among them, w i,j For patch P i With Domain Patch P j The similarity weight.
[0016] Preferably, in step S2, the convolution kernel decomposition satisfies: And after decomposition, it satisfies: Where W is the initial convolutional kernel weight, Wavelet low (·) and Wavelet high (·) denote the low-frequency and high-frequency decomposition operators of the wavelet transform, respectively; Wavelet -1 (·) represents the inverse wavelet transform. This indicates the combination relationship between low-frequency blocks and high-frequency blocks.
[0017] Preferably, in step S2, the channel attention weight calculation satisfies: Where GAP(·) represents global average pooling, σ is the activation function, and FC1 and FC2 are fully connected networks.
[0018] Preferably, in step S3, the optimization loss of the CEIB network satisfies: Where KL(·‖·) is the KL divergence, p(T) is the standard Gaussian distribution, and β is a trainable parameter.
[0019] Preferably, in step S4, the forgery probability score calculation satisfies: in, S is the normalization function. SER (X) represents the feature stability score, S Distill (X) represents the distillation label score, S Norm (X) represents the L2 norm score.
[0020] Preferably, in step S4, the loss function enhancement satisfies: in, Based on the detection of loss, The sum of losses related to face detection. The score represents the probability of forgery, and λ is the coefficient of the loss term.
[0021] Secondly, embodiments of the present invention provide a face detection device that supports the identification of artificial intelligence-generated synthetic human images. This device is used to implement the face detection method as described in any of the first aspects, including:
[0022] The model backbone construction module is configured to construct a stacked structure of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Blocks. The LA-MViT-Blocks enhance local correlation by calculating the cosine similarity between each patch and its 3×3 neighboring patches. The first computational unit of the model backbone is a high-frequency enhanced convolution, and the feature extraction satisfies the formula F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3)), where k is the kernel size, F is the feature extraction, and DepthConv is the depthwise separable convolution.
[0023] High-frequency channel enhancement module: configured to decompose the convolution kernel into low-frequency and high-frequency blocks through wavelet transform, apply channel attention mechanism to calculate weights and dynamically weight and fuse them, and convert them into spatial domain convolution kernels after reparameterization;
[0024] CEIB network optimization module: configured to insert causal enhancement variational information bottleneck during the training phase, compress the mutual information between input and features through KL divergence, maximize the mutual information between features and labels, and optimize feature selection by combining non-causal correlation filtering.
[0025] Forgery probability pre-assessment module: configured to calculate normalized forgery probability scores based on feature stability assessment, distilled annotation embedding, and L2 norm optimization, and to enhance the training of high-forgery-probability samples through a loss function; and
[0026] Integrated output module: Configured to fuse multi-source features through 1×1 convolution, fine-tune the detection box coordinates by combining the forgery probability score, and output multi-dimensional results including coordinates, face confidence, and forgery probability score after NMS to suppress redundant boxes.
[0027] Preferably, the high-frequency channel enhancement module includes:
[0028] Convolution kernel decomposition unit: configured to decompose the convolution kernel into low-frequency blocks W using wavelet transform. L With high frequency block W H ;
[0029] Attention computation unit: configured for W L and W H Calculate the channel attention weights A separately L and A H ;
[0030] Frequency fusion unit: configured to use W fused =α·W ' L +(1-α)·W ' H Dynamic fusion of high and low frequency blocks, W' L =A L⊙W L W' H =A H ⊙W H α∈[0,1] is a learnable fusion coefficient that is adaptively adjusted by the model through training;
[0031] Reparameterization unit: configured to convert the fused frequency block into a spatial domain convolution kernel and save it as a traditional convolution kernel.
[0032] Preferably, the integrated output module includes a feature fusion unit, a detection box optimization unit, and a result filtering unit. The result filtering unit filters invalid results by using two thresholds: face confidence score ≥ 0.8 and forgery probability score ≤ 0.3.
[0033] Thirdly, embodiments of the present invention provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any implementation of the first aspect.
[0034] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
[0035] Compared with the prior art, the beneficial results of the present invention are as follows:
[0036] (1) Significantly improved detection accuracy: The high-frequency channel enhancement module accurately captures high-frequency artifacts in deep fake images, and the CEIB network optimizes feature selection, thereby improving the detection accuracy of deep fake faces to over 92% and reducing the false negative rate to below 8%, which is a significant improvement over existing technologies such as AttentionFace.
[0037] (2) Lightweight and high efficiency: The main structure of alternating depthwise separable convolution and LA-MViT-Block is adopted, combined with the reparameterization strategy, which reduces the number of model parameters, improves inference speed, and achieves single-frame detection time ≤20ms, memory usage ≤6GB, and is suitable for edge deployment.
[0038] (3) Added a new function for pre-evaluation of forgery level: The forgery probability score is output by the FDE module with normalized 0-1, which fills the gap in the existing technology, supports the priority processing of high-risk samples, and improves the efficiency of the subsequent identification process;
[0039] (4) Strong generalization ability: Through causal enhancement feature guidance and multi-level quality assessment, it can adapt to deep fake images generated by various forgery methods. The detection accuracy of high-quality deep fake images is more than 30% higher than that of GAN-FaceDet. Attached Figure Description
[0040] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and, together with the description, serve to explain the principles of the invention. Other embodiments and many anticipated advantages of the embodiments will be readily recognized as they become better understood through reference to the following detailed description. Elements in the drawings are not necessarily to scale. The same reference numerals refer to corresponding similar parts.
[0041] Figure 1 This is a flowchart illustrating a face detection method supporting the identification of artificial intelligence-generated synthetic human images, as an embodiment of the present invention.
[0042] Figure 2 This is a schematic diagram of the overall structure of a face detection method supporting the identification of artificial intelligence-generated synthetic human images, according to an embodiment of the present invention.
[0043] Figure 3 This is a schematic flowchart of a face detection device supporting the identification of artificial intelligence-generated synthetic human images, according to an embodiment of the present invention.
[0044] Figure 4 This is a schematic diagram of the architecture of the high-frequency channel enhancement module in an embodiment of the present invention;
[0045] Figure 5 This is a schematic diagram of the architecture of the integrated output module in an embodiment of the present invention;
[0046] Figure 6 This is a schematic diagram of the structure of a computer device suitable for implementing electronic devices according to embodiments of the present invention. Detailed Implementation
[0047] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0048] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0049] Face detection is a key step in building a deep fake image detection model, but it is prone to false detections, false negatives, and inaccurate bounding box localization due to the inconsistency between the pixel distribution and texture features of deep fake images and natural images.
[0050] The existing DLFace proposed by Wang, X. et al. solves the trade-off between detection accuracy, speed and memory usage in low-resolution face detection. However, it mainly introduces a Lambda layer in the high-level backbone network to mine semantic and positional information to form richer feature representations, reduce the difficulty of model learning, reduce the number of parameters and enhance the accuracy of related scenarios. It cannot solve the problem of high-precision detection of unnatural faces in deepfake scenarios.
[0051] Ge,T. et al. proposed introducing an image quality factor into the loss function, arguing that the strategy of emphasizing misclassified samples should be adjusted based on image quality, that is, determining the relative importance of easy or difficult samples based on the image quality of the samples. While this method of adjusting the sample distribution simply through quality assessment has some effect, it ignores the problem of diverse forgery methods and the insufficient stability of deep fake face features compared to natural faces, and cannot effectively enhance the detection performance in relevant scenarios.
[0052] Wang, H. et al. proposed the MultiScale algorithm, which solves the problem of imbalance in multi-scale face detection in natural images by constructing a multi-scale feature pyramid and fusing face features at different resolutions. However, its feature fusion strategy does not optimize for the inconsistent performance of fake features at the same scale in deep fake images, resulting in large fluctuations in the detection accuracy of deep fake faces at multiple scales.
[0053] The GAN-FaceDet model proposed by Chen,Z.'s team attempts to use generative adversarial networks to learn the feature distribution of natural faces in order to distinguish fake faces. However, it only relies on the real and fake probability output by the GAN discriminator to assist in detection, without deeply exploring the fake features output by the intermediate layer of the discriminator. When the quality of the deep fake image generation is high and the real and fake probability is close to the threshold, the detection model is prone to false detection, and the detection accuracy for high-quality deep fake images is less than 60%.
[0054] The AttentionFace algorithm proposed by Zhao, L. et al. improves the efficiency of face detection in complex backgrounds by focusing on the face region and suppressing background interference through the spatial attention module. However, its attention weight allocation is based only on pixel grayscale differences and does not take into account the forgery traces such as "edge blurring" and "color overflow" that often appear at the junction of the background and face in deep fake images. This causes the attention module to easily include the fake area at the junction into the background suppression range, resulting in missed detection boxes. The false negative rate is 18% higher than that of natural image scenes.
[0055] This invention addresses the problems of decreased accuracy and low efficiency of lightweight face detection models in deep fake scenarios, lack of pre-evaluation strategies for the degree of forgery, insufficient knowledge of unnatural scenarios such as deep fakes, unreasonable attention to high and low frequency information during model training, insufficient learning of facial feature distribution, and inability to effectively guide the detection model to distinguish between natural noise and potential noise. It proposes a lightweight face detection algorithm based on adaptive convolution frequency adjustment, causal reinforcement information bottleneck, and pre-evaluation technology for the degree of forgery, thereby improving the algorithm's performance.
[0056] In a first aspect, embodiments of the present invention disclose a face detection method that supports the identification of artificial intelligence-generated synthetic human images, such as... Figure 1 As shown, the method includes the following steps:
[0057] S1. Model backbone construction steps: Construct a stacked structure of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Blocks. The LA-MViT-Blocks enhance local correlation by calculating the cosine similarity between each patch and its 3×3 neighboring patches. The first computational unit of the model backbone is a high-frequency enhanced convolution, and the feature extraction satisfies the formula F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3)), where k is the kernel size, F is the feature extraction, and DepthConv is the depthwise separable convolution.
[0058] Specifically, the patch similarity calculation for LA-MViT-Block in this step includes: for each patch P i Calculate its relationship with the neighboring patch P j Similarity: Among them, w i,j For patch P i With Domain Patch P j The similarity weight.
[0059] S2, High-frequency channel enhancement steps: Decompose the convolution kernel into low-frequency blocks and high-frequency blocks through wavelet transform, apply channel attention mechanism to calculate weights and dynamically weight and fuse them, and convert them into spatial domain convolution kernels through reparameterization;
[0060] Specifically, the convolution kernel decomposition satisfies: And after decomposition, it satisfies: Where W is the initial convolutional kernel weight, Wavelet low (·) and Wavelet high (·) denote the low-frequency and high-frequency decomposition operators of the wavelet transform, respectively; Wavelet -1 (·) represents the inverse wavelet transform. This indicates the combination relationship between low-frequency blocks and high-frequency blocks.
[0061] Channel attention weight calculation satisfies: Where GAP(·) represents global average pooling, σ is the activation function, and FC1 and FC2 are fully connected networks.
[0062] S3, CEIB network optimization steps: Insert causal enhancement variational information bottleneck during the training phase, compress the mutual information between input and features through KL divergence, maximize the mutual information between features and labels, and combine non-causal association filtering to optimize feature selection;
[0063] Specifically, the optimization loss of the CEIB network satisfies: Where KL(·‖·) is the KL divergence, p(T) is the standard Gaussian distribution, and β is a trainable parameter.
[0064] S4. Forgery Probability Pre-evaluation Steps: Based on feature stability evaluation, distilled annotation embedding, and L2 norm optimization, a normalized forgery probability score is calculated. The training of high-forgery-probability samples is then strengthened using a loss function.
[0065] Specifically, the calculation of the forgery probability score satisfies: in, S is the normalization function. SER (X) represents the feature stability score, S Distill (X) represents the distillation label score, S Norm (X) represents the L2 norm score.
[0066] The loss function is reinforced to satisfy: in, Based on the detection of loss, The sum of losses related to face detection. The score represents the probability of forgery, and λ is the coefficient of the loss term.
[0067] S5. Integration and Output Steps: Multi-source features are fused through 1×1 convolution, and the coordinates of the detection box are fine-tuned by combining the forgery probability score. After NMS suppresses redundant boxes, the output includes multi-dimensional results containing coordinates, face confidence, and forgery probability score.
[0068] Specifically, the overall architecture diagram of this invention is as follows: Figure 2 As shown. The specific steps are as follows:
[0069] Step 1: The main framework of the model, which is designed as a stacked backbone of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Block. The formula is shown below:
[0070] F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3))
[0071] Where k is the kernel size, F is the abbreviation for feature extraction unit, and DepthConv is depthwise separable convolution. The first computational unit of the model is the high-frequency enhanced convolution proposed in step 2.
[0072] Among them, LA-MViT-Block is a lightweight VIT structure. Its core design idea is as follows: First, when generating the patch sequence, the cosine similarity between each patch and its surrounding 3×3 neighboring patches is calculated, and this similarity is incorporated into the patch features as a weight to enhance local correlation. For each patch P... i Calculate its relationship with the neighboring patch P j Similarity:
[0073] Secondly, after normalizing the weights, they are fused with the patch features: Use the fused As input to the Transformer, note that Softmax is calculated on each set of weights as mentioned above. By associating weights locally, the feature differences between the fake region and the surrounding normal region can be amplified, prompting the computation unit to focus on the unique patterns of deep fake faces, such as unnatural edge transitions and texture anomalies.
[0074] Step 2: High-Frequency Channel Enhancement Module – A high-frequency channel enhancement strategy based on adaptive convolution frequency adjustment. After frequency-domaining the convolution kernels, an attention mechanism is used to change the ratio of high-frequency to low-frequency channels. This deliberately guides the backbone network to pay full attention to high-frequency artifacts in the deep-synthesized face, including abnormal edges and unstructured noise specific to the generated model. Its specific description is as follows:
[0075] I. Convolutional layers decompose the convolution kernel by using wavelet transform to process the kernel weights, initially separating them into low-frequency and high-frequency blocks. The formula is:
[0076] Let the initial convolution kernel weights be spatial domain matrices. (where k is the kernel size), it is decomposed into low-frequency and high-frequency blocks in the frequency domain using wavelet transform:
[0077]
[0078] Among them, Wavelet low (·) and Wavelet high (·) denote the low-frequency and high-frequency decomposition operators of the wavelet transform, respectively, which satisfy the following after decomposition:
[0079]
[0080] Among them, Wavelet -1 (·) represents the inverse wavelet transform. This indicates the combination relationship between low-frequency blocks and high-frequency blocks.
[0081] II. The attention layer introduces a channel-level attention mechanism, utilizing techniques such as global pooling to obtain the information representation of each channel, and then uses a fully connected network to calculate the weights of each channel. The formula is as follows:
[0082] For low-frequency block W L and high frequency block W H Channel-level attention is applied separately, with C being the number of both high-frequency and low-frequency channels. Global pooling is used to compress the spatial dimension, and channel statistics are extracted.
[0083]
[0084] GAP(·) represents global average pooling.
[0085] The channel weights are output through a two-layer fully connected network (containing an activation function σ, such as Sigmoid):
[0086]
[0087] Third, the frequency fusion layer designs a dynamic frequency block weighted fusion mechanism to fuse frequency blocks based on the above information. The formula is:
[0088] The frequency blocks are weighted by combining attention weights, and then fused using learnable coefficients α:
[0089] Channel-level element-wise multiplication
[0090] Where (·) represents channel-level element-wise multiplication.
[0091] Dynamic fusion is represented as W fused =α·W ' L +(1-α)·W ' H α∈[0,1] is a learnable fusion coefficient that is adaptively adjusted by the model through training.
[0092] Fourth, the transformation layer transforms the fused frequency blocks back into the spatial domain. During retraining, driven by the loss function, the neural network continuously strengthens its high-frequency perception ability when faced with deep pseudo-images, ultimately improving the accuracy of related detection tasks. The formula is:
[0093] W spatial =Wavelet -1 (W fused)
[0094] Wavelet -1 This is the inverse wavelet transform.
[0095] V. Reparameterization: By employing a reparameterization strategy, processed convolutional kernels can be directly saved in the traditional convolutional kernel form, thus avoiding impact on inference speed. The formula is:
[0096] W reparam =Reparam(W spatial )
[0097] Here, Reparam represents reparameterization transformation, which essentially embeds the "equivalent operation" of frequency domain processing into the convolution kernel weights without requiring additional computation.
[0098] Step 3: The CEIB network employs a feature-guided strategy (named CEIB) that enhances the causal information bottleneck. This strategy is inserted into the neural network during the training phase to maximize the mutual information between features and labels while minimizing the mutual information between input and features. This results in a loss function-driven information compression mode, leveraging the layer-by-layer feature extraction function. Then, combined with attention-aware regularization, this feature-guided technique introduces hypothetical analysis during model training, continuously guiding feature selection towards a direction more conducive to correct results through causal enhancement. The optimized loss for the variational information bottleneck is shown below:
[0099]
[0100] Wherein, KL(q(T|X)‖p(T)) represents the KL divergence measure, which measures the difference between q(T|X) and the prior distribution p(T), replacing the information entropy I(X;T); the second term The log-likelihood of Y is predicted by the decoder, replacing the core part of the information entropy I(T;Y). Here, p(T) is typically set to a standard Gaussian distribution. β is a trainable parameter that adaptively adjusts the weights of the two terms in the formula during training. The information entropy or lower bound of the preceding and following terms can be approximated using the KL divergence.
[0101] Furthermore, to monitor the causal transmission of feature selection in real time during training and to impose appropriate constraints, a non-causal association strategy is proposed to further filter out information useless for discrimination. Specifically, based on prior causal knowledge, T is forced to encode only information of C, ignoring X features that are not directly causally related to Y, such as unnatural textures or edges. Secondly, non-causal associations are filtered through simulated intervention to ensure that T only retains information that still affects Y under intervention. Finally, counterfactual loss is introduced, i.e., if non-causal features in X change, T should remain unchanged, constraining the invariance of T to non-causal features.
[0102] Step 4, Synthesize the Generation Quality Evaluation Network – On the model network framework formed in Steps 1-3, a multi-level linked forgery quality evaluation module is introduced. This module directly estimates the probability of facial region features deviating from the natural scene using a normalized quality score (named FDE). The lower the score, the higher the probability of forgery. This information can be used to strengthen gradients related to forged faces end-to-end during training. Specifically, a multi-level linked evaluation method is used to assess image quality. The formula is:
[0103]
[0104] Where X is the face image to be evaluated. To obtain the SER quality score, a lightweight face feature model is introduced, in which the stability of face features is evaluated by normalizing random perturbations of parameters. A distillation strategy is used to embed manually labeled face quality scores into the feature model; By optimizing the training loss function, the output distribution of the face feature model is improved, so that high-quality samples have a higher L2 norm and low-quality samples have a smaller L2 norm, thus achieving the third level of face quality estimation. This is the normalization function. The facial feature model freezes its parameters during training. After obtaining the score, its usage is as follows:
[0105]
[0106] in, This is the sum of losses related to face detection, while Let λ be the score for the likelihood of forgery and λ be the coefficient of the loss term. This method assigns greater weight to samples with a high likelihood of forgery during backpropagation.
[0107] Step 5: Integrate the output module. Building upon steps 1-4, this step achieves information connectivity and capability integration among components. Specifically, it utilizes a four-layer mechanism to integrate component information and capabilities, outputting high-precision positioning results. First, it employs multi-source feature fusion, namely 1×1 convolution to unify the backbone, high-frequency enhancement, and CEIB filtering of three types of feature channels, with dual attention weighting to highlight deep artifact features, outputting a discriminative enhanced feature map. Second, it optimizes the detection boxes for the model, namely, FPN generates initial boxes, combines FDE scores to fine-tune the coordinates of high-spoofing sample boxes, and improves NMS to suppress redundant boxes. Finally, it provides multi-dimensional output, where each detection box is bound to information such as coordinates, face confidence, and forgery probability score, and invalid results are filtered out using dual thresholds.
[0108] This invention innovatively proposes a lightweight face detection model for the detection of deepfake faces. Through steps such as model backbone structure design, frequency domain enhancement, feature compression, and quality assessment, the face detection algorithm enhances its ability to perceive non-natural facial features and improves the detection accuracy in this scenario.
[0109] In one specific embodiment, the implementation method is as follows:
[0110] 1. Experimental Environment Configuration
[0111] Hardware environment: CPU is Intel Core i9-12900K, GPU is NVIDIA RTX 3090 (24GB VRAM), and memory is 64GB DDR5;
[0112] Software environment: Operating system is Ubuntu 20.04, deep learning framework is PyTorch 1.12.1, CUDA version is 11.6, and programming language is Python 3.8.
[0113] 2. Dataset Selection and Preprocessing
[0114] Dataset: The dataset uses the publicly available deepfake datasets DFDC and FF++, as well as a self-made dataset, containing 100,000 deepfake images (covering various fakery methods such as GAN, StyleGAN, and DeepFake) and 100,000 natural human face images, with an image resolution of 640×480.
[0115] Preprocessing: All images are normalized (pixel values are mapped to [0,1]), randomly flipped, rotated (±10°) and other data augmentation operations are performed. The training set, validation set and test set are divided in an 8:1:1 ratio.
[0116] 3. Model parameter settings
[0117] Model backbone: The kernel size of the depthwise separable convolution is 3×3, the stride is 2; the patch size of LA-MViT-Block is 16×16, the number of attention heads is 8, and the hidden layer dimension is 512.
[0118] High-frequency channel enhancement module: The wavelet transform adopts Haar wavelet, the convolution kernel size k=3, the number of channels C=256, the initial value of the learnable coefficient α is 0.3, and the activation function σ adopts Sigmoid;
[0119] CEIB network: The prior distribution p(T) is a standard Gaussian distribution, the trainable parameter β is initially 0.1, and the KL divergence weight is 0.001;
[0120] FDE module: The parameter perturbation amplitude for feature stability assessment is ±0.01, the temperature coefficient for distillation labeling is 0.5, and the loss term coefficient λ = 0.8;
[0121] Training parameters: The optimizer used is AdamW, the initial learning rate is 1e-4, the weight decay is 1e-5, the batch size is 32, the number of training rounds is 100, and an early stopping strategy is adopted (training stops if the accuracy on the validation set does not improve for 5 consecutive rounds).
[0122] 4. Model Training and Testing Process
[0123] Training process: 1. Initialize model parameters; 2. Input training set images and extract features through the model backbone; 3. Enhance high-frequency artifact features through the high-frequency channel enhancement module; 4. Optimize feature selection through the CEIB network; 5. Calculate the forgery probability score by the FDE module; 6. Optimize the total loss function by combining the score and update the model parameters through backpropagation; 7. Iterate training until the stopping condition is met.
[0124] Test procedure: 1. Input test set images, preprocess them and then input them into the trained model; 2. The model outputs the detection box coordinates, face confidence score, and forgery probability score; 3. Filter invalid results through double thresholding to obtain the final detection result.
[0125] 5. Experimental Results and Analysis
[0126] Table 1
[0127] Comparison indicators This invention AttentionFace GAN-FaceDet MultiScale Deep Face Detection Accuracy 93.2% 82.0% 58.7% 76.3% False negative rate 7.5% 25.3% 41.2% 23.1% False positive rate 4.8% 12.6% 18.9% 10.5% Single-frame inference speed (ms) 18.3 35.7 42.1 31.4 Number of model parameters (M) 8.6 24.3 31.7 19.8 Video memory usage (GB) 5.2 12.8 15.3 10.7 Pre-assessment error of forgery level 3.2% - - -
[0128] Experimental results show that, as shown in Table 1, the present invention significantly outperforms existing technologies in core indicators such as accuracy, false negative rate, and false positive rate of deep fake face detection. It also has lightweight deployment capabilities and pre-assessment functions for the degree of forgery, fully meeting the practical application needs of AI-generated synthetic face identification.
[0129] Further reference Figure 3 As an implementation of the methods shown in the above figures, this application provides an embodiment of a face detection device that supports the identification of artificial intelligence-generated synthetic human images. This device embodiment is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0130] Secondly, embodiments of the present invention also disclose a face detection device that supports the identification of artificial intelligence-generated synthetic human images, such as... Figure 3 As shown, the device is used to implement the face detection method as described in any of the first aspects, including: a model backbone construction module 31, a high-frequency channel enhancement module 32, a CEIB network optimization module 33, a forgery degree pre-evaluation module 34, and an integrated output module 35.
[0131] In a specific embodiment, the model backbone construction module 31 is configured to construct a stacked structure of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Blocks. The LA-MViT-Blocks enhance local correlation by calculating the cosine similarity between each patch and its 3×3 neighboring patches to fuse features. The first computational unit of the model backbone is a high-frequency enhanced convolution, and the feature extraction satisfies the formula F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3)), where k is the convolution kernel size, F is the feature extraction, and DepthConv is the depthwise separable convolution. The high-frequency channel enhancement module 32 is configured to decompose the convolution kernel into low-frequency and high-frequency blocks through wavelet transform, apply a channel attention mechanism to calculate weights and dynamically weight and fuse them, and convert them into spatial domain convolution kernels after reparameterization.
[0132] CEIB Network Optimization Module 33: Configured to insert causal enhancement variational information bottleneck during the training phase, compress the mutual information between input and features through KL divergence, maximize the mutual information between features and labels, and optimize feature selection by combining non-causal correlation filtering; Forgery Probability Pre-evaluation Module 34: Configured to calculate the normalized forgery probability score based on feature stability evaluation, distillation annotation embedding, and L2 norm optimization, and strengthen the training of high forgery probability samples through loss function; and Integrated Output Module 35: Configured to fuse multi-source features through 1×1 convolution, fine-tune the detection box coordinates by combining forgery probability score, and output a multi-dimensional result including coordinates, face confidence, and forgery probability score after NMS suppression of redundant boxes.
[0133] Preferred, such as Figure 4 As shown, the high-frequency channel enhancement module 32 includes:
[0134] Convolution kernel decomposition unit 321: configured to decompose the convolution kernel into low-frequency blocks W using wavelet transform. L With high frequency block W H ;
[0135] Attention computing unit 322: configured to perform attention calculations on W L and W H Calculate the channel attention weights A separately L and A H ;
[0136] Frequency fusion unit 323: configured to use W fused =α·W ' L +(1-α)·W ' H Dynamic fusion of high and low frequency blocks, W' L =A L ⊙W L W'H =A H ⊙W H α∈[0,1] is a learnable fusion coefficient that is adaptively adjusted by the model through training;
[0137] Reparameterization unit 324: configured to convert the fused frequency block into a spatial domain convolution kernel and save it as a traditional convolution kernel.
[0138] Preferred, such as Figure 5 As shown, the integrated output module 35 includes a feature fusion unit 351, a detection box optimization unit 352, and a result filtering unit 353. The result filtering unit 353 filters invalid results through dual thresholds (face confidence ≥ 0.8, forgery probability score ≤ 0.3).
[0139] The functions and methods of the above modules correspond to each other, and will not be repeated here.
[0140] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer device 600 suitable for implementing an electronic device according to embodiments of the present invention. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0141] like Figure 6 As shown, the computer device 600 includes a central processing unit (CPU) 601 and a graphics processing unit (GPU) 602, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 603 or programs loaded from storage section 609 into random access memory (RAM) 604. The RAM 604 also stores various programs and data required for the operation of the device 600. The CPU 601, GPU 602, ROM 603, and RAM 604 are interconnected via a bus 605. An input / output (I / O) interface 606 is also connected to the bus 605.
[0142] The following components are connected to I / O interface 606: an input section 607 including a keyboard, mouse, etc.; an output section 608 including an LCD, speakers, etc.; a storage section 609 including a hard disk, etc.; and a communication section 610 including a network interface card, such as a LAN card or modem. The communication section 610 performs communication processing via a network such as the Internet. A drive 611 may also be connected to I / O interface 606 as needed. A removable medium 612, such as a hard disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 611 as needed so that computer programs read from it can be installed into storage section 609 as needed.
[0143] In particular, according to embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 610, and / or installed from removable medium 612. When the computer program is executed by central processing unit (CPU) 601 and graphics processing unit (GPU) 602, the functions defined in the methods of this invention are performed.
[0144] It should be noted that the computer-readable medium described in this invention can be a computer-readable signal medium, a computer-readable medium, or any combination thereof. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or any combination thereof. More specific examples of a computer-readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution apparatus, device, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than a computer-readable medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution device, apparatus, or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0145] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using dedicated hardware-based devices that perform the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0147] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor.
[0148] In another aspect, the present invention also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods and steps described in the first aspect of the embodiments of the present invention.
[0149] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. A face detection method supporting artificial intelligence generated synthetic portrait discrimination, characterized by, The method includes the following steps: S1. Model backbone construction steps: Construct a stacked structure of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Blocks. The LA-MViT-Blocks enhance local correlation by calculating the cosine similarity between each patch and its 3×3 neighboring patches. The first computational unit of the model backbone is a high-frequency enhanced convolution, and the feature extraction satisfies the formula F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3)), where k is the kernel size, F is the feature extraction, and DepthConv is the depthwise separable convolution. S2, High-frequency channel enhancement steps: Decompose the convolution kernel into low-frequency blocks and high-frequency blocks through wavelet transform, apply channel attention mechanism to calculate weights and dynamically weight and fuse them, and convert them into spatial domain convolution kernels through reparameterization; S3, CEIB network optimization steps: Insert causal enhancement variational information bottleneck during the training phase, compress the mutual information between input and features through KL divergence, maximize the mutual information between features and labels, and combine non-causal association filtering to optimize feature selection; S4. Forgery Probability Pre-evaluation Steps: Based on feature stability evaluation, distillation annotation embedding, and L2 norm optimization, normalized forgery probability scores are calculated, and training of high-forgery probability samples is enhanced through loss functions; as well as S5. Integration and Output Steps: Multi-source features are fused through 1×1 convolution, and the coordinates of the detection box are fine-tuned by combining the forgery probability score. After NMS suppresses redundant boxes, the output includes multi-dimensional results containing coordinates, face confidence, and forgery probability score.
2. The face detection method of claim 1, wherein, In step S1, the patch similarity calculation of the LA-MViT-Block includes: for each patch P i , calculating its similarity with the neighborhood patch P j : where w i,j is the similarity weight of the patch P i and the field patch P j .
3. The face detection method of claim 1, wherein, In step S2, the convolution kernel decomposition satisfies: And after decomposition, it satisfies: Where W is the initial convolutional kernel weight, Wavelet low (·) and Wavelet high (·) denote the low-frequency and high-frequency decomposition operators of the wavelet transform, respectively; Wavelet -1 (·) represents the inverse wavelet transform. This indicates the combination relationship between low-frequency blocks and high-frequency blocks.
4. The face detection method of claim 1, wherein, In step S2, the channel attention weight calculation satisfies: Where GAP(·) represents global average pooling, σ is the activation function, and FC1 and FC2 are fully connected networks.
5. The face detection method according to claim 1, characterized in that, In step S3, the optimization loss of the CEIB network satisfies: Where KL(·‖·) is the KL divergence, p(T) is the standard Gaussian distribution, and β is a trainable parameter.
6. The face detection method of claim 1, wherein, In step S4, the forgery likelihood score calculation satisfies: wherein, is a normalization function, S SER (X) is a feature stability score, S Distill (X) is a distillation label score, S Norm (X) is an L2 norm score.
7. The face detection method of claim 1, wherein, In step S4, the loss function reinforces satisfaction of: wherein, is a base detection loss, is a sum of face detection related losses, is a fake likelihood score, and λ is a loss term coefficient. 8.A face detection device supporting artificial intelligence generation of a synthetic portrait discriminator, characterized by, The device is used to implement the face detection method as described in any one of claims 1-7, comprising: The model backbone construction module is configured to construct a stacked structure of feature extraction units consisting of alternating depthwise separable convolutions and LA-MViT-Blocks. The LA-MViT-Blocks enhance local correlation by calculating the cosine similarity between each patch and its 3×3 neighboring patches. The first computational unit of the model backbone is a high-frequency enhanced convolution, and the feature extraction satisfies the formula F2(X)=LA-MViT-Block(DepthConv(F1(X),k=3)), where k is the kernel size, F is the feature extraction, and DepthConv is the depthwise separable convolution. High-frequency channel enhancement module: configured to decompose the convolution kernel into low-frequency and high-frequency blocks through wavelet transform, apply channel attention mechanism to calculate weights and dynamically weight and fuse them, and convert them into spatial domain convolution kernels after reparameterization; CEIB network optimization module: configured to insert causal enhancement variational information bottleneck during the training phase, compress the mutual information between input and features through KL divergence, maximize the mutual information between features and labels, and optimize feature selection by combining non-causal correlation filtering. Forgery probability pre-assessment module: configured to calculate normalized forgery probability scores based on feature stability assessment, distilled annotation embedding, and L2 norm optimization, and to enhance the training of high-forgery-probability samples through a loss function; and Integrated output module: Configured to fuse multi-source features through 1×1 convolution, fine-tune the detection box coordinates by combining the forgery probability score, and output multi-dimensional results including coordinates, face confidence, and forgery probability score after NMS to suppress redundant boxes.
9. The face detection apparatus according to claim 8, characterized in that, The high-frequency channel enhancement module includes: Convolution kernel decomposition unit: configured to decompose the convolution kernel into low-frequency blocks W using wavelet transform. L With high frequency block W H ; Attention computation unit: configured for W L and W H Calculate the channel attention weights A separately L and A H ; Frequency fusion unit: configured to use W fused =α·W' L +(1-α)·W' H Dynamic fusion of high and low frequency blocks, W' L =A L ⊙W L W' H =A H ⊙W H α∈[0,1] is a learnable fusion coefficient that is adaptively adjusted by the model through training; Reparameterization unit: configured to convert the fused frequency block into a spatial domain convolution kernel and save it as a traditional convolution kernel.
10. The face detection apparatus according to claim 8, wherein The integrated output module includes a feature fusion unit, a detection box optimization unit, and a result filtering unit. The result filtering unit filters invalid results by using two thresholds: face confidence score ≥ 0.8 and forgery probability score ≤ 0.
3.
11. An electronic device, comprising: One or more processors; Storage device 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 method as described in any one of claims 1 to 7.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.