Image tamper detection algorithm based on high-frequency amplitude and regional amplification

CN117576547BActive Publication Date: 2026-09-18TIANJIN UNIVERSITY OF TECHNOLOGY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311297758.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2026-09-18
Estimated Expiration
2043-10-09

AI Technical Summary

Technical Problem

[0005]本发明针对现有技术的不足,提出了一种基于高频分幅和区域放大的图像篡改检测算法,该发明可以解决传统图像篡改检测算法区分利用图像边缘特征和噪声特征不准确的问题,以及传统图像篡改检测算法存在的大量假阳性问题

Benefits of technology

[0062] 1) To address the problem of image tampering detection technology, an image tampering detection algorithm based on high-frequency sizing and regional magnification is proposed to learn generalized image tampering traces and features, which can effectively deal with various image tampering methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117576547B_ABST
    Figure CN117576547B_ABST
Patent Text Reader

Abstract

This invention relates to the fields of computer vision and deep learning, and particularly to an image tampering detection algorithm based on high-frequency amplitude division and region magnification. The algorithm includes the following steps: converting an RGB image into a frequency domain image using a two-dimensional Fourier transform and filtering out high-frequency features using a high-pass filter; dividing the high-frequency features into high-frequency high-amplitude and high-frequency low-amplitude features according to their amplitude; jointly extracting RGB features and high-frequency low-amplitude features using a cross-modal feature extraction network based on Vision Transformer; extracting high-frequency high-amplitude features using Pyramid Vision Transformer; magnifying the tampered region of interest using specific edges identified by the high-frequency high-amplitude features; training the network using a joint loss function constraint; and performing image tampering detection using the trained model. This invention solves the problems of inaccurate differentiation between image edge features and noise features in traditional image tampering detection algorithms, as well as the large number of false positives present in traditional image tampering detection algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and deep learning technology, and in particular to an image tampering detection algorithm based on high-frequency amplitude division and region magnification. Background Technology

[0002] Before the development of deep learning, most methods relied on manually designed features or simply explored features from RGB images for image tampering detection. These included: (1) Pattern noise estimation algorithms, where different imaging devices have different pattern noise, and this algorithm judged whether an image had been tampered with based on whether the pattern noise within the image was consistent; (2) Illumination inconsistency characteristics, where the illumination of an image is consistent during imaging, and image tampering changes this characteristic, so this method judged whether an image had been tampered with by judging the consistency of illumination. However, these characteristics of imaging devices can be masked by new tampering methods; for example, copying and pasting one part of an image to another, since the tampered area comes from the same image, this tampering will not change the pattern noise, CFA interpolation algorithm, and illumination properties within the image. Image tampering detection methods based on the inherent properties of imaging devices will then fail.

[0003] Deep learning-based methods focus on detecting traces left by image manipulation. Different manipulation techniques and post-processing often induce inconsistencies at the edges of the manipulated area; these inconsistencies are a direct result of the manipulation. Deep neural networks, through labeled supervision, can capture the features of these inconsistencies. Furthermore, different manipulation techniques may introduce various noises within the image, and deep neural networks can also learn the differences in these noises. In summary, deep learning methods can adaptively learn various manipulation features, making them a powerful tool for image manipulation detection.

[0004] Therefore, to address the above problems, an image tampering detection algorithm based on high-frequency amplitude division and regional magnification is proposed. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention proposes an image tampering detection algorithm based on high-frequency amplitude division and regional magnification. This invention can solve the problem that traditional image tampering detection algorithms are inaccurate in distinguishing between image edge features and noise features, as well as the problem of a large number of false positives in traditional image tampering detection algorithms.

[0006] The technical solution of this invention to solve the technical problem is: an image tampering detection algorithm based on high-frequency amplitude division and regional magnification, comprising the following steps:

[0007] S1. The RGB image is converted into frequency domain features through two-dimensional Fourier transform, and the high-frequency features of the image are filtered out through a high-pass filter;

[0008] S2. High-frequency characteristics are divided into high-frequency high-amplitude and high-frequency low-amplitude based on amplitude:

[0009] S3. Use a cross-modal feature extraction network based on the Vision Transformer to jointly extract RGB features and high-frequency low-amplitude features;

[0010] S4. Input the high-frequency, high-vibration-rate features into the Pyramid Vision Transformer for further extraction, capture specific tampered edges and suppress edge responses in non-tampered areas;

[0011] S5. Amplify the tampered region of interest by focusing on specific edges based on high-frequency, high-amplitude characteristics;

[0012] S6. The network is trained using a joint loss function. Two links are set up in the network. The loss function is divided into two parts: one part calculates the classification loss generated by the segmentation of the tampered region edge, and the other part calculates the classification loss generated by the segmentation of the image tampered region.

