JPEG synchronization recompression detection method for BMP format cover
By estimating the quantization step size to construct a quantization table and extracting the expected minimum error and first-order relative error features, the problem of decreased detection performance in BMP format JPEG recompression is solved, achieving higher detection accuracy and classification effect.
Patent Information
- Application Number
- CN202310765039.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-06-27
AI Technical Summary
Existing technologies cannot effectively detect synchronous JPEG recompressed images saved in BMP format, resulting in a decline in feature extraction performance. In particular, it is difficult to obtain recompressed features such as truncation error after the JPEG quantization table is lost.
By estimating the JPEG quantization step size, a quantization table is constructed, and the expected-minimum error feature and first-order relative error feature are extracted. Support Vector Machine (SVM) is then used for classification to detect JPEG synchronous recompression masked by BMP format.
It improves the accuracy and classification performance of synchronous recompression detection for BMP format JPEG images, and can effectively distinguish between single-compressed and recompressed images, especially performing better at low quality factors.
Smart Images

Figure CN116823765B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, specifically but not limited to a method for detecting JPEG synchronous recompression masked by BMP format. Background Technology
[0002] With the development of technology and the increasing prevalence of electronic devices, digital images have become an important information carrier in social production and daily life. In recent years, to ensure the credibility of images, digital image forensics technology has attracted widespread attention. JPEG format, due to its small size, fast storage, and strong compatibility, has become a widely used image format for saving pictures in daily life. Therefore, digital image forensics technology related to JPEG is one of the key areas of forensics, such as JPEG steganography, JPEG history forensics, JPEG resampling forensics, JPEG recompression detection, and JPEG quantization step size estimation. When an original image undergoes two JPEG compressions, it is called a JPEG recompressed image. Based on whether the DCT blocks between the two compressions are aligned, JPEG recompression can be divided into two categories: aligned JPEG recompression and unaligned JPEG recompression. Based on whether the quality factors between the two JPEG compressions are the same, aligned JPEG recompression can be further divided into two categories: asynchronous JPEG recompression and synchronous JPEG recompression. Among them, synchronous JPEG recompression detection has been a research hotspot in recent years.
[0003] Existing technology 1) proposes a detection algorithm based on random perturbation. In this algorithm, the given JPEG image J is first compressed again using the same quantization matrix, denoted as J′. The different JPEG coefficients between J and J′ are calculated, denoted as D. Then, perturbation is added to the image by randomly adding or subtracting one from the JPEG coefficients of image J′, and JPEG compression is performed again. The number of JPEG coefficients different from image J′ is calculated. This operation is repeated for image J′, and the average value is taken as a threshold. Finally, D is compared with the threshold to distinguish between single JPEG compression and JPEG recompression. Existing technology 2) builds on the above and proposes to further improve the algorithm's performance by restricting the symbols added for perturbation. Prior art 3) proposes an algorithm based on error images. It decompresses a given JPEG image into a spatial image, subtracts the inverse discrete cosine transform coefficients from the image pixel values during decompression to obtain the error image. Then, based on the source of the error, the error blocks are divided into rounding error blocks and truncation error blocks. DCT transformations are applied to the rounding and truncation error blocks respectively, mapping the errors to the DCT domain. Finally, error features in the DCT and spatial domains are extracted and classified using an SVM. Prior art 4) builds upon prior art 3) by designing a simple convolutional neural network containing four convolutional layers and two fully connected layers, using the error image as network input to detect JPEG recompression. Prior art 5) proposes a convolutional neural network based on a dense CNN framework, using the rounding and truncation error images as network input, capable of extracting subtle traces left by JPEG recompression. Prior art 6) also addresses recompression detection for smaller images, proposing a feature based on the quantized DCT coefficient difference, building upon the features proposed in prior art 3), which is used as network input. Finally, a multilayer perceptron is used for classification. Existing technology 7) proposes a feature extraction method based on spherical coordinates for JPEG recompression of color images. This method maps truncation and rounding errors in the three channels of a color image to spherical coordinates and extracts amplitude and angle in the spherical coordinates as features, fully utilizing the correlation between the three channels of the color image. Simultaneously, it proposes using the conversion errors caused by color conversion during compression to extract the number of conversion errors as features. Finally, these features are classified using an SVM. Existing technology 8) proposes a new method for detecting JPEG recompression based on convergence and perturbation. Based on rounding, truncation errors, and the convergence characteristics of JPEG coefficients during multiple compressions, inverse quantization error is defined. Then, based on rounding and truncation, inverse quantization error is divided into inverse quantization error of rounding error and inverse quantization error of truncation error, from which features are extracted. Simultaneously, by adding perturbation to the JPEG coefficients, the difference between the perturbation-based features and multiple thresholds is used as features. Finally, an SVM is used to detect the image based on the above features.In the prior art 9), a convergence-based JPEG recompression detection algorithm was proposed. This algorithm utilizes the characteristic that JPEG images tend to stabilize when continuously and synchronously compressed, and extracts the convergence error. In addition, the algorithm also obtains the transposition error by performing a transpose attack on the image to be detected, which characterizes the anti-interference ability of the features. Then, a four-element mapping is used to maintain the relationship between continuously compressed JPEG images. Finally, SVM is used to classify the images based on the features, achieving the best results to date.
[0004] While existing technologies have achieved good results for synchronous JPEG recompression, their features are obtained during the JPEG decompression process. For synchronous JPEG recompressed images saved in BMP format, existing algorithms cannot directly extract features, resulting in performance degradation. Furthermore, when saving JPEG images in BMP format, the image file loses the JPEG quantization table, making it difficult to directly obtain recompression features such as truncation error.
[0005] In view of this, a new detection method is needed to solve at least some of the above problems. Summary of the Invention
[0006] To address one or more problems in existing technologies, this invention proposes a method for detecting synchronized JPEG recompression masked by BMP format. By analyzing the shortcomings of existing quantization step size estimation methods, a method capable of effectively estimating the JPEG quantization table is proposed. Utilizing the unique characteristics of JPEG 100 quality factor compression, the minimum error caused by JPEG compression at quality factor 100 is extracted to construct an expected-minimum error feature. A first-order relative error feature is proposed using the convergence characteristics of inverse quantization JPEG coefficients. Ultimately, this method effectively detects synchronized JPEG recompressed images stored in BMP format, and can also detect synchronized JPEG recompression at any quality factor.
[0007] The technical solution to achieve the purpose of this invention is as follows:
[0008] A method for detecting JPEG synchronous recompression masked by BMP format includes:
[0009] S1. Obtain a JPEG image masked in BMP format, estimate the quantization step size of the image, and use the quantization step size to estimate the quality factor. And based on quality factor Generate a complete quantization table;
[0010] S2. Use the above quantization table to extract the expected error features of the image, use the minimum quantization table to extract the minimum error features of the image, and utilize the redundancy of the minimum error to construct the expected-minimum error features; the minimum quantization table refers to a quantization table in which all quantization steps are 1, and the minimum error refers to the error caused by domain change and color conversion error.
[0011] S3. Based on the characteristic that the relative transformation rate of the JPEG coefficients gradually decreases after dequantization, a first-order relative error feature is constructed by extracting the dequantized JPEG coefficients from the three JPEG compressions.
[0012] S4. Use Support Vector Machine (SVM) to classify the above-mentioned expected minimum error features and first-order relative error features.
[0013] Furthermore, the specific steps for estimating the quantization step size of the image in S1 include:
[0014] S1-1. Perform DCT transformation on the JPEG image masked by BMP format, round the obtained DCT coefficients and calculate the factor histogram.
[0015] S1-2. Find the largest factor whose frequency is greater than the threshold T1 in the factor histogram. As an initial quantization step size, the maximum factor in the factor histogram is calculated. Maximum factor The proportionate measure (PCT) between its multiples, wherein the PCT characterizes the similarity of frequencies at two factors;
[0016] S1-3. Determine the relationship between the proportion PCT and the threshold T2. If there exists a PCT > T2, then record the largest multiple among all multiples of PCT > T2 as [the value of PCT]. Then the quantization step size If PCT > T2 does not exist, then the quantization step size is...
[0017] Furthermore, in S1, the quality factor is estimated using a quantization step size. The specific steps include:
[0018] The quality factor is calculated using the estimated quantization step size eq and the standard quantization table:
[0019]
[0020] In the formula, q(i,j) is the quantization base of the i-th row and j-th column of the standard quantization table, Q(i,j) is the quantization step size of the i-th row and j-th column of the estimated quantization table, and round(·) is the rounding function.
[0021] Let C be the set of all estimated quality factors. Calculate the mean of set C and round it down to the nearest integer. Use this mean as the final estimated quality factor.
[0022]
[0023] In the formula, mean(·) is the function for calculating the mean.
[0024] Furthermore, the formula for generating the quantification table based on the quality factor in S1 is as follows:
[0025]
[0026] In the formula, Q(i,j) is the quantization step size of the i-th row and j-th column of the quantization table, floor(·) is the floor function, QF is the quality factor, and q(i,j) is the quantization base corresponding to the i-th row and j-th column of the standard quantization table.
[0027] Furthermore, the specific steps in S2 for extracting the expected error features of the image using a quantization table include:
[0028] The JPEG image is compressed twice using the estimated quantization table. The quantization error QE1, truncation error TE1, and rounding error RE1 in the first compression are extracted, and the quantization error QE2, truncation error TE2, and rounding error RE2 in the second compression are extracted.
[0029] Calculate the quantization error difference (DQE), truncation error difference (DTE), and rounding error difference (DRE):
[0030] DTE = TE1 - TE2
[0031] DRE = RE1 - RE2
[0032] DQE = QE1 - QE2
[0033] The quantization error difference DQE is transformed to the spatial domain and then subtracted from the truncation error difference DTE and the rounding error difference DRE, denoted as DQT and DQR respectively.
[0034] DQT = IDCT(DQE) - DTE
[0035] DQR = IDCT(DQE) - DRE
[0036] In the formula, IDCT(·) is the inverse discrete cosine transform function;
[0037] The truncation error difference DTE, rounding error difference DRE, DQT, and DQR are denoted as the expected error characteristics.
[0038] Furthermore, the specific steps for extracting the minimum error features of the image using the minimum quantization table in S2 include:
[0039] The JPEG image is compressed twice using a minimum quantization table. The quantization error QE1′, truncation error TE1′, and rounding error RE1′ in the first compression and the quantization error QE2′, truncation error TE2′, and rounding error RE2′ in the second compression are extracted.
[0040] Calculate the quantization error difference DQE′, truncation error difference DTE′, and rounding error difference DRE′:
[0041] DTE′=TE1′-TE2′
[0042] DRE′=RE1′-RE2′
[0043] DQE′=QE1′-QE2′
[0044] The quantization error difference DQE′ is transformed to the spatial domain and then subtracted from the truncation error difference DTE′ and the rounding error difference DRE′, denoted as DQT′ and DQR′ respectively.
[0045] DQT′=IDCT(DQE′)-DTE′
[0046] DQR′=IDCT(DQE′)-DRE′
[0047] In the formula, IDCT(·) is the inverse discrete cosine transform function;
[0048] The truncation error difference DTE′, rounding error difference DRE′, DQT′, and DQR′ are denoted as the minimum error characteristics.
[0049] Furthermore, the construction of the expected-minimum error feature in S2 specifically includes:
[0050] The expected error feature and the minimum error feature are processed separately, including statistical features, calculation of mean and variance, etc. The difference between the expected error feature and the minimum error feature after processing is obtained as the expected-minimum error feature.
[0051] Furthermore, the construction of the first-order relative error feature in S3 specifically includes:
[0052] S3-1. Perform three JPEG compression and decompression operations on the JPEG image, and extract the inverse quantization JPEG coefficients DB1, DB2 and DB3 after the three compression processes;
[0053] S3-2. Calculate the JPEG coefficients (DB) between two consecutive JPEG compressions. n The relative changes R1 and R2:
[0054]
[0055] S3-3. Extract features from R1 and R2 as first-order relative error features by statistical characteristics and by calculating the mean, variance, maximum value, minimum value, etc.
[0056] Furthermore, the formula for calculating the proportion PCT mentioned in S1-2 is as follows:
[0057]
[0058] In the formula, a and b represent two different factors.
[0059] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:
[0060] 1. The JPEG synchronous recompression detection method for BMP format masking of the present invention provides a reliable quantization table for subsequent extraction of JPEG recompression features by designing a quantization table estimation method.
[0061] 2. The JPEG synchronous recompression detection method for BMP format masking of the present invention extracts the minimum error to construct the expected-minimum error feature, making the proposed feature more effective for classification, removing redundant data in the proposed feature, and improving the classification performance of the proposed feature.
[0062] 3. The JPEG synchronous recompression detection method for BMP format masking of the present invention can effectively distinguish between single compressed images and recompressed images by constructing first-order relative error features, and has higher accuracy than the corresponding traditional JPEG recompression detection method. Attached Figure Description
[0063] The accompanying drawings are provided to further illustrate the invention and, together with the description, serve to explain embodiments of the invention, but do not constitute a limitation thereof. In the drawings:
[0064] Figure 1 A flowchart of the JPEG synchronous recompression detection method for BMP format masking according to the present invention is shown.
[0065] Figure 2 A flowchart illustrating the estimation quantization step size of the JPEG synchronous recompression detection method for BMP format masking according to the present invention is shown.
[0066] Figure 3 A flowchart illustrating the extraction of the expected-minimum error features in the JPEG synchronous recompression detection method for BMP format masking according to the present invention is shown.
[0067] Figure 4A flowchart illustrating the extraction of first-order relative error features in the JPEG synchronous recompression detection method for BMP format masking according to the present invention is shown.
[0068] Figure 5 The graph shows the trend of the sum of the relative changes of the JPEG synchronous recompression detection method for BMP format masking as the number of compressions increases. Detailed Implementation
[0069] To further understand the present invention, preferred embodiments of the present invention are described below in conjunction with examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, and not for limiting the scope of the claims of the present invention.
[0070] The description in this section pertains only to typical embodiments, and the present invention is not limited to the scope of the embodiments described. Combinations of different embodiments, substitution of some technical features in different embodiments, and substitution of similar or identical prior art with some technical features in the embodiments are also within the scope of the description and protection of the present invention.
[0071] This invention proposes a method for detecting synchronized JPEG recompression masked by BMP format. It effectively detects synchronized JPEG recompressed images saved in BMP format. A quantization matrix is obtained through quantization step size estimation, providing a reliable quantization table for subsequent feature extraction. The method improves the classification performance of synchronized JPEG recompression detection by constructing an expectation-minimum error feature by extracting the minimum error. First-order relative error features are extracted, improving the accuracy of the proposed method at low quality factors. This invention aims to discover synchronized JPEG recompression traces in given BMP images, thereby detecting synchronized JPEG recompression. This invention mainly consists of three parts: quantization table estimation, expectation-minimum error features, and first-order relative error features. These three parts will be described in detail below:
[0072] Quantization table estimation: Existing techniques propose estimating the quantization step size using factor histograms. A factor histogram is a statistic constructed by factoring all coefficients at a certain frequency in the DCT coefficients and statistically plotting the distribution histogram of the resulting factors. It is effective for estimating small quantization steps. However, its accuracy decreases significantly with larger quantization steps. This is because a larger quantization step size leads to more DCT coefficients being zero, resulting in less effective information extracted. In this case, the frequency at the quantization step size in the factor histogram may be less than the empirical threshold T1, while the frequency at the quantization step size factor may be greater than the threshold T1. This is because the frequency at a certain point in the factor histogram is also accumulated at its factor, causing the frequency at that point to be less than the frequency at its factor.
[0073] To address the aforementioned issues, the existing method was improved by adding a threshold T2. The specific process is as follows: Figure 2 As shown. By studying the frequencies at the quantization step size and its factors and multiples in the factor histogram, we found different relationships between the quantization step size and the frequencies at its factors and multiples. Since a large number of JPEG coefficients are distributed at the quantization step size, the frequency difference between the quantization step size and its multiples is significant. To characterize this relationship, a proportionate measure (PCT) is defined to represent the similarity of frequencies at two factors. The calculation formula is as follows:
[0074]
[0075] Here, a and b are two different factors. Based on the above analysis, the PCT between the quantization step size and its factors is large, while the PCT between the quantization step size and its multiples is small. When the initial quantization step size is estimated using the threshold T1... Then, calculate the factor histogram. The multiples of, and calculate the sum of each multiple and The PCT. Then, based on the above analysis, the threshold T2 is used to determine... Is the estimate accurate? Specifically, if all PCT values are less than T2, then it is considered... The multiples do not include the quantization step size. The estimate is accurate. If PCT is greater than T2, then it means... It is a factor of the actual quantization step size, at which point it applies to all variables. Among the multiples of PCT greater than T2, the largest multiple is selected as the estimated quantization step size.
[0076] Furthermore, when the quantization step size is greater than 40, most of its DCT coefficients are 0, resulting in insufficient effective information, making it difficult to directly estimate the quantization step size. However, there is a relationship between quantization step sizes of different frequencies in the quantization table. Through this relationship, the quality factor can be estimated based on partial quantization step sizes, and a complete quantization table can be generated.
[0077] After estimating a portion of the quantization step size, the quantization table is further studied. Formula 2 is the formula for calculating the quantization table:
[0078]
[0079] Here, QF is the quality factor, q(i,j) is the quantization base corresponding to the i-th row and j-th column of the quantization base table, which is an 8*8 matrix that determines the JPEG compression standard, floor(·) is the floor function, and Q(i,j) is the quantization step size in the i-th row and j-th column of the quantization base table. According to Formula 2, the quantization table is calculated from the quality factor; therefore, the quantization table and the quality factor are closely related. Through this correlation, the quality factor can be estimated using a portion of the estimated quantization step size, thereby generating the complete quantization table. The detailed method is as follows:
[0080] Let the rounding error be denoted as ε, then we have Formula 3:
[0081]
[0082] Let ω = (0.5 + ε) / q(i,j) × 50. Taking the standard quantization table as an example, considering that the range of ε is (-1, 0], and the lowest quantization base in the standard quantization table is 10, the range of ω is (-2.5, 2.5). Furthermore, since most quantization bases are greater than 20, the values of ω are mostly within (-1.25, 1.25]. Therefore, ω has a relatively small impact on QF, and can be ignored here. Equation 3 can be rewritten as Equation 4:
[0083]
[0084] At this point, the quality factor can be directly calculated using the estimated quantization step size and the standard quantization table according to Formula 4. If an unknown quantization table is used, the standard quantization table can also be used for calculation, because unknown quantization tables are mostly derived from standard quantization tables, and the two are closely related. When estimating the quality factor, since the quality factor is estimated one by one based on the estimated quantization step size, multiple quality factors will be obtained. The set of all quality factors is denoted as C. Due to the omission of ω and the use of the floor function, the calculation process of the quality factor introduces an error, with the error range being (-3, 3). Furthermore, since the value of ω is mostly between (-1.25, 1.25], the actual error is mostly an integer within [-1, 1]. This makes the quality factors in C mostly distributed within the actual quality factor interval [-1, 1]. Based on the above analysis, the mean of set C is calculated and rounded, and this is used as the estimated quality factor. The formula is expressed as follows:
[0085]
[0086] Here, mean(·) is the function for calculating the mean.
[0087] Finally, using the estimated quality factor Formula 2 is used to calculate the complete quantization table, which provides the conditions for subsequent recompression feature extraction.
[0088] Expected Minimum Error Feature: When using a quality factor of 100 for JPEG compression (quality factor refers to the quality of the compressed image; a quality factor of 100 results in the least loss after compression, the largest file size, and the best image quality), the image still undergoes changes. This is due to errors caused by color conversion between the RGB and YCbCr color spaces, and by domain transformation between the spatial and DCT frequency domains. For JPEG compression with a quality factor other than 100, in addition to domain transformation and color conversion errors causing image errors, quantization errors also contribute. Therefore, the errors caused by domain transformation and color conversion errors are defined as the minimum error. Since the error caused by JPEG compression with any quality factor includes the minimum error, when extracting recompression features, the minimum error is actually redundant information. Especially when the image information is limited, this redundancy interferes with the features, thus degrading the performance of JPEG recompression detection.
[0089] Furthermore, since estimation errors may occur during quantization table estimation, using the estimated quantization table to extract features will introduce noise, interfering with recompression detection. The minimum image error is known and can be obtained through JPEG compression with a quality factor of 100. Using the minimum error as a benchmark can reduce the impact of noise. Based on the above analysis, a new feature based on the expected minimum error is proposed. The general idea is as follows: using the estimated quantization table and the minimum quantization table respectively, the difference features between the two image compressions are extracted and denoted as the expected error feature and the minimum error feature, respectively. Then, the difference between the two is taken to obtain the expected minimum error feature, thereby removing redundant features and reducing noise interference.
[0090] The extraction method of the expected-minimum error feature is as follows: Figure 3 As shown, the expected error feature and the minimum error feature are first calculated separately. The expected error feature is calculated using the estimated quantization table, and the minimum error feature is calculated using the minimum quantization table. Taking the calculation of the expected error feature as an example, the given image is first compressed twice using the estimated quantization table. The quantization error, truncation error, and rounding error in the two compressions are extracted and denoted as QE1, TE1, RE1, QE2, TE2, and RE2, respectively. Compared with the truncation error and rounding error, the difference in truncation error (DTE) and the difference in rounding error (DRE) further amplify the statistical differences between single-compressed and recompressed images. Therefore, DTE and DRE are used as features, and the calculation formulas for DTE and DRE are as follows:
[0091]
[0092] Furthermore, truncation and rounding errors are directly affected by quantization errors throughout the JPEG compression process. Therefore, there is a certain relationship between quantization error and truncation / rounding errors. To characterize this relationship and extract additional information, the difference in quantization errors (DQE) between two JPEG compressions is transformed to the spatial domain and then subtracted from DTE and DRE respectively, denoted as DQT and DQR. The formulas for calculating DQE, DQT, and DQR are as follows:
[0093]
[0094] Here, IDCT(·) is the inverse discrete cosine transform function. DTE, DRE, DQT, and DQR are denoted as the expected error features. The calculation process for the minimum error features is similar to that of the expected error features, only the quantization table used is different. The above process is repeated using the minimum quantization table to calculate DTE', DRE', DQT', and DQR', which are denoted as the minimum error features. Then, the expected error features and the minimum error features are processed separately, and the difference is taken to obtain the expected-minimum error features.
[0095] First-order relative error characteristics: Quantization is the core operation of JPEG compression. After dequantization, the JPEG coefficients not only contain the re-compression characteristics, but also reflect the resistance to quantization. Therefore, the JPEG coefficients after dequantization were observed. Figure 5 This shows the sum of the relative changes in coefficients after inverse quantization between two consecutive JPEG compressions, S. n The trend of change with increasing compression cycles, where the relative change magnitude S n The calculation formula is as follows:
[0096] S n =sum(|(DB) n+1 -DB n ) / DB n |). (8)
[0097] Here, `sum(·)` is the summation function. It can be seen that as the number of compression iterations increases, the change in the inversely quantized coefficients gradually decreases. This means that the inversely quantized coefficients will gradually converge with the increase in the number of compression iterations. However, the convergence trends are different for single-compressed images and recompressed images. Therefore, the convergence trend of the inversely quantized coefficients can effectively detect JPEG recompression. Based on the above analysis, a first-order relative error feature is constructed by calculating the relative change rate of the inversely quantized coefficients to characterize its convergence trend, thereby detecting JPEG recompression.
[0098] First-order relative error feature extraction method such as Figure 4As shown, firstly, the given image is subjected to three JPEG compression and decompression processes, and the inverse-quantized JPEG coefficients DB1, DB2, and DB3 are extracted from each of the three compression processes. Then, the DB values between two adjacent JPEG compression operations are calculated. n The relative changes R1 and R2 are calculated using the following formulas:
[0099]
[0100] Finally, features are extracted from R1 and R2 as first-order relative error features to characterize DB. n The convergence trend of the coefficients.
[0101] The description and application of the present invention herein are illustrative and not intended to limit the scope of the invention to the embodiments described above. The effects or advantages described in the specification may not be apparent in actual experimental cases due to uncertainties in specific conditions or other factors, and such descriptions are not intended to limit the scope of the invention. Variations and modifications to the embodiments disclosed herein are possible, and various substitutions and equivalents of the components in the embodiments are well known to those skilled in the art. It should be understood by those skilled in the art that the invention can be implemented in other forms, structures, arrangements, proportions, and with other components, materials, and parts without departing from the spirit or essential characteristics of the invention. Other variations and modifications can be made to the embodiments disclosed herein without departing from the scope and spirit of the invention.
Claims
1. A method for detecting JPEG synchronous recompression masked by BMP format, characterized in that, include: S1. Obtain a JPEG image masked in BMP format, estimate the quantization step size of the image, and use the quantization step size to estimate the quality factor. And based on quality factor Generate a complete quantization table; wherein, the specific steps for estimating the quantization step size of the image include: S1-1. Perform DCT transformation on the JPEG image masked by BMP format, round the obtained DCT coefficients and calculate the factor histogram. S1-2. Find the largest factor whose frequency is greater than the threshold T1 in the factor histogram. As an initial quantization step size, the maximum factor in the factor histogram is calculated. The proportionate measure (PCT) between its multiples, wherein the PCT characterizes the similarity of frequencies at two factors; S1-3. Determine the relationship between the proportion PCT and the threshold T2. If there exists a PCT > T2, then record the largest multiple among all multiples of PCT > T2 as [the value of PCT]. Then the quantization step size If PCT > T2 does not exist, then the quantization step size is... S2. Extract the expected error features of the image using the above quantization table, extract the minimum error features of the image using the minimum quantization table, and construct the expected-minimum error features by utilizing the redundancy of the minimum error; the minimum quantization table refers to a quantization table where all quantization steps are 1, and the minimum error refers to the error caused by domain changes and color conversion errors; wherein, constructing the expected-minimum error features specifically includes: The expected error feature and the minimum error feature are processed separately, including statistical features, calculation of mean and variance. The difference between the expected error feature and the minimum error feature after processing is obtained as the expected-minimum error feature. S3. Based on the characteristic that the relative transformation rate of the JPEG coefficients gradually decreases after dequantization, a first-order relative error feature is constructed by extracting the dequantized JPEG coefficients from the three JPEG compression processes. Specifically, constructing the first-order relative error feature includes: S3-1. Perform three JPEG compression and decompression operations on the JPEG image, and extract the inverse quantization JPEG coefficients DB1, DB2 and DB3 after the three compression processes; S3-2. Calculate the JPEG coefficients (DB) between two consecutive JPEG compressions. n The relative changes R1 and R2: S3-3. Extract features from R1 and R2 as first-order relative error features by statistical characteristics and by calculating the mean, variance, maximum and minimum values. S4. Use Support Vector Machine (SVM) to classify the above-mentioned expected minimum error features and first-order relative error features.
2. The JPEG synchronous recompression detection method for BMP format masking according to claim 1, characterized in that, S1 uses quantization step size to estimate the quality factor. The specific steps include: The quality factor is calculated using the estimated quantization step size eq and the standard quantization table: In the formula, q(i,j) is the quantization base of the i-th row and j-th column of the standard quantization table, Q(i,j) is the quantization step size of the i-th row and j-th column of the quantization table, and round(·) is the rounding function. Let C be the set of all estimated quality factors. Calculate the mean of set C and round it down to the nearest integer. Use this mean as the final estimated quality factor. In the formula, mean(·) is the function for calculating the mean.
3. The JPEG synchronous recompression detection method for BMP format masking according to claim 1, characterized in that, The formula for generating a quantification table based on quality factors in S1 is: In the formula, Q(i,j) is the quantization step size in the i-th row and j-th column of the quantization table, and floor(·) is the floor function. It is the quality factor, and q(i,j) is the quantization base corresponding to the i-th row and j-th column of the standard quantization table.
4. The JPEG synchronous recompression detection method for BMP format masking according to claim 1, characterized in that, The specific features of the expected error extracted from the image using the quantization table in S2 include: The JPEG image is compressed twice using the estimated quantization table. The quantization error QE1, truncation error TE1, and rounding error RE1 in the first compression are extracted, and the quantization error QE2, truncation error TE2, and rounding error RE2 in the second compression are extracted. Calculate the quantization error difference (DQE), truncation error difference (DTE), and rounding error difference (DRE): DTE = TE1 - TE2 DRE = RE1 - RE2 DQE = QE1 - QE2 The quantization error difference DQE is transformed to the spatial domain and then subtracted from the truncation error difference DTE and the rounding error difference DRE, denoted as DQT and DQR respectively. DQT = IDCT(DQE) - DTE DQR = IDCT(DQE) - DRE In the formula, IDCT(·) is the inverse discrete cosine transform function; The truncation error difference DTE, rounding error difference DRE, DQT, and DQR are denoted as the expected error characteristics.
5. The method for detecting JPEG synchronous recompression masked by BMP format according to claim 1, characterized in that, The specific steps for extracting the minimum error features of an image using a minimum quantization table in S2 include: The JPEG image is compressed twice using a minimum quantization table. The quantization error QE1′, truncation error TE1′, and rounding error RE1′ in the first compression and the quantization error QE2′, truncation error TE2′, and rounding error RE2′ in the second compression are extracted. Calculate the quantization error difference DQE′, truncation error difference DTE′, and rounding error difference DRE′: DTE′=TE1′-TE2′ DRE′=RE1′-RE2′ DQE′=QE1′-QE2′ The quantization error difference DQE′ is transformed to the spatial domain and then subtracted from the truncation error difference DTE′ and the rounding error difference DRE′, denoted as DQT′ and DQR′ respectively. DQT′=IDCT(DQE′)-DTE′ DQR′=IDCT(DQE′)-DRE′ In the formula, IDCT(·) is the inverse discrete cosine transform function; The truncation error difference DTE′, rounding error difference DRE′, DQT′, and DQR′ are denoted as the minimum error characteristics.
6. The JPEG synchronous recompression detection method for BMP format masking according to claim 1, characterized in that, The formula for calculating the proportion PCT mentioned in S1-2 is as follows: In the formula, a and b represent two different factors. This represents the frequency at factor a in the factor histogram. This represents the frequency at factor b in the factor histogram.