An unsupervised face forgery detection method and system based on frequency domain complementation

Through the combination of frequency domain enhanced variational autoencoder and unsupervised detection network, the problem of low face forgery detection accuracy of existing methods under diversified forgery technologies is solved, and high-precision and robust forgery trace detection is achieved.

CN120183052BActive Publication Date: 2025-08-29GOLDEN TIMES CULTURE COMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510653184.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-29
Estimated Expiration
2045-05-21

AI Technical Summary

Technical Problem

When faced with diverse and complex forgery techniques, it is difficult to fully capture the details and global information in the image, resulting in low accuracy of forgery trace recognition, and existing models are prone to training deviations. Especially when images generated by different forgery techniques, it is difficult to maintain stable detection performance.

Method used

Unsupervised face forgery detection method based on frequency domain supplementation is adopted, multi-level encoding features are extracted through frequency domain enhancement variational autoencoder, feature reconstruction is carried out in combination with dynamic spectrum loss mechanism, global and local representations are generated, and multi-scale feature fusion is performed through unsupervised detection network, and the anomaly score map is finally calculated for pixel-level judgment.

Benefits of technology

Effectively detecting forged traces in face images under unsupervised conditions improves the accuracy and robustness of detection, can identify complex forged images, and has high accuracy and wide application prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120183052B_ABST
    Figure CN120183052B_ABST
Patent Text Reader

Abstract

The present application relates to an unsupervised face forgery detection method and system based on frequency domain supplementation, which belongs to the field of computer vision technology. The detection method includes: inputting the face image to be detected into a benchmark network based on ResNet, extracting multi-level coding features through the encoder of the frequency domain enhanced variational autoencoder; performing frequency domain enhancement processing on the multi-level coding features, generating high-frequency enhanced features and inputting them into the decoder of the frequency domain enhanced variational autoencoder, combining the dynamic spectrum loss mechanism to perform feature reconstruction, and generating reconstructed frequency domain supplementary features; performing global pooling and local pooling on the multi-level coding features, generating global representation and local representation and connecting them along the channel axis to generate fused multi-scale features; calculating an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features; and determining the image authenticity result of the face image to be detected based on the pixel-level score of the anomaly score map. The present application can improve the accuracy of face forgery detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to an unsupervised face forgery detection method and system based on frequency domain complementation. Background Art

[0002] With the continuous development of deepfake technology and the increasing quality of fake images and videos, facial forgery detection technology faces increasing challenges. Face forgery detection technology aims to identify and detect whether facial images have been tampered with or forged, and has important applications in digital image processing, social security, and legal evidence. In recent years, with the rise of technologies such as generative adversarial networks (GANs) and deepfake videos, the authenticity of forged images has approached or even exceeded that of real images, posing a serious threat to privacy protection, trust mechanisms, and social security. Therefore, accurate and efficient forgery detection technology is crucial to maintaining social order and protecting personal privacy.

[0003] Common face forgery detection methods can be roughly divided into three categories: detection methods based on image block features, detection methods based on deep learning, and detection methods based on frequency domain feature enhancement. Among them, detection methods based on image block features primarily extract local features from images, analyzing and comparing image details to detect forgery traces. However, due to the continuous advancement of forgery technology, traditional image block-based feature extraction methods often lack robustness and adaptability, making them difficult to cope with complex forgery methods. Detection methods based on deep learning can improve forgery detection performance to a certain extent by training deep neural network (DNN) models to automatically learn complex image features. However, these methods typically require large amounts of labeled data for training and are computationally expensive, making them unsuitable for real-time applications. In recent years, detection methods based on frequency domain feature enhancement have gradually gained attention. By enhancing the high-frequency information of the image and suppressing noise in forged images, they can effectively improve detection accuracy and generalization ability.

[0004] Currently, most common detection methods rely on the extraction and comparison of local features. However, when faced with diverse and complex forgery techniques, these methods often fail to fully capture the details and global information in the image, resulting in low accuracy in identifying forgery traces. In particular, subtle local forgery traces in forged images are often overlooked by traditional methods, or the fusion of local and global features presents significant difficulties, making effective simultaneous modeling impossible. Furthermore, due to the diversity of forged images and the lack of annotated data, existing models are prone to training bias. This makes it difficult to maintain stable detection performance, especially when faced with images generated by different forgery techniques, reducing the accuracy of forgery detection. Summary of the Invention

[0005] In order to improve the accuracy of face forgery detection, the present application provides an unsupervised face forgery detection method and system based on frequency domain complementation.

[0006] In a first aspect, the present application provides an unsupervised face forgery detection method based on frequency domain supplementation, which adopts the following technical solutions:

[0007] An unsupervised face forgery detection method based on frequency domain complementation, the detection method comprising:

[0008] The face image to be detected is input into the baseline network based on ResNet, and the multi-level coding features are extracted through the encoder of the frequency domain enhanced variational autoencoder;

[0009] Performing frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhancement features;

[0010] Inputting the high-frequency enhancement features into the decoder of the frequency-domain enhanced variational autoencoder, performing feature reconstruction in combination with a dynamic spectrum loss mechanism, and generating reconstructed frequency-domain supplementary features;

[0011] Performing global pooling and local pooling on the multi-level encoding features through an unsupervised detection network to generate a global representation and a local representation, and connecting the global representation and the local representation along a channel axis to generate a fused multi-scale feature;

[0012] Calculating an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features;

[0013] The image authenticity result of the face image to be detected is determined according to the pixel-level scores of the abnormal score map.

[0014] By adopting the above technical solution, which introduces a frequency-domain enhanced variational autoencoder, an unsupervised detection network, and frequency-domain supplementary features, and comprehensively utilizes global and local image features, it can effectively detect forgeries in facial images under unsupervised conditions. Frequency-domain enhancement enhances image detail, multi-scale feature fusion enhances the ability to identify forged images, and finally, pixel-level judgment is made through anomaly score maps, ensuring high detection accuracy and robustness. This technical solution can effectively identify complex forged images and has broad application prospects.

[0015] Optionally, the step of performing frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhancement features includes:

[0016] Performing discrete cosine transform on each layer of coding features of the multi-level coding features to convert them into frequency domain features;

[0017] Performing low-pass filtering and weighting on the low-frequency components of the frequency domain features, and performing adaptive weight allocation on the high-frequency components of the frequency domain features;

[0018] The weighted frequency domain features are converted to the spatial domain through inverse discrete cosine transform to obtain high-frequency enhanced features.