[0013] S7. Use the trained model to detect image tampering. The network output is processed by a sigmoid activation function. Each pixel value is between 0 and 1. With 0.5 as the threshold, pixels greater than 0.5 are considered tampered pixels, and pixels less than 0.5 are considered non-tampered pixels.

[0014] S1 specifically includes the following process:

[0015] S11. Convert the RGB image to a grayscale image, and use a two-dimensional Fourier transform to convert the RGB image into frequency domain features;

[0016] S12. Design a high-pass filter with a value of 1 in the edge region and 0 in the center region to filter out the high-frequency features of the image;

[0017] The formulas used in S1 are as follows:

[0018] frequency=fft2d(rgb2gray(image)),

[0019] Where frequency represents frequency domain information, fft2d represents two-dimensional Fourier convolution, which converts the image into the frequency domain, rgb2gray represents reading the RGB image in grayscale form, and image represents the image used for detection.

[0020] highpass filter =np.ones(rows, cols),

[0021] Where `rows` represents the width of the frequency domain plot, `cols` represents the height of the frequency domain plot, and `np.ones` indicates that the `ones` function from the `numpy` package was called to generate a matrix with width `rows` and height `cols`, containing only 1s as elements. `np` is short for `numpy`, which represents a numerical computation method. `highpass`... filter It is a matrix whose elements are all 1s;

[0022] highpass filter [xrow-d: xrow+d, xcol-d: xcol+d]=0 (d=30),

[0023] frequency high =frequency * highpass filter ,

[0024] Where xrow represents half the width of the frequency domain plot, and xcol represents half the height of the frequency domain plot; d represents the float size, set to 30; xrow-d: xrow+d, xcol-d: xcol+d represent a range, xrow-d: xrow+d is half the width of the frequency domain plot minus the float value d to half the width of the frequency domain plot plus the float value, representing the width of the range, xcol-d: xcol+d is half the height of the frequency domain plot minus the float value d to half the height of the frequency domain plot plus the float value d, representing the height of the range, frequency high This represents the high-frequency information obtained.

[0025] S2 specifically includes the following process:

[0026] S21. The absolute value of the filtered high-frequency features is used to obtain the amplitude spectrum, and the amplitude value in the amplitude spectrum represents the density of the features;

[0027] S22. Regularize the amplitude value to between 0 and 1, set the threshold to 0.5, obtain high-frequency, high-amplitude features from the high-frequency features, retain the amplitude value greater than the threshold, and set the amplitude value less than the threshold to 0; obtain high-frequency, low-amplitude features from the high-frequency features, set the amplitude value greater than the threshold to 0, and retain the amplitude value less than the threshold to 0.

[0028] The formula used in S2 is as follows:

[0029] amplitude=normalize(np.abs(frequency high )),

[0030] Where amplitude represents the obtained amplitude value, normalize means regularizing the amplitude value to between 0 and 1, and frequency... highTo represent high-frequency information, np.abs means taking the absolute value to obtain the amplitude value of the high-frequency information;

[0031] frequency high amplitude high =frequency high *(amplitude > threshold)

[0032] The resulting characteristic is high frequency and high amplitude, where threshold = 0.5, and threshold represents the threshold value. high Indicates high amplitude;

[0033] frequency high amplitude high =ifft2d(frequency) high amplitude high ),

[0034] This transforms the high-frequency, high-amplitude characteristics into the RGB domain, where ifft2d represents the inverse two-dimensional Fourier transform, and amplitude... high Indicates high amplitude;

[0035] frequency high amplitude low =frequency high *(amplitude < threshold),

[0036] The resulting characteristic is high frequency and low amplitude, where threshold = 0.5, and threshold represents the threshold value. low Indicates low amplitude;

[0037] frequency high amplitude low =ifft2d(frequency) high amplitude low ),

[0038] This transforms the high-frequency, low-amplitude characteristics into the RGB domain, where ifft2d represents the inverse two-dimensional Fourier transform, and amplitude... low This indicates a low amplitude.

[0039] The specific steps of S3 are as follows: Input the RGB features and high-frequency low-amplitude features into a network containing a feature correction module and a feature fusion module, so that the RGB features and high-frequency low-amplitude features are complementary;

[0040] The specific formula in S3 is as follows:

[0041] f i =net(frequency) high amplitude low , rgb), i=1, 2, 3, 4,

[0042] Among them, f i This indicates the corrected and fused extracted features, frequency. high amplitude low represents high-frequency, low-amplitude features, rgb represents RGB features, and net represents a cross-modal feature extraction network based on Vision Transformer.

