Image tampering detection technology based on gradient residual U-shaped convolutional neural network
By using the technology of gradient residual U-shaped convolutional neural network in image tampering detection, combined with adaptive central difference convolution and Sobel operator residual module, the rash problems in image fingerprint feature extraction and edge detail detection in the existing technology are solved. stickiness problem, achieving more efficient image tampering detection.
Patent Information
- Application Number
- CN202111197057.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2024-09-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing image tampering detection methods lack robustness when extracting image fingerprint features and inconsistent edge details generated during processing, and have high time complexity, making it difficult to effectively detect image tampering traces.
Using detection technology based on gradient residual U-shaped convolutional neural network, the edge gradient information and essential attribute features of the image are extracted through adaptive central difference convolution and Sobel operator residual module, combined with the multi-view detection process and Focalloss loss function. Improve model robustness and detection accuracy.
It improves the detection accuracy and model generalization ability under various tampering methods, reduces the average error rate, and makes image tampering detection more accurate and efficient.
Smart Images

Figure CN113920094B
Abstract
Description
Technical Field
[0001] The invention relates to an image tampering detection technology based on a gradient residual U-type convolutional neural network. Background Art
[0002] With the development of image editing technology, people can easily correct image content or manipulate the image generation process. The authenticity and challenge of the image have seriously affected people's trust in the authenticity of news reports and military and economics. Within the existing research scope, researchers divide image content tampering into three categories: splicing, copy-move, and removal. Splicing, copying an area in an image to another image to generate a new image. Copy-move, copying and pasting part of the same image to other locations in the image. Removal, removing content from the image. Existing image manipulation detection methods try to use feature extraction methods to explore traces of image manipulation. Feature extraction methods for image manipulation detection can generally be divided into two categories: traditional feature extraction methods and detection methods based on convolutional neural networks.
[0003] For traditional feature extraction methods, we focus on the statistical information and physical characteristics of the image itself, such as color interpolation, sensor noise, and other processing signals in the image generation process. Many algorithms for passive tampering detection have been proposed. However, traditional image processing detection techniques are only designed for a certain attribute of the image, resulting in low final detection rate and lack of robustness.
[0004] The tampering detection technology based on convolutional neural network utilizes the multi-layer structure and powerful feature learning ability of deep learning network to realize tampering detection that does not rely on a single attribute of the image, making up for the shortcomings of traditional image tampering detection technology. All images have inherent characteristics through imaging processing. These attributes are inherent to the image content as image fingerprints, and they can be used to distinguish images from other images. When splicing forged images, the tampered and untampered areas come from different source images. When deleting and copying forged pictures, the edges of the operation area will be inconsistent. However, the CNN-based detection network tends to extract strong signal features related to the content, so the existing convolution-based detection methods cannot effectively extract the image fingerprint features and the details of the inconsistent edges generated during the image processing process. The feature extraction without image fingerprint information will make it difficult for the final detection results to reach the ideal state. At the same time, these detection methods require complex image preprocessing steps and have high time complexity. Summary of the invention
[0005] The purpose of the present invention is to provide an image tampering detection technology based on a gradient residual U-type convolutional neural network, which can be used for image verification of certificate qualification documents, verification of facial images, etc.
[0006] The purpose of the present invention is achieved through the following technical solution: an image tampering detection technology based on a gradient residual U-type convolutional neural network, characterized in that it includes the following steps:
[0007] S1. Input the tampered image to be detected;
[0008] S2. Perform data enhancement on the input tampered image to obtain three sets of enhanced test images;
[0009] S3. The tampered image and the test image are sequentially input into the pre-trained encoder for downsampling. The encoder is configured with four downsampling layers, each of which includes an adaptive center difference convolution and a maximum pooling layer.
[0010] The downsampling layer first extracts the tampered edge gradient information of the input image through the Sobel operator residual module, and then extracts the essential attribute features of the input image through the adaptive center difference convolution and maximum pooling layer. Finally, the essential attribute features are combined with the edge gradient information and normalized to obtain a feature map. The feature map is input to the next downsampling layer, and the feature map is copied for cross-connection.
[0011] S4. The encoder also sets 4 upsampling layers and 1 classification layer. The feature map obtained by the last downsampling layer is input to the upsampling layer. Each upsampling layer includes adaptive central difference convolution, upsampling convolution and RELU activation.
[0012] The encoder inputs the copied feature map obtained by the downsampling layer to the upsampling layer corresponding to the decoder through the cross-connection method. The upsampling layer first connects the input image with the cross-connection feature map of the same resolution in the decoder, and then extracts the tampered edge gradient information of the connected image through the Sobel operator residual module. The connected image is then used to extract the essential attribute features through adaptive central difference convolution and upsampling convolution. Finally, the essential attribute features are combined with the edge gradient information and normalized to obtain a new feature map, which is input to the next upsampling layer;
[0013] The new feature map obtained by the last upsampling layer is input to the classification layer. After the new feature map is connected with the cross-connected feature map of the same resolution in the downsampling layer, the essential attribute features of the connected image are extracted through the central difference convolution. Finally, a 1*1 central difference convolution is performed to obtain the prediction map of the pixel-by-pixel tampering probability.
[0014] S5. Perform enhanced reverse restoration on the prediction images obtained from the three groups of test images in step 4;
[0015] S6. Perform weighted fusion on the prediction map obtained from the tampered image and the prediction maps after restoration of the three groups of test images to obtain the final pixel-by-pixel tampering probability prediction map.
[0016] Compared with the prior art, the advantages of the present invention are:
[0017] 1. The adaptive central difference convolution proposed in the present invention can capture the basic properties of an image by collecting intensity and gradient information. The convolution used in the prior art tends to extract the content features of the image, but in image tampering detection, the image fingerprint features of the tampered area have a weak correlation with the image content. Therefore, the present invention can improve the accuracy under the combined action of multiple tampering methods, making the model have better robustness.
[0018] 2. The Sobel gradient residual module proposed in the present invention can extract image edge gradient information. Since image processing will lead to the correlation discontinuity information of the edge pixels of the tampered area, the module utilizes the function of the Sobel operator to extract image edge gradient information. The learnable Sobel operator is added to the residual connection added in the downsampling layer and the upsampling layer to extract the edge gradient information, which effectively improves the tampering detection accuracy under the copy-paste and splicing tampering methods.
[0019] 3. The Focalloss loss function used in the present invention during training reduces the loss of easily classified samples through the γ factor, and the balance factor α t , which is used to balance the uneven ratio of positive and negative samples, so that the model can focus more on difficult and misclassified tampered areas.
[0020] 4. The present invention adopts a multi-view detection process for tampered images. By weighted fusion of the detection results of the images enhanced by Gaussian noise, folding, and rotation, it fully utilizes the various attribute characteristics of the images to be tested, effectively reduces the average error rate of the model test, and improves the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 The present invention is a flowchart of an embodiment of an image tampering detection technology based on a gradient residual U-type convolutional neural network.
[0022] Figure 2 This is a schematic diagram of the overall structure of the model of the image tampering detection technology based on the gradient residual U-type convolutional neural network of the present invention.
[0023] Figure 3 Schematic diagram of the adaptive central difference convolution operator of the present invention.
[0024] Figure 4 Schematic diagram of the Sobel gradient residual module of the present invention.
[0025] Figure 5This is a test comparison diagram of the tampering localization result of the present invention (a represents the tampered image; b represents the real annotation of the tampered area; c represents the U-Net prediction result; d represents the prediction result of the present invention). DETAILED DESCRIPTION
[0026] The present invention is described in detail below with reference to the accompanying drawings and embodiments:
[0027] like Figure 1-5 The figure shows an image tampering detection technology based on a gradient residual U-type convolutional neural network provided by the present invention.
[0028] An image tampering detection technology based on a gradient residual U-type convolutional neural network includes the following steps:
[0029] S1. Input the tampered image to be detected.
[0030] S2. Perform data enhancement on the input tampered image to obtain three sets of enhanced test images; the data enhancement methods include Gaussian noise, 90° clockwise rotation, and horizontal flipping.
[0031] S3. The tampered image and the test image are sequentially input into the pre-trained encoder for downsampling. The encoder is configured with four downsampling layers, each of which includes an adaptive center difference convolution and a maximum pooling layer.
[0032] The downsampling layer first extracts the tampered edge gradient information of the input image through the Sobel operator residual module, and then extracts the essential attribute features of the input image through the adaptive center difference convolution and maximum pooling layer. Finally, the essential attribute features are combined with the edge gradient information and normalized to obtain the feature map. The feature map is input to the next downsampling layer, and the feature map is copied for cross-connection. The input image is downsampled four times in total, and the resolution is one sixteenth of the original image.
[0033] Each downsampling layer includes two 3*3 adaptive center difference convolutions. Adaptive center difference convolution can capture the intrinsic details of the image by aggregating intensity and gradient information, effectively improving the robustness of the model.
[0034] The Sobel operator residual module is mainly used to extract edge gradient features of images. Since image processing will cause the correlation of edge pixels in the tampered area to be discontinuous, the Sobel operator residual module can effectively improve the accuracy of the model under various tampering attack methods.
[0035] S4. The encoder also sets 4 upsampling layers and 1 classification layer. The feature map obtained by the last downsampling layer is input to the upsampling layer. Each upsampling layer includes adaptive central difference convolution, upsampling convolution and RELU activation.
[0036] The encoder inputs the copied feature map obtained by the downsampling layer to the upsampling layer corresponding to the decoder through the cross-connection method. The upsampling layer first connects the input image with the cross-connection feature map of the same resolution in the decoder, and then extracts the tampered edge gradient information of the connected image through the Sobel operator residual module. The connected image is then used to extract the essential attribute features through adaptive central difference convolution and upsampling convolution. Finally, the essential attribute features are combined with the edge gradient information and normalized to obtain a new feature map, which is input to the next upsampling layer;
[0037] The new feature map obtained by the last upsampling layer is input to the classification layer. After the new feature map is connected with the cross-connected feature map of the same resolution in the downsampling layer, the essential attribute features of the connected image are extracted through the central difference convolution. Finally, a 1*1 central difference convolution is performed to obtain the prediction map of the pixel-by-pixel tampering probability.
[0038] Each upsampling layer consists of two 3*3 adaptive central difference convolutions.
[0039] S5. Perform enhanced reverse restoration on the prediction images obtained from the three groups of test images in step 4;
[0040] The prediction image obtained by rotating the test image 90° clockwise is restored by rotating it 90° counterclockwise, and the prediction image of the test image after horizontal flipping is restored by horizontal flipping. The prediction image after Gaussian noise processing is not restored.
[0041] S6. Perform weighted fusion on the prediction map obtained from the tampered image and the prediction maps after restoration of the three groups of test images to obtain the final pixel-by-pixel tampering probability prediction map.
[0042] The formula for weighted fusion is as follows:
[0043] P=0.5P ori +0.2P fold +0.2P spin +0.1P noise
[0044] Among them, P ori is the prediction result of the tampered image of the original input, P fold is the prediction result of the image after horizontal flip enhancement, P spin The prediction result of the enhanced image after rotating 90° clockwise, P noise Prediction results of the image after Gaussian noise enhancement.
[0045] The encoder pre-training process is as follows:
[0046] Select several untampered images as original images, copy-paste, splice, and remove tampering operations on these images through image editing programs, and make corresponding binary tampering label images, with the tampered area in black and the untampered area in white, and use the tampered images as training sets;
[0047] Before training, the images in the training set are first enhanced. During training, the Focalloss loss function is used to calculate the error between the predicted value and the true label. The formula of the Focalloss loss function is as follows:
[0048] FL(p t )=-α t (1-p t ) γ log(p t )
[0049] Where Pt is the classification probability of different categories, γ is a value greater than 0, and α t is a decimal number between [0, 1].
[0050] In reality, the tampering traces of images are usually hidden by compression, or covered by a variety of tampering methods. Therefore, it is difficult to detect samples. Focalloss reduces the loss of easy-to-classify samples through the γ factor, and the balance factor α t , which is used to balance the uneven ratio of positive and negative samples, so that the model pays more attention to difficult and misclassified tampering areas. After experiments, γ is set to 2, α t Set to 0.25.
[0051] The convolution operator can realize content feature extraction. In image tampering detection, the image fingerprint features of the tampered area have a weak correlation with the image content. Ordinary convolution cannot effectively extract image fingerprint features, while the center difference convolution can capture the intrinsic details of the image by aggregating intensity and gradient information. To this end, the present invention proposes a center difference convolution operator to improve the network's ability to represent image fingerprint details.
[0052] The central difference convolution is performed in two stages, namely sampling and aggregation. First, the sampling process of the central difference convolution is to perform a weighted summation of the receptive field area of the input image x, and then aggregate the gradient of the center of the sampled value. For each position P0 on the output feature map:
[0053]
[0054] Although CDC can improve the network's ability to represent detailed information of image fingerprints, CDC requires the operator to manually set the difference parameter θ. The θ parameter of each layer of central difference convolution is difficult to determine experimentally, so the θ parameter of each layer can only be set to the same value, which greatly limits the central difference convolution fingerprint feature extraction. To this end, the present invention proposes an adaptive central difference convolution, which learns the θ parameter of each adaptive central difference layer by adding a self-attention path.
[0055] The encoder of U-Net has four downsampling layers, each of which consists of two 3*3 ordinary convolutions and one maximum pooling layer. We use adaptive center difference convolution to replace the ordinary convolution. The difference between the center difference convolution and the ordinary convolution is that the aggregation step of the convolution requires the gradient of the aggregation center, that is, the features extracted by the entire 3*3 convolution need to be subtracted from a certain proportion θ of the features extracted by the 3*3 convolution center, and we autonomously learn this proportion θ through the attention channel.
[0056] Adaptive central difference convolution automatically updates the difference operator of each central difference convolution sampling area during network training;
[0057] First, the original convolution network is divided into two channels and the input image is shared. In the upper channel, the input image first passes through the convolution layer to obtain a C*W*1 feature map, which is then globally averaged pooled (pooling size is C*W) to obtain a 1*1 parameter, and finally sent to sigmoid for Normalize processing to obtain the differential parameter θ.
[0058] The central differential convolution can use local zero-order intensity information and first-order gradient differential information. The first-order gradient differential information is helpful in capturing the inherent detail patterns of the image, but the local zero-order intensity information is also important in the network, so we use the added attention module to automatically learn the importance of local zero-order intensity information and first-order gradient difference information.
[0059] The working process of the Sobel operator residual module is as follows:
[0060] First, perform a 1*1 convolution on the input image (to maintain the same number of channels), then input the 1*1 convolved image into the vertical Sobel operation and the horizontal Sobel operation respectively, and finally add the residual outputs of the vertical Sobel operation and the horizontal Sobel operation.
[0061] The horizontal and vertical edge gradients can be obtained by the following convolution:
[0062]
[0063] in represents the depth convolution operation, x represents the input image, and FH represents the horizontal Sobel operation, F V represents vertical Sobel operation;
[0064] The formula for adding the residual output of the vertical Sobel operation and the horizontal Sobel operation is as follows:
[0065] y f =N(F V (F1(x,{W i})) 2 +F H (F1(x,{W i})) 2 )
[0066] Where x represents the input image, F1 represents the 1*1 convolution, N represents the normalization layer, and W i Represents the weight parameter of the convolution. Then after the normalization layer and the Relu layer, the addition operation is performed. The Sobel residual structure module is defined as the equation:
[0067]
[0068] in Represents the Relu layer. The Sobel residual structure module provides edge information for image processing by extracting rich edge gradient information.
[0069] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and shall be included in the protection scope of the present invention.
Claims
1. An image tampering detection method based on gradient residual U-type convolutional neural network, characterized in that: It includes the following steps: S1. Input the tampered image to be detected; S2. Perform data enhancement on the input tampered image to obtain three sets of enhanced test images; S3. The tampered image and the test image are sequentially input into the pre-trained encoder for downsampling. The encoder is configured with four downsampling layers, each of which includes an adaptive center difference convolution and a maximum pooling layer. The downsampling layer first extracts the tampered edge gradient information of the input image through the Sobel operator residual module, and then extracts the essential attribute features of the input image through the adaptive center difference convolution and maximum pooling layer. Finally, the essential attribute features are combined with the edge gradient information and normalized to obtain a feature map. The feature map is input to the next downsampling layer, and the feature map is copied for cross-connection. S4. The encoder also sets 4 upsampling layers and 1 classification layer. The feature map obtained by the last downsampling layer is input to the upsampling layer. Each upsampling layer includes adaptive central difference convolution, upsampling convolution and RELU activation. The encoder inputs the copied feature map obtained by the downsampling layer to the upsampling layer corresponding to the decoder through the cross-connection method. The upsampling layer first connects the input image with the cross-connection feature map of the same resolution in the decoder, and then extracts the tampered edge gradient information of the connected image through the Sobel operator residual module. The connected image is then used to extract the essential attribute features through adaptive central difference convolution and upsampling convolution. Finally, the essential attribute features are combined with the edge gradient information and normalized to obtain a new feature map, which is input to the next upsampling layer; The new feature map obtained by the last upsampling layer is input to the classification layer. After the new feature map is connected with the cross-connected feature map of the same resolution in the downsampling layer, the essential attribute features of the connected image are extracted through the central difference convolution. Finally, a 1*1 central difference convolution is performed to obtain the prediction map of the pixel-by-pixel tampering probability. S5. Perform enhanced reverse restoration on the prediction images obtained from the three groups of test images in step 4; S6. weighted fusion of the prediction map obtained by tampering with the image and the prediction map after restoration of the three test images to obtain the final pixel-by-pixel tampering probability prediction map; The formula for weighted fusion in step 6 is as follows: P=0.5P ori +0.2P fold +0.2P spin +0.1P noise Among them, P ori is the prediction result of the tampered image of the original input, P fold is the prediction result of the image after horizontal flip enhancement, P spin The prediction result of the enhanced image after rotating 90° clockwise, P noise Prediction results of the image after Gaussian noise enhancement; The working process of the Sobel operator residual module is as follows: First, perform 1*1 convolution on the input image, then input the 1*1 convolved image into the vertical Sobel operation and the horizontal Sobel operation respectively, and finally add the residual outputs of the vertical Sobel operation and the horizontal Sobel operation; The horizontal and vertical edge gradients can be obtained by the following convolution: in represents the depth convolution operation, x represents the input image, and F H represents the horizontal Sobel operation, F V represents vertical Sobel operation; The formula for adding the residual output of the vertical Sobel operation and the horizontal Sobel operation is as follows: y f =N(F V (F1(x,{W i }) 2 ))+F H (F1(x,{W i })) 2 ) Where x represents the input image, F1 represents the 1*1 convolution, N represents the normalization layer, and W i Represents the weight parameters of the convolution.
2. The image tampering detection method based on gradient residual U-type convolutional neural network according to claim 1 is characterized in that: In step 2, the data enhancement methods include Gaussian noise, 90° clockwise rotation, and horizontal flipping; In step 5, the prediction image obtained by rotating the test image 90° clockwise is restored by rotating it 90° counterclockwise, the prediction image of the test image after horizontal flipping is restored by horizontal flipping, and the prediction image after Gaussian noise processing is not restored.
3. The image tampering detection method based on gradient residual U-type convolutional neural network according to claim 1 is characterized in that: Each downsampling layer includes two 3*3 adaptive central difference convolutions; each upsampling layer includes two 3*3 adaptive central difference convolutions.
4. The image tampering detection method based on gradient residual U-type convolutional neural network according to claim 1 is characterized in that: The encoder pre-training process is as follows: Select several untampered images as original images, copy-paste, splice, and remove tampering operations on these images through image editing programs, and make corresponding binary tampering label images, with the tampered area in black and the untampered area in white, and use the tampered images as training sets; Before training, the images in the training set are first enhanced. During training, the Focalloss loss function is used to calculate the error between the predicted value and the true label. The formula of the Focalloss loss function is as follows: FL(p t )=-a t (1-p t ) γ log(p t ) Where Pt is the classification probability of different categories, γ is a value greater than 0, and α t is a decimal number between [0, 1].
5. The image tampering detection method based on gradient residual U-type convolutional neural network according to claim 4 is characterized in that: In the Focalloss loss function formula, γ = 2; α t =0.
25.
6. The image tampering detection method based on gradient residual U-type convolutional neural network according to claim 1 is characterized in that: Adaptive central difference convolution automatically updates the difference operator of each central difference convolution sampling area during network training; First, the original convolution network is divided into two channels and the input image is shared. In the upper channel, the input image first passes through the convolution layer to obtain a C*W*1 feature map, which is then globally averaged pooled to obtain a 1*1 parameter, and finally sent to sigmoid for Normalize processing to obtain the differential parameter θ. Among them, C*W*1 represents the dimension of the feature map, "C" represents the number of channels, "W" represents the width of the feature map, and "1" represents the height of the feature map is 1.