[0019] By employing this technical solution, image features are converted from the spatial domain to the frequency domain. Low-pass filtering and adaptive weight assignment are then used to emphasize high-frequency details, thereby enhancing the expressiveness of forgery traces. Finally, the enhanced frequency domain features are converted back to the spatial domain using an inverse discrete cosine transform (IDCT), generating high-frequency enhanced features. This process not only enhances image detail, especially when forgery traces are subtle, but also makes subtle changes in the forged image more pronounced through high-frequency enhancement, providing a more reliable basis for subsequent forgery detection.

[0020] Optionally, the step of constructing the frequency domain enhanced variational autoencoder includes:

[0021] Input the input feature x into the encoder E of the pre-built variational autoencoder for convolution sampling and mapping to the latent space z;

[0022] Quantize the features in the latent space z and generate the quantized latent embedding using formula (1)

[0023]

[0024] Among them, the embedding space C = {c1,c2,…,c|C|} is a preset discrete vector set, z ij is the jth feature of the i-th layer in the latent space z, c k represents the nearest vector in the embedding space;

[0025] Embedding the quantized potential Input to the decoder of the variational autoencoder G and reconstruct layer by layer to generate a preliminary reconstructed image The calculation process is:

[0026]

[0027] In the above formula (2), E i represents the i-th layer of the encoder, a i represents the features before the activation of the encoder layer i, b i =F i (a i ) represents the frequency supplementary feature of the i-th layer, F i Used to extract features a before activation from the encoder i The rich frequency features learned in the above formula (3), G i represents the corresponding function of the decoder layer i, represents the output features of the decoder;

[0028] The pre-activation feature a of the encoder i and the decoder output features Perform frequency domain processing to generate frequency supplementary features b i =F i (a i );

[0029] Supplement the frequency feature b i and the decoder output feature c i Perform discrete Fourier transform to calculate the focus frequency loss FFL and dynamic spectrum loss SL. The specific calculation formula is:

[0030]

[0031] In the above formula (4), e and i represent the Euler number and imaginary unit respectively, M×N is the spatial resolution of the feature map, f(x,y) is the value at (x,y) of each feature map, and F(u,v) is the corresponding value at the (u,v) coordinate on the spectrum; in the above formula (5), represents the weight applied to each frequency; Represents the main error function based on the frequency domain; In the above formula (6), K i (μ,σ) represents the Gaussian kernel function, μ is the mean, σ i is the variance, * represents the convolution operation, and is a weighted feature;

[0032] Combining the focus frequency loss FFL, dynamic spectrum loss SL, pixel-level reconstruction loss and perceptual loss, the total reconstruction loss L is calculated rec , the specific calculation formula is:

[0033]

[0034] In the above formula (8), α and β are hyperparameters, is the L1 norm pixel-level reconstruction loss, It is a loss of perception;

[0035] Based on the total reconstruction loss L rec Optimize the model parameters to obtain the trained frequency domain enhanced variational autoencoder.

[0036] By adopting the above technical solutions and introducing optimization mechanisms such as frequency domain processing and focal frequency loss (FFL) and dynamic spectrum loss (SL), the reconstruction quality of the variational autoencoder (VAE) is effectively improved. By performing frequency domain enhancement on the features of the encoder and decoder, not only the traditional pixel-level reconstruction error is taken into account, but also the error constraints at the frequency level are introduced, which enhances the model's ability to learn the frequency domain features of the image. The combination of quantized latent embedding and frequency domain features ensures the preservation of image details and reconstruction accuracy. At the same time, the use of focal frequency loss and dynamic spectrum loss effectively reduces the reconstruction errors of low-frequency and high-frequency parts. Ultimately, by comprehensively optimizing the total reconstruction loss, higher quality and more realistic image reconstruction results can be obtained, which improves the expressiveness and reconstruction effect of the model, especially in terms of high-frequency details and visual perception.

[0037] Optionally, performing global pooling and local pooling on the multi-level coding features through an unsupervised detection network to generate a global representation and a local representation, and connecting the global representation and the local representation along the channel axis to generate a calculation formula for fusion multi-scale features includes:

[0038] Perform global average pooling on the input feature x to generate a global representation f G (x) is:

[0039] f G (x) = Pooling(x; 1 × 1) (9)

[0040] In the above formula (9), Pooling represents the global pooling operation;

[0041] Divide the input feature x into q×q regions, perform local average pooling on each region, and generate a local representation f L (x) is:

[0042] f L (x) = Pooling(x;q×q) (10)

[0043] In the above formula (10), Pooling represents the local pooling operation;

[0044] The global representation f G (x) and the local representation f L (x) is connected in series along the channel axis and input into the convolutional network ψ(·) to obtain the fused multi-scale feature f n (x) is:

[0045] f n (x)=ψ(concat(f L (x),f G (x))) (11)

[0046] In the above formula (11), fn (x) is the fusion of multi-scale features, ψ(·) is the convolutional network, concat(f L (x),f G (x)) represents the concatenation of the global representation and the local representation along the channel axis.

[0047] By adopting the above technical solution, the input features are globally and locally pooled based on the unsupervised detection network, and the global and local representations are combined to generate fused multi-scale features. Global average pooling retains the overall information of the input features, while local average pooling captures local details. By concatenating the global and local representations along the channel axis, it is possible to effectively combine global and local information and fully express multi-scale features. This method improves the network's ability to perceive information at different scales, thereby enhancing the network's feature extraction and discrimination capabilities. In particular, it can significantly improve the model's expressiveness and detection accuracy when dealing with tasks with complex details and multi-level structures.

[0048] Optionally, the step of calculating an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features includes:

[0049] Calculate the fused multi-scale feature f n (x) and the mean square error and cosine similarity of the reconstructed frequency domain supplementary features to obtain the pixel similarity S h,w for:

[0050]

[0051] In the above formula (12), h and w represent the coordinate index of the spatial feature, is the indicator function, mse(·) and cosim(·) are mean square error and cosine similarity respectively, γ1 and γ2 are hyperparameters, and k represents the threshold that determines the similarity measure MSE;

[0052] According to the pixel similarity S h,w Get the reconstructed features for:

[0053]

[0054] The mean square error loss is calculated based on the input feature x and the reconstructed feature:

[0055]

[0056] In the above formula (14), C, H, and W are the number of channels, height, and width of the feature map, respectively, and ||·||2 represents the Euclidean distance;

[0057] According to the reconstruction features Get the abnormal score graph d. The specific formula includes:

[0058]

[0059] In the above formula (15), h and w represent the position of each pixel.