[0043] The specific formula in S4 is as follows:

[0044] e i =net v (frequency high amplitude high ),

[0045] edge fre =decoder edge (e i ),

[0046] i = 1, 2, 3, 4

[0047] Among them, e i This indicates the extracted high-frequency, high-amplitude features that contain more edge information. v This represents the PyramidVision Transformer feature extraction network, frequency. high amplitude high Indicates high-frequency, high-amplitude characteristics, edge fre The decoder represents the specific tampering edges of interest related to high-frequency, high-amplitude features. edge This represents the decoder that generates specific tampering edges, where i represents different scales, and i = 1, 2, 3, 4 represents the feature extraction network net. v The extracted features have four scales.

[0048] 6. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that,

[0049] S5 specifically includes the following processes:

[0050] S51. Input the tampering edge of high frequency and high amplitude features and the joint features extracted by the cross-modal feature extraction network based on Vision Transformer into the region magnification module;

[0051] S52. Sample the tampered edge to the same size as the joint feature, perform a convolution operation on the tampered edge using a Gaussian convolution kernel, and then normalize the obtained value to between 0 and 1. The Gaussian convolution kernel can blur the non-tampered edge, making the tampered edge relatively more accurate; perform a two-dimensional convolution operation on the tampered edge, and normalize the obtained value to between 0 and 1 again.

[0052] S53. Take the maximum value of the original tampered edge, the tampered edge after Gaussian convolution kernel, the tampered edge after 2D convolution, and the specific tampered edge of interest from the original high-frequency, high-amplitude features. Multiply the maximum value element-wise with the joint features to amplify the tampered edge.

[0053]

[0054]

[0055] Where weight represents the result, abs represents taking the absolute value, pool represents the pooling operation, target represents the label of the tampered region, and BCE LOSS This represents the result obtained, where N represents the total number of samples, and y i p represents the category to which the i-th pixel belongs. i Let represent the predicted value of the category to which the i-th pixel belongs, sum represents the summation, pre represents the model's prediction result, log represents the natural logarithm, and loss represents the predicted value of the i-th pixel. seg The loss represents the classification loss caused by segmenting the image tampered region. edge This represents the classification loss caused by altering the segmentation of the region's edges.

[0056] The specific formula used in S7:

[0057]

[0058]

[0059]

[0060] Where TP represents true positive samples, which is the number of pixels that were actually tampered but were predicted as tampered; FP represents false positive samples, which is the number of pixels that were actually not tampered but were predicted as tampered; FN represents false negative samples, which is the number of pixels that were actually tampered but were predicted as not tampered; F1 represents the F1 score; Precision represents accuracy; and Recall represents recall.

[0061] The above technical solution has the following advantages or beneficial effects:

[0062] 1) To address the problem of image tampering detection technology, an image tampering detection algorithm based on high-frequency sizing and regional magnification is proposed to learn generalized image tampering traces and features, which can effectively deal with various image tampering methods.

[0063] 2) The high-frequency features are divided into high-frequency high-amplitude features and high-frequency low-amplitude features by using the amplitude division method. The high-frequency high-amplitude features contain more edge information, while the high-frequency low-amplitude features contain more noise information. By exploring the edge differences and noise information of the tampered image from the high-frequency features, the problem of the inaccuracy of traditional image tampering detection algorithms in distinguishing between image edge features and noise features is solved.

[0064] 3) By utilizing the specific edges of high-frequency, high-amplitude features to amplify the tampered region of interest, the model can focus on tampering with specific edge responses, thus solving the problem of numerous false positives in traditional image tampering detection algorithms.

[0065] 4) The image tampering detection algorithm based on high-frequency amplitude division and regional magnification of the present invention has achieved excellent results in relevant image tampering datasets. Attached Figure Description

[0066] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0067] Figure 1 This is a flowchart of the present invention.

[0068] Figure 2 A framework diagram of the network designed for this invention.

[0069] Figure 3 Example 1 of image manipulation.

[0070] Figure 4 Example 2 of image manipulation. Detailed Implementation

[0071] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0072] Example 1

[0073] like Figures 1 to 2 As shown, an image tampering detection algorithm based on high-frequency amplitude division and region magnification includes the following steps:

[0074] S1. The RGB image is converted into frequency domain features through two-dimensional Fourier transform, and the high-frequency features of the image are filtered out through a high-pass filter;

[0075] S2. High-frequency characteristics are divided into high-frequency high-amplitude and high-frequency low-amplitude based on amplitude:

[0076] S3. Use a cross-modal feature extraction network based on the Vision Transformer to jointly extract RGB features and high-frequency low-amplitude features;

