Method for detecting counterfeit content, electronic device, and storage medium
By performing lossy compression and trace removal processing on digital media data before forgery detection, the problem of decreased detection performance in existing technologies is solved, and the detection accuracy and generalization ability are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING GESHI TECH CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies tend to rely on lossy compression traces and ignore forgery features when detecting deepfake content, resulting in decreased detection performance and insufficient generalization ability.
Lossy compression artifact removal is performed on the input digital media data using high-pass filters such as Gaussian high-pass filters or Butterworth high-pass filters to remove lossy compression artifacts before forgery detection. The training sample set contains samples that have undergone lossy compression artifact removal.
It effectively reduces the interference of lossy compression traces on network learning, improves the accuracy and generalization ability of forged content detection, and achieves more reliable and robust detection results.
Smart Images

Figure CN122156561A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method for detecting forged content, an electronic device, and a storage medium. Background Technology
[0002] In recent years, with the rapid development of deepfake and generative artificial intelligence technologies, images and videos generated by these technologies have become highly realistic, making them difficult to distinguish from genuine forgeries by the naked eye. Current mainstream detection methods for this type of content rely on data-driven deep learning models, which are trained by constructing datasets containing both genuine and forged samples. However, actual training data vary significantly in resolution, encoding format, and lossy compression quality, causing classifiers to easily overfit to "non-forgery artifacts" unrelated to the nature of the forgery, such as compression artifacts introduced by different lossy compression algorithms. These lossy compression artifacts are often stronger in the spectrum than genuine forgery artifacts, causing classifiers to rely on compression artifacts for judgment, thus reducing their ability to identify genuine forgery features.
[0003] The relevant technologies mainly improve the dataset in two directions to reduce the classifier's reliance on "non-forged traces" (especially lossy compression traces): one is to simulate diverse compression traces through complex data augmentation (such as recoding and resolution adjustment), and the other is to construct pairs of real and fake data to force the classifier to learn relative differences.
[0004] However, the former is difficult to cover all real-world compression scenarios, while the latter is limited by specific generation tools, resulting in insufficient generalization ability of the classifier and low detection performance in complex real-world scenarios. Summary of the Invention
[0005] This application provides a method, electronic device, and storage medium for detecting counterfeit content, which can improve the detection performance of counterfeit content in complex real-world scenarios.
[0006] According to a first aspect of this application, a method for detecting forged content is disclosed, the method comprising: Lossy compression trace removal processing is performed on the first digital media data to obtain the second digital media data; wherein, the first digital media data includes images or videos; Based on a binary classification network, forgery detection is performed on the second digital media data to obtain a detection result indicating whether the first digital media data is forged content; The binary classification network is trained based on a training sample set, which includes real training samples and fake training samples, and at least some of the samples in the training sample set are trace-removed samples after lossy compression trace removal processing.
[0007] According to a second aspect of this application, an electronic device is disclosed, comprising: a memory, an under-display optical fingerprint sensor, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the counterfeit content detection method as described in the first aspect.
[0008] According to a third aspect of this application, a computer-readable storage medium is disclosed having a computer program / instructions stored thereon, which, when executed by a processor, implements the forgery detection method as described in the first aspect.
[0009] According to a fourth aspect of this application, a computer program product is disclosed, comprising a computer program / instructions that, when executed by a processor, implement the forgery detection method as described in the first aspect.
[0010] In this embodiment, lossy compression trace removal processing is performed on the first digital media data to obtain the second digital media data; wherein, the first digital media data includes images or videos; based on a binary classification network, forgery detection is performed on the second digital media data to obtain a detection result indicating whether the first digital media data is forged content; wherein, the binary classification network is trained based on a training sample set, the training sample set includes real training samples and forged training samples, and at least some samples in the training sample set are trace removal samples after lossy compression trace removal processing.
[0011] As can be seen, unlike the strategies in related technologies that allow the classifier to passively adapt to noise from lossy compression artifacts, this embodiment first performs signal-level purification processing on the input digital media data before training and inference of the binary classification network, that is, actively eliminating lossy compression artifacts. This processing reduces the interference of such strong noise on network learning at the source, effectively preventing the binary classification network from overfitting to lossy compression artifacts such as compression artifacts, thereby prompting the network to focus on learning more essential and stable forgery features. Therefore, this embodiment can effectively overcome the problems of decreased detection performance and insufficient generalization ability caused by the reliance on the classifier to adapt to noise in related technologies, improve the detection accuracy and generalization ability of the binary classification network when facing complex real-world data with different compression histories and sources, and ultimately achieve a more reliable and robust forgery content detection effect. Attached Figure Description
[0012] Figure 1 This is a flowchart of a method for detecting counterfeit content provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the process of determining the high-pass filter in the filter set provided in this application embodiment; Figure 3 These are example diagrams illustrating different types of digital media data cropping methods provided in the embodiments of this application; Figure 4 This is a flowchart of the binary classification network training process provided in the embodiments of this application; Figure 5 This is a structural block diagram of a forgery detection device provided in an embodiment of this application; Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] It should be noted that the image data obtained in this application is accessed, collected, stored, and used for subsequent analysis and processing after the user or relevant data owner has been clearly informed of the content of the data collection, the purpose of the data, the processing method, etc., and with the consent and authorization of the user or relevant data owner. Furthermore, the application can provide the user or relevant data owner with the means to access, correct, or delete the data, as well as the method to revoke consent or authorization.
[0014] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0015] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0016] To facilitate understanding, some relevant concepts and application scenarios involved in the embodiments of this application will be introduced below.
[0017] I. Related Concepts Lossy compression artifacts refer to the loss of image content caused by encoding images and videos using image and video encoding tools based on lossy compression schemes. The certain regularity of this content loss is called lossy compression artifacts. In the embodiments of this application, lossy compression artifacts include artifacts unrelated to the image content generated during the compression process due to the quantization of high-frequency coefficients, such as blocking artifacts and ringing artifacts based on 8×8 pixel blocks in JPEG compression. These artifacts manifest as concentrated mid-to-high frequency components in the frequency domain.
[0018] A high-pass filter is a linear time-invariant system that allows high-frequency signal components to pass through while suppressing or attenuating low-frequency signal components. In image processing, high-pass filters can enhance high-frequency components such as edges and textures in an image, while weakening low-frequency components such as smooth areas and background.
[0019] A Gaussian high-pass filter is a high-pass filter constructed based on a Gaussian function. Its frequency response exhibits a smooth, oscillatory transition between the passband and stopband. This filter can be implemented in the spatial domain using the difference of a Gaussian kernel, and in the frequency domain, it is implemented by subtracting the transfer function of a Gaussian low-pass filter from 1.
[0020] The Butterworth high-pass filter is a high-pass filter designed based on the Butterworth filter prototype. Its frequency response is the flattest in the passband, and the steepness of the transition band can be controlled by the order parameter.
[0021] The order, specifically a design parameter of a Butterworth filter, controls the decay rate of the frequency response curve near the cutoff frequency. A higher order results in a narrower transition band and stronger frequency selectivity.
[0022] The cutoff frequency is the frequency value in the frequency response curve of a filter at which the amplitude drops to a specific proportion of the passband amplitude. Components below this frequency are significantly suppressed, while components above this frequency are preserved or enhanced.
[0023] Frequency domain representation refers to the mathematical representation of a signal (such as an image, video frame, or audio) after it has been transformed from its original spatial or temporal domain to the frequency domain. In this representation, the signal is decomposed into a superposition of sine (or cosine) wave components with different frequencies, amplitudes, and phases, thereby clearly revealing the distribution and energy intensity of each frequency component in the signal.
[0024] II. Application Scenarios Lossy compression, while removing high-frequency information from images or videos (which may contain weak traces of forgery or generation), introduces significant lossy compression artifacts, such as blocky noise. In terms of spectral distribution, the intensity of these compression artifacts is typically much higher than the residual forgery traces. This makes classifiers trained on lossy compressed data more prone to capturing the distributional differences between positive and negative samples (real training samples are negative, and forged training samples are positive) on the compression traces, while failing to fully learn the essential forgery features. Therefore, lossy compression has become a major source of interference in deepfake and generative AI content detection tasks. Related techniques employ data augmentation or training data pair adjustments to adapt classifiers to this interference, but their performance in detecting forged content remains poor.
[0025] To address the aforementioned technical problems, embodiments of this application provide a method for detecting counterfeit content, an electronic device, and a storage medium.
[0026] The method for detecting counterfeit content provided in the embodiments of this application will now be described in conjunction with the accompanying drawings.
[0027] It should be noted that the method for detecting counterfeit content provided in this application is applicable to various electronic devices, including but not limited to: mobile terminals such as smartphones, tablets, and personal digital assistants (PDAs), as well as computer equipment such as servers and computers. This application does not limit this.
[0028] Figure 1 This is a flowchart of a method for detecting forged content provided in an embodiment of this application, such as... Figure 1 As shown, the method may include the following steps: step 101 and step 102.
[0029] In step 101, the first digital media data is subjected to lossy compression trace removal processing to obtain the second digital media data; wherein, the first digital media data includes images or videos.
[0030] In this embodiment of the application, the first digital media data is the original digital media data to be detected.
[0031] In this embodiment, the first digital media data may include images or videos. By supporting unified processing of the two main digital media formats, images and videos, a wider range of practical application scenarios can be covered, including static images and moving images, thereby expanding the applicability of the forged content detection method.
[0032] In this embodiment of the application, the second digital media data is purified data obtained after lossy compression trace removal processing, and its visual quality is closer to the original uncompressed content, and the relative signal-to-noise ratio of the forgery traces is significantly improved.
[0033] In this embodiment, the elimination process refers to the operation of extracting lossy compression artifacts using a preset elimination algorithm and removing the extracted artifacts from the first digital media data to obtain the second digital media data. The elimination algorithm selectively extracts primarily the structured artifacts generated by lossy compression while preserving, to the maximum extent possible, the original content details and effective high-frequency texture information in the digital media data.
[0034] In this embodiment, the specific implementation of the elimination algorithm may include various signal processing methods based on frequency domain or spatial domain filtering. Optionally, the elimination algorithm is implemented based on a high-pass filter, such as a Gaussian high-pass filter or a Butterworth high-pass filter, and the above-mentioned selective extraction and retention objectives are achieved by configuring parameters such as its cutoff frequency. The specific details of the filter used in the elimination algorithm will be described in detail in subsequent embodiments.
[0035] In this embodiment of the application, after obtaining the first digital media data, lossy compression artifact removal processing is performed on it to weaken or eliminate the structured artifacts introduced by lossy compression (such as JPEG, H.264 / HEVC encoding) and obtain the purified second digital media data.
[0036] In this embodiment, the above-described elimination process can suppress strong noise (i.e., lossy compression artifacts) in the training data and the data to be detected from the source, thereby preventing the binary classification network from misidentifying this type of noise as a key discriminative feature for distinguishing genuine and fake content during subsequent learning and inference. Simultaneously, this process makes the signal distribution represented by the compression artifacts of data with different compression parameters or from different sources tend to be consistent, thus providing the binary classification network with a cleaner and more stable input data environment, improving the learning efficiency and generalization ability of the binary classification network for inherently forged features.
[0037] In step 102, based on a binary classification network, forgery detection is performed on the second digital media data to obtain a detection result indicating whether the first digital media data is forged content; wherein, the binary classification network is trained based on a training sample set, the training sample set includes real training samples and forged training samples, and at least some of the samples in the training sample set are trace-removed samples after lossy compression trace removal processing.
[0038] In this embodiment, the binary classification network is a pre-trained neural network model whose backbone can be a general architecture such as ResNet, EfficientNet, or Vision Transformer, and finally outputs the detection result through a fully connected layer.
[0039] In some embodiments, the detection result is a confidence level indicating that the first digital media data belongs to forged content. This confidence level can provide a fine-grained deterministic measure, support dynamic adjustment of the judgment threshold according to scenario requirements, and flexibly balance between false positive rate and false negative rate.
[0040] In other embodiments, the detection result is a label indicating whether the first digital media data belongs to fake content or real content. This output conclusion is direct and clear, requiring no additional decision-making strategy, making it easy for downstream systems to directly integrate and apply, and improving detection efficiency.
[0041] In this embodiment of the application, during the training process of the binary classification network, fake training samples are used as positive samples and real training samples are used as negative samples. This enables the binary classification network to clearly define its optimization objective, focus on learning the essential discrimination boundary between fake content and real content, avoid learning bias caused by ambiguous sample definitions, and thus improve the detection accuracy and convergence efficiency of the network.
[0042] In this embodiment, trace removal samples are introduced during the training process of the binary classification network. On the one hand, this makes the distribution of training data closer to the cleaned input data in the inference stage, reducing the distribution difference between training and inference and improving the detection stability of the network in real-world scenarios. On the other hand, by exposing the network to samples with removed compression interference, it is forced to learn essential forgery features that are unrelated to compression artifacts, thereby enhancing the purity and discriminative power of feature representation. Furthermore, only a portion of the samples need to participate in the removal process to effectively guide the learning direction of the network, reducing computational overhead.
[0043] In this embodiment of the application, unremoved samples are introduced during the training process of the binary classification network. This allows the network to simultaneously access data distributions containing original compression traces, avoiding domain shifts caused by using only cleaned samples. This enhances the network's adaptability when directly processing uncleaned raw data in practical applications, thereby improving the network's robustness and scenario compatibility.
[0044] In this embodiment of the application, the forged content may include: deepfake content and / or content generated by generative artificial intelligence.
[0045] In some embodiments, the binary classification network can integrate a lossy compression trace removal function. Specifically, the first digital media data is first processed by the lossy compression trace removal function built into the binary classification network to obtain the second digital media data; then, the second digital media data is used for forgery detection by the inference function of the binary classification network to obtain the detection result.
[0046] In other embodiments, the binary classification network may only have inference capabilities. In this case, the lossy compression trace removal process is performed by a separate preprocessing module, and the processed second digital media data is then input into the binary classification network for forgery detection.
[0047] As can be seen from the above embodiments, in this embodiment, lossy compression trace removal processing is performed on the first digital media data to obtain the second digital media data; wherein, the first digital media data includes images or videos; based on a binary classification network, forgery detection is performed on the second digital media data to obtain a detection result indicating whether the first digital media data is forged content; wherein, the binary classification network is trained based on a training sample set, the training sample set includes real training samples and forged training samples, and at least some samples in the training sample set are trace removal samples after lossy compression trace removal processing.
[0048] As can be seen, unlike the strategies in related technologies that passively adapt the classifier to noise caused by lossy compression artifacts, this embodiment first performs signal-level purification processing on the input digital media data before training and inference of the binary classification network, that is, actively eliminating lossy compression artifacts. This processing reduces the interference of such strong noise on network learning at the source, effectively preventing the binary classification network from overfitting to compression artifacts, thereby prompting the network to focus on learning more essential and stable forgery features. Therefore, this embodiment can effectively overcome the problems of decreased detection performance and insufficient generalization ability caused by the reliance on the classifier to adapt to noise in related technologies, improve the detection accuracy and generalization ability of the binary classification network when facing complex real-world data with different compression histories and sources, and ultimately achieve a more reliable and robust forgery content detection effect.
[0049] In some embodiments provided in this application, when the detection result indicating whether the first digital media data is counterfeit content is a confidence level, the provided counterfeit content detection method, in Figure 1 Based on the embodiment shown, after step 102 above, the following step can be added: step 103.
[0050] In step 103, the confidence level is compared with a preset confidence threshold. If the confidence level is greater than or equal to the preset confidence threshold, the first digital media data is determined to be fake content; otherwise, the first digital media data is determined to be real content.
[0051] In this embodiment, the confidence level refers to the probability estimate assigned by the binary classification network to the input digital media data, indicating that the data belongs to the "fake" category. It is typically a scalar between 0 and 1. This value reflects the network's degree of confidence in its judgment that "the input is fake content."
[0052] For example, a binary classification network outputting 0.93 indicates that the binary classification network is 93% confident that the input content is fake; an output of 0.05 indicates that the binary classification network is 95% confident that the input content is real (i.e., the confidence level of belonging to the "real" category is 0.95).
[0053] In this embodiment, the preset confidence threshold is a pre-defined critical value used to make a final decision. It is the decision boundary that maps continuous confidence levels to discrete "fake" or "real" labels.
[0054] For example, the preset confidence threshold is set to 0.5. When the confidence level is ≥0.5, it is judged as "forgery"; when the confidence level is <0.5, it is judged as "real".
[0055] In practical applications, the preset reliability threshold can be adjusted according to specific needs. For example, it can be set to 0.9 in scenarios requiring extremely high accuracy and 0.1 in scenarios requiring extremely high recall.
[0056] As can be seen, in this embodiment, by transforming the probability values output by the binary classification network into threshold-based binary classification decisions, the detection results are made explicit and operable, enabling the conclusions to be directly understood and executed by downstream systems or manual reviewers. Furthermore, a flexible risk control mechanism is provided. By adjusting the confidence threshold, a trade-off can be struck between false positive and false negative rates to adapt to the stringent requirements of different application scenarios. For example, in high-security scenarios, a higher threshold can be set to prioritize certainty in the judgment, while in content review scenarios, a lower threshold can be set to improve the coverage of suspected counterfeit content screening.
[0057] In some embodiments provided in this application, lossy compression trace removal is implemented using a high-pass filter in a filter set; The filter set includes multiple high-pass filters with different parameter configurations, and each high-pass filter can extract lossy compression traces in digital media data and retain effective high-frequency texture information related to the semantic content of the image in the digital media data; the high-pass filters include Gaussian high-pass filters or Butterworth high-pass filters, and the parameters include cutoff frequency and / or order.
[0058] In this embodiment, the filter set refers to a pre-built library containing multiple high-pass filters with different frequency response characteristics. Each filter in this set defines its frequency selectivity characteristics through specific parameter configurations (such as cutoff frequency and order), thereby adapting to the trace removal requirements of digital media data with different compression intensities and content types.
[0059] In this embodiment, effective high-frequency texture information related to the semantic content of an image refers to high-frequency components in a digital image that are associated with visual semantic features such as object contours, surface details, and material texture. This type of information is crucial for image content recognition and understanding, and is distinct from content-irrelevant structured noise artifacts introduced by lossy compression.
[0060] In this embodiment, during the training phase, the filter set can be deployed as a front-end preprocessing module within the binary classification network. This module filters the input samples based on a random selection mechanism, and its filter parameters do not participate in the network's backpropagation update.
[0061] As can be seen, in this embodiment, by constructing a filter set including Gaussian high-pass filters and Butterworth high-pass filters covering different cutoff frequencies and orders, full-spectrum coverage and adaptive processing of lossy compression artifacts are achieved. The Gaussian high-pass filter avoids ringing effects with its smooth transition characteristics, while the Butterworth high-pass filter achieves precise frequency selectivity with its adjustable order. The two complement each other, effectively extracting various compression artifacts while preserving as much detail and texture as possible related to the semantic content of the image. This provides a complete and scalable algorithmic foundation for randomization enhancement in the training phase and optimal filter selection in the inference phase. Furthermore, based on mature frequency domain or spatial domain convolution implementations, it possesses good engineering deployment efficiency and hardware adaptability.
[0062] In some embodiments provided in this application, during the training phase, the lossy compression trace removal processing corresponding to the trace removal sample is implemented by a high-pass filter randomly selected from the filter set.
[0063] In this embodiment, for each training sample requiring lossy compression trace removal processing, the high-pass filter used for the removal process is not fixed and unique, but randomly selected from a pre-constructed filter set. This random selection mechanism includes two dimensions: whether removal processing is performed is random (i.e., some samples in the training sample set are trace removal samples), and for samples undergoing removal processing, which specific high-pass filter is used for processing is also randomly determined. Therefore, the same original image may be processed by different filters in different training iterations, generating trace removal samples with diverse trace residue states.
[0064] As can be seen, in this embodiment, by randomly selecting a high-pass filter from the filter set to process the training samples, a diverse environment of compression trace residues is constructed during the training phase. This prevents the binary classification network from relying on fixed filtering patterns or specific trace features for discrimination, thus forcing it to learn essential forgery features that remain stable under different elimination conditions. This randomization mechanism improves the robustness of the binary classification network to differences in filter selection, enhances the network's generalization ability across scenarios and compression parameters in real-world data, and effectively suppresses the risk of overfitting to specific compression traces.
[0065] In some embodiments provided in this application, during the inference phase, the lossy compression trace removal processing corresponding to the first digital media data is achieved by a target high-pass filter deployed in a binary classification network, which is the filter with the best removal effect in the filter set.
[0066] In this embodiment, the target high-pass filter refers to the high-pass filter selected from the filter set that has the best overall elimination effect. The best elimination effect means that the filter performs best in balancing the two opposing metrics of "lossy compression trace extraction capability" and "effective high-frequency texture information preservation capability," and enables the binary classification network to achieve the highest forgery detection performance.
[0067] In this embodiment, deployment in a binary classification network means using the target high-pass filter as a preprocessing layer or module before the binary classification network, forming a complete end-to-end forgery detection network together with the subsequent classification network backbone. This network receives the original input data, outputs cleaned data after trace removal processing, and then the backbone network performs classification.
[0068] In this embodiment, during the training phase, the filter set can be deployed as a preprocessing layer or preprocessing module within the binary classification network. This processing layer or module filters the input samples based on a random selection mechanism, and the filter parameters do not participate in the network's backpropagation update. During the inference phase, this processing layer or module retains only the preset target high-pass filter with the optimal elimination effect and performs standardized processing on the input data to be detected. Its parameters are completely fixed and do not participate in any dynamic adjustment or random selection. This deployment method integrates trace elimination and forgery detection into an end-to-end network, eliminating the need for an external preprocessing pipeline, effectively simplifying the training and inference processes, and improving the overall architecture's compactness and engineering deployment efficiency.
[0069] As can be seen, in this embodiment, by using a single optimal target high-pass filter during the inference stage, all data to be detected undergo the same standardized preprocessing transformation, eliminating output fluctuations introduced by differences in processing methods, and ensuring the stability and repeatability of the detection results. Simultaneously, the inference process does not require real-time filter selection or dynamic parameter calculation; it only needs to perform deterministic operations on a single filter, reducing computational overhead and processing latency.
[0070] In some embodiments provided in this application, during the inference stage, when the lossy compression trace removal process corresponding to the first digital media data is implemented by a target high-pass filter deployed in a binary classification network, the above step 101 may specifically include the following steps: step 1011, step 1012, step 1013 and step 1014.
[0071] In step 1011, the first digital media data is subjected to frequency domain transformation to obtain a frequency domain representation.
[0072] In this embodiment, frequency domain transformation refers to the mathematical process of converting a signal from its original domain (spatial domain or time domain) to the frequency domain. For example, for image signals, a two-dimensional discrete Fourier transform or a two-dimensional discrete cosine transform can be used.
[0073] In this embodiment, frequency domain representation refers to the data form obtained after the image undergoes frequency domain transformation, typically a complex matrix (Fourier transform) or a real matrix (cosine transform) with the same size as the original image. The value of each element in the matrix reflects the amplitude and phase information of the corresponding spatial frequency component.
[0074] For example, for a grayscale image with a size of 224×224 pixels, a 224×224 complex matrix is obtained after a two-dimensional discrete Fourier transform. The central region of the matrix corresponds to low-frequency components (smooth areas of the image, background, large areas of color), while the surrounding regions of the matrix correspond to high-frequency components (edges, textures, details, and compression artifacts).
[0075] In this embodiment, lossy compression traces are transformed from complex visual forms in the pixel domain to quantifiable and separable spectral energy distributions in the frequency domain through frequency domain transformation, thereby providing a direct operation object for subsequent frequency domain filtering operations, which is a prerequisite for achieving accurate trace extraction; at the same time, frequency domain filtering is based on matrix element-wise multiplication, which has higher computational efficiency than spatial domain convolution with large kernel size.
[0076] In step 1012, the frequency domain representation is filtered using the frequency response function of the target high-pass filter to suppress low-frequency components unrelated to lossy compression traces and enhance high-frequency components related to lossy compression traces, thereby obtaining the first frequency domain data.
[0077] In this embodiment, the frequency response function of the target high-pass filter is used to perform element-wise multiplication on the frequency domain representation of the first digital media data. The frequency response function of the target high-pass filter takes a value close to 0 (suppression) in the low-frequency region and a value close to 1 (preservation or enhancement) in the high-frequency region. Through this operation, low-frequency components unrelated to lossy compression artifacts in the frequency domain representation are effectively suppressed, while high-frequency components related to lossy compression artifacts are significantly enhanced.
[0078] In this embodiment of the application, the first frequency domain data is the frequency domain data obtained after filtering, wherein the low frequency components have been suppressed and the high frequency components (including lossy compression traces) have been preserved.
[0079] In this embodiment, since lossy compression traces have the unique characteristic of being concentrated in the mid-to-high frequency range and exhibiting a periodic distribution in the frequency domain, frequency-selective filtering can effectively extract the trace signal. Therefore, frequency domain filtering can achieve accurate separation of lossy compression traces. Furthermore, as a linearly reversible operation, frequency domain filtering has a clear and predictable inverse transformation process, providing a guarantee for the accurate reconstruction of the processing results into the spatial domain.
[0080] In step 1013, the first frequency domain data is inversely transformed to obtain a lossy compression trace feature map in the spatial domain.
[0081] In the embodiments of this application, the inverse transform is the inverse process of the frequency domain transform, which restores the frequency domain representation to the spatial domain representation, such as the inverse discrete Fourier transform, the inverse discrete cosine transform, etc.
[0082] In this embodiment of the application, the lossy compression trace feature map is a single-channel or multi-channel image data in the spatial domain, and its size is exactly the same as that of the first digital media data. The feature map quantifies the estimated intensity of the lossy compression trace at each pixel location.
[0083] In this embodiment, through inverse transformation, the first frequency domain data obtained after filtering is accurately converted back to the spatial domain to obtain a lossy compression trace feature map with the same size as the original first digital media data and a strict one-to-one spatial correspondence. This feature Figure 1 On the one hand, the frequency domain energy distribution of compression traces is transformed into pixel-level operable noise estimation, enabling subsequent subtraction operations to be performed point-by-point at precisely aligned coordinate positions; on the other hand, the feature map presents the spatial distribution pattern of compression traces in the image (such as block boundaries, ringing regions, etc.) in an intuitive visual form, providing clear quantitative basis and visualization support for algorithm debugging, parameter optimization, and effect verification.
[0084] In step 1014, the first digital media data is subtracted from the pixel value at the corresponding pixel position of the lossy compression trace feature map to obtain the second digital media data.
[0085] In this embodiment of the application, based on the additive noise model assumption, the pixel values at corresponding pixel positions of the original first digital media data and the lossy compression trace feature map are subtracted point by point to remove the estimated compression trace components from the original data, thereby obtaining the purified second digital media data.
[0086] In this embodiment, lossy compression artifacts can be eliminated through a single pixel-by-pixel subtraction operation, resulting in low computational complexity and real-time performance on various hardware platforms. This subtraction operation removes only the components identified as compression artifacts, rather than simply attenuating the entire high-frequency band, thus effectively suppressing artifacts while fully preserving the image's scene content, color distribution, and semantic texture information.
[0087] As can be seen, in this embodiment of the application, based on the additive noise model, frequency domain filtering is used as the core processing method, and pixel-level subtraction is used as the specific implementation path. This enables accurate identification and effective elimination of various types of lossy compression artifacts, thereby providing higher quality and less interference-free clean input data for the subsequent forgery detection task of the binary classification network.
[0088] In some embodiments provided in this application, during the inference phase, when the first digital media data is video and its lossy compression trace removal processing is implemented by a target high-pass filter deployed in a binary classification network, the above step 101 may specifically include the following step: step 1015.
[0089] In step 1015, at least one frame of image is extracted from the video; lossy compression artifact removal processing is performed on the at least one frame of image through a target high-pass filter to obtain at least one processed image; the at least one processed image and the remaining frame images in the video together constitute the second digital media data.
[0090] In this embodiment, a keyframe selective processing strategy is adopted for video data, rather than uniformly processing all frames. Specifically, one or more image frames can be extracted from the video stream or video file according to a preset sampling strategy, which includes, but is not limited to, uniform time interval sampling, scene change detection-based sampling, or random sampling.
[0091] For example, for a 30-second video with a frame rate of 30fps, a strategy of extracting one frame per second is adopted, and a total of 30 frames are extracted for processing; the remaining 870 frames in the video remain unchanged, and the final output video data is composed of the processed 30 frames and the unprocessed 870 frames.
[0092] As can be seen, in this embodiment, the computational overhead of eliminating lossy compression artifacts in video is reduced through the aforementioned selective processing mechanism. Processing only representative frames reduces the computational load while ensuring the effectiveness of forgery detection, thus enabling efficient deployment in resource-constrained scenarios such as mobile terminals and edge devices. Furthermore, since only a small number of frames are modified to address compression artifacts without affecting the semantic content of the image, the processed video is virtually indistinguishable from the original video in terms of playback smoothness and visual consistency, effectively avoiding problems such as overall color shift, detail blurring, or motion jitter that may be introduced by full-frame processing.
[0093] In some embodiments provided in this application, such as Figure 2 As shown, the high-pass filter in the filter set is determined by the following steps: steps 201, 202, 203, 204 and 205.
[0094] In step 201, an original image set is acquired; wherein the original image set contains images that have not been lossily compressed.
[0095] In this embodiment of the application, a batch of high-quality original images that have not undergone any lossy compression processing can be obtained to form an original image set.
[0096] In this embodiment, an uncompressed image refers to image data stored in a lossless format (such as PNG, RAW, BMP) or directly from an image sensor without lossy encoding processing such as JPEG, and does not contain structured artifacts such as blockiness and ringing introduced by lossy compression. For example, uncompressed images include: photographs taken with a professional digital camera and saved in RAW format, or frame sequences extracted losslessly from high-quality video sources.
[0097] In this embodiment of the application, by acquiring the original image set, a ground truth without compression noise interference is provided, which provides a reliable reference for subsequent accurate evaluation of the filter's ability to separate compression traces and preserve the original texture.
[0098] In step 202, each original image is converted into a lossy compressed image using various compression parameters to obtain a lossy compressed image set.
[0099] In this embodiment of the application, each original image in the original image set is subjected to lossy compression encoding using a set of different compression parameters to generate a series of lossy compressed images with different compression strengths and qualities.
[0100] In the embodiments of this application, the various compression parameters mainly refer to the key control parameters in lossy compression algorithms. For example, in JPEG compression, these refer to different quality factors, whose values typically range from 1 (lowest quality, strongest compression) to 100 (highest quality, weakest compression) or a similar range.
[0101] For example, the same original image is compressed using JPEG with quality factors of 30, 50, 70 and 90 respectively, resulting in four lossy compressed images with different degrees of compression.
[0102] In this embodiment of the application, each original image is converted into a lossy compressed image by using a variety of different compression parameters, simulating various compression situations that images may undergo in the real world, and constructing a diverse test set covering everything from strong compression traces to weak compression traces, to ensure that the selected filters have broad applicability.
[0103] In step 203, each lossy compressed image in the lossy compressed image set is filtered by multiple high-pass filters with different parameter configurations.
[0104] In this embodiment, a series of high-pass filters with different parameter configurations are used to filter each image in the lossy compressed image set.
[0105] In this embodiment, the high-pass filter to be evaluated is a series of high-pass filters with preset parameters (such as cutoff frequency and order) whose performance needs to be tested. They may cover a wide range of parameters. For example, a set of Gaussian high-pass filters with cutoff frequencies of 0.02, 0.05, 0.1, 0.2, and 0.3 can be prepared.
[0106] In this embodiment, each lossy compressed image in the lossy compressed image set is filtered by multiple high-pass filters with different parameter configurations. The performance of different filtering parameters in processing images with different compression intensities is systematically tested, providing a data basis for subsequent quantitative comparison and screening.
[0107] In step 204, the texture similarity between the filtered result of each lossy compressed image and the corresponding original image is calculated.
[0108] In this embodiment of the application, for each lossy compressed image and its result after being processed by a certain filter, a texture similarity metric between the result and the corresponding original image (the uncompressed image) is calculated.
[0109] In this embodiment, texture similarity is an index used to quantify the degree of similarity between two images in perceptual features such as texture and structure. Texture similarity may include: Structural Similarity Index (SSIM), Feature Similarity Index (FSIM), or similarity based on perceptual hashing, etc.
[0110] For example, the SSIM index is used for calculation, with values ranging from [-1, 1]. The closer the value is to 1, the more similar the two images are in terms of structure, brightness, and contrast.
[0111] In this embodiment, the texture similarity between the filtered result of each lossy compressed image and the corresponding original image is calculated, directly reflecting the filter's comprehensive balance between removing compression artifacts and preserving the original texture. High texture similarity indicates that the filter effectively removes compression artifacts (making the result more like the original image) while better preserving the original image's details and textures.
[0112] In step 205, based on the calculation results of texture similarity, the high-pass filters to be evaluated among the multiple high-pass filters to be evaluated whose texture similarity is greater than a preset similarity threshold are determined as high-pass filters in the filter set.
[0113] In this embodiment, for all calculated texture similarity results, a subset with the best performance can be selected as the filter set from all filters to be evaluated according to a screening criterion based on a preset similarity threshold. For example, the preset similarity threshold is set to 0.85.
[0114] In some embodiments, the top K filters (such as the top 10% with the highest similarity scores) may be selected as high-pass filters in the filter set, but this application embodiment does not limit this.
[0115] As can be seen, in this embodiment, by constructing a baseline set of original-lossy compressed paired images and using texture similarity as the core quantitative evaluation index, it is possible to objectively and reproducibly identify and select a filter set that achieves the optimal balance between removing lossy compression artifacts and preserving effective image texture from a wide parameter space, avoiding subjective selection bias. The selected filter set has both good artifact removal and texture preservation performance, and the naturally formed algorithmic diversity within it provides a proven high-performance elimination algorithm for the randomization elimination strategy in subsequent binary classification network training.
[0116] In some embodiments provided in this application, during the training phase, the training samples used to train the binary classification network in the training sample set are local images that have been randomly cropped.
[0117] In this embodiment of the application, random cropping refers to randomly selecting at least one rectangular region from the original training samples as the actual input for each training iteration, wherein the cropping position and / or cropping size are randomly determined within a preset range.
[0118] Accordingly, in the reasoning stage, step 102 above may specifically include the following steps: step 1021.
[0119] In step 1021, the second digital media data is cropped at a fixed spatial location to obtain a local detection image; based on a binary classification network, forgery detection is performed on the local detection image.
[0120] In this embodiment, during the inference phase, before the second digital media data to be detected is input into the binary classification network, it is first subjected to fixed spatial location cropping: that is, according to a predetermined cropping rule (including cropping position and cropping size) that has been solidified during the training phase, a local image of a specific region is extracted from the second digital media data, and this local image is then used as the actual input to the binary classification network for forgery detection. This cropping rule is fixed after the binary classification network completes training and remains unchanged throughout all subsequent inference processes.
[0121] In this embodiment of the application, different pruning strategies can be adapted according to the input data type, such as... Figure 3 As shown, for static images, a single fixed-position cropping is performed to extract a region as the processing object of the binary classification network; for video data, cropping is performed at the same spatial position in each frame, thus forming a spatially aligned sequential input between frames. This adaptive processing ensures both the simplicity and consistency of the image input and maintains the spatial correspondence of consecutive temporal frames in the video, providing a unified and adaptable preprocessing interface for the subsequent binary classification network to process digital media data of different forms.
[0122] In this embodiment, during the training phase, spatial uncertainty is introduced through random cropping, enabling the binary classification network to learn feature discrimination capabilities independent of the absolute position of forgery traces, effectively adapting to real-world scenarios where traces are distributed in different areas. This process simultaneously simulates real-world shooting conditions such as the target object's positional shift within the image, compositional changes, and close-ups, enhancing the network's adaptability to diverse visual scenes. Furthermore, random cropping achieves implicit data augmentation, generating multiple differentiated local training samples from a single image, effectively mitigating overfitting and improving network performance when training data is limited; it also encourages the network to pay more attention to subtle local forgery flaws, strengthening its accurate discrimination capability based on local regions. Further, random cropping synergizes with the aforementioned random elimination process, constructing a highly diverse training environment in both spatial content and frequency domain features, and improving the generalization ability and overall robustness of the learned feature representations through a dual randomization mechanism.
[0123] In this embodiment, during the inference phase, the second digital media data is cropped at a fixed spatial location to ensure the determinism and repeatability of the detection results. During training, random cropping enhances the network's insensitivity to changes in the location of forgery traces. During inference, fixed cropping achieves optimal alignment with the training strategy, fully utilizing the network's learned positional robustness while avoiding output uncertainty caused by random fluctuations in input. Furthermore, fixed cropping eliminates the need for dynamic calculation of the cropping position, effectively reducing computational overhead during the inference phase.
[0124] In some embodiments provided in this application, such as Figure 4 As shown, the above binary classification network can be trained through the following steps: steps 401, 402 and 403.
[0125] In step 401, the dataset is divided into a training sample set and a test sample set.
[0126] In this embodiment, the dataset is a collection of digital media data labeled with authenticity categories (real or fake) for training and evaluating a binary classification network. This dataset is constructed as follows: First, unaltered real images and videos are collected or purchased as real samples; second, corresponding fake images and videos are generated based on the aforementioned real materials using open-source or closed-source deepfake tools and generative artificial intelligence tools; furthermore, resources already labeled in existing publicly available or commercial fake datasets can be introduced as supplements. The dataset constructed in this way fully covers both real and fake samples, ensuring diversity in content sources, compression history, and generation methods, providing the necessary data for training a binary classification network with strong generalization capabilities.
[0127] In this embodiment, the complete dataset containing both real and fake training samples is divided into two mutually exclusive subsets according to a preset ratio: a training sample set for learning network parameters and a test sample set for independently evaluating network performance. The training sample set is the data subset used to directly update network weight parameters; the binary classification network learns by calculating the loss on the training sample set and backpropagating. The test sample set is the data subset that does not participate in network parameter updates during the training phase, but is only used to periodically evaluate the network's generalization ability under the current parameters; its data distribution should reflect real-world application scenarios as much as possible.
[0128] For example, a dataset containing 100,000 images is randomly divided in an 8:2 ratio into a training sample set containing 80,000 images and a test sample set containing 20,000 images.
[0129] In this embodiment, by dividing the dataset into a training sample set and a test sample set, it is ensured that the network never comes into contact with the test sample set data during the training process. This allows for an objective and realistic evaluation of the network's generalization ability when facing unknown data based on the test sample set. This division method is crucial for accurately determining whether the network is overfitting to specific noise (such as lossy compression artifacts) in the training sample set. Simultaneously, the performance metrics obtained on the test sample set provide a core, quantitative basis for selecting the optimal network parameters from multiple network states (checkpoints) generated during training.
[0130] In step 402, the initial classification network is trained using the training sample set.
[0131] In this embodiment, an initial classification network with initial weights is iteratively trained using a partitioned training sample set. The training process includes forward propagation, loss calculation, backpropagation, and parameter update.
[0132] In this embodiment, the initial classification network used exhibits high flexibility in its structural selection. Specifically, there are no specific restrictions on the backbone network architecture, allowing it to adapt to various mainstream neural network structures, including but not limited to ResNet, MobileNet, ShuffleNet, EfficientNet, Vision Transformer (ViT), and SwingTransformer. In actual deployment, the network can be selectively chosen based on the computing resources of the target hardware platform: in scenarios with limited computing power, such as mobile devices or CPUs, lightweight networks with higher computational efficiency, such as MobileNet, ShuffleNet, and EfficientNet, are selected; in scenarios with sufficient computing power, such as GPUs or dedicated accelerators, networks with larger parameter sets and stronger representation capabilities, such as ViT and SwingTransformer, are selected to pursue higher classification accuracy. The classification layer also does not require complex design; a simple linear layer (fully connected layer) is preferred to implement the mapping from feature vectors to the final category, ensuring effective classification while reducing network complexity and computational overhead.
[0133] In this embodiment of the application, optimization algorithms (such as stochastic gradient descent SGD, Adam) can be used to minimize the loss function (such as cross-entropy loss) so that the network's prediction results gradually approach the true labels.
[0134] In this embodiment, in each training batch, samples that have undergone preprocessing such as random cropping and random elimination in the training sample set are input into the network to calculate the loss, and the parameters are updated through the backpropagation algorithm.
[0135] In step 403, during the training process, the network parameters that achieve the best detection performance on the test sample set are used as the final binary classification network parameters; wherein, the detection performance metrics include at least one of the following: accuracy, precision, recall or F1 score.
[0136] In this embodiment of the application, the performance of the current network can be evaluated periodically or at specific nodes on an independent test sample set throughout the training process. After training, the set of network parameters that achieves the best evaluation metric on the test sample set is selected as the final deployable binary classification network parameters.
[0137] In this embodiment of the application, optimal detection performance refers to the best performance measured on the test sample set according to one or more preset evaluation indicators.
[0138] In this embodiment, accuracy refers to the proportion of correctly classified samples out of the total number of samples. Precision refers to the proportion of samples that are actually fake among all samples predicted as fake by the network. Recall refers to the proportion of genuine fake samples that are correctly identified by the network. The F1 score is the harmonic mean of precision and recall, and is a commonly used indicator for comprehensively evaluating network performance.
[0139] For example, the training is performed for 100 epochs. After each epoch, the F1 score is calculated on the test sample set. Finally, it is found that the network parameters saved at the end of the 85th epoch have the highest F1 score on the test sample set (e.g., 0.92). Then, this set of parameters is selected as the parameters of the final binary classification network.
[0140] As can be seen, in this embodiment, by selecting the final binary classification network based on its performance on independent test sample sets, the deployed network is guaranteed to have good generalization ability and robustness to the greatest extent, effectively avoiding the selection of network parameters that are overfitted on the training sample set. This selection process is based on clear quantitative indicators such as accuracy, precision, recall, and F1 score, ensuring the objectivity and reproducibility of the decision and avoiding biases that may be introduced by subjective selection. At the same time, the best performance state explored during training is solidified, thereby ensuring that the binary classification network deployed in actual applications is the version with the best performance during its training lifecycle, achieving stable deployment of optimal performance.
[0141] The forgery detection method provided in this application can be executed by a forgery detection device. This application uses the example of a forgery detection device executing the forgery detection method to illustrate the forgery detection device provided in this application.
[0142] Figure 5 This is a structural block diagram of a forged content detection device provided in an embodiment of this application, such as... Figure 5 As shown, the forged content detection device 500 may include: an elimination module 501 and a detection module 502; The elimination module 501 is used to perform lossy compression trace elimination processing on the first digital media data to obtain the second digital media data; wherein, the first digital media data includes images or videos; The detection module 502 is used to perform forgery detection on the second digital media data based on a binary classification network, and obtain a detection result indicating whether the first digital media data is forged content; The binary classification network is trained based on a training sample set, which includes real training samples and fake training samples, and at least some of the samples in the training sample set are trace-removed samples after lossy compression trace removal processing.
[0143] As can be seen from the above embodiments, unlike the strategy in related technologies that allows the classifier to passively adapt to noise caused by lossy compression artifacts, this embodiment first performs signal-level purification processing on the input digital media data before training and inference of the binary classification network, that is, actively eliminating lossy compression artifacts. This processing reduces the interference of such strong noise on network learning at the source, effectively preventing the binary classification network from overfitting to compression artifacts, thereby prompting the network to focus on learning more essential and stable forgery features. Therefore, the embodiments of this application can effectively overcome the problems of decreased detection performance and insufficient generalization ability caused by the reliance on the classifier to adapt to noise in related technologies, improve the detection accuracy and generalization ability of the binary classification network when facing complex real-world data with different compression histories and sources, and ultimately achieve a more reliable and robust forgery content detection effect.
[0144] Optionally, as an embodiment, the detection result is a confidence level indicating that the first digital media data belongs to fake content; or, the detection result is a label indicating that the first digital media data belongs to fake content or real content.
[0145] Optionally, as an embodiment, the forged content detection device 500 may further include: The determination module is used to compare the confidence level with a preset confidence threshold when the detection result is a confidence level. If the confidence level is greater than or equal to the preset confidence threshold, the first digital media data is determined to be fake content; otherwise, the first digital media data is determined to be real content.
[0146] Optionally, as an embodiment, the lossy compression artifact removal process is implemented using a high-pass filter in a filter set; the filter set includes multiple high-pass filters with different parameter configurations, and each high-pass filter is capable of extracting lossy compression artifacts from digital media data and retaining effective high-frequency texture information related to the semantic content of the image in the digital media data; the high-pass filter includes a Gaussian high-pass filter or a Butterworth high-pass filter, and the parameters include cutoff frequency and / or order.
[0147] Alternatively, as an embodiment, the lossy compression trace removal process corresponding to the trace removal sample is implemented by a high-pass filter randomly selected from the filter set.
[0148] Optionally, as an embodiment, the lossy compression trace removal processing corresponding to the first digital media data is implemented by a target high-pass filter deployed in the binary classification network, wherein the target high-pass filter is the one with the best removal effect in the filter set.
[0149] Optionally, as an embodiment, the elimination module 501 is specifically used to perform frequency domain transformation on the first digital media data to obtain a frequency domain representation; use the frequency response function of the target high-pass filter to perform filtering operation on the frequency domain representation to suppress low-frequency components unrelated to lossy compression traces and enhance high-frequency components related to lossy compression traces in the frequency domain representation to obtain first frequency domain data; perform inverse transformation on the first frequency domain data to obtain a lossy compression trace feature map in the spatial domain; and subtract the pixel values at corresponding pixel positions from the first digital media data and the lossy compression trace feature map to obtain second digital media data.
[0150] Optionally, as an embodiment, the elimination module 501 is specifically used to extract at least one frame of image from the video when the first digital media data is video; to perform lossy compression trace elimination processing on the at least one frame of image through the target high-pass filter to obtain at least one processed image; and to form the second digital media data together with the at least one processed image and the remaining frame images in the video.
[0151] Optionally, as an embodiment, the high-pass filters in the filter set are determined through the following process: acquiring an original image set; wherein the original image set contains images that have not been lossily compressed; converting each of the original images into a lossily compressed image set using multiple different compression parameters; filtering each of the lossily compressed images in the lossily compressed image set using multiple high-pass filters configured with different parameters; calculating the texture similarity between the filtered result of each lossily compressed image and the corresponding original image; and based on the texture similarity calculation result, determining the high-pass filters in the filter set whose texture similarity is greater than a preset similarity threshold.
[0152] Optionally, as an embodiment, in the training sample set, the training samples used to train the binary classification network are local images that have been randomly cropped. The detection module 502 is specifically used to perform fixed spatial position cropping processing on the second digital media data to obtain a local detection image; and to perform forgery detection on the local detection image based on a binary classification network.
[0153] Figure 6This is a structural block diagram of an electronic device provided in an embodiment of this application. The electronic device includes a processing component 622, which further includes one or more processors, and memory resources represented by a memory 632 for storing instructions executable by the processing component 622, such as application programs. The application programs stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 622 is configured to execute instructions to perform the aforementioned forgery detection method.
[0154] The electronic device may also include a power supply 626 configured to perform power management of the electronic device, a wired or wireless network interface 650 configured to connect the electronic device to a network, and an input / output (I / O) interface 658. The electronic device may operate on an operating system stored in memory 632, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or similar.
[0155] According to yet another embodiment of this application, this application also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps in the forgery detection method as described in any of the above embodiments.
[0156] According to yet another embodiment of this application, this application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps in the forgery detection method as described in any of the above embodiments.
[0157] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Those skilled in the art will understand that the embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, the embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0158] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0159] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. Although preferred embodiments of the embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of this application.
[0160] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0161] The foregoing has provided a detailed description of the method, electronic device, and storage medium for detecting counterfeit content provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting forged content, characterized in that, The method includes: Lossy compression trace removal processing is performed on the first digital media data to obtain the second digital media data; wherein, the first digital media data includes images or videos; Based on a binary classification network, forgery detection is performed on the second digital media data to obtain a detection result indicating whether the first digital media data is forged content; The binary classification network is trained based on a training sample set, which includes real training samples and fake training samples, and at least some of the samples in the training sample set are trace-removed samples after lossy compression trace removal processing.
2. The method according to claim 1, characterized in that, The detection result is a confidence level indicating that the first digital media data belongs to fake content; or, the detection result is a label indicating whether the first digital media data belongs to fake content or real content.
3. The method according to claim 2, characterized in that, When the detection result is a confidence level, the method further includes: The confidence level is compared with a preset confidence threshold. If the confidence level is greater than or equal to the preset confidence threshold, the first digital media data is determined to be fake content; otherwise, the first digital media data is determined to be real content.
4. The method according to claim 1, characterized in that, The lossy compression trace removal process is implemented using a high-pass filter in the filter set; The filter set includes multiple high-pass filters with different parameter configurations, and each high-pass filter can extract lossy compression traces in digital media data and retain effective high-frequency texture information related to the semantic content of the image in the digital media data. The high-pass filter includes a Gaussian high-pass filter or a Butterworth high-pass filter, and the parameters include the cutoff frequency and / or order.
5. The method according to claim 4, characterized in that, The lossy compression trace removal process corresponding to the trace removal sample is implemented by a high-pass filter randomly selected from the filter set.
6. The method according to claim 4, characterized in that, The lossy compression trace removal processing corresponding to the first digital media data is achieved by a target high-pass filter deployed in the binary classification network, which is the filter with the best removal effect in the filter set.
7. The method according to claim 6, characterized in that, The step of performing lossy compression artifact removal processing on the first digital media data to obtain the second digital media data includes: The first digital media data is transformed in the frequency domain to obtain a frequency domain representation; Using the frequency response function of the target high-pass filter, a filtering operation is performed on the frequency domain representation to suppress low-frequency components unrelated to lossy compression traces and enhance high-frequency components related to lossy compression traces in the frequency domain representation, thereby obtaining the first frequency domain data; Perform an inverse transform on the first frequency domain data to obtain a lossy compression trace feature map in the spatial domain; The second digital media data is obtained by subtracting the pixel value at the corresponding pixel position from the lossy compression trace feature map of the first digital media data.
8. The method according to claim 6, characterized in that, When the first digital media data is video, the step of performing lossy compression artifact removal processing on the first digital media data to obtain the second digital media data includes: Extract at least one frame from the video; The at least one frame of the image is subjected to lossy compression artifact removal processing through the target high-pass filter to obtain at least one frame of processed image; The processed image of at least one frame and the remaining frames in the video together constitute the second digital media data.
9. The method according to any one of claims 4-8, characterized in that, The high-pass filters in the filter set are determined through the following process: Acquire a raw image set; wherein the raw image set contains images that have not been lossily compressed; Using various compression parameters, each of the original images is converted into a lossy compressed image to obtain a set of lossy compressed images; Each of the lossy compressed images in the lossy compressed image set is filtered by using multiple high-pass filters with different parameter configurations. Calculate the texture similarity between the filtered result of each of the lossy compressed images and the corresponding original image; Based on the calculation results of texture similarity, the high-pass filters whose texture similarity is greater than a preset similarity threshold among the multiple high-pass filters to be evaluated are determined as high-pass filters in the filter set.
10. The method according to claim 1, characterized in that, In the training sample set, the training samples used to train the binary classification network are local images that have been randomly cropped. The method of detecting forgery in the second digital media data based on a binary classification network includes: The second digital media data is cropped at a fixed spatial location to obtain a local detection image; Based on a binary classification network, forgery detection is performed on the local detection images.
11. An electronic device, comprising: A memory, a processor, and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the forgery detection method as described in any one of claims 1-10.
12. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the method for detecting forged content as described in any one of claims 1-10.