[0060] By adopting the above technical solution, pixel similarity is calculated and anomaly score maps are generated based on the fusion of multi-scale features and reconstructed frequency domain complementary features, thereby effectively detecting abnormal areas. First, by calculating the mean square error and cosine similarity of the fused features and the frequency domain complementary features, the similarity between pixels can be accurately measured, and the reconstructed features can be obtained. This process can capture the differences between the input features and the reconstructed features, and use these differences to calculate the mean square error loss, thereby generating an anomaly score map for each pixel position. This technical solution can accurately identify abnormal areas in the image. By combining multi-scale features and frequency domain information, anomaly detection is made more precise and robust, and is particularly suitable for processing images with complex structures and noise.

[0061] Optionally, the step of determining the authenticity of the face image to be detected according to the pixel-level scores of the abnormality score map includes:

[0062] Interpolating the anomaly score map to the original size of the input image to be detected;

[0063] Performing global maximum pooling on the interpolated anomaly score map, and extracting the maximum anomaly score in the anomaly score map as the final anomaly score;

[0064] The authenticity of the face image to be detected is determined by comparing the final anomaly score with a preset threshold.

[0065] By employing this technical solution, the anomaly score map is aligned with the input image, enabling accurate pixel-level comparison of anomaly scores. Global max pooling is then used to extract the most significant forgery traces within the image, ensuring accurate forgery detection. Finally, the authenticity of the image is determined by comparing it with a preset threshold. By combining the anomaly score map, pooling, and thresholding, this technical solution can accurately and effectively detect forgeries in images, achieving high detection accuracy and robustness.

[0066] Optionally, the detection method further includes:

[0067] The total reconstruction loss L rec and mean square error loss L mse Perform weighted combination and get the total objective function as L total :

[0068] L total =λ1L rec +λ2Lmse ; (16)

[0069] In the above formula (16), λ1 and λ2 are preset hyperparameters, which respectively control the impact of the total reconstruction loss and the mean square error loss on the overall objective function.

[0070] By employing these technical solutions, the weighted combination of total reconstruction loss and mean squared error loss enables this method to take into account both global and local features in forgery detection, more accurately capturing the differences between forged and real images. This combination allows the detection method to achieve finer distinctions between different types of forged images, ensuring more accurate detection results.

[0071] In a second aspect, the present application provides an unsupervised face forgery detection system based on frequency domain supplementation, which adopts the following technical solutions:

[0072] An unsupervised face forgery detection system based on frequency domain complementation, the detection system comprising:

[0073] The feature extraction module is used to input the face image to be detected into the ResNet-based baseline network and extract multi-level coding features through the encoder of the frequency domain enhanced variational autoencoder;

[0074] A frequency domain enhancement module, configured to perform frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhanced features;

[0075] A reconstruction module, configured to input the high-frequency enhancement features into the decoder of the frequency-domain enhanced variational autoencoder, perform feature reconstruction in combination with a dynamic spectrum loss mechanism, and generate reconstructed frequency-domain supplementary features;

[0076] A multi-scale feature fusion module is used to perform global pooling and local pooling on the multi-level coding features through an unsupervised detection network to generate global representation and local representation, and connect the global representation and local representation along the channel axis to generate fused multi-scale features;

[0077] An anomaly score map calculation module, used to calculate an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features;

[0078] The authenticity verification module is used to determine the authenticity of the face image to be detected based on the pixel-level scores of the abnormal score map.

[0079] In a third aspect, the present application provides a computer device that adopts the following technical solution:

[0080] A computer device comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to the first aspect.

[0081] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0082] A computer-readable storage medium stores a computer program capable of being loaded by a processor and executing any one of the methods in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] Figure 1 This is a first flow chart of an unsupervised face forgery detection method according to one embodiment of the present application.

[0084] Figure 2 This is a schematic diagram of the overall network model structure of the unsupervised face forgery detection method of one of the embodiments of the present application.

[0085] Figure 3 This is a second flow chart of the unsupervised face forgery detection method according to one embodiment of the present application.

[0086] Figure 4 This is a third flow chart of the unsupervised face forgery detection method according to one embodiment of the present application.

[0087] Figure 5 This is a schematic diagram of a frequency domain supplementation module according to one embodiment of the present application.

[0088] Figure 6 This is a schematic diagram of dynamic frequency domain loss according to one embodiment of the present application.

[0089] Figure 7 This is a fourth flow chart of the unsupervised face forgery detection method according to one embodiment of the present application.

[0090] Figure 8 This is a fifth flow chart of the unsupervised face forgery detection method according to one of the embodiments of the present application.

[0091] Figure 9 This is the sixth flow chart of the unsupervised face forgery detection method according to one embodiment of the present application. DETAILED DESCRIPTION

[0092] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-9 It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0093] The embodiment of the present application discloses an unsupervised face forgery detection method based on frequency domain supplementation.

[0094] Reference Figure 1、 Figure 2 , an unsupervised face forgery detection method based on frequency domain complementation, the detection method includes:

[0095] Step S101: input the face image to be detected into a ResNet-based baseline network, and extract multi-level coding features through the encoder of the frequency domain enhanced variational autoencoder;

[0096] ResNet (residual network) is a deep convolutional neural network structure that effectively alleviates the vanishing gradient problem in deep networks by introducing residual connections. It can retain information in deeper networks and thus extract high-level abstract features. The input face image to be detected can be passed through the ResNet network to extract global and local feature information.

[0097] In some embodiments, a variational autoencoder (VAE) is a generative model that compresses image data into a distribution in a latent space through an encoder and then recovers the original data through a decoder. A frequency-augmented variational autoencoder (FA-VAE) converts image features into the frequency domain, capturing more detailed frequency information. This is crucial for forgery detection, especially the high-frequency variations often seen in facial forgeries.

[0098] For example, assuming the input image is a standard face image, after extraction by the ResNet network, the image's features are encoded into a low-dimensional latent space, which includes abstract representations of various hierarchical features of the face, such as the eyes, nose, and mouth. The multi-level features extracted by ResNet can effectively capture both global and local information of the face image, while the frequency-domain enhanced variational autoencoder enhances the high-frequency details of the image by extracting multi-level encoding features (F1, F2, F3), which can improve the detection of forgery traces.

[0099] Step S102, performing frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhanced features;

[0100] Frequency domain enhancement extracts high-frequency information by transforming image features into the frequency domain (e.g., discrete Fourier transform, discrete cosine transform, etc.). Since artifacts in images often manifest in subtle details (such as subtle changes in the image and unusual textures), frequency domain enhancement can extract these details.