[0077] S4. Input the high-frequency, high-vibration-rate features into the Pyramid Vision Transformer for further extraction, capture specific tampered edges and suppress edge responses in non-tampered areas;

[0078] S5. Amplify the tampered region of interest by focusing on specific edges based on high-frequency, high-amplitude characteristics;

[0079] S6. The network is trained using a joint loss function. Two links are set up in the network. The loss function is divided into two parts: one part calculates the classification loss generated by the segmentation of the tampered region edge, and the other part calculates the classification loss generated by the segmentation of the image tampered region.

[0080] S7. Use the trained model to detect image tampering. The network output is processed by a sigmoid activation function. Each pixel value is between 0 and 1. With 0.5 as the threshold, pixels greater than 0.5 are considered tampered pixels, and pixels less than 0.5 are considered non-tampered pixels.

[0081] The specific steps for S1 are as follows:

[0082] The RGB image is converted into a frequency domain image using a two-dimensional Fourier transform, and the high-frequency features of the image are filtered out using a high-pass filter.

[0083] First, the RGB image is converted into a grayscale image. Then, a two-dimensional Fourier transform is used to convert the RGB image into frequency domain information. After the two-dimensional Fourier transform, the high-frequency information is located at the edges of the image far from the center, and the low-frequency information is located in the central region of the image. Therefore, a high-pass filter is designed with 0 in the central region and 1 in the edge region far from the center to filter out the high-frequency information of the image.

[0084] The formulas used in S1 are as follows:

[0085] frequency=fft2d(rgb2gray(image)),

[0086] Where frequency represents frequency domain information, fft2d represents two-dimensional Fourier convolution, which converts the image into the frequency domain, rgb2gray represents reading the RGB image in grayscale form, and image represents the image used for detection.

[0087] highpass filter =np.ones(rows, cols),

[0088] Where `rows` represents the width of the frequency domain plot, `cols` represents the height of the frequency domain plot, and `np.ones` indicates that the `ones` function from the `numpy` package was called to generate a matrix with width `rows` and height `cols`, containing only 1s as elements. `np` is short for `numpy`, which represents a numerical computation method. `highpass`... filter It is a matrix whose elements are all 1s;

[0089] highpass filter [xrow-d: xrow+d, xcol-d: xcol+d]=0 (d=30),

[0090] frequency high =frequency * highpass filter ,

[0091] Where xrow represents half the width of the frequency domain plot, and xcol represents half the height of the frequency domain plot; d represents the float size, set to 30; xrow-d: xrow+d, xcol-d: xcol+d represent a range, xrow-d: xrow+d is half the width of the frequency domain plot minus the float value d to half the width of the frequency domain plot plus the float value, representing the width of the range, xcol-d: xcol+d is half the height of the frequency domain plot minus the float value d to half the height of the frequency domain plot plus the float value d, representing the height of the range, frequency high This represents the high-frequency information obtained.

[0092] The specific steps for S2 are as follows:

[0093] This invention addresses the problem of traditional image tampering detection algorithms' inaccurate differentiation between image edge features and noise features by designing and inventing an amplitude segmentation module. This module divides high-frequency features into high-frequency high-amplitude and high-frequency low-amplitude features. The specific operation is as follows: First, the absolute values ​​of the filtered high-frequency features are used to obtain the amplitude spectrum. The amplitude values ​​in the spectrum represent the density of the features. Therefore, the high amplitude values ​​obtained by amplitude segmentation within the high-frequency features represent regions with dense high-frequency features, containing more edge information; the low amplitude values ​​represent regions with sparse high-frequency features, containing more noise information. Thus, the method proposed in this invention can effectively distinguish edge features from noise features in the frequency domain. Then, the amplitude values ​​are regularized to between 0 and 1. A threshold of 0.5 is set; amplitude values ​​greater than this threshold are retained, and amplitude values ​​less than this threshold are set to 0; thus, high-frequency high-amplitude features are obtained from the high-frequency features. Similarly, amplitude values ​​greater than the threshold are set to 0, and amplitude values ​​less than the threshold are retained; thus, high-frequency low-amplitude features are obtained from the high-frequency features.

[0094] The formula used in S2 is as follows:

[0095] amplitude=normalize(np.abs(frequency high )),

[0096] Where amplitude represents the obtained amplitude value, normalize means regularizing the amplitude value to between 0 and 1, and frequency... high To represent high-frequency information, np.abs means taking the absolute value to obtain the amplitude value of the high-frequency information;

[0097] frequency high amplitude high =frequency high *(amplitude > threshold)

[0098] The resulting characteristic is high frequency and high amplitude, where threshold = 0.5, and threshold represents the threshold value. high Indicates high amplitude;

