Image forgery detection model explainability analysis method and system
By employing sparse-constrained nonnegative matrix factorization and frequency domain perturbation methods, the problem of unknowable decision evidence in image forgery detection models is solved, enabling efficient and reliable visualization interpretation and improving the model's transparency and interpretive depth.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-19
AI Technical Summary
Existing image forgery detection models lack transparency and cannot provide visual evidence that humans can understand. Furthermore, existing interpretation methods suffer from insufficient interpretation, instability, and high computational costs.
A nonnegative matrix factorization method with sparsity constraints is used to extract semantic feature maps, and a frequency domain perturbation method is used to quantify the importance of decision evidence, generating a visual saliency evidence map that supports both forgery and authenticity.
It improves the interpretability and reliability of the model, reduces computational overhead, provides clear visual evidence, and enhances the interpretability and credibility of the model.
Smart Images

Figure CN121982501B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for interpretability analysis of image forgery detection models. Background Technology
[0002] Currently, deep learning-based image forgery detection technology has demonstrated a powerful ability to identify fake content generated by generative artificial intelligence or traditional image manipulation methods. However, these high-performance models are generally regarded as "black boxes," lacking transparency in their internal decision-making processes. They can only output binary classification probabilities of true and false, without providing human-understandable visual evidence for making that judgment.
[0003] Existing research has shown that current technologies for image forgery detection have shortcomings. For example, Nazneen Mansoor et al., in their paper "Explainable AI for DeepFake Detection" (2025), pointed out that existing detection systems lack human interpretability and are insufficient in providing coherent and explainable explanations behind their classification decisions. To alleviate this problem, existing technologies attempt to introduce interpretability analysis methods, but most have significant limitations.
[0004] A common approach is to perform independent post-processing on the trained detection model, such as generating coarse class activation heatmaps. The core logic here is to measure the importance of each unit to the final decision by calculating the gradient of the model's output relative to the input pixels or intermediate features. Typical examples include Grad-CAM and its variants. The fundamental assumption of these methods is that the magnitude of the gradient directly reflects the degree to which small changes in the input affect the output. However, their limitations are significant: these methods heavily rely on the selected network layers, and the generated heatmaps often only identify important regions relevant to the decision, failing to reveal the specific visual anomalies driving the decision within those regions. Essentially, this is a post-hoc interpretation after the model's decision-making process, and the interpretation itself may deviate from the model's actual reasoning logic, making it difficult to map the model's high-dimensional features back to human-understandable semantic concepts.
[0005] Another type of research attempts to observe changes in output by perturbing the input, such as blurring or obscuring specific regions, to infer feature importance. The logic is to systematically mask or modify parts of the input, intermediate features, etc., and observe changes in the model's output probability to infer the importance of the modified part. This method is intuitive, but its limitations are equally profound: First, it faces the problem of causal confusion. When masking a region of an image causes a change in prediction, we cannot determine whether this is because genuine forgery evidence has been removed or because the semantic coherence of the image has been disrupted, thus triggering a generalized response to anomalies. Second, it suffers from the computational dilemma of combinatorial explosion. Images contain a massive number of pixels or feature units, making exhaustive perturbation testing computationally difficult. Furthermore, relying on heuristic rules to select perturbation regions introduces subjective bias, casting doubt on the reliability of the interpretation.
[0006] On the other hand, in recent years, using multimodal large language models for simultaneous detection and interpretation has become a cutting-edge research direction. However, this methodology faces its own insurmountable bottlenecks: its performance heavily relies on training with massive amounts of "image-precise description" pairing data, while the cost of fine-grained annotation for highly realistic forgery traces is extremely high and scarce; at the same time, the model may produce illusions, fabricating defects that do not exist in the image as explanations, and its detection accuracy itself often lags behind dedicated models. Coupled with the huge computational overhead, it is difficult to implement and apply it in real-world scenarios.
[0007] In summary, existing technologies present a dilemma: on the one hand, high-performance detection models lack credibility due to their difficulty in interpretation; on the other hand, rudimentary interpretability methods often exhibit problems such as crude, unstable, and unreliable interpretations, making it difficult to interpret what internal features the model uses as evidence to make decisions. Meanwhile, emerging large-scale model approaches are limited by high requirements for training data, the generation of model illusions, and high computational costs. Summary of the Invention
[0008] To address the problem of low model decision-making credibility caused by the lack of transparency of features and evidence used in existing technologies, this invention proposes an interpretability analysis method and system for image forgery detection models. It utilizes non-negative matrix factorization to solve the problem of unknown model decision-making evidence, and then uses frequency domain perturbation to quantify the importance of different decision-making evidence in the decision-making process, which can effectively improve the interpretability of image forgery detection models.
[0009] The technical solution adopted in this invention is as follows:
[0010] An interpretability analysis method for image forgery detection models includes:
[0011] Extract the intermediate layer features of the image forgery detection model to be interpreted, and generate semantic feature maps based on nonnegative matrix factorization with sparsity constraints;
[0012] Perform feature importance pre-screening on the semantic feature map to obtain important feature maps;
[0013] For each important feature map, high activation regions are located and image patches are extracted. The dominant frequency components and bandwidth of the image patches corresponding to the high activation regions are analyzed. A band-stop filter is constructed in the frequency domain of the original image and a perturbation image is generated. Initial weights are assigned to each feature based on the decision distance.
[0014] Features are grouped and fused according to the signs of the initial weights to generate final visual saliency evidence maps that support forgery and authenticity.
[0015] Further, the step of extracting intermediate layer features from the image forgery detection model to be interpreted and generating semantic feature maps based on nonnegative matrix factorization with sparsity constraints includes:
[0016] The intermediate layer output feature tensor of the unexplained image forgery detection model In the spatial dimension Expand into a matrix ,in , , and These represent the height, width, and number of channels of the feature map, respectively. Represents the real number field;
[0017] For matrix transpose matrix Join The nonnegative matrix decomposition with sparsity constraints yields the basis matrix. sum coefficient matrix :
[0018]
[0019] ≥0, ≥0
[0020] in, Represents the objective function for optimization; The Frobenius norm of a matrix is represented by the square root of the sum of the squares of all its elements. Representing a matrix Norm, which is the sum of the absolute values of the elements of a matrix; basis matrix Each column is a semantic basis, and the coefficient matrix Each line corresponds to a global activation of a semantic base; To be applied to the coefficient matrix On The weighting coefficients of the regularization term are used to control the sparsity strength; Indicates the number of basis vectors;
[0021] coefficient matrix Each row is reshaped into a spatial diagram, resulting in A set of semantic feature maps:
[0022]
[0023] in, For the first A semantic feature map, consisting of a coefficient matrix The Reshaping is achieved. .
[0024] Furthermore, after generating the semantic feature map through the nonnegative matrix factorization based on sparsity constraints, the process also includes semantic basis visualization:
[0025] Reference image set Each image in the model is input into the same image forgery detection model, and the same intermediate layer features are extracted. The semantic feature map of each image is calculated and compared with the first image at each spatial location. The dot product of several semantic bases yields the semantic base in the reference image set. Response graph on;
[0026] For the The response maps of each semantic basis are binarized using a response threshold. A value is set to 1 if the response is greater than the threshold, and 0 otherwise, to obtain the activation mask of that semantic basis on the image. If referring to an image set Providing pixel-level semantic annotation means that for each semantic concept... Calculate the activation mask With semantic tags intersection ratio :
[0027]
[0028] In the reference image set The intersection-union ratio of the activation mask with each semantic label is calculated cumulatively over all images to obtain the first... Semantic bases and semantic concepts Overall crossover ratio :
[0029]
[0030] in, It is the size of the reference image set. and They are the first Activation mask and semantic labels for the image;
[0031] Take the intersection and union ratio of the whole The highest one or more semantic labels are used as the final semantic labels. Through this process, each semantic base is assigned a semantic label associated with it. These semantic labels will be used to interpret the specific visual anomaly type corresponding to the highlighted area in the final saliency map.
[0032] Further, the step of performing feature importance pre-screening on the semantic feature map to obtain important feature maps includes:
[0033] On the validation set, for each semantic feature map Calculate the average activation strength vector Compared with the original predicted probability vector of the image forgery detection model for forged images The average activation intensity vector The original predicted probability vector is used to describe the average activity level of a certain semantic feature across all images in the validation set. Used to describe the raw confidence level of an image forgery detection model in determining whether each image in the validation set is forged;
[0034] For the first in the validation set Zhang Image The corresponding number Semantic feature map Average activation intensity vector The calculation formula is:
[0035]
[0036] Calculate the average activation strength vector Compared with the original predicted probability vector Pearson correlation coefficient As a reference for feature importance:
[0037]
[0038] in, Describing covariance, Standard deviation; Pearson correlation coefficient The closer the absolute value is to 1, the stronger the correlation between the average activation intensity of the corresponding feature and the confidence of the model decision.
[0039] reserve The semantic features constitute an important feature map set. ;in, For the preset threshold, , To meet The number of semantic features, .
[0040] Furthermore, for each important feature map, locating highly activated regions and extracting image patches includes:
[0041] Important feature maps Perform threshold processing to find the region with the highest activation value; select all coordinates with activation values greater than the activation threshold, or directly select the connected region containing the maximum activation value as the high activation region;
[0042] Calculate the center coordinates or circumscribed rectangle of the highly activated region; for a rectangular region, define the coordinates of its top-left corner as... The coordinates of the lower right corner are Due to important feature maps It is the original image. The dimensions after downsampling need to be mapped back to the original image coordinates. Size:
[0043]
[0044]
[0045] in, Original image The coordinates of the top left corner, Original image The coordinates of the lower right corner, and Original images Height and width;
[0046] From the original image The rectangular region is cropped out to obtain the image patch. .
[0047] Furthermore, the analysis of the dominant frequency components and bandwidth of the image patch corresponding to the highly activated region includes:
[0048] For image patches After grayscale processing, a two-dimensional discrete Fourier transform is performed:
[0049]
[0050] in, and These are image blocks Width and height, These are frequency domain coordinates, which, after a centering operation, yield a complex spectrum. ;
[0051] To analyze the energy distribution, the power spectrum is calculated. :
[0052]
[0053] In power spectrum In the above, ignoring the center point representing the DC component, we search for the local maximum point with the strongest energy, and the frequency coordinates of this point are... These are the dominant frequency components, converted to coordinates relative to the image center:
[0054]
[0055]
[0056] in, It represents the frequency of the most prominent periodic patterns in the horizontal and vertical directions within the local image content;
[0057] by Centered on the target, calculate the energy distribution of the power spectrum within a corresponding radius; based on a preset energy threshold. Find the value containing that energy threshold. The minimum radius is used as the bandwidth. :
[0058]
[0059] in, Therefore Centered on and with radius The area.
[0060] Further, the step of constructing a band-stop filter in the frequency domain of the original image and generating a perturbed image includes:
[0061] For image patches The spectral parameters are normalized to obtain the normalized spatial frequency. and its radius bandwidth Then, the normalized frequencies are mapped back to the coordinate system of the whole-graph centered spectrum:
[0062]
[0063]
[0064]
[0065] Construct a full-map band-stop filter :
[0066]
[0067]
[0068] in, , This is the scaling factor; As the attenuation factor, it determines in Attenuation intensity at the location;
[0069] Calculate the original image The two-dimensional discrete Fourier transform yields the original spectrum. and the original spectrum With band-stop filter Perform point-by-point complex multiplication to achieve frequency domain perturbation blocking:
[0070]
[0071] The perturbated spectrum Perform a two-dimensional discrete Fourier inverse transform and take the real part to obtain the perturbed image. .
[0072] Furthermore, assigning initial weights to each feature based on decision distance includes:
[0073] Define decision distance ,in The probability of detecting forgery;
[0074] Perturbed image The image is then input into the forgery detection model again for judgment, and the decision distance is considered. Initial weights of design features :
[0075] If the image after disturbance The judgment result is consistent with the original image. If they are different, then the initial weights ; where, if the original image The result indicates it is a forgery, and the image has been perturbed. If the judgment result is true, then If the opposite is true, then ;
[0076] If the image after disturbance The judgment result is consistent with the original image. If they are the same, then the initial weights are... .
[0077] Furthermore, the step of grouping and fusing features based on the signs of the initial weights to generate final visual saliency evidence maps supporting forgery and authenticity includes:
[0078] Feature grouping and weight normalization: Features are divided into groups that support forgery based on the sign of the weights. With support for real groups Within each group, the absolute value of the weights is normalized to obtain the normalized result. :
[0079]
[0080] Weighted fusion to generate the initial saliency map: The semantic feature maps within the same group are weighted and summed according to normalized weights to obtain the initial saliency map. ,Right now and :
[0081]
[0082]
[0083] Spatial optimization: converting the grayscale image of the original input image... As a guide graph, for the initial saliency graph Perform filtering to smooth the internal regions while preserving the edges:
[0084]
[0085] in, This is the optimized saliency map. The filter radius is... For regularization parameters;
[0086] Upsampling and final output: The optimized saliency map Upsampled to the original image size via bilinear upsampling This yielded two final visual saliency evidence maps. and Furthermore, the highlighted areas support the image forgery detection model in identifying regions as forged or real.
[0087] An interpretability analysis system for an image forgery detection model includes:
[0088] The feature extraction and feature map generation module is configured to extract intermediate layer features from the image forgery detection model to be interpreted and generate semantic feature maps based on nonnegative matrix factorization with sparsity constraints.
[0089] The feature importance pre-screening module is configured to perform feature importance pre-screening on the semantic feature map to obtain important feature maps;
[0090] The fine evaluation and weighting module is configured to locate high-activation regions and extract image patches for each important feature map, analyze the dominant frequency components and bandwidth of the image patches corresponding to the high-activation regions, construct a band-stop filter in the frequency domain of the original image and generate a perturbation image, and assign initial weights to each feature based on the decision distance.
[0091] The feature fusion and result output module is configured to group and fuse features based on the signs of the initial weights, generating final visual saliency evidence maps that support both forgery and authenticity.
[0092] The beneficial effects of this invention are as follows:
[0093] This invention utilizes the nonnegative matrix factorization method to address the problem of unknowable model decision evidence, and employs the frequency domain perturbation method to quantify the importance of different decision evidence in the decision-making process, which can effectively improve the interpretability of image forgery detection models. The specific details are as follows.
[0094] 1. Improve the depth of explanation for the model.
[0095] This invention utilizes nonnegative matrix factorization to discover semantic features, decoding the model's internal features into a series of basic visual patterns that are understandable to humans. The final presentation not only shows highlighted areas but also the specific types of visual anomalies corresponding to these areas. This elevates interpretation from simple localization to diagnosis, helping users understand the specific types and traces of forgery.
[0096] 2. Improve the rigor and causal relationships in the evaluation process.
[0097] This invention introduces a causal intervention logic through fine-grained weighting based on frequency domain perturbations. It not only observes the correlation between features and predictions but also proactively and precisely weakens frequency patterns considered important, quantifying the actual impact of this intervention on the model's decision confidence. Only features that lead to a significant decrease in model confidence or a reversal of decisions after intervention are assigned high weights. This hypothesis-intervention-verification process ensures that the final contribution weight assigned to each feature has the rigor of causal inference, significantly improving the reliability and robustness of the interpretation results.
[0098] 3. Improve computing efficiency and resource utilization.
[0099] This invention avoids excessive computational resource consumption and reduces computational overhead by selectively focusing on important features after rapid pre-screening and avoiding the use of computationally expensive model structures. Simultaneously, it maximizes the interpretability and reliability of the model results. Compared to methods that utilize large models for interpretability analysis, this invention is better suited for scenarios with limited resources where the primary resources must be allocated to detection rather than interpretation.
[0100] 4. Optimize the presentation of interpretation results
[0101] Traditional saliency maps are typically heatmaps that mix all evidence together, with opposing evidence superimposed on each other, making them difficult to distinguish and often noisy with blurred boundaries. This invention innovatively outputs both forged evidence maps and genuine evidence maps by grouping and fusing features based on weighted symbols. This presentation clearly reveals the internal trade-offs in the model's decision-making process, allowing users to see evidence supporting and opposing the current judgment simultaneously, making the interpretation more dialectical and persuasive.
[0102] In summary, this invention, by combining nonnegative matrix factorization with frequency domain perturbation occlusion, solves the problem of the uncertainty of which intermediate features are used as evidence for decision-making within an image forgery detection model. This is of great significance for promoting the responsible implementation of AI technology in safety-critical fields. Attached Figure Description
[0103] Figure 1 This is a flowchart of an interpretability analysis method for an image forgery detection model according to Embodiment 1 of the present invention. Detailed Implementation
[0104] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments are now described. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention; that is, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0105] Example 1
[0106] like Figure 1 As shown, this embodiment provides a method for interpretability analysis of an image forgery detection model, including:
[0107] Extract the intermediate layer features of the image forgery detection model to be interpreted, and generate semantic feature maps based on nonnegative matrix factorization with sparsity constraints;
[0108] Perform feature importance pre-screening on the semantic feature map to obtain important feature maps;
[0109] For each important feature map, high activation regions are located and image patches are extracted. The dominant frequency components and bandwidth of the image patches corresponding to the high activation regions are analyzed. A band-stop filter is constructed in the frequency domain of the original image and a perturbation image is generated. Initial weights are assigned to each feature based on the decision distance.
[0110] Features are grouped and fused according to the signs of the initial weights to generate final visual saliency evidence maps that support forgery and authenticity.
[0111] It should be noted that this method can be used to address the problem that existing technologies struggle to explain what internal features a model relies on as evidence for decision-making. By analyzing the activated regions within the model, extracting human-understandable semantic features, and constructing a hierarchical, quantitative, and integrated weight evaluation system, the abstract decisions of the model are mapped into concrete and visualized visual evidence maps, thereby effectively improving the interpretability of the detection model.
[0112] Preferably, the step of extracting intermediate layer features from the image forgery detection model to be interpreted and generating semantic feature maps based on sparse-constrained nonnegative matrix factorization includes:
[0113] The intermediate layer output feature tensor of the unexplained image forgery detection model In the spatial dimension Expand into a matrix ,in , , and These represent the height, width, and number of channels of the feature map, respectively. Represents the real number field.
[0114] For matrix transpose matrix Join The nonnegative matrix decomposition with sparsity constraints yields the basis matrix. sum coefficient matrix :
[0115]
[0116] ≥0, ≥0
[0117] in, Represents the objective function for optimization; The Frobenius norm of a matrix is represented by the square root of the sum of the squares of all its elements. Representing a matrix Norm, which is the sum of the absolute values of all elements of a matrix; Represents the number of basis vectors; basis matrix Each column is a semantic basis, and the coefficient matrix Each line corresponds to a global activation of a semantic base. To be applied to the coefficient matrix On The weighting coefficients of the regularization term are used to control the sparsity strength. Specifically, if The larger the coefficient matrix, the sparser the coefficient matrix obtained by decomposition, meaning that each position is activated by only a few semantic bases, thus making the semantic bases more local and more discriminative.
[0118] coefficient matrix Each row is reshaped into a spatial diagram, resulting in A set of semantic feature maps:
[0119]
[0120] in, For the first A semantic feature map, consisting of a coefficient matrix The Reshaping is achieved. .
[0121] Preferably, after generating the semantic feature map through nonnegative matrix factorization based on sparsity constraints, the method further includes semantic basis visualization:
[0122] Prepare a general reference image set containing rich visual concepts. Such as a subset of ImageNet or the Broden dataset; referencing image sets Each image in the model is input into the same image forgery detection model, and the same intermediate layer features are extracted. The semantic feature map of each image is calculated and compared with the first image at each spatial location. The dot product of several semantic bases yields the semantic base in the reference image set. The response graph above.
[0123] For the The response maps of each semantic basis are binarized using a response threshold, which can be the top 1% or the remainder of all response values. Specifically, a value is set to 1 when the response is greater than the response threshold, and 0 otherwise, to obtain the activation mask of the semantic basis on the image. If referring to an image set Providing pixel-level semantic annotation means that for each semantic concept... Calculate the activation mask With semantic tags intersection ratio :
[0124]
[0125] In the reference image set The intersection-union ratio of the activation mask with each semantic label is calculated cumulatively over all images to obtain the first... Semantic bases and semantic concepts Overall crossover ratio :
[0126]
[0127] in, It is the size of the reference image set. and They are the first Activation mask and semantic labels for an image.
[0128] Take the intersection and union ratio of the whole The highest one or more semantic labels are used as the final semantic labels. Through this process, each semantic base is assigned an associated semantic label. These semantic labels will be used to interpret the specific visual anomaly type corresponding to the highlighted area in the final saliency map, thus completing the visual definition of the semantic base. If the reference image set does not have pixel-level semantic annotations, the image set needs to be processed manually or intelligently before performing the above work.
[0129] Preferably, the step of performing feature importance pre-screening on the semantic feature map to obtain important feature maps includes:
[0130] As an example, prepare a small verification set containing 100 real images and 100 fake images. On a small validation set, for each semantic feature map Calculate the average activation strength vector Compared with the original predicted probability vector of the image forgery detection model for forged images The average activation intensity vector The original predicted probability vector is used to describe the average activity level of a certain semantic feature across all images in the validation set. This is used to describe the raw confidence level of an image forgery detection model in determining whether each image in the validation set is forged.
[0131] For the first in the validation set Zhang Image The corresponding number Semantic feature map Average activation intensity vector The calculation formula is:
[0132]
[0133] Calculate the average activation strength vector Compared with the original predicted probability vector Pearson correlation coefficient As a reference for feature importance:
[0134]
[0135] in, Describing covariance, Standard deviation; Pearson correlation coefficient The closer the absolute value is to 1, the stronger the correlation between the average activation intensity of the corresponding feature and the model's decision confidence, which to some extent indicates the importance of that feature in the model's decision-making. (Retain) The semantic features constitute an important feature map set. ;in, For the preset threshold, , To meet The number of semantic features, .
[0136] Preferably, the step of locating highly activated regions and extracting image patches for each important feature map includes:
[0137] Important feature maps Thresholding is performed to find the region with the highest activation value. Specifically, all coordinates with activation values greater than the activation threshold can be selected, or the connected region containing the maximum activation value can be directly selected as the high-activation region; the center coordinates or the bounding rectangle of the high-activation region are calculated. For simplicity, it is assumed that a rectangular region is obtained, and its upper left corner coordinates are defined as follows: The coordinates of the lower right corner are Due to important feature maps It is the original image. The dimensions after downsampling need to be mapped back to the original image coordinates. Size:
[0138]
[0139]
[0140] in, Original image The coordinates of the top left corner, Original image The coordinates of the lower right corner, and Original images Height and width. From the original image. The rectangular region is cropped out to obtain the image patch. .
[0141] Preferably, the analysis of the dominant frequency components and bandwidth of the image patch corresponding to the highly activated region includes:
[0142] For image patches After grayscale processing, a two-dimensional discrete Fourier transform is performed:
[0143]
[0144] in, and These are image blocks Width and height, These are frequency domain coordinates, which, after a centering operation, yield a complex spectrum. .
[0145] To analyze the energy distribution, the power spectrum is calculated. :
[0146]
[0147] In power spectrum In the above, ignoring the center point representing the DC component, we search for the local maximum point with the strongest energy, and the frequency coordinates of this point are... These are the dominant frequency components, converted to coordinates relative to the image center:
[0148]
[0149]
[0150] in, It represents the frequency of the most prominent periodic patterns in the horizontal and vertical directions within the local image content.
[0151] by Centered on the target, calculate the energy distribution of the power spectrum within a corresponding radius; based on a preset energy threshold. Find the value containing that energy threshold. The minimum radius is used as the bandwidth. :
[0152]
[0153] in, Therefore Centered on and with radius The area.
[0154] In the field of signal processing, energy threshold The selection is generally 90%-99%. Specifically, 95% can be selected as the default value to capture most of the effective energy while filtering out some noise, and then fine-tuned according to the actual situation.
[0155] Preferably, the step of constructing a band-stop filter in the frequency domain of the original image and generating a perturbed image includes:
[0156] For image patches The spectral parameters are normalized to obtain the normalized spatial frequency. and its radius bandwidth Then, the normalized frequencies are mapped back to the coordinate system of the whole-graph centered spectrum:
[0157]
[0158]
[0159]
[0160] Construct a full-map band-stop filter :
[0161]
[0162]
[0163] in, , This is the scaling factor; As the attenuation factor, it determines in The attenuation intensity at that location.
[0164] Calculate the original image The two-dimensional discrete Fourier transform yields the original spectrum. and the original spectrum With band-stop filter Perform point-by-point complex multiplication to achieve frequency domain perturbation blocking:
[0165]
[0166] The perturbated spectrum Perform a two-dimensional discrete Fourier inverse transform and take the real part to obtain the perturbed image. .
[0167] Preferably, assigning initial weights to each feature based on decision distance includes:
[0168] Define decision distance ,in For forgery detection probability; the perturbed image The image is then input into the forgery detection model again for judgment, and the decision distance is considered. Initial weights of design features :
[0169] If the image after disturbance The judgment result is consistent with the original image. If they are different, then the initial weights ; where, if the original image The result indicates it is a forgery, and the image has been perturbed. If the judgment result is true, then If the opposite is true, then .
[0170] If the image after disturbance The judgment result is consistent with the original image. If they are the same, then the initial weights are... .
[0171] Preferably, the step of grouping and fusing features according to the signs of the initial weights to generate final visual saliency evidence maps supporting forgery and authenticity includes:
[0172] (1) Feature grouping and weight normalization
[0173] Features are categorized into groups supporting forgery based on their weight signs. With support for real groups Within each group, the absolute value of the weights is normalized to obtain the normalized result. :
[0174]
[0175] (2) Weighted fusion generates the initial saliency map
[0176] The semantic feature maps within the same group are weighted and summed according to normalized weights to obtain the initial saliency map. ,Right now and :
[0177]
[0178]
[0179] (3) Space optimization
[0180] To improve the spatial coherence of the initial image and suppress noise, guided filtering can be used to optimize the image. This involves converting the grayscale image of the original input image... As a guide graph, for the initial saliency graph Perform filtering to smooth the internal regions while preserving the edges:
[0181]
[0182] in, This is the optimized saliency map. The filter radius is... This is the regularization parameter.
[0183] It should be noted that this step can effectively enhance the consistency of salient regions without introducing complex models. The spatial optimization work here mainly focuses on improving the spatial coherence of the salient map rather than restoring color information. Compared to using color images for guidance, using grayscale images for guidance is less complex and less susceptible to interference from potential color variations in the original image.
[0184] (4) Upsampling and final output
[0185] The optimized saliency map Upsampled to the original image size via bilinear upsampling This yielded two final visual saliency evidence maps. and Furthermore, the highlighted areas support the image forgery detection model in identifying regions as forged or real.
[0186] Accordingly, this embodiment also provides an interpretability analysis system for image forgery detection models, including:
[0187] The feature extraction and feature map generation module is configured to extract intermediate layer features from the image forgery detection model to be interpreted and generate semantic feature maps based on nonnegative matrix factorization with sparsity constraints.
[0188] The feature importance pre-screening module is configured to perform feature importance pre-screening on the semantic feature map to obtain important feature maps;
[0189] The fine evaluation and weighting module is configured to locate high-activation regions and extract image patches for each important feature map, analyze the dominant frequency components and bandwidth of the image patches corresponding to the high-activation regions, construct a band-stop filter in the frequency domain of the original image and generate a perturbation image, and assign initial weights to each feature based on the decision distance.
[0190] The feature fusion and result output module is configured to group and fuse features based on the signs of the initial weights, generating final visual saliency evidence maps that support both forgery and authenticity.
[0191] In summary, this embodiment processes the feature output of the intermediate layer of the detected model by introducing a non-negative matrix factorization with sparsity constraints, decomposing it into a set of semantic bases and their spatial activation maps to address the problem of unknown evidence for model decisions. Each semantic base can be understood as a basic feature template learned by the model from a large amount of data, such as a specific texture, edge, or frequency pattern. The sparsity constraint makes each template tend to respond strongly only to a few specific types of visual patterns, thus making it more discriminative. Subsequently, for some important features, band-stop filters are constructed to perturb them in their dominant frequency bands, and initial weights are assigned based on the change in the model's decision distance before and after the perturbation. The frequency domain perturbation is chosen because numerous studies have found that mainstream generative models, such as GANs and diffusion models, leave specific frequency domain statistical traces in images. Attenuating the feature-dominant frequency band is a precise and targeted causal intervention aimed at verifying whether the frequency band pattern is indeed the basis for the model's decision, which is more theoretically grounded and targeted than blindly occluding image patches. Finally, based on the weight symbols, the features are divided into two groups: those supporting forgery and those supporting reality. Intra-group normalization and weighted fusion are then performed on each group to generate two initial saliency maps, making them more spatially coherent. This allows users to clearly understand the evidence on which the model makes its final decision, thus providing a more in-depth, thorough, and credible model interpretability analysis solution.
[0192] Example 2
[0193] This embodiment is based on embodiment 1:
[0194] This embodiment provides a method for interpretability analysis of an image forgery detection model, including:
[0195] Step 1: Dataset and Model Preparation
[0196] Prepare an Xception image forgery detection model pre-trained on the FaceForensics++ dataset, and an input image of size 224×224 to be analyzed. A pixel-level concept annotation portion using the Broden dataset, containing a large image set with rich natural objects, textures, and colors. And a small verification set containing 100 real and 100 fake images. .
[0197] Step 2: Semantic Feature Discovery
[0198] Image The input to the Xception model is used to extract feature tensors from its depthwise separable convolutional layers. These tensors are then matrixed and decomposed into nonnegative matrices. With K=32, 32 semantic feature maps are obtained.
[0199] Step 3: Semantic base visualization attribution
[0200] Image set The data is input into the Xception model, where features are extracted and stored. For different semantic bases, the dot product of the base with each image feature map at each spatial location is calculated to obtain the response map, thus yielding a visual definition of each semantic base.
[0201] Step 4: Quick Pre-screening
[0202] In small validation sets The Pearson correlation coefficient between the average activation vector of each semantic basis and the model's predicted probability vector was calculated, and the top ten features with the highest correlation were selected as important features for further research.
[0203] Step 5: Detailed Evaluation and Weighting
[0204] For each feature, the following steps are performed: High-activation regions are identified on the feature map, mapped back to the original image, and image patches are cropped. FFT analysis is performed on the image patches to obtain the dominant frequency and bandwidth corresponding to the feature. These are then mapped to the full-image spectrum, and a Gaussian band-stop filter is constructed to generate a perturbed image that blocks the frequency components. The perturbed image is then input into the model, and the decision results and confidence scores of the model before and after perturbation are compared. The initial weights for each feature are calculated using a formula.
[0205] Step 6: Integration, Optimization, and Output
[0206] After grouping and normalizing the weights of each feature, two initial saliency maps are generated by weighted fusion. Then, using the original image as a guide, the initial saliency maps are filtered to obtain a more spatially coherent optimized saliency map. Finally, an upsampling process is performed to a size of 224×224 to obtain the final saliency map.
[0207] Example 3
[0208] This embodiment is based on embodiment 1:
[0209] This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the interpretability analysis method of the image forgery detection model in Embodiment 1. The computer program can be in the form of source code, object code, executable file, or some intermediate form.
[0210] Example 4
[0211] This embodiment is based on embodiment 1:
[0212] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the interpretability analysis method of the image forgery detection model in Embodiment 1. The computer program can be in the form of source code, object code, executable file, or some intermediate form. The storage medium includes any entity or device capable of carrying computer program code, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0213] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
[0214] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
Claims
1. A method for interpretability analysis of an image forgery detection model, characterized in that, include: Extract the intermediate layer features of the image forgery detection model to be interpreted, and generate semantic feature maps based on nonnegative matrix factorization with sparsity constraints; Perform feature importance pre-screening on the semantic feature map to obtain important feature maps; For each important feature map, high activation regions are located and image patches are extracted. The dominant frequency components and bandwidth of the image patches corresponding to the high activation regions are analyzed. A band-stop filter is constructed in the frequency domain of the original image and a perturbation image is generated. Initial weights are assigned to each feature based on the decision distance. Features are grouped and fused according to the signs of the initial weights to generate final visual saliency evidence maps that support forgery and authenticity respectively; The step of constructing a band-stop filter in the frequency domain of the original image and generating a perturbed image includes: Extracted image patches The spectral parameters are normalized to obtain the normalized spatial frequency. and its radius bandwidth Then, the normalized frequencies are mapped back to the coordinate system of the whole-graph centered spectrum: Construct a full-map band-stop filter : in, , This is the scaling factor; As the attenuation factor, it determines in Attenuation intensity at the location; Calculate the original image The two-dimensional discrete Fourier transform yields the original spectrum. and the original spectrum With band-stop filter Perform point-by-point complex multiplication to achieve frequency domain perturbation blocking: The perturbated spectrum Perform a two-dimensional discrete Fourier inverse transform and take the real part to obtain the perturbed image. ; The process of assigning initial weights to each feature based on decision distance includes: Define decision distance ,in The probability of detecting forgery; Perturbed image The image is then input into the forgery detection model again for judgment, and the decision distance is considered. Initial weights of design features : If the image after disturbance The judgment result is consistent with the original image. If they are different, then the initial weights ; where, if the original image The result indicates it is a forgery, and the image has been perturbed. If the judgment result is true, then If the opposite is true, then ; If the image after disturbance The judgment result is consistent with the original image. If they are the same, then the initial weights are... ; The process of grouping and fusing features based on the signs of the initial weights to generate final visual saliency evidence maps supporting both forgery and authenticity includes: Feature grouping and weight normalization: Features are divided into groups that support forgery based on the sign of the weights. With support for real groups Within each group, the absolute value of the weights is normalized to obtain the normalized result. : Weighted fusion to generate the initial saliency map: The semantic feature maps within the same group are weighted and summed according to normalized weights to obtain the initial saliency map. ,Right now and : Spatial optimization: converting the grayscale image of the original input image... As a guide graph, for the initial saliency graph Perform filtering to smooth the internal regions while preserving the edges: in, This is the optimized saliency map. The filter radius is... For regularization parameters; Upsampling and final output: The optimized saliency map Upsampled to the original image size via bilinear upsampling This yielded two final visual saliency evidence maps. and Furthermore, the highlighted areas support the image forgery detection model in identifying regions as forged or real.
2. The interpretability analysis method for the image forgery detection model according to claim 1, characterized in that, The step of extracting intermediate layer features from the image forgery detection model to be interpreted and generating semantic feature maps based on nonnegative matrix factorization with sparsity constraints includes: The intermediate layer output feature tensor of the unexplained image forgery detection model In the spatial dimension Expand into a matrix ,in , , and These represent the height, width, and number of channels of the feature map, respectively. Represents the real number field; For matrix transpose matrix Join The nonnegative matrix decomposition with sparsity constraints yields the basis matrix. sum coefficient matrix : ≥0, ≥0 in, Represents the objective function for optimization; The Frobenius norm of a matrix is represented by the square root of the sum of the squares of all its elements. Representing a matrix Norm, which is the sum of the absolute values of the elements of a matrix; basis matrix Each column is a semantic basis, and the coefficient matrix Each line corresponds to a global activation of a semantic base; To be applied to the coefficient matrix On The weighting coefficients of the regularization term are used to control the sparsity strength; Indicates the number of basis vectors; coefficient matrix Each row is reshaped into a spatial diagram, resulting in A set of semantic feature maps: in, For the first A semantic feature map, consisting of a coefficient matrix The Reshaping is achieved. .
3. The interpretability analysis method for the image forgery detection model according to claim 2, characterized in that, After generating the semantic feature map through the nonnegative matrix factorization based on sparse constraints, the method also includes semantic basis visualization: Reference image set Each image in the model is input into the same image forgery detection model, and the same intermediate layer features are extracted. The semantic feature map of each image is calculated and compared with the first image at each spatial location. The dot product of several semantic bases yields the semantic base in the reference image set. Response graph on; For the The response maps of each semantic basis are binarized using a response threshold. A value is set to 1 if the response is greater than the threshold, and 0 otherwise, to obtain the activation mask of that semantic basis on the image. If referring to an image set Providing pixel-level semantic annotation means that for each semantic concept... Calculate the activation mask With semantic tags intersection ratio : In the reference image set The intersection-union ratio of the activation mask with each semantic label is calculated cumulatively over all images to obtain the first... Semantic bases and semantic concepts Overall crossover ratio : in, It is the size of the reference image set. and They are the first Activation mask and semantic labels for the image; Take the intersection and union ratio of the whole The highest one or more semantic labels are used as the final semantic labels. Through this process, each semantic base is assigned a semantic label associated with it. These semantic labels will be used to interpret the specific visual anomaly type corresponding to the highlighted area in the final saliency map.
4. The interpretability analysis method for the image forgery detection model according to claim 2, characterized in that, The step of performing feature importance pre-screening on the semantic feature map to obtain important feature maps includes: On the validation set, for each semantic feature map Calculate the average activation strength vector Compared with the original predicted probability vector of the image forgery detection model for forged images The average activation intensity vector The original predicted probability vector is used to describe the average activity level of a certain semantic feature across all images in the validation set. Used to describe the raw confidence level of an image forgery detection model in determining whether each image in the validation set is forged; For the first in the validation set Zhang Image The corresponding number Semantic feature map Average activation intensity vector The calculation formula is: Calculate the average activation strength vector Compared with the original predicted probability vector Pearson correlation coefficient As a reference for feature importance: in, Describing covariance, Standard deviation; Pearson correlation coefficient The closer the absolute value is to 1, the stronger the correlation between the average activation intensity of the corresponding feature and the confidence of the model decision. reserve The semantic features constitute an important feature map set. ;in, For the preset threshold, , To meet The number of semantic features, .
5. The interpretability analysis method for the image forgery detection model according to claim 4, characterized in that, The step of locating high-activation regions and extracting image patches for each important feature map includes: Important feature maps Perform threshold processing to find the region with the highest activation value; select all coordinates with activation values greater than the activation threshold, or directly select the connected region containing the maximum activation value as the high activation region; Calculate the center coordinates or circumscribed rectangle of the highly activated region; for a rectangular region, define the coordinates of its top-left corner as... The coordinates of the lower right corner are Due to important feature maps It is the original image. The dimensions after downsampling need to be mapped back to the original image coordinates. Size: in, Original image The coordinates of the top left corner, Original image The coordinates of the lower right corner, and Original images Height and width; From the original image The rectangular region is cropped out to obtain the image patch. .
6. The interpretability analysis method for the image forgery detection model according to claim 5, characterized in that, The analysis of the dominant frequency components and bandwidth of the image blocks corresponding to the highly activated regions includes: For image patches After grayscale processing, a two-dimensional discrete Fourier transform is performed: in, and These are image blocks Width and height, These are frequency domain coordinates, which, after a centering operation, yield a complex spectrum. ; To analyze the energy distribution, the power spectrum is calculated. : In power spectrum In the above, ignoring the center point representing the DC component, we search for the local maximum point with the strongest energy, and the frequency coordinates of this point are... These are the dominant frequency components, converted to coordinates relative to the image center: in, It represents the frequency of the most prominent periodic patterns in the horizontal and vertical directions within the local image content; by Centered on the target, calculate the energy distribution of the power spectrum within a corresponding radius; based on a preset energy threshold. Find the value containing that energy threshold. The minimum radius is used as the bandwidth. : in, Therefore Centered on and with radius The area.
7. An interpretability analysis system for an image forgery detection model, employing the interpretability analysis method for an image forgery detection model as described in claim 1, characterized in that, include: The feature extraction and feature map generation module is configured to extract intermediate layer features from the image forgery detection model to be interpreted and generate semantic feature maps based on nonnegative matrix factorization with sparsity constraints. The feature importance pre-screening module is configured to perform feature importance pre-screening on the semantic feature map to obtain important feature maps; The fine evaluation and weighting module is configured to locate high-activation regions and extract image patches for each important feature map, analyze the dominant frequency components and bandwidth of the image patches corresponding to the high-activation regions, construct a band-stop filter in the frequency domain of the original image and generate a perturbation image, and assign initial weights to each feature based on the decision distance. The feature fusion and result output module is configured to group and fuse features based on the signs of the initial weights, generating final visual saliency evidence maps that support both forgery and authenticity.
Citation Information
Patent Citations
Visual interpretation method and system for deep neural network model.
CN112861933A
Systems and methods for detection and localization of image and document forgery
US20180101751A1