[0101] For example, after frequency domain enhancement processing is performed on the input image, high-frequency details (such as texture, noise, etc.) in the image will be emphasized, which helps to highlight the forgery traces and makes these details more noticeable for subsequent forgery detection.

[0102] Step S103: input the high-frequency enhancement features into the decoder of the frequency-domain enhancement variational autoencoder, perform feature reconstruction in combination with the dynamic spectrum loss mechanism, and generate reconstructed frequency-domain supplementary features;

[0103] The decoder of the frequency-domain enhanced variational autoencoder converts high-frequency enhanced features back into the image space (or latent space), restoring image detail. Combined with a dynamic spectrum loss mechanism, the decoder prioritizes the high-frequency components of the image during reconstruction, resulting in more accurate reconstruction of the forged image's features.

[0104] Specifically, the decoder converts the frequency domain enhanced features into a reconstructed version of the image, in which details (such as forgery traces) are clearer, and at the same time optimizes the reconstruction process through a spectral loss mechanism, making the difference in details between the reconstructed image and the real image more significant.

[0105] Step S104: performing global pooling and local pooling on the multi-level coding features through an unsupervised detection network to generate a global representation and a local representation, and then connecting the global representation and the local representation along the channel axis to generate a fused multi-scale feature;

[0106] Global pooling extracts overall image information, while local pooling extracts local features. Combining these two operations allows for simultaneous global and local analysis of facial images, enhancing the comprehensiveness of detection. For example, global pooling yields a feature representation of the entire image (such as the general outline of a face), while local pooling captures detailed information (such as the specific structure of the eyes and mouth).

[0107] Furthermore, the global and local representations are concatenated along the channel axis to form a comprehensive feature map. These fused multi-scale features capture image details from multiple angles. After processing through a convolutional network, richer features are extracted for forgery detection.

[0108] For example, assuming that the global representation contains the basic outline of the face, and the local representation captures detailed features such as the eyes and nose, after further processing by the convolutional network, a multi-scale feature map that integrates global and local information can be obtained.

[0109] Step S105, calculating an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features;

[0110] Among them, the fused multi-scale features are combined with the frequency domain complementary features, and the difference between the two is calculated to generate an abnormal score map. The score map can highlight the abnormal areas in the image and indicate possible forged parts.

[0111] For example, by calculating the difference between the two features (eg, reconstruction error), a score map is generated, where high-scoring regions may represent forged image parts.

[0112] Step S106: determining the authenticity of the face image to be detected based on the pixel-level scores of the abnormality score map.

[0113] The pixel-level scores in the anomaly score map are used to determine which areas may contain traces of forgery. A threshold is set to determine whether an image is forged. Typically, if the scores of certain areas in the anomaly score map exceed the predetermined threshold, the area is considered to be forged, and the entire image is ultimately judged to be forged.

[0114] The above implementation introduces a frequency-domain enhanced variational autoencoder, an unsupervised detection network, and frequency-domain supplementary features. By comprehensively leveraging global and local image features, this approach effectively detects forgeries in facial images under unsupervised conditions. Frequency-domain enhancement enhances image detail, while multi-scale feature fusion enhances the ability to identify forged images. Finally, pixel-level judgment is performed using anomaly score maps, ensuring high-precision and robust detection. This technical solution is effective in identifying complex forged images and has broad application prospects.

[0115] Reference Figure 2 As shown, an image processing model based on an encoder-decoder architecture of an embodiment of the present application is shown. The input image is first subjected to feature extraction by an encoder (E), wherein image features are extracted by multiple encoding modules (such as E1, E2, E3), and feature representations a1, a2, and a3 are generated. These features are processed by a DSL (feature learning module) to generate more refined features c1, c2, and c3. The image is then reconstructed by a decoder (G) to generate an image output. The model also includes local and global information processing, using a convolutional neural network (CNN) to perform further feature learning and visual generation on the input image, and finally outputs an image. The model encodes, processes, and reconstructs the input image through an encoder-decoder architecture and a deep learning strategy, aiming to accurately restore or forge the image.

[0116] Reference Figure 3 As an implementation of step S102, the step of performing frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhanced features includes:

[0117] Step S201, performing discrete cosine transform on each layer of the multi-level coding features to convert them into frequency domain features;

[0118] Deep neural networks (such as ResNet) are used to extract multi-level encoding features from images. These features represent different levels of image information, from low-level edges and corners to high-level object recognition information (such as the nose and eyes of a face). Applying discrete cosine transforms (DCTs) to these features effectively converts the image from the spatial domain to the frequency domain, allowing analysis of the frequency domain representation of each layer of image features.

[0119] Specifically, the discrete cosine transform (DCT) is a commonly used frequency domain transformation method that helps extract the frequency components of an image by converting the spatial domain (pixel values ​​in the original image) into the frequency domain. The frequency domain representation can reveal both high-frequency and low-frequency information in an image. High-frequency components typically represent image details (such as texture and noise), while low-frequency components represent the overall structure of the image (such as contours and smooth areas).

[0120] For example, let's assume the input image is a facial image that shows signs of forgery. After processing it through the ResNet network, the resulting encoded features contain information at different levels, including details and structure. By performing a DCT transform on the encoded features at each layer, we can obtain the corresponding frequency domain features, which facilitate the subsequent frequency domain analysis.

[0121] Step S202, performing low-pass filtering and weighting on the low-frequency components of the frequency domain features, and performing adaptive weight allocation on the high-frequency components of the frequency domain features;

[0122] Low-pass filters allow low-frequency components to pass through while suppressing high-frequency components. In image processing, low-frequency components often represent smooth areas or large-scale structures in an image, such as the outlines of a person or facial contours. By weighting these low-pass filters, the expressiveness of these low-frequency components can be enhanced, making the overall image structure more prominent.

[0123] For high-frequency components in the frequency domain, adaptive weighting is used to enhance their effectiveness. Adaptive weighting dynamically adjusts the weights based on the characteristics of different frequencies. The weights of certain high-frequency components are typically determined based on the characteristics of the forged image and its specific artifacts. For example, artifacts often manifest as subtle changes in the image, often concentrated in high-frequency regions. Therefore, assigning higher weights to high-frequency components helps highlight these artifacts.

[0124] For example, for low-frequency areas in facial images (such as facial contours), their smoothing effect is enhanced through low-pass filtering weighting; while for high-frequency areas in the image (such as eyes, skin texture and other details), their performance in the frequency domain is further enhanced through adaptive weight allocation, making the forgery traces more prominent and facilitating subsequent detection.