[0099] frequency high amplitude high =ifft2d(frequency) high amplitude high ),

[0100] This transforms the high-frequency, high-amplitude characteristics into the RGB domain, where ifft2d represents the inverse two-dimensional Fourier transform, and amplitude... high Indicates high amplitude;

[0101] frequency high amplitude low =frequency high *(amplitude < threshold),

[0102] The resulting characteristic is high frequency and low amplitude, where threshold = 0.5, and threshold represents the threshold value. low Indicates low amplitude;

[0103] frequency high amplitude low =ifft2d(frequency) high amplitude low ),

[0104] This transforms the high-frequency, low-amplitude characteristics into the RGB domain, where ifft2d represents the inverse two-dimensional Fourier transform, and amplitude... low This indicates a low amplitude.

[0105] The specific steps for S3 are as follows:

[0106] A cross-modal feature extraction network based on Vision Transformer is used to jointly extract RGB features and high-frequency low-amplitude features:

[0107] By inputting RGB features and high-frequency low-amplitude features into the network, which includes a feature correction module and a feature fusion module, the RGB features and high-frequency low-amplitude features complement each other, enabling a more comprehensive discovery of tampering clues.

[0108] The specific formula in S3 is as follows:

[0109] f i =net(frequency) high amplitude low , rgb), i=1, 2, 3, 4,

[0110] Among them, f i This indicates the corrected and fused extracted features, frequency. high amplitude lowrepresents high-frequency, low-amplitude features, rgb represents RGB features, and net represents a cross-modal feature extraction network based on Vision Transformer.

[0111] The specific steps for S4 are as follows:

[0112] The high-frequency, high-amplitude features separated from the high-frequency features contain more information about tampering edges. The high-frequency, high-amplitude features are then input into the Pyramid Vision Transformer for further extraction, thereby capturing specific tampering edges and suppressing edge responses in non-tampering regions.

[0113] The specific formula in S4 is as follows:

[0114] e i =net v (frequency high amplitude high ),

[0115] edge fre =decoder edge (e i ),

[0116] i = 1, 2, 3, 4

[0117] Among them, e i This indicates the extracted high-frequency, high-amplitude features that contain more edge information. v This represents the PyramidVision Transformer feature extraction network, frequency. high amplitude high Indicates high-frequency, high-amplitude characteristics, edge fre The decoder represents the specific tampering edges of interest related to high-frequency, high-amplitude features. edge This represents the decoder that generates specific tampering edges, where i represents different scales, and i = 1, 2, 3, 4 represents the feature extraction network net. v The extracted features have four scales.

[0118] The specific steps for S5 are as follows:

[0119] Amplify the tampered region of interest by focusing on specific edges based on high-frequency, high-amplitude features:

[0120] A tampered image often becomes more obvious the larger it is magnified. This invention uses high-frequency, high-amplitude features to focus on the tampered edges to magnify the tampered area of ​​interest. This makes the model's perception of the tampered area clearer and more obvious, while also reducing false positives from non-tampered areas. The specific operation is as follows: First, the tampered edge, which is of interest due to its high-frequency and high-amplitude features, and the joint features extracted by the cross-modal feature extraction network based on Vision Transformer are input into the region magnification module. Then, the tampered edge is sampled to the same size as the joint features. The tampered edge is then convolved with a Gaussian convolution kernel, and the resulting value is normalized to between 0 and 1. The Gaussian convolution kernel can blur the non-tampered edge, making the tampered edge relatively more accurate. The tampered edge is then convolved with a two-dimensional convolution operation, and the resulting value is normalized to between 0 and 1 again. The maximum value of the original tampered edge, the tampered edge after the Gaussian convolution kernel, and the tampered edge after the two-dimensional convolution is taken, and the maximum value is multiplied element-wise with the joint features to magnify the tampered region of interest of the tampered edge. Finally, a decoder is used to generate the model prediction result.

[0121] The specific formula used in S5:

[0122] attention soft =conv2d(edge) fre kernel gaussian ),

[0123] Among them, attention soft This represents the result obtained by convolution with a Gaussian kernel; conv2d represents a two-dimensional convolutional layer; edge fre This indicates a specific tampering edge of interest related to high-frequency, high-amplitude characteristics; kernel gaussian Represents the Gaussian convolution kernel;

[0124] attention steel =conv2d(edge) fre ),

[0125] Among them, attention steel This represents the result obtained after convolution, where conv2d represents a two-dimensional convolutional layer, and edge represents the edge. fre This indicates specific tampering edges of interest related to high-frequency, high-amplitude characteristics;

[0126] f zi =f i *max(attention soft attention steel edge fre ), i = 2, 3,

