Small-size image smoothing filter detection algorithm based on quantized differential co-occurrence matrix
By using the detection algorithm of quantized differential symbiosis matrix on small-size images, the problem of poor smooth filter detection effect in the prior art is solved, effective detection of median filtering, mean filtering and Gaussian filtering is realized, and image stitching is performed, and image stitching is performed. Significant results were achieved in regional positioning.
Patent Information
- Application Number
- CN202110922339.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-12
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-08-12
AI Technical Summary
The existing smooth filter detection algorithm is poor in small-sized images, and the reduction in statistics leads to a sharp decline in detection effect, especially for smooth filter identification other than median filtering.
A small-size image smoothing filter detection algorithm based on the quantized differential symbiosis matrix is used to calculate the symbiosis matrix of the differential image and the quantized differential image, and a binary model is constructed for detection in combination with machine learning methods.
Effectively detect median filtering, mean filtering and Gaussian filtering on small-sized images, and realize the positioning of tampered areas on the stitching image library, improving the robustness and accuracy of smooth filter detection.
Smart Images

Figure CN113850857B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a small-size image smoothing filter detection algorithm based on a quantized differential co-occurrence matrix. Background Art
[0002] The rapid development of digital image processing technology has made it extremely easy to edit, tamper with, and even forge images. Some of the original processing methods used to modify digital images have been used by forgers to tamper with images. Therefore, it is particularly necessary to identify the processing history of digital images. Image processing history mainly includes smoothing, sharpening, contrast enhancement, JPEG compression, etc. Among them, smoothing, as a common technology in digital image processing, is widely used for image denoising, blurring, and beautification, but it is also often used by image forgers to cover up the traces left after tampering with the image. Therefore, detecting whether the image has undergone smoothing filtering is a strong evidence for identifying the originality and integrity of the image.
[0003] Among the current research on various smoothing filter detection, the results of median filter detection are relatively rich. In the early period, some literature proposed a median filter detection method based on the first-order difference histogram according to the unique "Streaking" characteristic of the median filter. This method is not robust to JPEG compression. The author borrowed the SPAM feature in steganalysis (Article 1: "PEVNYT, BAS P, FRIDRICH J. Steganalysis by Subtractive Pixel Adjacency Matrix[J]. IEEE Transactions on Information Forensics and Security, 2010, 5(2): 215-224"). This feature models the first-order difference as an n-order Markov chain and transfers it to a probability matrix as a feature vector. The detection effect of median filter in JPEG images is good. Paper 2 (YUAN H. Blind Forensics of Median Filtering in Digital Images [J]. IEEE Transactions on Information Forensics and Security, 2011, 6 (4): 1335-1345) analyzed the impact of median filtering on grayscale statistical features and proposed MFF features to detect median filtering. This feature also has a detection effect on other image operations. The recognition of other smoothing filters has also received attention in recent years. Paper 3 (LI M, WANG C, PENG A, et al. A Blind Forensics Algorithm for Digital Image Smoothing Filtering [J]. Semiconductor Optoelectronics, 2017, 38 (3): 430-434) uses high-frequency residuals as feature extraction domains, extracts features based on binary local patterns (LBP) and autoregressive models, and can identify mean filters, Gaussian filters, and median filters. Paper 4 (DING F, SHI Y, ZHU G, et al. Smoothing identification for digital image forensics [J]. Multimedia Tools and Applications, 2019, 78 (7): 8225–8245) uses the gradient histogram of the edge area to construct features to detect smooth images, which can distinguish various smoothing filters.
[0004] Most of the current smoothing filter detection methods are performed on images of a certain size. When the image size is too small, especially when the size is ≤64×64, the detection effect will drop sharply due to the significant reduction in statistics. Although there have been some achievements in detecting median filters on small-sized images, the recognition of other smoothing filters on small-sized images remains to be studied. Summary of the invention
[0005] Most of the current smoothing filter detection algorithms are performed on images of a certain size. When the image size is too small, the detection effect will drop sharply due to the significant reduction in statistics. In order to solve this technical problem, the present invention provides a small-size image smoothing filter detection algorithm based on a quantized differential co-occurrence matrix.
[0006] In a first aspect, the present invention provides a smoothing filter detection feature extraction method based on a quantized differential co-occurrence matrix, comprising:
[0007] Step 1: Extract features from image I n , calculate the difference images of its 8 difference directions (p, q) Where p,q∈{-1,0,1}; for each of the differential images Quantize and get 8 corresponding quantized difference images
[0008] Step 2: For each of the difference images and each of the quantized difference images The difference value in is truncated, where the truncation threshold is [-T, T];
[0009] Step 3: For each of the differential images after truncation and each of the quantized difference images The corresponding co-occurrence matrices are calculated respectively and recorded as differential co-occurrence matrices and quantized differential co-occurrence matrices respectively;
[0010] Step 4: Average the differential co-occurrence matrices in the horizontal / vertical direction and the diagonal direction to obtain two co-occurrence matrices M h / v and M d ; The quantized differential co-occurrence matrices in the horizontal / vertical direction and the diagonal direction are averaged to obtain two co-occurrence matrices M′ h / v and M′ d ;
[0011] Step 5: Substitute the four co-occurrence matrices M h / v , M′ h / v 、M d , M′ d The combination is 4×(2T+1) 3The dimension feature W is used as the image I to be extracted n detection features.
[0012] Further, according to formula (5), for each of the differential images To quantify:
[0013]
[0014] in, Represents the difference image The coordinates are the difference values of the pixels at (x, y). Represents the quantized difference image The coordinates are the difference values of the pixel points (x, y), k represents the quantization parameter, k is an integer greater than 1, and [·] is a rounding operation.
[0015] Furthermore, the differential co-occurrence matrix is calculated according to formula (6) and formula (7): and quantized differential co-occurrence matrix
[0016]
[0017]
[0018] in, Represents the difference image The coordinates are the difference values of the pixels at (x, y). Represents the quantized difference image The coordinates are the difference values of the pixels at (x, y), c 1 ,c 2 ,c 3 ∈{-T,…,T}, Z is the difference image I d All triples in , and |·| represents the number of elements in the set ·.
[0019] Furthermore, according to formula (8) to formula (11), four co-occurrence matrices M are calculated: h / v , M′ h / v 、M d , M′ d :
[0020]
[0021]
[0022]
[0023]
[0024] in, and denote the differential co-occurrence matrix and the quantized differential co-occurrence matrix, respectively.
[0025] In a second aspect, the present invention provides a small-size image smoothing filter detection algorithm based on a quantized differential co-occurrence matrix, comprising:
[0026] Step 1: Construct four types of training image sets, namely: original image set, median filtered image set, mean filtered image set and Gaussian filtered image set;
[0027] Step 2: for each type of training image set, assign a corresponding type label to each training image therein, and extract the detection features of each training image according to the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix as described in any one of claims 1 to 4, and form a training sample with the type label and the detection features of each training image, and finally obtain four types of training sample sets; the type label is used to indicate the training image set to which the training image belongs;
[0028] Step 3: construct every two types of training sample sets in the four types of training sample sets into a training group, and obtain 6 training groups in total; train the two types of training sample sets in each training group using a machine learning method to obtain its binary classifier model, and finally obtain 6 binary classifier models corresponding to the 6 training groups;
[0029] Step 4: Extract detection features of the image to be detected according to the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix as described in any one of claims 1 to 4, input the detection features into 6 trained binary divider models to obtain 6 discrimination results, and use the majority voting method to vote on the 6 discrimination results to obtain the final classification result.
[0030] In a third aspect, the present invention provides an image stitching area positioning method based on block smoothing filter detection, comprising:
[0031] Step 1: Convert the image to be detected into a gray image, set the detection window size to z×z, and divide the gray image into image blocks through the detection window;
[0032] Step 2: extracting feature vectors of image blocks divided by the detection window by using the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix as described in any one of claims 1 to 4, and inputting the feature vectors into a multi-classifier to obtain a classification result; the multi-classifier is obtained by connecting in parallel six binary classifiers obtained by using the small-size image smoothing filter detection algorithm based on the quantized differential co-occurrence matrix as described in claim 5;
[0033] Step 3: Slide the detection window with a step size of L to traverse the entire image to be detected, where 1≤L≤z and L is an integer, so as to divide many overlapping image blocks. Each time the detection window is slid, the image block is smoothed and filtered according to step 2, and the corresponding classification result is recorded for each pixel in the window;
[0034] Step 4: Use the majority voting method to obtain the final classification result of each pixel point, and determine the area that is inconsistent with the smoothing filter performance of the entire image to be detected as the splicing area based on the final classification result of each pixel point.
[0035] Beneficial effects of the present invention:
[0036] The present invention analyzes the classification performance of three common smoothing filters using the differential co-occurrence matrix as a statistical feature under low statistics, and proposes a small-size image smoothing filter detection algorithm based on the quantized differential co-occurrence matrix. This method starts from the joint distribution relationship of adjacent differences, quantizes the differences in multiple directions and distances, and calculates the triple co-occurrence matrix. This feature can better reflect the differences between linear filters. On the basis of the above method, an image splicing area positioning algorithm based on block smoothing filter detection is proposed. Experimental results show that the method of the present invention can effectively detect median filtering, mean filtering and Gaussian filtering on small-size images, and realizes the positioning of tampered areas on the constructed splicing image library. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of visualization of differential co-occurrence matrices of different smoothing filter images provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of visualization of quantized differential co-occurrence matrices of different smoothing filter images provided by an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of MMD value statistical results provided by an embodiment of the present invention;
[0040] Figure 4 A schematic flow chart of a smoothing filter detection feature extraction method based on a quantized differential co-occurrence matrix provided in an embodiment of the present invention;
[0041] Figure 5 A schematic diagram of a flow chart of a small-size image smoothing filter detection algorithm based on a quantized differential co-occurrence matrix provided in an embodiment of the present invention;
[0042] Figure 6 An example diagram of image splicing and tampering provided by an embodiment of the present invention;
[0043] Figure 7 This is an image stitching area positioning test chart provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0045] Before describing the specific technical solution of the method proposed in the present invention, the research and development background of the present invention is introduced. The differential co-occurrence matrix is a common differential statistical method. n First calculate its difference image I d , as shown in formula (1); the difference value d is truncated, as shown in formula (2); then the difference pair is obtained by counting the "difference pairs" that maintain a certain distance on the difference image, which not only describes the number of each difference value on the difference image, but also reflects the difference between the two difference values (d x,y ,d x+p,y+q ) and gives the statistical results in the form of a matrix m of size T×T, as shown in formula (3).
[0046] I n →I d :d x,y =n x,y -n x+p,y+q (1)
[0047] In formula (1), n x,y Represents image I n The gray value n, d of the pixel with coordinate (x, y) x,y Represents the difference image I d The coordinates are the difference values of the pixels at (x, y), and (p, q) is defined as the difference direction, which is an integer.
[0048]
[0049] In formula (2), T is the cutoff threshold;
[0050]
[0051] In formula (3), c 1 , c 2 ∈{-L,…,T}, Z is the normalization coefficient that makes the sum of all elements of the matrix equal to 1, and |·| represents the number of elements in the set ·.
[0052] Figure 1For two small-size images of 64×64, the visualization results of the differential co-occurrence matrices of the original image, median filtered image, mean filtered image, and Gaussian filtered image are given respectively when the truncation threshold is [-3,3]. Each element in the matrix represents a differential pair (d 1 ,d 2 ), the right ruler shows the statistical frequency corresponding to each grayscale. It can be seen that on small-size images, the number of statistical samples is low, and the differential co-occurrence matrix as a feature can still well reflect the differences between the original image, median filter and linear filter. The statistical frequency of the differential co-occurrence matrix of the original image is mainly concentrated in the four corners of the matrix; for the image processed by the median filter, due to the unique "streaking" characteristic of the median filter, the statistical frequency of the differential pairs {(0,d), (d,0)|d∈(0,±1,±2,±3)} in the matrix is increased, and the matrix probability map is a "cross" shape; after the linear filter, the differential value (0,±1,±2) is significantly improved, and the statistical frequency of the differential pairs at the center of the matrix is increased. It can be seen that due to the introduction of the joint distribution of the differential pairs, the differential co-occurrence matrix as a detection feature can effectively distinguish the three types of images, the original image, the median filter image and the linear filter image, even when the number of statistical samples is small.
[0053] However, although the differential co-occurrence matrix can reflect the differences between the original image, the median filtered image and the linear filtered image, for the two linear filters, namely the mean filter and the Gaussian filter, Figure 1 As can be seen in Figure 2, the differential co-occurrence matrices of the two linear smoothing filters are similar. This is due to the similar smoothing strategies of the mean filter and the Gaussian filter, as well as the "truncation" operation performed when calculating the differential co-occurrence matrix.
[0054] The smoothing strategies of mean filtering and Gaussian filtering are similar. Mean filtering replaces a pixel with the mean of all pixels in a certain point and its domain; Gaussian filtering calculates the grayscale value of a certain point by "weighted averaging" the pixels in the point and its domain. These two similar strategies result in similar performances in areas with smaller absolute difference values (saturation areas) after the image is processed by mean filtering and Gaussian filtering respectively, and there are certain differences in areas with larger absolute difference values (texture areas). Therefore, when measuring mean filtered images and Gaussian filtered images, attention should be paid to areas with larger absolute difference values. However, before calculating the differential co-occurrence matrix, in order to control the size of the matrix, the difference is usually truncated first, and the threshold is set to [-T, T]. If the difference is less than -T, it is equal to -T, and if the difference is greater than T, it is equal to T. This truncation operation ignores the information of areas with larger absolute difference values, resulting in poor classification performance of the differential co-occurrence matrix when distinguishing between mean filtering and Gaussian filtering.
[0055] In order to more effectively distinguish between mean filtering and Gaussian filtering, the method of the present invention first quantizes the difference value and then calculates the differential co-occurrence matrix, so that it can measure the part of information with a larger absolute value of the difference, thereby reflecting the difference between the above two linear filters.
[0056] Example 1
[0057] Based on the above research and development background, Figure 4 As shown, an embodiment of the present invention provides a smoothing filter detection feature extraction method based on a quantized differential co-occurrence matrix, characterized in that it includes:
[0058] S101: For the image I to be feature extracted n , calculate the difference images of its 8 difference directions (p, q) Where p,q∈{-1,0,1}; for each of the differential images Quantize and get 8 corresponding quantized difference images
[0059] Specifically, the image I to be feature extracted is calculated according to formula (4): n Difference images in 8 difference directions (p,q)
[0060]
[0061] Among them, n x,y Represents image I n The gray value of the pixel with coordinate (x, y) Represents the difference image The coordinates are the difference values of the pixels at (x, y);
[0062] According to formula (5), for each of the differential images To quantify:
[0063]
[0064] in, Represents the difference image The coordinates are the difference values of the pixels at (x, y). Represents the quantized difference image The coordinates are the difference values of the pixel points (x, y), k represents the quantization parameter, k is an integer greater than 1, and [·] is a rounding operation.
[0065] S102: for each of the differential images and each of the quantized difference images The difference value in is truncated, where the truncation threshold is [-T, T];
[0066] Specifically, the truncation process is performed according to formula (2):
[0067]
[0068] In formula (2), “d” is used to represent the image. and images The difference value in , sign represents the sign function, and the function of the sign function is: if d<-T, then d=-T, if d>T, then d=T.
[0069] In order to better reflect the filtering characteristics and relatively control the dimension of the features, in the embodiment of the present invention, T=3 is set.
[0070] S103: for each of the differential images after truncation and each of the quantized difference images The corresponding co-occurrence matrices are calculated respectively and recorded as differential co-occurrence matrices and quantized differential co-occurrence matrices respectively;
[0071] Specifically, the differential co-occurrence matrix is calculated according to formula (6) and formula (7): and quantized differential co-occurrence matrix
[0072]
[0073]
[0074] in, Represents the difference image The coordinates are the difference values of the pixels at (x, y). Represents the quantized difference image The coordinates are the difference values of the pixels at (x, y), c 1 ,c 2 ,c 3 ∈{-T,…,T}, Z is the difference image I d All triples in , and |·| represents the number of elements in the set ·.
[0075] S104: In view of the small statistics of small-sized images, the statistical features are unstable. Therefore, in order to increase the stability of the features, this step averages the differential co-occurrence matrices in the horizontal / vertical (h / v) direction and the diagonal (d) direction to obtain two co-occurrence matrices M h / v and M d ; The quantized differential co-occurrence matrices in the horizontal / vertical direction and the diagonal direction are averaged to obtain two co-occurrence matrices M′ h / vand M′ d ;
[0076] Specifically, four co-occurrence matrices M are calculated according to formula (8) to formula (11): h / v , M′ h / v 、M d , M′ d :
[0077]
[0078]
[0079]
[0080]
[0081] S105: The four co-occurrence matrices M h / v , M′ h / v 、M d , M′ d The combination is 4×(2T+1) 3 The dimension feature W is used as the image I to be extracted n detection features.
[0082] Specifically, the feature W can be obtained by combining according to formula (12):
[0083] W=(M h / v ,M′ h / v ,M d ,M′ d ) (12)
[0084] In order to verify the effectiveness of the detection features extracted by the method provided by the embodiment of the present invention, Figure 2 The co-occurrence matrix statistics after quantization difference is given. The quantization parameter k is 15. Since there is a strong correlation between the pixels of natural images, the number of pixels with smaller difference amplitudes in an image accounts for a large proportion. After the difference is quantized, the statistical frequency of the difference pair (0,0) will increase significantly. In order to make the statistics more intuitive, the display of the difference pair (0,0) is discarded. Figure 1 , in the unquantized differential co-occurrence matrix (such as Figure 1 The statistical frequency of the four "corners" (as shown in Figure 1) is higher because the "truncation" operation makes the larger or smaller difference values defined as T or -T; Figure 2 In the quantized differential co-occurrence matrix, the statistical frequencies of the four “corners” all decreased, and the differences with larger amplitudes in the image appeared more in the central area of the matrix. It was observed that after the three smoothing filters, the statistical numbers of the lower left and upper right corners of the matrix decreased significantly, and the difference pairs (|d′ 1|,-|d′ 2 |) and (-|d′ 1 |,|d′ 2 |) decreases, indicating that pixel correlation increases. Due to the unique "streaking" characteristic of the median filter, the frequency of occurrence of the difference pairs (0, d′) and (d′, 0) is higher than that of the two linear filters. In particular, after the difference is quantized, there are certain differences in the differential co-occurrence matrices of the mean filter and the Gaussian filter: the frequency of occurrence of the difference pairs of the mean filter is more concentrated in the center of the matrix, and the frequency of occurrence of the difference pairs in the central area of the matrix is obviously different, while the frequency of occurrence of the difference pairs of the Gaussian filter is distributed in the diagonal corners of the matrix, and the frequency distribution is more uniform than that of the mean filter.
[0085] In order to further verify the universality of the quantized differential co-occurrence matrix in reflecting the linear filtering difference, the maximum mean discrepancy (MMD) standard is used for 10,000 images to measure the separability of the differential co-occurrence matrix before and after quantization for linear filtering, so as to characterize the performance of the feature. The calculation expression of MMD is shown in formula (13):
[0086]
[0087] Among them, x i represents the feature extracted from the i-th mean filter image, y i represents the features extracted from the i-th Gaussian filter image, (m,n) represents the number of mean filter images and Gaussian filter images, and k(·,·) is the radial basis function (RBF). The original differential co-occurrence matrix is used as feature 1, and the original differential co-occurrence matrix and the quantized differential co-occurrence matrix are combined into feature 2. Feature 1 and feature 2 are respectively used as detection features extracted from the image, and the MMD value between the mean filter image and the Gaussian filter image is calculated. The larger the MMD value, the better the performance of the feature in distinguishing the mean filter image and the Gaussian filter image. Figure 3 The statistical results of the MMD values are given. It can be seen that the MMD values of the features with the quantized differential co-occurrence matrix added extracted from mean filtered images and Gaussian filtered images of different sizes are higher than the original differential co-occurrence matrix without quantization, indicating that the features with the quantized differential co-occurrence matrix added can better reflect the difference between mean filtering and Gaussian filtering, and have better classification performance for these two types of images.
[0088] Example 2
[0089] On the basis of the above-mentioned embodiment 1, Figure 5As shown, the embodiment of the present invention also provides a small-size image smoothing filter detection algorithm based on a quantized differential co-occurrence matrix, including two stages of training and testing, and realizing the detection of original images and various smoothing filter images by adopting a multi-classifier model, specifically including the following steps:
[0090] Training phase:
[0091] S201: Construct four types of training image sets, namely: original image set (I ORI ), median filter image set (I MF ), mean filter image set (I AF ) and Gaussian filter image set (I GF );
[0092] S202: for each type of training image set, assign a corresponding type label to each training image therein, and extract detection features of each training image according to the above-mentioned smoothing filter detection feature extraction method based on quantized differential co-occurrence matrix, and form a training sample with the type label and detection features of each training image, and finally obtain four types of training sample sets; the type label is used to indicate the training image set to which the training image belongs;
[0093] S203: constructing every two types of training sample sets in the four types of training sample sets into a training group, and obtaining a total of 6 training groups; training the two types of training sample sets in each training group using a machine learning method to obtain its binary classifier model, and finally obtaining 6 binary classifier models corresponding to the 6 training groups;
[0094] Testing phase:
[0095] S204: Extract detection features of the image to be detected according to the above-mentioned smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix, input the detection features into the 6 trained binary divider models to obtain 6 discrimination results, and use the majority voting method to vote on the 6 discrimination results to obtain the final classification result.
[0096] Example 3
[0097] The traditional image stitching region positioning algorithm based on inconsistent local feature performance generally divides the image into non-overlapping image blocks, then performs local feature detection on each image block, and finally determines the image blocks that are inconsistent with the global features. This positioning method will be affected by the positioning accuracy due to the limitation of the image block size. Because the divided image blocks do not overlap, when the image block size is too small, the recognition accuracy is not ideal due to too few statistical samples; when the image block size is too large, the positioning accuracy of the edge of the stitching area will be reduced. In view of the above-mentioned defects of the existing methods, an embodiment of the present invention also provides an image stitching region positioning method based on block smoothing filter detection, comprising the following steps:
[0098] S301: converting the image to be detected into a gray image, setting the detection window size to z×z, and dividing the gray image into image blocks through the detection window;
[0099] S302: extracting feature vectors of image blocks divided by the detection window by using the above-mentioned smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix, and inputting the feature vectors into a multi-classifier to obtain a classification result; the multi-classifier is obtained by connecting in parallel six binary classifiers obtained by using the above-mentioned small-size image smoothing filter detection algorithm based on the quantized differential co-occurrence matrix;
[0100] S303: Slide the detection window with a step length of L to traverse the entire image to be detected, where 1≤L≤z and L is an integer, so as to divide a number of overlapping image blocks. Each time the detection window is slid, smoothing filter detection is performed on the image block according to step S302, and the corresponding classification result is recorded for each pixel in the window;
[0101] S304: After the image passes through the detection window, the pixel points record multiple classification results; this step adopts the majority voting method to obtain the final classification result of each pixel point, and according to the final classification result of each pixel point, the area inconsistent with the smoothing filter performance of the entire image to be detected is determined as the stitching area.
[0102] Specifically, the splicing area usually has a certain size and shape. The saturated blocks (with a variance of zero) are removed and morphological closing processing is performed to finally determine the splicing area.
[0103] The stitching area positioning method provided by the embodiment of the present invention can be applied to the following stitching "forgery" scenarios: (1) The stitching image includes two parts, the original image area and the stitching area, wherein the stitching area comes from an image that has been processed by a certain smoothing filter (or has not been processed by a certain smoothing filter), while the background area has not been smoothed (or has been processed by a certain smoothing filter). (2) Both the background area and the stitching area of the stitching image come from an image that has not been smoothed, but the forger smoothed the stitching area in order to cover up the traces left by the stitching. The above two types of scenarios will cause the "forgery" image to have different smoothing filter performances locally, so it is possible to collect evidence of the stitching image and locate the tampered area based on block smoothing filter detection.
[0104] In order to verify the effectiveness of the method of the present invention, the present invention also provides the following experimental data.
[0105] The experimental database comes from two public image libraries, BOSS and NRCS. 3000 images are selected from each of the two image libraries. These 6000 images are regarded as the unprocessed original image set, denoted as I ORI ; to IORI The median filter processing is performed, and the smoothing window size is randomly set to 3×3 and 5×5 to obtain the median filter image set, which is denoted as I MF ; to I ORI The mean filtering process is performed, and the smoothing window size is randomly set to 3×3 and 5×5 to obtain the mean filtered image set, which is denoted as I AF ; to I ORI Gaussian filtering is performed, and the standard deviation σ is randomly set to 0.7 and 1.0 to obtain a Gaussian filtered image set, denoted as I GF . Then cut along the center and {I ORI ,I MF ,I AF ,I GF These four types of images are cropped into image sets of 128×128, 64×64, 32×32, and 16×16 sizes respectively.
[0106] For each type of image set, 50% is randomly selected as the training set for training the classifier model, and the remaining 50% is used as the test set to test the classification performance. The classifier uses an integrated classifier.
[0107] (1) Selection of quantization parameters
[0108] The construction of detection features based on quantized differential co-occurrence matrix involves the parameter k for quantizing the difference. If the parameter k is set too small, the difference amplitude that can be measured will be smaller, resulting in the inability to achieve the ideal performance of mean filtering and Gaussian filtering. If the parameter k is set too large, the quantized difference value d′ x,y Included x,y Too much, d′ x,y and d x,y The relationship is shown in formula (5). In this case, the information of pixel correlation cannot be accurately reflected, which will also reduce the classification performance. In order to correctly set the parameters of the algorithm and optimize the smoothing filter detection performance of the feature, an appropriate parameter k is selected through experiments.
[0109] From the four categories of image sets {I ORI ,I MF ,I AF ,I GF}, the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix provided by the present invention is used to extract features, and the quantization parameters are set to k∈(1, 5, 10, 15, 20, 25, 30) respectively, and then the smoothing filter is detected based on the features extracted by the above quantization parameters. Table 1 shows the results of the test on images of different sizes, where k=1 means that the difference is not quantized. It can be seen that the average error rate of the smoothing filter using the unquantized differential co-occurrence matrix as a feature detection is higher than the average error rate of the detection with the introduction of the quantized differential co-occurrence matrix features, indicating that the combined features proposed by the present invention can more effectively detect the smoothing filter. Secondly, on images of four different sizes, the average detection error rate reaches the lowest value when the quantization parameter k=15. Therefore, the quantization parameter of the present invention selects k=15.
[0110] Table 1 Average error rate of smoothing filter detection with different quantization parameters k (%)
[0111]
[0112] (2) Smoothing filter detection of small-size images
[0113] This group of experiments tests the smoothing filter detection performance of the proposed method on small-size images. 3000 images are selected from the BOSS and NRCS databases respectively, and the operations in the experimental settings of Section (1) are used to generate {I ORI ,I MF ,I AF ,I GF}These four types of image sets are cropped along the center into 128×128, 64×64, 32×32, and 16×16 sizes respectively. Then, the smoothing filter detection feature extraction method based on quantized differential co-occurrence matrix and the small-size image smoothing filter detection algorithm based on quantized differential co-occurrence matrix provided by the present invention are used to extract features from the training sets of various types of images, input them into the corresponding classifiers for training, and obtain 6 two-class classifiers, which are combined into a multi-classifier. Finally, the test sets of various types of images are input to verify the detection performance of the proposed algorithm.
[0114] Table 2 shows the error rates of various image detections by existing methods, including SPAM in Paper 1, MFF in Paper 2, the method in Paper 3, the method in Paper 4, and the method of the present invention. It can be seen that the method of the present invention has a good smoothing filter detection effect on small-sized images. On images of 128×128 and 64×64 sizes, the recognition accuracy of the original image and the median filter image is more than 99%. Although there are about 3% and 8% error rates when distinguishing between the mean filter image and the Gaussian filter image, it can basically meet the smoothing filter detection in small-sized image scenes. On the 16×16 size image, due to the small size of the image, the image contains less texture and is prone to saturation, resulting in about 5% of the original image being misjudged as an image processed by linear filtering, and the distinction performance between the mean filter image and the Gaussian filter image is also due to the small size, and the classification accuracy is reduced.
[0115] Compared with other methods, the detection error rate of the method of the present invention for various types of images on images of different sizes is lower than that of the other four methods. It can be seen that the smoothing filter detection effect of MFF, method 3 and method 4 on small-sized images is not ideal. SPAM also uses differential co-occurrence matrix as a detection feature. The detection performance of this feature for original images and median filtered images is comparable to that of the method of the present invention. However, because the feature proposed by the present invention adds a quantized differential co-occurrence matrix, the classification performance for mean filtering and Gaussian filtering is improved, especially on images of 32×32 and 16×16 sizes. The detection performance for mean filtering and Gaussian filtering is more significantly improved compared with the SPAM feature.
[0116] Table 2 Smoothing filter detection error rate of existing methods and the method of the present invention (%)
[0117]
[0118] (3) Image stitching area positioning test
[0119] Based on the two "forged" scenes described in Example 3, an image set containing 10 stitched images was constructed. The stitched materials of these 10 forged images were taken from the Raise image library (Article 5: DANG-Nguyen DT, PASQUINI C, CONOTTERV, et al. RAISE: a raw images dataset for digital image forensics [C] / / ACM Multimedia Systems Conference, 2015: 219-224). The Raise public image library is unprocessed color images with an image size of 4288×2848 or 2848×4288. This group of experiments selected materials from the image library, smoothed them with different filters, and then spliced them onto another image to synthesize a forged image, and finally converted the forged image into a grayscale image. Figure 6 As shown, after smoothing the stitched material, the "road sign" in the image is cut out and then stitched into the original image to synthesize a fake image.
[0120] First, the experiment needs to determine the parameters of splicing detection, namely the smoothing detection window size z and the window sliding step size L. Table 3 shows the average pixel-level accuracy of 10 spliced images when different z and L are used. It can be seen that when L is constant, the detection accuracy of the detection window size of 64×64 is higher than the accuracy of the other two window sizes; when the window size z is constant, the smaller the sliding step size L, the higher the detection accuracy, but at the same time, as L decreases, the time consumed by the detection algorithm increases exponentially. Considering the two factors of detection accuracy and time consumption, the detection parameters of this group of experiments are selected as z=64×64 and L=8.
[0121] Table 3 Average detection accuracy (%) of different detection windows and sliding steps
[0122]
[0123] Figure 7 Some spliced images and detection results are shown, with the first column being the original image, the second column being the spliced image, the third column being the schematic diagram of the spliced area, and the fourth column being the detection result. The original image or the spliced area is processed with different smoothing filters to construct a scene where the smoothing filter performance of the original image area and the spliced area is inconsistent. It can be seen that in this scenario, the image splicing area positioning algorithm proposed in the present invention has a good detection effect. Through the detection results, it can be basically determined whether the test image is a spliced forged image and locate the spliced area.
[0124] For smoothing filter detection of small-sized images, the present invention proposes a detection algorithm based on a quantized differential co-occurrence matrix, analyzes the separability of different smoothing filters by the statistical differential co-occurrence matrix on small-sized images, points out that the classification performance of this method for two linear filters is poor, and proposes a detection feature of a quantized differential co-occurrence matrix to address this problem. This feature effectively measures the difference between mean filtering and Gaussian filtering, and improves the ability to distinguish between the two linear filters. Furthermore, a smoothing filter detection algorithm based on a quantized differential co-occurrence matrix and an image splicing area positioning algorithm based on block smoothing filter detection are proposed.
[0125] Experimental results show that the method proposed in the present invention has excellent detection performance for three common smoothing filters - median filtering, mean filtering, and Gaussian filtering, and also has good detection effects on small-size images, which is better than existing methods. In addition, the splicing area positioning algorithm proposed in the present invention can accurately locate the tampered area to the pixel level, and the positioning of the edge of the splicing area is more accurate. At the same time, the detection algorithm can cope with a variety of smoothing filter operations, and has a wider range of application scenarios.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A smoothing filter detection feature extraction method based on quantized differential co-occurrence matrix, characterized in that: include: Step 1: Extract features from image I n , calculate the difference images of its 8 difference directions (p, q) Where p,q∈{-1,0,1}; for each of the differential images Quantize and get 8 corresponding quantized difference images Step 2: For each of the difference images and each of the quantized difference images The difference value in is truncated, where the truncation threshold is [-T, T]; Step 3: For each of the differential images after truncation and each of the quantized difference images The corresponding co-occurrence matrices are calculated respectively and recorded as differential co-occurrence matrices and quantized differential co-occurrence matrices respectively; Step 4: Average the differential co-occurrence matrices in the horizontal / vertical direction and the diagonal direction to obtain two co-occurrence matrices M h / v and M d ; The quantized differential co-occurrence matrices in the horizontal / vertical direction and the diagonal direction are averaged to obtain two co-occurrence matrices M′ h / v and M′ d ; Step 5: Substitute the four co-occurrence matrices M h / v , M′ h / v 、M d , M′ d The combination is 4×(2T+1) 3 The dimension feature W is used as the image I to be extracted n detection features.
2. The method for extracting smoothing filter detection features based on quantized differential co-occurrence matrix according to claim 1, characterized in that: According to formula (5), for each of the differential images To quantify: in, Represents the difference image The coordinates are the difference values of the pixels at (x, y). Represents the quantized difference image The coordinates are the difference values of the pixel points (x, y), k represents the quantization parameter, k is an integer greater than 1, and [·] is a rounding operation.
3. The method for extracting smoothing filter detection features based on quantized differential co-occurrence matrix according to claim 1, characterized in that: According to formula (6) and formula (7), the differential co-occurrence matrix is calculated as and quantized differential co-occurrence matrix in, Represents the difference image The coordinates are the difference values of the pixels at (x, y). Represents the quantized difference image The coordinates are the difference values of the pixels at (x, y), c1, c2, c3 ∈ {-T,…, T}, and Z is the difference image I d All triples in , and |·| represents the number of elements in the set ·.
4. The method for extracting smoothing filter detection features based on quantized differential co-occurrence matrix according to claim 1, characterized in that: According to formula (8) to formula (11), four co-occurrence matrices M are calculated: h / v , M′ h / v 、M d , M′ d : in, and denote the differential co-occurrence matrix and the quantized differential co-occurrence matrix, respectively.
5. A small-size image smoothing filter detection algorithm based on quantized differential co-occurrence matrix, characterized in that: include: Step 1: Construct four types of training image sets, namely: original image set, median filtered image set, mean filtered image set and Gaussian filtered image set; Step 2: for each type of training image set, assign a corresponding type label to each training image therein, and extract the detection features of each training image according to the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix as described in any one of claims 1 to 4, and form a training sample with the type label and the detection features of each training image, and finally obtain four types of training sample sets; the type label is used to indicate the training image set to which the training image belongs; Step 3: construct every two training sample sets in the four types of training sample sets into a training group, and obtain 6 training groups in total; The two types of training sample sets in each training group are trained using a machine learning method to obtain their binary classifier models, and finally 6 binary classifier models corresponding to 6 training groups are obtained; Step 4: Extract detection features of the image to be detected according to the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix as described in any one of claims 1 to 4, input the detection features into 6 trained binary divider models to obtain 6 discrimination results, and use the majority voting method to vote on the 6 discrimination results to obtain the final classification result.
6. The image splicing area positioning method based on block smoothing filter detection is characterized by: include: Step 1: Convert the image to be detected into a gray image, set the detection window size to z×z, and divide the gray image into image blocks through the detection window; Step 2: extracting feature vectors of image blocks divided by the detection window by using the smoothing filter detection feature extraction method based on the quantized differential co-occurrence matrix as described in any one of claims 1 to 4, and inputting the feature vectors into a multi-classifier to obtain a classification result; the multi-classifier is obtained by connecting in parallel six binary classifiers obtained by using the small-size image smoothing filter detection algorithm based on the quantized differential co-occurrence matrix as described in claim 5; Step 3: Slide the detection window with a step size of L to traverse the entire image to be detected, where 1≤L≤z and L is an integer, so as to divide many overlapping image blocks. Each time the detection window is slid, the image block is smoothed and filtered according to step 2, and the corresponding classification result is recorded for each pixel in the window; Step 4: Use the majority voting method to obtain the final classification result of each pixel point, and determine the area that is inconsistent with the smoothing filter performance of the entire image to be detected as the splicing area based on the final classification result of each pixel point.
Citation Information
Patent Citations
Facial expression identification method based on Gabor wavelet and gray-level co-occurrence matrix
CN105005765A
Systems and methods for image reconstruction
US20210104023A1