[0125] It can be understood that low-pass filtering weighting enhances the overall structure of the image, while adaptive weight allocation helps detect subtle artifacts in forged images by increasing the weight of high-frequency features, especially detail information. This approach significantly improves the visibility of forgery artifacts in the frequency domain.

[0126] Step S203: convert the weighted frequency domain features into the spatial domain through inverse discrete cosine transform to obtain high frequency enhanced features.

[0127] The inverse discrete cosine transform (IDCT) is the inverse of the DCT, converting frequency domain information back to the spatial domain. The IDCT restores the weighted frequency domain features to the spatial domain, generating a new image feature. This process allows the details enhanced in the frequency domain to be reflected in the spatial domain of the image, facilitating further image analysis and processing.

[0128] Specifically, through the IDCT transformation, the enhanced features originally present in the frequency domain (especially the high-frequency details) are restored to the image in a more distinct form. This makes the details in the image (such as forgery traces) more prominent, making subsequent forgery detection more sensitive and accurate.

[0129] For example, after low-pass filtering, weighting, and adaptive weight assignment, the frequency domain features are transformed through IDCT, resulting in an image that highlights detailed information. For example, previously imperceptible forgery traces become more apparent in the image, making it easier for the detection network to process and judge.

[0130] In the above implementation, image features are converted from the spatial domain to the frequency domain. Low-pass filtering and adaptive weighting are then used to emphasize high-frequency details, thereby enhancing the expressiveness of forgery traces. Finally, the enhanced frequency domain features are converted back to the spatial domain via an inverse discrete cosine transform (IDCT), generating high-frequency enhanced features. This process not only enhances image detail, especially when forgery traces are subtle, but also makes subtle changes in the forged image more pronounced through high-frequency enhancement, providing a more reliable basis for subsequent forgery detection.

[0131] Reference Figure 4 As an implementation of the frequency domain enhanced variational autoencoder, the steps of constructing the frequency domain enhanced variational autoencoder include:

[0132] Step S301: Input the input feature x into the encoder E of the pre-built variational autoencoder for convolution sampling and mapping to the latent space z;

[0133] Among them, the input feature x is a multi-level encoding feature (F1, F2, F3);

[0134] Step S302: quantize the features in the latent space z and generate the quantized latent embedding using formula (1)

[0135]

[0136] Among them, the embedding space C = {c1,c2,…,c|C|} is a preset discrete vector set, z ij is the jth feature of the i-th layer in the latent space z, c k represents the nearest vector in the embedding space;

[0137] Step S303: quantize the potential embedding Input to the decoder of the variational autoencoder G and reconstruct layer by layer to generate a preliminary reconstructed image The calculation process is:

[0138]

[0139] In the above formula (2), E i represents the i-th layer of the encoder, a i represents the features before the activation of the encoder layer i, b i =F i (a i ) represents the frequency supplementary feature of the i-th layer, F i Used to extract features a before activation from the encoder i The rich frequency features learned in the above formula (3), G i represents the corresponding function of the decoder layer i, represents the output features of the decoder;

[0140] Step S304: the encoder’s pre-activation feature a i and the decoder output features Perform frequency domain processing to generate frequency supplementary features b i =F i (a i );

[0141] Step S305: add feature b to the frequency i and the decoder output feature c i Perform discrete Fourier transform to calculate the focus frequency loss FFL and dynamic spectrum loss SL. The specific calculation formula is:

[0142]

[0143] In the above formula (4), e and i represent the Euler number and imaginary unit respectively, M×N is the spatial resolution of the feature map, f(x,y) is the value at (x,y) of each feature map, and F(u,v) is the corresponding value at the (u,v) coordinate on the spectrum; in the above formula (5), represents the weight applied to each frequency; Represents the main error function based on the frequency domain; In the above formula (6), K i (μ,σ) represents the Gaussian kernel function, μ is the mean, σ i is the variance, * represents the convolution operation, and is a weighted feature;

[0144] Reference Figure 5 The frequency domain enhanced variational autoencoder of the embodiment of the present application is based on the frequency domain supplementation module. Figure 5 The figure shows a schematic diagram of a frequency domain supplementation module constructed in an embodiment of the present application. The module receives an input signal and undergoes a series of operations (including normalization (Norm), ReLU activation, Dropout and convolution (Conv)). These operations are repeated N times to extract features from the signal. Ultimately, through the processing of these steps, the output signal is supplemented and enhanced and synthesized with other signals. The purpose of the frequency domain supplementation module is to enhance the feature expression of the input signal through frequency domain feature processing, thereby improving the performance of the overall model in image or signal processing.

[0145] Step S306: Combine the focus frequency loss FFL, dynamic spectrum loss SL, pixel-level reconstruction loss and perceptual loss to calculate the total reconstruction loss L rec , the specific calculation formula is:

[0146]

[0147] In the above formula (8), α and β are hyperparameters, is the L1 norm pixel-level reconstruction loss, It is a loss of perception;

[0148] Step S307: Based on the total reconstruction loss L rec Optimize the model parameters to obtain the trained frequency domain enhanced variational autoencoder.