[0127] Among them, f i f represents the feature extracted by combining RGB and high-frequency low-amplitude features. zi This indicates that the frequency amplitude characteristic of f is too large. i max means taking the maximum value, i = 2, 3 means taking f i f2 and f3 in the equation are amplified using high-frequency, high-amplitude characteristics to obtain the value f. z2 and f z3 ;

[0128] mask i =decoder mask (f i ), i = 1, 2, 3, 4,

[0129] Among them, mask i This represents the generated tampered region mask, decoder mask f represents the decoder that generates the predicted mask for the tampered region. i This includes f1 and f4 from the combined RGB and high-frequency low-amplitude feature extraction, and f after high-frequency high-amplitude feature amplification. z2 f z3 .

[0130] The specific steps for S6 are as follows:

[0131] Training the network by constraining it with a joint loss function:

[0132] This invention establishes two links in the network. The loss function is divided into two parts: one part calculates the classification loss generated by the segmentation of the tampered region edges, and the other part calculates the classification loss generated by the segmentation of the tampered region.

[0133] The specific formula used in S6:

[0134] weight=1+5*abs(pool(target)-target),

[0135]

[0136]

[0137]

[0138] Where weight represents the result, abs represents taking the absolute value, pool represents the pooling operation, target represents the label of the tampered region, and BCE LOSS This represents the result obtained, where N represents the total number of samples, and y i p represents the category to which the i-th pixel belongs. iLet represent the predicted value of the category to which the i-th pixel belongs, sum represents the summation, pre represents the model's prediction result, log represents the natural logarithm, and loss represents the predicted value of the i-th pixel. seg The loss represents the classification loss caused by segmenting the image tampered region. edge This represents the classification loss caused by altering the segmentation of the region's edges.

[0139] The specific steps for S7 are as follows:

[0140] Image tampering detection using a trained model:

[0141] First, the RGB image is converted into frequency domain features, and high-frequency features are filtered out using a high-pass filter. Second, the high-frequency features are divided into high-frequency high-amplitude features and high-frequency low-amplitude features. The RGB features, high-frequency low-amplitude features, and high-frequency high-amplitude features are input into the trained network to obtain a 1-channel image. The network output is processed by a sigmoid activation function, and each pixel value is between 0 and 1. With 0.5 as the threshold, pixels greater than 0.5 are considered tampered pixels, and pixels less than 0.5 are considered untampered pixels.

[0142] The specific formula used in S7:

[0143]

[0144]

[0145]

[0146] Where TP represents true positive samples, which is the number of pixels that were actually tampered but were predicted as tampered; FP represents false positive samples, which is the number of pixels that were actually not tampered but were predicted as tampered; FN represents false negative samples, which is the number of pixels that were actually tampered but were predicted as not tampered; F1 represents the F1 score; Precision represents accuracy; and Recall represents recall.

[0147] Example 2

[0148] Figures 3 to 4 To demonstrate the effectiveness of this invention, experiments were conducted on publicly available image tampering datasets, including the NIST (National Institute of Standards and Technology), Columbia dataset, and the DSO-1 digital storage oscilloscope. The F1 score was used as the evaluation metric. MVSS-Net is an image tampering detection method based on multi-view, multi-scale supervision, while TruFor is a framework applicable to various image processing methods.

[0149] The performance comparison of different algorithms with the present invention is shown in the figure. It can be seen that the image tampering detection algorithm based on high frequency amplitude division and regional magnification proposed in this invention has excellent performance.

[0150] The table below compares the F1 scores of this invention with those of state-of-the-art methods on the NIST, Columbia, and DSO-1 datasets.

[0151]

[0152] As can be seen from the above technical solution, this invention provides an effective image tampering detection algorithm based on high-frequency amplitude division and region magnification. It utilizes amplitude division to divide high-frequency information into high-frequency high-amplitude and high-frequency low-amplitude regions. High-frequency low-amplitude features and RGB features are used to jointly mine potential tampering traces in the tampered region. High-frequency high-amplitude features are used to capture specific tampered edges in the image and suppress edge responses in non-tampered regions. The edge response map is used as weights to magnify regions in the original image that contain edge responses. This effectively solves the problems of inaccurate differentiation between image edge features and noise features in traditional image tampering detection algorithms, as well as the large number of false positives present in traditional image tampering detection algorithms.

[0153] Although the specific embodiments of the invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the invention. Based on the technical solutions of the invention, various modifications or variations that can be made by those skilled in the art without creative effort are still within the scope of protection of the invention.

Claims

