Double compression detection method for color JPEG images based on polynomial fitting
Through the combination of polynomial fitting and support vector machine, the problem of insufficient accuracy of double compression detection of the same quantization matrix of color JPEG images is solved, and high accuracy detection is achieved under high quality factors, especially under high quality factors, the detection accuracy reaches more than 99%.
Patent Information
- Application Number
- CN202310084835.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-02
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-02-02
AI Technical Summary
The existing dual compression detection method for the same quantization matrix of color JPEG images has shortcomings in terms of detection accuracy, especially when the quality factor of the first compression is large or other operations exists, it is difficult to effectively distinguish between single and double compression, and there is a lack of scientific data analysis methods.
The error characteristics of color JPEG images were analyzed by polynomial fitting method, polynomial fitting was performed by the error information extracted during continuous compression, the least squares method was used to fit the curve, and combined with the support vector machine for detection, enriching the detection basis and reducing the influence of accidental factors.
The accuracy of color JPEG images is improved, and the reliability and accuracy of detection are enhanced through the combination of polynomial fitting and support vector machine, especially in the case of high-quality factors, which is more than 99%.
Smart Images

Figure CN116402744B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image forensics, and in particular to a color JPEG image double compression detection method based on polynomial fitting. Background Art
[0002] Images are increasingly used in our daily lives, and image manipulation technology has also advanced significantly. Many manipulated images are no longer detectable to the naked eye, making image manipulation detection technology increasingly important. The Joint Photographic Experts Group (JPEG) is currently the most commonly used image file format, accounting for approximately 70% of all images transmitted online.
[0003] Detecting whether an image has undergone JPEG double compression is important for image forensics. Most image tampering processes result in repeated compression of the image, while the original, untampered image is compressed only once. Therefore, double compression detection can be used to determine whether the image has been tampered with. JPEG double-compressed images can be classified in two ways: aligned JPEG double-compressed images and misaligned JPEG double-compressed images, based on whether the block-by-block discrete cosine transform (DCT) grids between the primary and secondary JPEG compression are aligned. Alternatively, they can be classified into same-quantization-matrix JPEG double-compression detection and different-quantization-matrix JPEG double-compression detection, based on whether the quantization matrices used in the primary and secondary JPEG compression are the same.
[0004] At present, the problem of detecting double compression of JPEG with different quantization matrices has basically been solved well, and good performance can be achieved even in small-scale cases, which will help the development of tampering location method research. The problem that still exists is that when the quality factor of the first compression is greater than the second compression and there are some other operations between the two compressions, the existing methods cannot solve it well. For the same quantization matrix, the detection accuracy of some previous algorithms is not high enough. In particular, for the detection of double compression of color JPEG with the same quantization matrix, the following problems still need to be solved:
[0005] (1) Insufficient data available for analysis. Currently, most algorithms are targeted at grayscale images. Color images have more color channels and color correlations, so grayscale image detection algorithms cannot be directly used on color images. Therefore, Wang et al. [1] used the conversion error generated when the color space is converted from RGB to YCbCr during color image JPEG compression, as well as the truncation error and rounding error during the decompression process to perform color JPEG same quantization matrix alignment double compression detection. In order to better utilize the color correlation of color images, they also proposed using spherical coordinate transformation to map the RGB channels of color images to the spherical coordinate system, solving some of the problems of insufficient data. However, the above work still has some shortcomings. They did not explore other error information generated during the color image compression process, such as the quantization error generated during the compression process and the coefficient error that can reflect the image changes as a whole.
[0006] (2) Lack of more scientific data analysis methods. By simply analyzing the data and discovering certain characteristics of the image, Niu et al. [2] found that when the image is continuously compressed, the error and quantization coefficient will gradually converge as the number of compressions increases. They proposed extracting a total of 15-dimensional features from the error and quantization coefficient for dual compression detection. However, this paper only uses the mean and variance of the error information to analyze the convergence of the error. This method is easily affected by some accidental factors and is not accurate enough in analyzing the convergence of the error information. Summary of the Invention
[0007] Aiming at the problem of low detection accuracy in the current double compression detection method for color JPEG images with the same quantization matrix, the present invention proposes a double compression detection method for color JPEG images based on polynomial fitting.
[0008] The present invention provides a color JPEG image double compression detection method based on polynomial fitting, comprising:
[0009] Step 1: Use the same quantization matrix to perform n consecutive JPEG compressions on the JPEG file to be tested;
[0010] Step 2: Extract the error characteristics generated during each JPEG compression process;
[0011] Step 3: Use the given polynomial model and the least squares method to perform polynomial fitting on the error features extracted during the n consecutive JPEG compression processes to obtain a fitting curve;
[0012] Step 4: using the fitting curve to predict the error characteristics before the first JPEG compression;
[0013] Step 5: Use the training set to train the support vector machine, and input the error features obtained in steps 2 and 4 into the trained support vector machine to detect whether the JPEG file to be tested has been double-compressed.
[0014] Furthermore, the JPEG compression includes a compression process and a decompression process;
[0015] The decompression process includes, in sequence: an entropy decoding operation, an inverse quantization operation, an inverse discrete cosine transform operation, a truncation and rounding operation, and an inverse color space conversion operation from a YCbCr space to an RGB space;
[0016] The compression process includes, in sequence: a color space conversion operation from RGB space to YCbCr space, a discrete cosine transform operation, a quantization operation, a rounding operation, and an entropy coding operation.
[0017] Furthermore, in step 2, the error characteristics include the inverse quantization error generated before and after the truncation and rounding operations are performed on the inverse discrete cosine transform operation result, the truncation error separated from the inverse quantization error, the quantization error generated before and after the forensic operation is performed on the quantization operation result, and the JPEG coefficient error before and after the JPEG compression is performed on the JPEG file.
[0018] Furthermore, the calculation formula of the inverse quantization error is shown in formula (3):
[0019]
[0020] Among them, DE n (u, v) represents the inverse quantization error during the nth JPEG compression process, u and v represent the number of pixel rows and columns of the image, respectively. Represents the coefficient of the pixel at position (i, j) after the inverse discrete cosine transform operation, RT n (i, j) represents the coefficient of the pixel at position (i, j) after truncation and rounding.
[0021] Furthermore, the calculation formula of the quantization error is shown in formula (4):
[0022]
[0023] Among them, QE n (u,v) represents the quantization error, Q n (i, j) represents the coefficient of the pixel at position (i, j) after quantization operation, J n+1 (i, j) represents the coefficient of the pixel at position (i, j) after the rounding operation or the coefficient of the pixel at position (i, j) after the entropy decoding operation in the (n+1)th JPEG compression process, and u and v represent the number of pixel rows and columns in the image, respectively.
[0024] Furthermore, the number of pixels with JPEG coefficient errors before and after JPEG compression is calculated using formula (5):
[0025]
[0026] Among them, CE n (u, v) represents the number of pixels with JPEG coefficient errors; logical represents the logical value, where the logical value of non-zero elements is recorded as 1 and the logical value of zero elements is recorded as 0; J n (i,j) and J n+1 (i, j) represents the coefficient of the pixel at position (i, j) after entropy decoding operation in the nth and n+1th JPEG compression processes, respectively.
[0027] Furthermore, in step 3, a third-order polynomial model is used for polynomial fitting.
[0028] Furthermore, in step 3, each error feature type corresponds to a fitting curve.
[0029] Beneficial effects of the present invention:
[0030] (1) The error information extracted during the continuous compression and decompression process is convergent. The error features extracted by this method are used for double compression detection, which can improve the accuracy of the detection results. Furthermore, the quantization error and coefficient error are used in double compression detection of the same quantization matrix of color JPEG images, which enriches the content of the available information of the detection method. In particular, the coefficient error provides the image change trend from the overall change, providing more detection basis.
[0031] (2) The polynomial model and least squares method are used in error image convergence analysis. By smoothing the fitting curve, the possibility of individual erroneous data affecting the accuracy of the entire method is reduced. At the same time, a better method is provided for error image convergence analysis, which can more scientifically express the convergence of the error image, thereby further increasing the detection accuracy.
[0032] (3) By using the polynomial fitting curve to predict the state of the image before compression, the gap between single and double compression is effectively magnified, while providing more available information, further enhancing the performance of the overall method. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic flow chart of a method for detecting double compression of color JPEG images based on polynomial fitting provided by an embodiment of the present invention;
[0034] Figure 2 A flowchart of JPEG compression and decompression of a color image provided by an embodiment of the present invention;
[0035] Figure 3 A flowchart of error feature extraction provided by an embodiment of the present invention;
[0036] Figure 4 Coefficient error convergence diagram (left) and quantization error convergence diagram (right) provided by an embodiment of the present invention;
[0037] Figure 5 The inverse quantization error convergence graph (left) and the truncation error convergence graph (right) provided by an embodiment of the present invention;
[0038] Figure 6 The third-order polynomial fitting curves of the three channel coefficient errors provided by the embodiment of the present invention;
[0039] Figure 7 A forward prediction comparison chart provided by an embodiment of the present invention;
[0040] Figure 8 A graph showing the experimental results of quantization error and coefficient error ablation provided by an embodiment of the present invention;
[0041] Figure 9 A comparison chart of the prediction error provided by an embodiment of the present invention and the detection accuracy without adding the prediction error. DETAILED DESCRIPTION
[0042] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0043] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting double compression of color JPEG images based on polynomial fitting, comprising the following steps:
[0044] S101: Perform n consecutive JPEG compressions on the JPEG file to be tested using the same quantization matrix;
[0045] Specifically, JPEG compression includes compression and decompression. For a JPEG file to be detected, it first undergoes decompression and then compression. The complete process of JPEG compression is as follows: Figure 2As shown, the decompression process sequentially includes: entropy decoding, inverse quantization, inverse discrete cosine transform, truncation and rounding, and inverse color space conversion from YCbCr space to RGB space. The compression process is the inverse of the decompression process, sequentially including: color space conversion from RGB space to YCbCr space, discrete cosine transform, quantization, rounding, and entropy encoding. It is worth noting that the calculations in both compression and decompression are performed within 8×8 image blocks. The image segmentation step is not described here, and the compression process in the method of the present invention does not involve color sampling.
[0046] Figure 2 J n Represents the coefficients of the JPEG file after entropy decoding operation; Represents the coefficient after the inverse quantization operation; Represents the coefficients after the inverse discrete cosine transform operation; RT n Represents the coefficient after truncation and rounding operations; YR n Represents the coefficients after the color space inverse conversion operation; RY n Indicates the coefficient after color space conversion operation; D n Represents the coefficient after discrete cosine transform operation; Q n Represents the coefficient after quantization operation; the subscript n represents the number of compressions.
[0047] The calculation formula for the entire JPEG compression process is shown in formula (1):
[0048]
[0049] Where Q represents the quantization table, and [.] represents the rounding operation. The color space conversion operation is to convert from RGB space to YCbCr space. The conversion formula is shown in formula (2):
[0050]
[0051] S102: extracting error features generated during each JPEG compression process;
[0052] Specifically, if Figure 3 As shown, in the embodiment of the present invention, the error features extracted during each JPEG compression process include four types of error information, specifically: the inverse quantization error generated before and after the truncation and rounding operations on the inverse discrete cosine transform operation result, the truncation error separated from the inverse quantization error, the quantization error generated before and after the forensic operation on the quantization operation result, and the JPEG coefficient error before and after the JPEG file is JPEG compressed.
[0053] The rounding operation is to round the coefficients to the nearest integer, and the truncation operation is to round coefficients less than 0 to 0 and coefficients greater than 255 to 255. The error information generated by the rounding operation is called the rounding error, and the error information generated by the truncation operation is called the truncation error. The rounding error and truncation error are collectively called the inverse quantization error. The inverse quantization error is calculated as shown in formula (3). The truncation error is directly separated from the inverse quantization error through an operation, and the extraction process is similar to that of the inverse quantization error.
[0054]
[0055] Among them, DE n (u, v) represents the inverse quantization error during the nth JPEG compression process, u and v represent the number of pixel rows and columns of the image, respectively. Represents the coefficient of the pixel at position (i, j) after the inverse discrete cosine transform operation, RT n (i, j) represents the coefficient of the pixel at position (i, j) after truncation and rounding.
[0056] The calculation formula of quantization error is shown in formula (4):
[0057]
[0058] Among them, QE n (u,v) represents the quantization error, Q n (i, j) represents the coefficient of the pixel at position (i, j) after quantization operation, J n+1 (i, j) represents the coefficient of the pixel at position (i, j) after the rounding operation or the coefficient of the pixel at position (i, j) after the entropy decoding operation in the (n+1)th JPEG compression process, and u and v represent the number of pixel rows and columns in the image, respectively.
[0059] The coefficient error is determined by the recompressed JPEG coefficient (ie J n+1 ) minus the JPEG coefficient before recompression (J n ). The coefficient error can reflect useful information of the entire compression and decompression process and is directly obtained by subtracting the JPEG coefficients of the two compressions. In this embodiment, the number of pixels whose coefficients change between the two compressions is mainly calculated, as shown in formula (5):
[0060]
[0061] Among them, CE n (u, v) represents the number of pixels with JPEG coefficient errors; logical represents the logical value, where the logical value of non-zero elements is recorded as 1 and the logical value of zero elements is recorded as 0; J n (i,j) and Jn+1 (i, j) represents the coefficient of the pixel at position (i, j) after entropy decoding operation in the nth and n+1th JPEG compression processes, respectively.
[0062] As an example, Tables 1 and 2 show the detailed information of four error information in each color channel for the first three consecutive compressions. As can be seen from the tables, the errors gradually decrease with increasing compression times, and some error information is effective at low quality factors, while some error information is effective at high quality factors.
[0063] Table 1 The first three points of coefficient error and inverse quantization error under different quality factors
[0064]
[0065] Table 2 The first three points of truncation error and quantization error under different quality factors
[0066]
[0067] S103: using a given polynomial model and the least squares method to perform polynomial fitting on the error features extracted during n consecutive JPEG compression processes to obtain a fitting curve, where each error feature type corresponds to a fitting curve;
[0068] Specifically, according to Tables 1 and 2 mentioned above, the error information extracted from a color JPEG image when the same quantization matrix is used for JPEG compression decreases with each compression cycle, eventually reaching a stable value. This is the process of error information convergence with compression. Therefore, color JPEG images exhibit different convergence trends at different compression cycles. Fewer compression cycles result in less information loss and a more pronounced downward trend. More compression cycles result in more information loss, resulting in a more stable image and a more gradual downward trend. Figure 4 and Figure 5 This is a convergence trend diagram before fitting for four types of error information.
[0069] As an example, a third-order polynomial model and the least squares method are used to fit the error information extracted from five consecutive compressions to obtain fitting curves for four types of error information. The slope and slope difference of the fitting curve can then be calculated and used as the convergence rate of the error information. The specific fitting process is as follows:
[0070] S1031: The general formula of the third-order polynomial model is shown in formula (6). The JPEG image is compressed continuously to obtain the required set of error data containing m sample points {(x1, y1), (x2, y2), (x3, y3)… (x m ,ym )}.
[0071] y=a×x 3 +b×x 2 +c×x+d (6)
[0072] S1032: Substitute the horizontal coordinates of the m sample points into formula (6) to obtain their calculated vertical coordinates, as shown in formula (7).
[0073]
[0074] S1033: Solve the model using the least squares method, using the calculated value of each sample point and the actual value y i The square sum of the errors of all sample points is used to represent the errors of all sample points, as shown in formula (8).
[0075]
[0076] S1034: Calculate the minimum error and find the partial derivative of each parameter, as shown in formula (9).
[0077]
[0078] The specific values of the obtained parameters a, b, c, d are recorded as A, B, C, D respectively; and the complete fitting curve equation can be obtained by bringing it back to formula (6). Figure 6 Shown are the coefficient error curves after fitting the three channels.
[0079] S1035: Calculate the first derivative of y based on the complete fitting curve equation, as shown in formula (10), and then calculate the slope.
[0080] y′=3A×x 2 +2B×x+C (10)
[0081] S104: using the fitting curve to predict the error characteristics before the first JPEG compression;
[0082] Specifically, through the previous analysis, we know that the more times the compression is performed, the less available information can be obtained. It can be seen that the error of the first compression is the largest, and the error becomes smaller and smaller as time goes by, and the trend of change gradually stabilizes, such as Figure 5 As shown, the difference between the first and second compressions is the largest. Therefore, the present invention uses the fitted curve to predict the pre-compression state, which not only further increases the available information but also amplifies the error information according to different trends. The pre-compression state predicted by a single compression is much larger than the pre-compression state predicted by a double compression.
[0083] As an example, still taking the third-order polynomial formula for the fitting curve obtained by the above calculation as an example, the slope of the previous compression point is calculated by formula (10), and x=-1 is substituted into formula (10) to obtain, as shown in formula (11).
[0084] y=3A-2B+C (11)
[0085] Where A, B, and C are all values obtained through previous calculations. In the same way, by substituting x=-1 into the solved third-order polynomial formula, the error information before the prediction compression can be obtained. The predicted points are plotted on the graph, as shown in the figure. Figure 7 As shown. Figure 7 As can be seen from the figure, as analyzed, the data difference of the predicted segment is much larger than the data difference of the original fitting segment. Therefore, using the data of the predicted segment can effectively amplify the gap between single and double compression, making the detection more reliable.
[0086] S105: Using the training set to train the support vector machine, the error features obtained in step S102 and step S104 are input into the trained support vector machine to detect whether the JPEG file to be tested has been double-compressed.
[0087] Specifically, several JPEG images are obtained as a training set, all images in the training set are compressed once to produce a single-compressed sample set, and then compressed again with the same quantization table to produce a double-compressed sample set. Then, features are extracted from the single-compressed samples and the double-compressed samples by manual extraction. Finally, the support vector machine with Gaussian kernel is used for training and verification to obtain a trained support vector machine.
[0088] This embodiment of the present invention targets double compression detection for color JPEG images. First, a polynomial fitting approach is used to fit the error information obtained from multiple consecutive compressions. The slope and slope difference of the fitted curve are used to represent the convergence rate and rate difference. Secondly, for error extraction, quantization error, dequantization error, truncation error, and coefficient error are selected as features for convergence analysis. Furthermore, using the fitted curve to predict pre-compression error information can amplify the gap between compressions and thus improve accuracy. Finally, a support vector machine (SVM) is trained to detect whether an image has undergone double compression, resulting in more accurate detection results.
[0089] In order to verify the performance of the method of the present invention, the present invention also provides the following experiments.
[0090] The experimental simulation platform is as follows: CPU: Intel(R) Core(TM) i5-8300, 2.30GHz; Memory: 8.00GB; Operating System: Windows 10; Coding Tool: Matlab 2021b. The datasets used in this method are the publicly available UCID, NRCS, MIXDATA, and MIXDATA-I datasets. UCID contains 1338 images with dimensions of 512×384 or 384×512. NRCS contains 959 images cropped to 512×768. MIXDATA contains 923 images with dimensions of 600×800 and 1024×1024, and MIXDATA-I contains 923 images with a size of 512×768. The datasets used in this experiment are all uncompressed TIF format images. No pre-processing is performed on the dataset. All images in the dataset are compressed once to produce a single-compressed sample set, and then compressed again with the same quantization table to produce a double-compressed sample set. Then, features are extracted from the single-compressed samples and the double-compressed samples by manual extraction, and finally trained and verified using a support vector machine with a Gaussian kernel.
[0091] The features used in this method are the slope of the one-dimensional forward prediction and the slope difference of the three-dimensional continuous compression. Of the four error information, the truncation error is only selected from the Y channel, while the remaining three error information is extracted from all three channels, resulting in a total of ten error information and 40 convergent features. In addition, the mean and variance of the 24-dimensional quantization error and the 18-dimensional color space conversion error are selected as auxiliary features, bringing the total number of features in this method to 82 dimensions.
[0092] (1) Detection accuracy analysis
[0093] We validated our method on four datasets. Table 3 shows the TPR and TNR performance of our method on the four datasets. TPR (True Positive Rate) can be understood as the percentage of all positive classes that are predicted as positive, and TNR (True Negative Rate) can be understood as the percentage of all negative classes that are predicted as negative.
[0094] We first validated the feasibility of our proposed method on various datasets. As shown in Table 3, our method performs well across all datasets. For high quality factors, our method effectively analyzes the convergence characteristics of various image error features, achieving a good accuracy rate. For quality factors greater than 80, our method achieves an accuracy rate of over 99%. At lower quality factors, the accuracy rate decreases due to a lack of available data for analysis, but the overall accuracy rate remains relatively good, remaining above 80%. Lower quality factors are not considered in this paper due to their significant loss of image information and poor practicality. Next, we analyze and compare the performance on four datasets. We find that the MIXDATA and MIXDATA-I datasets perform better than the UCID and NRCS datasets. This is because MIXDATA and MIXDATA-I datasets were created more recently, resulting in higher image quality and more information, leading to better performance, especially at lower quality factors. When the quality factor is 45-60, the average improvement is about 10%, and when the quality factor is 70-80, the improvement is also about 5%. When the quality factor is higher, the results achieved on the four datasets are good, so the improvement is not significant.
[0095] Table 3 Performance of TPR and TNR of the method of the present invention on four data sets
[0096]
[0097] (2) Comparative analysis with existing dual compression methods
[0098] The detection accuracy of the method of the present invention is compared with that of the existing double compression method, wherein the calculation formula of the accuracy is shown in formula (12).
[0099]
[0100] In the four data sets, the method of the present invention outperforms most methods, as shown in Table 4 (bold font indicates the optimal performance value). As can be seen from Table 4, when the quality factor is high, especially when the quality factor exceeds 80, the detection accuracy of the method of the present invention can reach more than 99% in the four data sets, which is currently the most advanced position, and has different degrees of improvement compared to the existing dual compression methods. When the quality factor is 45-80, the method of the present invention is also ahead of the existing dual compression methods. We also found that when there is more available information, such as in the MIXDATA and MIXDATA-I data sets, the method of the present invention has more advantages, which shows that the method of the present invention is more accurate in analyzing data.
[0101] Table 4 Comparison of the accuracy of the method of the present invention and the existing double compression detection method
[0102]
[0103] (3) Performance analysis of quantization error and coefficient error
[0104] In addition to using inverse quantization error and truncation error, the method of the present invention also uses two types of error information: quantization error and coefficient error. In order to verify the effectiveness of these two types of error information on the algorithm, this paper conducted relevant ablation experiments. Figure 8 As can be seen from the figure, coefficient error significantly improves algorithm accuracy at quality factors of 15, 20, 60, and 70, particularly at 60 and 70, where the improvement is nearly 4%. Improvements also occur to varying degrees at other quality factors. However, at low quality factors, quantization error reaches a stable state after two compressions, resulting in less usable data and a smaller improvement in algorithm detection accuracy. Similarly, at quality factors of 30-70, the improvement in algorithm accuracy is more significant, approximately 2%-4%. At higher quality factors, the algorithm already achieves a high level of accuracy using only inverse quantization error and truncation error. Therefore, using both quantization error and coefficient error does not significantly improve the accuracy of the algorithm.
[0105] (4) Forward prediction performance analysis
[0106] Figure 9 The results show that in most cases, applying forward prediction to the method of the present invention can improve the accuracy of the algorithm. By predicting the image's pre-compression state through a fitted curve, the method can restore as much error information as possible according to its convergence law, thereby narrowing the gap between single and double compression. Especially in the case of low quality factors, where less error information is extracted from subsequent compression, the fitted prediction supplements the feature data, effectively improving accuracy by approximately 2%. Furthermore, in the case of high quality factors, forward prediction also slightly improves the algorithm's accuracy.
[0107] (5) Generalization experiment
[0108] To verify the generalization performance of our method, we conducted cross-validation. We selected three datasets for generalization experiments: NRCS, MIXDATA, and MIXDATA-I. We trained on one of these datasets and tested on the other two, comparing the results with other state-of-the-art algorithms. We divided the experiments into two scenarios: between MIXDATA and MIXDATA-I, and between MIXDATA, MIXDATA-I, and NRCS. This is because the image quality in the MIXDATA and MIXDATA-I datasets is generally higher, while the image quality in the NRCS dataset is generally lower, resulting in different convergence behavior compared to images in MIXDATA and MIXDATA-I.
[0109] The data in Table 5 (bold text indicates optimal performance) show that the proposed method exhibits good generalization performance at all high quality factors. When the quality factor is greater than 80, the proposed method's generalization performance outperforms existing algorithms or is very close. Even with significant differences in image quality between MIXDATA, MIXDATA-I, and NRCS, we are still able to identify their convergence trends using the abundant error information, thus maintaining high detection accuracy. At lower quality factors, the generalization performance between MIXDATA and MIXDATA-I remains relatively good, while the generalization performance between MIXDATA, MIXDATA-I, and NRCS remains significantly lacking. Low quality factors inherently lack sufficient error information, causing the fitted curve to converge too quickly and preventing a more detailed picture of rate variations. Given the relatively high image quality of MIXDATA and MIXDATA-I, we are still able to extract sufficient error information for fitting. In most cases, the proposed method outperforms existing algorithms. However, when the image quality differences between MIXDATA, MIXDATA-I, and NRCS are significant, resulting in different convergence patterns, the generalization performance exhibits even poorer performance. At this time, one of TPR or TNR is often close to 0 and the other is close to 100, resulting in a low accuracy of the final test.
[0110] Table 5 Cross-validation comparison with other algorithms on NRCS, MIXDATA and MIXDATA1 datasets
[0111]
[0112]
[0113] The existing dual compression detection methods mentioned in the background technology of the present invention, Table 4, and Table 5 are specifically:
[0114] [1]:Jinwei Wang,Hao Wang,Jian Li,Xiangyang Luo,Yun-Qing Shi,and SunilKumar Jha,"Detecting double JPEG compressed color images with the samequantization matrix in spherical coordinates,"IEEE Transactions on Circuitsand Systems for Video Technology,vol.30,no.8,pp.2736-2749,2019;
[0115] [2]:Yakun Niu,Xiaolong Li,Yao Zhao,and Rongrong Ni,"Detection ofdouble jpeg compression with the same quantization matrix via convergenceanalysis,"IEEE Transactions on Circuits and Systems for Video Technology,vol.32,no.5,pp.3279-3290,2022
[0116] [3]:Jianquan Yang,Jin Xie,Guopu Zhu,Sam Kwong,and Yun-Qing Shi,"Aneffective method for detecting double JPEG compression with the samequantization matrix,"IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY,vol.9,no.11,pp.1933-1942,2014;
[0117] [4]:Yakun Niu,Xiaolong Li,Yao Zhao,and Rongrong Ni,"An enhancedapproach for detecting double JPEG compression with the same quantizationmatrix,"Signal Processing:Image Communication,vol.76,pp.89-96,2019;
[0118] [5]:Peng Peng,Tanfeng Sun,Xinghao Jiang,Ke Xu,Bin Li,and YunqingShi,"Detection of double JPEG compression with the same quantization matrixbased on convolutional neural networks,"in 2018Asia-Pacific Signal andInformation Processing Association Annual Summit and Conference(APSIPA ASC),2018,pp.717-721:IEEE;
[0119] [6]:Ajit Umesh Deshpande,Abhinav Narayan Harish,Shubhranshu Singh,Vinay Verma,and Nitin Khanna,"Neural network based block-level detection ofsame quality factor double JPEG compression,"in 2020 7th InternationalConference on Signal Processing and Integrated Networks(SPIN),2020,pp.828-833:IEEE.
[0120] 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 various embodiments of the present invention.
Claims
1. A double compression detection method for color JPEG images based on polynomial fitting, characterized in that: include: Step 1: Continuously quantize the JPEG file to be tested using the same quantization matrix n Secondary JPEG compression; Step 2: Extract the error characteristics generated during each JPEG compression process; Step 3: Use the given polynomial model and least squares method to find the continuous n The error features extracted during the JPEG compression process are fitted with a polynomial to obtain a fitting curve. Step 4: using the fitting curve to predict the error characteristics before the first JPEG compression; Step 5: Use the training set to train the support vector machine, and input the error features obtained in steps 2 and 4 into the trained support vector machine to detect whether the JPEG file to be tested has been double-compressed.
2. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 1, wherein: The JPEG compression includes a compression process and a decompression process; The decompression process includes, in sequence: an entropy decoding operation, an inverse quantization operation, an inverse discrete cosine transform operation, a truncation and rounding operation, and an inverse color space conversion operation from a YCbCr space to an RGB space; The compression process includes, in sequence: a color space conversion operation from RGB space to YCbCr space, a discrete cosine transform operation, a quantization operation, a rounding operation, and an entropy coding operation.
3. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 2, wherein: In step 2, the error characteristics include the inverse quantization error generated before and after the truncation and rounding operations are performed on the inverse discrete cosine transform operation result, the truncation error separated from the inverse quantization error, the quantization error generated before and after the forensic operation is performed on the quantization operation result, and the JPEG coefficient error before and after the JPEG compression of the JPEG file.
4. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 3, wherein: The calculation formula of the inverse quantization error is shown in formula (3): in, Indicates the n The dequantization error during the JPEG compression process, Represent the number of pixel rows and columns of the image, Indicates the position after the inverse discrete cosine transform operation The coefficient of the pixel at , Indicates the position after truncation and rounding operations The coefficient of the pixel at .
5. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 3, wherein: The calculation formula of the quantization error is shown in formula (4): in, Indicates the n times the quantization error, Indicates the position after quantization operation The coefficient of the pixel at , Indicates the position after rounding The coefficient of the pixel at n +1 position after entropy decoding during JPEG compression The coefficient of the pixel at , and Represents the number of pixel rows and columns of the image respectively.
6. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 3, wherein: Formula (5) is used to calculate the number of pixels with JPEG coefficient errors before and after JPEG compression: in, Indicates the n The number of pixels with JPEG coefficient errors before and after JPEG compression, Respectively represent the number of pixel rows and columns of the image; logical Indicates taking logical values, recording the logical value of non-zero elements as 1 and the logical value of zero elements as 0; and Respectively represent n Second and n +1 position after entropy decoding during JPEG compression The coefficient of the pixel at .
7. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 1, wherein: In step 3, a third-order polynomial model is used for polynomial fitting.
8. The method for detecting double compression of color JPEG images based on polynomial fitting according to claim 3, wherein: In step 3, each error feature type corresponds to a fitting curve.
Citation Information
Patent Citations
Duration-related mp3 double compression detection method under same bit rate
CN105513600A
JPEG image double-compression automatic detection method
CN106960435A