[0149] Reference Figure 6 , which is a schematic diagram of the dynamic frequency domain loss constructed in the embodiment of the present application, wherein the input feature is converted to the frequency domain after discrete Fourier transform to generate the focus frequency loss (FFL). i and the decoding block output c iThe spectrum F(u,v) is obtained by discrete Fourier transform, and then the loss value is calculated using the difference in characteristic frequencies. The focus frequency loss (FFL) is calculated by the formula, and a low-pass filter is applied according to the frequency domain characteristics to adjust the penalty weights of the low-frequency and high-frequency parts to ensure the accurate restoration of the overall image layout and main features. Then, the frequency domain weighting processing is performed through convolution operation and Gaussian kernel (K_i) to obtain the weighted feature and Then calculate the frequency loss SL( and Finally, the total reconstruction loss is used to measure the image reconstruction quality. This loss function combines focus frequency loss, feature map loss, and pixel-level and perceptual losses to ensure the quality and visual effect of the reconstructed image.

[0150] In the above implementation, frequency domain processing and optimization mechanisms such as focal frequency loss (FFL) and dynamic spectrum loss (SL) are introduced to effectively improve the reconstruction quality of the variational autoencoder (VAE). By performing frequency domain enhancement on the features of the encoder and decoder, not only the traditional pixel-level reconstruction error is taken into account, but also the error constraint of the frequency level is introduced, which enhances the model's learning ability of the frequency domain features of the image. The combination of quantized latent embedding and frequency domain features ensures the retention of image details and reconstruction accuracy. At the same time, the use of focal frequency loss and dynamic spectrum loss effectively reduces the reconstruction errors of the low-frequency and high-frequency parts. Ultimately, by comprehensively optimizing the total reconstruction loss, higher quality and more realistic image reconstruction results can be obtained, which improves the expressiveness and reconstruction effect of the model, especially in terms of high-frequency details and visual perception.

[0151] Reference Figure 7 As an implementation method of step S104, the multi-level coding features are globally pooled and locally pooled through the unsupervised detection network to generate global representation and local representation, and the global representation and local representation are connected along the channel axis to generate a calculation formula for fusion multi-scale features including:

[0152] Step S401: perform global average pooling on the input feature x to generate a global representation f G (x) is:

[0153] f G (x) = Pooling(x; 1 × 1) (9)

[0154] In the above formula (9), Pooling represents the global pooling operation;

[0155] Step S402: Divide the input feature x into q×q regions, perform local average pooling on each region, and generate a local representation f L (x) is:

[0156] f L (x) = Pooling(x;q×q) (10)

[0157] In the above formula (10), Pooling represents the local pooling operation;

[0158] Step S403: The global representation f G (x) and the local representation f L (x) is connected in series along the channel axis and input into the convolutional network ψ(·) to obtain the fused multi-scale feature f n (x) is:

[0159] f n (x)=ψ(concat(f L (x),f G (x))) (11)

[0160] In the above formula (11), f n (x) is the fusion of multi-scale features, ψ(·) is the convolutional network, concat(f L (x),f G (x)) represents the concatenation of the global representation and the local representation along the channel axis.

[0161] In the above implementation, global and local pooling are performed on the input features based on the unsupervised detection network, and the global and local representations are combined to generate fused multi-scale features. Global average pooling retains the overall information of the input features, while local average pooling captures local detail features. By connecting the global and local representations along the channel axis, it is possible to effectively combine global and local information and fully express multi-scale features. This method improves the network's ability to perceive information at different scales, thereby enhancing the network's feature extraction and discrimination capabilities. In particular, it can significantly improve the model's expressiveness and detection accuracy when dealing with tasks with complex details and multi-level structures.

[0162] Reference Figure 8 As an implementation of step S105, the step of calculating the abnormality score map based on the fusion of multi-scale features and the reconstructed frequency domain supplementary features includes:

[0163] Step S501, calculate the fusion multi-scale feature f n (x) and the mean square error and cosine similarity of the reconstructed frequency domain supplementary features to obtain the pixel similarity S h,w for:

[0164]

[0165] In the above formula (12), h and w represent the coordinate index of the spatial feature, is the indicator function, mse(·) and cosim(·) are mean square error and cosine similarity respectively, γ1 and γ2 are hyperparameters, and k represents the threshold that determines the similarity measure MSE;

[0166] Step S502: Based on the pixel similarity S h,w Get the reconstructed features for:

[0167]

[0168] Step S503: Calculate the mean square error loss based on the input feature x and the reconstructed feature:

[0169]

[0170] In the above formula (14), C, H, and W are the number of channels, height, and width of the feature map, respectively, and ||·||2 represents the Euclidean distance;

[0171] Step S504: Reconstruct the features Get the abnormal score graph d. The specific formula includes:

[0172]

[0173] In the above formula (15), h and w represent the position of each pixel.

[0174] Among them, the score d of each pixel position (h,w) h,w Indicates the degree of abnormality of the location. The larger the value, the more significant the difference from the real face features, and the higher the possibility of forgery.

[0175] In the above implementation, based on the fusion of multi-scale features and the reconstructed frequency domain supplementary features, pixel similarity is calculated and an anomaly score map is generated, thereby effectively detecting abnormal areas. First, by calculating the mean square error and cosine similarity of the fused features and the frequency domain supplementary features, the similarity between pixels can be accurately measured, and then the reconstructed features can be obtained. This process can capture the differences between the input features and the reconstructed features, and use these differences to calculate the mean square error loss, thereby generating an anomaly score map for each pixel position. This technical solution can accurately identify abnormal areas in images. By combining multi-scale features and frequency domain information, anomaly detection is made more refined and robust, and is particularly suitable for processing images with complex structures and noise.

[0176] Reference Figure 9 As an implementation of step S106, the step of determining the authenticity of the face image to be detected according to the pixel-level scores of the abnormality score map includes:

[0177] Step S601, interpolating the anomaly score map to the original size of the input image to be detected;

[0178] The size of the anomaly score map is typically obtained by extracting features from the input image. These feature maps may become smaller due to processes such as pooling and convolution. Therefore, to align the anomaly score map with the input image, interpolation is required. This interpolation process can restore the anomaly score map to the original image size through image upsampling or interpolation algorithms (such as bilinear interpolation or nearest neighbor interpolation), ensuring that the anomaly score of each pixel corresponds to the corresponding image pixel, facilitating subsequent processing.

[0179] For example, assuming that the size of the input image is 224×224 and the size of the anomaly score map is 56×56, the anomaly score map is upsampled from 56×56 to 224×224 by interpolation, so that the anomaly score at each position can correspond to the corresponding position in the original image.

[0180] Step S602: Perform global maximum pooling on the interpolated anomaly score map, and extract the maximum anomaly score in the anomaly score map as the final anomaly score;

[0181] Global pooling extracts the most significant anomaly regions in the image by pooling the anomaly score map. Max pooling selects the maximum value within a pooling window. Global max pooling finds the maximum anomaly score in the entire anomaly score map, representing the degree of anomaly in the most anomalous and potentially forged region of the image.

[0182] For example, if a region in the interpolated anomaly score map has the highest score (e.g., 0.8), then that region is the most severely anomaly-prone region. Global maximum pooling is used to extract the maximum score as the final anomaly score.

[0183] Step S603 : determining the authenticity of the face image to be detected based on a comparison between the preset threshold and the final anomaly score.

[0184] A preset threshold is used to determine the degree of image forgery. If the final anomaly score exceeds this threshold, the image is considered forged. Otherwise, the image is considered genuine. The choice of the threshold typically depends on the distribution of scores for real and forged images during training. By comparing the final anomaly score with the threshold, a judgment can be made as to whether the image is forged.

[0185] For example, assuming the preset threshold is 0.7, when the final anomaly score is 0.8, it means that the abnormal part in the image is significant, and the system judges that the image is forged; if the final anomaly score is 0.5, the image is judged to be real.

[0186] In the above implementation, the anomaly score map is aligned with the input image, enabling accurate pixel-level comparison of anomaly scores. Global maximum pooling is used to extract the most significant forgery traces within the image, ensuring accurate forgery detection. Finally, the authenticity of the image is determined by comparing it with a preset threshold. This technical solution, by combining the anomaly score map, pooling, and thresholding, can accurately and effectively detect forged portions in images, achieving high detection accuracy and robustness.

[0187] As a further embodiment of the detection method, it also includes:

[0188] The total reconstruction loss L rec and mean square error loss L mse Perform weighted combination and get the total objective function as L total :

[0189] L total =λ1L rec +λ2L mse ; (16)

[0190] In the above formula (16), λ1 and λ2 are preset hyperparameters, which respectively control the impact of the total reconstruction loss and the mean square error loss on the overall objective function.

[0191] Among them, by weighted combination of total reconstruction loss and mean square error loss, the model is guided to simultaneously optimize the reconstructed image quality and feature distribution alignment, ensuring the similarity between the reconstructed image output by the decoder and the input source image, while constraining the distribution consistency between the real facial features and the fused features.

[0192] In the above implementation, the weighted combination of the total reconstruction loss and the mean squared error loss enables this method to take into account both global and local features in forgery detection, more accurately capturing the differences between forged and real images. This combination enables the detection method to achieve finer distinctions between different types of forged images, ensuring more accurate detection results.

[0193] The technical solution of this application proposes a multi-feature fusion face forgery detection method (FDS-Net) based on frequency domain supplementation and unsupervised learning. Its core lies in combining the strategy of frequency domain enhancement and local-global feature fusion to significantly improve the detection accuracy and robustness of forged images. First, a variational autoencoder (VAE) based on frequency domain enhancement is adopted. By converting the face image to the frequency domain and enhancing the high-frequency spectrum features, it can effectively amplify the forgery traces of the forged image and suppress the noise in the real image, making the distinction between forged and real images more obvious, thereby improving the detection performance. This technology effectively addresses the shortcomings of traditional methods in forged image detection, especially in the processing of high-frequency details.

[0194] Secondly, the unsupervised network used in the embodiment of the present application combines local detail features and global semantic information to enhance the model's detection ability for forged images through multi-scale perception. In the absence of artificial labels, the network automatically extracts the intrinsic structure and forgery clues of the image through self-supervised learning, can adapt to different types of forgery methods, and maintains strong robustness and generalization ability. This innovative design avoids the information loss in traditional methods, improves detection accuracy, and has high adaptability. Experimental results show that FDS-Net performs well on multiple public data sets (such as Celeb-DF and DFDC), not only surpassing many existing methods in forgery detection accuracy and generalization ability, but also demonstrating strong cross-dataset adaptability. The innovation of this technical solution lies in combining frequency domain enhancement and unsupervised learning to achieve efficient and accurate forged image detection in the absence of a large amount of labeled data. It has strong practical application value, especially in scenarios requiring large-scale automated detection, and can effectively improve the efficiency and accuracy of face forgery detection.

[0195] The embodiment of the present application also discloses an unsupervised face forgery detection system based on frequency domain complementation.

[0196] An unsupervised face forgery detection system based on frequency domain complementation, comprising:

[0197] The feature extraction module is used to input the face image to be detected into the ResNet-based baseline network and extract multi-level coding features through the encoder of the frequency domain enhanced variational autoencoder;

[0198] The frequency domain enhancement module is used to perform frequency domain enhancement processing on multi-level coding features to generate high-frequency enhanced features;

[0199] The reconstruction module is used to input the high-frequency enhancement features into the decoder of the frequency-domain enhanced variational autoencoder, combine the dynamic spectrum loss mechanism to perform feature reconstruction, and generate reconstructed frequency-domain supplementary features;

[0200] The multi-scale feature fusion module is used to perform global and local pooling on multi-level encoding features through an unsupervised detection network to generate global and local representations, and then connect the global and local representations along the channel axis to generate fused multi-scale features;

[0201] Anomaly score map calculation module, used to calculate the anomaly score map based on the fusion of multi-scale features and the reconstructed frequency domain supplementary features;

[0202] The authenticity verification module is used to determine the authenticity of the face image to be detected based on the pixel-level scores of the anomaly score map.

[0203] An unsupervised face forgery detection system based on frequency domain supplementation in an embodiment of the present application can implement any of the forgery detection methods described above, and the specific working processes of each module in the forgery detection system can refer to the corresponding processes in the above method embodiments.

[0204] In the several embodiments provided in this application, it should be understood that the provided methods and systems can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for example, the division of a module is merely a logical functional division, and in actual implementation, other division methods may be used, such as combining or integrating multiple modules into another system, or ignoring or not implementing certain features.

[0205] The embodiment of the present application also discloses a computer device.

[0206] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned unsupervised face forgery detection method based on frequency domain complementation is implemented.

[0207] The embodiment of the present application also discloses a computer-readable storage medium.

[0208] A computer-readable storage medium stores a computer program capable of being loaded by a processor and executing any one of the above-mentioned unsupervised face forgery detection methods based on frequency domain complementation.

[0209] Among them, computer-readable storage media can be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus or device; the program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0210] It should be noted that, in the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0211] The above are all preferred embodiments of the present application and are not intended to limit the scope of protection of this application. Unless otherwise stated, any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features. In other words, unless otherwise stated, each feature is merely an example of a series of equivalent or similar features.