1. An image tampering detection algorithm based on high-frequency amplitude division and region magnification, characterized in that, Includes the following steps: S1. The RGB image is converted into frequency domain features through two-dimensional Fourier transform, and the high-frequency features of the image are filtered out through a high-pass filter; S2. High-frequency characteristics are divided into high-frequency high-amplitude and high-frequency low-amplitude based on amplitude: S3. Use a cross-modal feature extraction network based on the Vision Transformer to jointly extract RGB features and high-frequency low-amplitude features; S4. Input the high-frequency, high-vibration-rate features into the Pyramid Vision Transformer for further extraction, capture specific tampered edges and suppress edge responses in non-tampered areas; S5. Amplify the tampered region of interest by focusing on specific edges based on high-frequency, high-amplitude characteristics; S6. The network is trained using a joint loss function. Two links are set up in the network. The loss function is divided into two parts: one part calculates the classification loss generated by the segmentation of the tampered region edge, and the other part calculates the classification loss generated by the segmentation of the image tampered region. S7. Use the trained model to detect image tampering. The network output is processed by a sigmoid activation function. Each pixel value is between 0 and 1. With 0.5 as the threshold, pixels greater than 0.5 are considered tampered pixels, and pixels less than 0.5 are considered non-tampered pixels.

2. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, S1 specifically includes the following process: S11. Convert the RGB image to a grayscale image, and use a two-dimensional Fourier transform to convert the RGB image into frequency domain features; S12. Design a high-pass filter with a value of 1 in the edge region and 0 in the center region to filter out the high-frequency features of the image; The formulas used in S1 are as follows: frequency=fft2d(rgb2gray(image)), Where frequency represents frequency domain information, fft2d represents two-dimensional Fourier convolution, which converts the image into the frequency domain, rgb2gray represents reading the RGB image in grayscale form, and image represents the image used for detection. highpass filter = np. ones (rows, cols), where rows represents the width of the frequency domain map, cols represents the height of the frequency domain map, np.ones represents that the ones function of the numpy package is called to generate a matrix with rows in width and cols in height, all elements of which are 1, np is the abbreviation of numpy, numpy represents a numerical calculation, highpass filter is a matrix with all elements being 1; highpass filter [xrow-d:xrow+d,xcol-d:xcol+d]=0(d=30), frequency high =frequency*highpass filter , Where xrow represents half the width of the frequency domain plot, and xcol represents half the height of the frequency domain plot; d represents the float size, set to 30; xrow-d: xrow+d, xcol-d: xcol+d represent a range, xrow-d: xrow+d is half the width of the frequency domain plot minus the float value d to half the width of the frequency domain plot plus the float value, representing the width of the range, xcol-d: xcol+d is half the height of the frequency domain plot minus the float value d to half the height of the frequency domain plot plus the float value d, representing the height of the range, frequency high This represents the high-frequency information obtained.

3. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, S2 specifically includes the following process: S21. The absolute value of the filtered high-frequency features is used to obtain the amplitude spectrum, and the amplitude value in the amplitude spectrum represents the density of the features; S22. Regularize the amplitude value to between 0 and 1, set the threshold to 0.5, obtain high-frequency, high-amplitude features from the high-frequency features, retain the amplitude value greater than the threshold, and set the amplitude value less than the threshold to 0; obtain high-frequency, low-amplitude features from the high-frequency features, set the amplitude value greater than the threshold to 0, and retain the amplitude value less than the threshold to 0. The formula used in S2 is as follows: amplitude=normalize(np.abs(frequency high )), Where amplitude represents the obtained amplitude value, normalize means regularizing the amplitude value to between 0 and 1, and frequency... high To represent high-frequency information, np.abs means taking the absolute value to obtain the amplitude value of the high-frequency information; frequency high amplitude high =frequency high *(amplitude>threshold), The resulting characteristic is high frequency and high amplitude, where threshold = 0.5, and threshold represents the threshold value. high Indicates high amplitude; frequency high amplitude high =ifft2d(frequency high amplitude high ), This transforms the high-frequency, high-amplitude characteristics into the RGB domain, where ifft2d represents the inverse two-dimensional Fourier transform, and amplitude... high Indicates high amplitude; frequency high amplitude low =frequency high *(amplitude<threshold), The resulting characteristic is high frequency and low amplitude, where threshold = 0.5, and threshold represents the threshold value. low Indicates low amplitude; frequency high amplitude low =ifft2d(frequency high amplitude low ), This transforms the high-frequency, low-amplitude characteristics into the RGB domain, where ifft2d represents the inverse two-dimensional Fourier transform, and amplitude... low This indicates a low amplitude.

4. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, The specific steps of S3 are as follows: Input the RGB features and high-frequency low-amplitude features into a network containing a feature correction module and a feature fusion module, so that the RGB features and high-frequency low-amplitude features are complementary; The specific formula in S3 is as follows: f i =net(frequency high amplitude low ,rgb),i=1,2,3,4, Among them, f i This indicates the corrected and fused extracted features, frequency. high amplitude low represents high-frequency, low-amplitude features, rgb represents RGB features, and net represents a cross-modal feature extraction network based on Vision Transformer.

5. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, The specific formula in S4 is as follows: e i =net v (frequency high amplitude high ), edge fre =decoder edge (e i ), i=1,2,3,4, Among them, e i This indicates the extracted high-frequency, high-amplitude features that contain more edge information. v This represents the Pyramid VisionTransformer feature extraction network, frequency. high amplitude high Indicates high-frequency, high-amplitude characteristics, edge fre The decoder represents the specific tampering edges that are of interest in high-frequency, high-amplitude features. edge This represents the decoder that generates specific tampering edges, where i represents different scales, and i = 1, 2, 3, 4 represents the feature extraction network net. v The extracted features have four scales.

6. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, S5 specifically includes the following processes: S51. Input the tampering edge of high frequency and high amplitude features and the joint features extracted by the cross-modal feature extraction network based on Vision Transformer into the region magnification module; S52. Sample the tampered edge to the same size as the joint feature, perform a convolution operation on the tampered edge using a Gaussian convolution kernel, and then normalize the obtained value to between 0 and 1. The Gaussian convolution kernel can blur the non-tampered edge, making the tampered edge relatively more accurate; perform a two-dimensional convolution operation on the tampered edge, and normalize the obtained value to between 0 and 1 again. S53. Take the maximum value of the original tampered edge, the tampered edge after Gaussian convolution kernel, the tampered edge after two-dimensional convolution, and the specific tampered edge of interest of the original high-frequency and high-amplitude features. Multiply the maximum value element-wise with the joint features to amplify the tampered region of interest of the tampered edge. Finally, generate the model prediction result through a decoder. The specific formula used in S5: attention soft =conv2d(edge fre ,kernel gaussian ), Among them, attention soft This represents the result obtained by convolution with a Gaussian convolution kernel; conv2d represents a two-dimensional convolutional layer; edge fre This indicates a specific tampering edge of interest related to high-frequency, high-amplitude characteristics; kernel gaussian Represents the Gaussian convolution kernel; attention steel =conv2d(edge fre ), Among them, attention steel This represents the result obtained after convolution, where conv2d represents a two-dimensional convolutional layer, and edge represents the edge. fre This indicates specific tampering edges of interest related to high-frequency, high-amplitude characteristics; f zi =f i *max(attention soft ,attention steel ,edge fre ),i=2,3, Among them, f i f represents the feature extracted by combining RGB and high-frequency low-amplitude features. zi This indicates that the frequency amplitude characteristic of f is too large. i max means taking the maximum value, i = 2, 3 means taking f i f2 and f3 in the equation are amplified using high-frequency, high-amplitude characteristics to obtain the value f. z2 and f z3 ; mask i =decoder mask (f i ),i=1,2,3,4, Among them, mask i This represents the generated tampered region mask, decoder mask f represents the decoder that generates the predicted mask for the tampered region. i This includes f1 and f4 from the combined RGB and high-frequency low-amplitude feature extraction, and f after high-frequency high-amplitude feature amplification. z2 f z3 .

7. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, The specific formula used in S6: weight=1+5*abs(pool(target)-target), Where weight represents the result, abs represents taking the absolute value, pool represents the pooling operation, target represents the label of the tampered region, and BCE LOSS This represents the result obtained, where N represents the total number of samples, and y i p represents the category to which the i-th pixel belongs. i Let represent the predicted value of the category to which the i-th pixel belongs, sum represents the summation, pre represents the model's prediction result, log represents the natural logarithm, and loss represents the predicted value of the i-th pixel. seg The loss represents the classification loss caused by segmenting the image tampered region. edge This represents the classification loss caused by altering the segmentation of the region's edges.

8. The image tampering detection algorithm based on high-frequency amplitude division and regional magnification according to claim 1, characterized in that, The specific formula used in S7: Where TP represents true positive samples, which is the number of pixels that were actually tampered but were predicted as tampered; FP represents false positive samples, which is the number of pixels that were actually not tampered but were predicted as tampered; FN represents false negative samples, which is the number of pixels that were actually tampered but were predicted as not tampered; F1 represents the F1 score; Precision represents accuracy; and Recall represents recall.

Citation Information

Patent Citations

  • Tampered image detection method based on deep learning

    CN110349136A

  • Social media image tampering detection method based on feature enhancement fusion

    CN115984571A