Claims

1. An unsupervised face forgery detection method based on frequency domain complementation, characterized in that: The detection method comprises: The face image to be detected is input into the baseline network based on ResNet, and the multi-level coding features are extracted through the encoder of the frequency domain enhanced variational autoencoder; Performing frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhancement features; Inputting the high-frequency enhancement features into the decoder of the frequency-domain enhanced variational autoencoder, performing feature reconstruction in combination with a dynamic spectrum loss mechanism, and generating reconstructed frequency-domain supplementary features; Performing global pooling and local pooling on the multi-level encoding features through an unsupervised detection network to generate a global representation and a local representation, and connecting the global representation and the local representation along a channel axis to generate a fused multi-scale feature; Calculating an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features; Determining the authenticity of the face image to be detected based on the pixel-level scores of the abnormality score map; The steps of constructing the frequency domain enhanced variational autoencoder include: Input the input feature x into the encoder E of the pre-built variational autoencoder for convolution sampling and mapping to the latent space z; Quantize the features in the latent space z and generate the quantized latent embedding using formula (1) Among them, the embedding space C = {c1,c2,…,c|C|} is a preset discrete vector set, z ij is the jth feature of the i-th layer in the latent space z, c k represents the nearest vector in the embedding space; Embedding the quantized potential Input to the decoder of the variational autoencoder G and reconstruct layer by layer to generate a preliminary reconstructed image The calculation process is: In the above formula (2), E i represents the i-th layer of the encoder, a i represents the features before the activation of the encoder layer i, b i =F i (a i ) represents the frequency supplementary feature of the i-th layer, F i Used to extract features a before activation from the encoder i The rich frequency features learned in the above formula (3), G i represents the corresponding function of the decoder layer i, represents the output features of the decoder; The pre-activation feature a of the encoder i and the decoder output features Perform frequency domain processing to generate frequency supplementary features b i =F i (a i ); Supplement the frequency feature b i and the decoder output feature c i Perform discrete Fourier transform to calculate the focus frequency loss FFL and dynamic spectrum loss SL. The specific calculation formula is: In the above formula (4), e and i represent the Euler number and imaginary unit respectively, M×N is the spatial resolution of the feature map, f(x,y) is the value at (x,y) of each feature map, and F(u,v) is the corresponding value at the (u,v) coordinate on the spectrum; in the above formula (5), represents the weight applied to each frequency; Represents the error function based on the frequency domain; in the above formula (6), K i (μ,σ) represents the Gaussian kernel function, μ is the mean, σ i is the variance, * represents the convolution operation, and is a weighted feature; Combining the focus frequency loss FFL, dynamic spectrum loss SL, pixel-level reconstruction loss and perceptual loss, the total reconstruction loss L is calculated rec , the specific calculation formula is: In the above formula (8), α and β are hyperparameters, is the L1 norm pixel-level reconstruction loss, It is a loss of perception; Based on the total reconstruction loss L rec Optimize the model parameters to obtain the trained frequency domain enhanced variational autoencoder.

2. The unsupervised face forgery detection method based on frequency domain complementation according to claim 1, characterized in that: The step of performing frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhancement features includes: Performing discrete cosine transform on each layer of coding features of the multi-level coding features to convert them into frequency domain features; Performing low-pass filtering and weighting on the low-frequency components of the frequency domain features, and performing adaptive weight allocation on the high-frequency components of the frequency domain features; The weighted frequency domain features are converted to the spatial domain through inverse discrete cosine transform to obtain high-frequency enhanced features.

3. The unsupervised face forgery detection method based on frequency domain complementation according to claim 1, characterized in that: The multi-level coding features are globally and locally pooled through an unsupervised detection network to generate global representation and local representation, and the global representation and local representation are connected along the channel axis to generate a calculation formula for fusion multi-scale features. Perform global average pooling on the input feature x to generate a global representation f G (x) is: f G (x)=Pooling(x;1×1) (9) In the above formula (9), Pooling represents the global pooling operation; Divide the input feature x into q×q regions, perform local average pooling on each region, and generate a local representation f L (x) is: f L (x)=Pooling(x;q×q) (10) In the above formula (10), Pooling represents the local pooling operation; The global representation f G (x) and the local representation f L (x) is connected in series along the channel axis and input into the convolutional network ψ(·) to obtain the fused multi-scale feature f n (x) is: f n (x)=ψ(concat(f L (x),f G (x))) (11) In the above formula (11), f n (x) is the fusion of multi-scale features, ψ(·) is the convolutional network, concat(f L (x),f G (x)) represents the concatenation of the global representation and the local representation along the channel axis.

4. The unsupervised face forgery detection method based on frequency domain complementation according to claim 3, characterized in that: The step of calculating an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features includes: Calculate the fused multi-scale feature f n (x) and the mean square error and cosine similarity of the reconstructed frequency domain supplementary features to obtain the pixel similarity S h,w for: In the above formula (12), h and w represent the coordinate index of the spatial feature, is the indicator function, mse(·) and cosim(·) are mean square error and cosine similarity respectively, γ1 and γ2 are hyperparameters, and k represents the threshold that determines the similarity measure MSE; According to the pixel similarity S h,w Get the reconstructed features for: According to the input feature x and the reconstructed feature The mean square error loss is calculated as: In the above formula (14), C, H, and W are the number of channels, height, and width of the feature map, respectively, and ||·||2 represents the Euclidean distance; According to the reconstruction features Get the abnormal score graph d. The specific formula includes: In the above formula (15), h and w represent the position of each pixel.

5. The unsupervised face forgery detection method based on frequency domain complementation according to claim 4, characterized in that: The step of determining the authenticity of the face image to be detected according to the pixel-level scores of the abnormality score map includes: Interpolating the anomaly score map to the original size of the input image to be detected; Performing global maximum pooling on the interpolated anomaly score map, and extracting the maximum anomaly score in the anomaly score map as the final anomaly score; The authenticity of the face image to be detected is determined by comparing the final anomaly score with a preset threshold.

6. The unsupervised face forgery detection method based on frequency domain complementation according to any one of claims 1 to 5, characterized in that: The detection method further comprises: The total reconstruction loss L rec and mean square error loss L mse Perform weighted combination and get the total objective function as L total : L total =λ1L rec +λ2L mse (16) In the above formula (16), λ1 and λ2 are preset hyperparameters, which respectively control the impact of the total reconstruction loss and the mean square error loss on the overall objective function.

7. An unsupervised face forgery detection system based on frequency domain complementation, characterized in that: A method for detecting unsupervised face forgery based on frequency domain complementation according to any one of claims 1 to 6 is used, wherein the detection system comprises: The feature extraction module is used to input the face image to be detected into the ResNet-based baseline network and extract multi-level coding features through the encoder of the frequency domain enhanced variational autoencoder; A frequency domain enhancement module, configured to perform frequency domain enhancement processing on the multi-level coding features to generate high-frequency enhanced features; A reconstruction module, configured to input the high-frequency enhancement features into the decoder of the frequency-domain enhanced variational autoencoder, perform feature reconstruction in combination with a dynamic spectrum loss mechanism, and generate reconstructed frequency-domain supplementary features; A multi-scale feature fusion module is used to perform global pooling and local pooling on the multi-level coding features through an unsupervised detection network to generate global representation and local representation, and connect the global representation and local representation along the channel axis to generate fused multi-scale features; An anomaly score map calculation module, used to calculate an anomaly score map based on the fused multi-scale features and the reconstructed frequency domain supplementary features; The authenticity verification module is used to determine the authenticity of the face image to be detected based on the pixel-level scores of the abnormal score map.

8. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program.

9. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Deep fake face detection method based on frequency learning

    CN114898437A

  • Forgery image detection method, electronic equipment and computer readable storage medium

    CN115984178A