JPEG compression domain enhancement detection method, device, storage medium and computing equipment
By performing pixel matrix chunking, discrete cosine transformation and global likelihood function value calculation methods on JPEG images, the problem that the existing technology cannot effectively detect JPEG compression domain enhancement is solved, and accurate detection of JPEG compression domain enhancement is achieved, and technical support for image synthesis and tamper detection is provided.
Patent Information
- Application Number
- CN202011439317.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-07
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-12-07
AI Technical Summary
The existing enhancement detection methods mainly target pixel domain enhancement, and cannot effectively detect JPEG compression domain enhancement, resulting in poor results in image synthesis and tamper detection.
By blocking the pixel matrix of the image to be detected, discrete cosine transformation is performed, the global likelihood function value is calculated, and the vector is arranged as an enhanced detection feature vector to realize the detection of the JPEG compression domain enhancement.
This method can accurately determine whether the image has experienced JPEG compression domain enhancement, providing effective technical guarantees for image synthesis and tampering.
Smart Images

Figure CN114596246B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and image security, and in particular to a detection method, device, storage medium and computing equipment for JPEG compression domain enhancement. Background Art
[0002] JPEG (Joint Photographic Experts Group) is a standard for continuous tone static image compression. The file extension is .jpg or .jpeg, and it is the most commonly used image file format. JPEG compression domain enhancement is a processing operation that enhances the contrast of JPEG images. When two JPEG images are synthesized, if there is a difference in the contrast between the two, it is easy to leave obvious synthesis traces. A common practice to reduce synthesis traces is to adjust the contrast of one image to match the other image, which will cause a certain part of the synthesized image to be enhanced while other parts are not enhanced. Therefore, by performing enhancement detection on each part of the suspicious image, it is helpful to determine whether the suspicious image is a synthetic image, and provide technical protection for preventing the use of synthetic images for illegal purposes.
[0003] The current enhancement detection methods are mainly designed for the detection of pixel domain enhancement. Generally, the sharpening detection is realized based on the overshoot effect caused by image sharpening on the image. There are no detection methods for JPEG compression domain enhancement. If the existing enhancement detection methods are directly applied to detect JPEG compression domain enhancement, the effect is often poor or even impossible to implement. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a JPEG compression domain enhancement detection method, device, storage medium and computing device, which can be used to determine whether a bitmap has undergone JPEG compression domain enhancement, and can be further extended to image tampering detection to obtain accurate detection results.
[0005] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solutions:
[0006] A JPEG compression domain enhancement detection method, comprising:
[0007] Divide the pixel matrix of the image to be inspected into blocks and select available blocks suitable for enhanced detection;
[0008] Perform discrete cosine transform on each available block to obtain the corresponding coefficient matrix D k ;
[0009] According to each enhanced parameter candidate value λ t and the coefficient matrix Dk , and obtain the global likelihood function value L(λ t );
[0010] Each enhanced parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H, which is used as the enhanced detection feature vector for enhanced detection.
[0011] As one implementation manner, the step of dividing the pixel matrix of the image to be inspected into blocks and selecting available blocks suitable for enhanced detection includes:
[0012] Divide the pixel matrix of the image to be inspected into 8×8 blocks;
[0013] Exclude the singular blocks in the block, the maximum grayscale value of the singular block is 255, or the minimum grayscale value is 0, or the maximum grayscale value is equal to the minimum grayscale value.
[0014] As one implementation manner, the method according to each enhanced parameter candidate value λ t and the coefficient matrix D k , and obtain the global likelihood function value L(λ t ) steps, including:
[0015] Traverse each enhanced parameter candidate value λ t , for each coefficient Perform reverse enhancement operation on the difference rows to obtain the reverse enhancement coefficient matrix;
[0016] According to the inverse enhancement coefficient matrix, the likelihood function value L of each spatial frequency (i, j) is calculated i j(λ t ,q ij );
[0017] According to the likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ).
[0018] As one implementation method, the likelihood function value L of each spatial frequency (i, j) is calculated according to the inverse enhancement coefficient matrix. ij (λ t ,q ij ) steps, including:
[0019] For each spatial frequency (i, j), calculate the corresponding likelihood function value L ij (λ t ,q ij ):
[0020]
[0021] Where K is the number of available blocks, k is the block index, 1≤k≤K; is the coefficient matrix D k The coefficient at the medium spatial frequency (i, j), and 0≤i, j≤7; q ij is the integer quantization step size at spatial frequency (i, j), and 1≤q ij ≤q B ;
[0022] p(.) is the probability distribution function, Among them represents the set of integers, P L (.) is the Laplace probability mass function, G(.) is the Gaussian truncated probability density function;
[0023] Among them, ρ ij is the scale parameter,
[0024] Among them, σ 2 =1 / 12, B=4,
[0025] As one implementation manner, the likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ) steps, including:
[0026]
[0027] Where F is the set of spatial frequencies.
[0028] Another object of the present invention is to provide a detection device for JPEG compression domain enhancement, comprising:
[0029] A screening module is used to divide the pixel matrix of the image to be inspected into blocks and select available blocks suitable for enhanced detection;
[0030] Transformation module, used to perform discrete cosine transform on each available block to obtain the corresponding coefficient matrix D k ;
[0031] A calculation module is used to calculate the value of each enhanced parameter candidate λ t and the coefficient matrix D k , we get the global likelihood function value L(λ t );
[0032] The analysis module is used to convert each enhanced parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H, which is used as the enhanced detection feature vector for enhanced detection.
[0033] As one embodiment, the screening module includes:
[0034] A partitioning module is used to divide the pixel matrix of the image to be inspected into 8×8 blocks;
[0035] The screening module is used to exclude the singular blocks in the blocks, wherein the maximum grayscale value of the singular blocks is 255, or the minimum grayscale value is 0, or the maximum grayscale value is equal to the minimum grayscale value.
[0036] As one implementation manner, the computing module includes:
[0037] Reverse enhancement module, used to traverse each enhancement parameter candidate value λ t , for each coefficient Perform a reverse enhancement operation to obtain a reverse enhancement coefficient matrix;
[0038] The likelihood function value calculation module is used to calculate the likelihood function value L of each spatial frequency (i, j) according to the inverse enhancement coefficient matrix. ij (λ t ,q ij );
[0039] A global likelihood function value calculation module is used to calculate the likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ).
[0040] Another object of the present invention is to provide a storage medium, wherein a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor and executing the steps of the JPEG compression domain enhancement detection method.
[0041] Another object of the present invention is to provide a computing device, comprising the storage medium and a processor suitable for implementing various instructions.
[0042] The present invention divides the pixel matrix of the image to be inspected into blocks, designs a suitable likelihood function, uses the global likelihood function values corresponding to a series of enhancement parameter candidate values as the enhancement detection feature vector, and determines whether the image to be inspected has been enhanced in the JPEG compression domain, so as to obtain accurate detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1A schematic flow chart of a JPEG compression domain enhancement detection method according to an embodiment of the present invention;
[0044] Figure 2 The present invention is a structural block diagram of a JPEG compression domain enhancement detection device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0046] See also Figure 1 , an embodiment of the present invention provides a method for detecting JPEG compression domain enhancement, comprising:
[0047] S01. Divide the pixel matrix of the image to be inspected into blocks, select available blocks suitable for enhanced detection, and exclude singular blocks.
[0048] In step S01, the step of dividing the pixel matrix of the image to be inspected into blocks and selecting available blocks suitable for enhanced detection may specifically include:
[0049] S011, dividing the pixel matrix of the image to be inspected into 8×8 blocks.
[0050] For example, the input pixel matrix of the image to be inspected may be denoted as I, and the pixel matrix of the image to be inspected I is divided into 8×8 blocks.
[0051] S012. Exclude the singular blocks in the blocks, where the maximum grayscale value of the singular blocks is 255, or the minimum grayscale value is 0, or the maximum grayscale value is equal to the minimum grayscale value.
[0052] Considering that if the maximum gray value in a block is 255, or the minimum gray value is 0, or the maximum gray value is equal to the minimum gray value, the block will have an adverse effect on enhanced detection, so such singular blocks need to be discarded. After excluding all singular blocks, the remaining blocks are called available blocks, and the number of available blocks is recorded as K.
[0053] S02. Perform discrete cosine transform on each available block to obtain the corresponding coefficient matrix D k .
[0054] The superscript k represents the block index, 1≤k≤K. The coefficient matrix D k The coefficient at the medium spatial frequency (i, j) (0≤i,j≤7) is
[0055] S03, according to each enhanced parameter candidate value λ t And the coefficient matrix D k, we get the global likelihood function value L(λ t ).
[0056] This step involves multiple processes, which may include:
[0057] S031. Traverse each enhanced parameter candidate value λ t , for each coefficient Perform a reverse enhancement operation to obtain a reverse enhancement coefficient matrix.
[0058] Here, the candidate value set S of the enhancement parameter is set to be {λ1, λ2, ..., λ t , ..., λ T}. Traverse each candidate value λ t , for the coefficient Perform reverse enhancement operation:
[0059]
[0060] Where f is the enhancement operator, Represents the use of enhancement parameter λ t DCT (Discrete Cosine Transform) coefficients after inverse enhancement.
[0061] S032. Calculate the likelihood function value L of each spatial frequency (i, j) according to the reverse enhancement coefficient matrix ij (λ t ,q ij ).
[0062] Here, the likelihood function value L of each spatial frequency (i, j) is calculated ij (λ t ,q ij The specific step of ) can be, for each spatial frequency (i, j), calculating the corresponding likelihood function value L ij (λ t ,q ij ):
[0063]
[0064] Among them, q in formula (2) ij is the integer quantization step size at spatial frequency (i, j), and 1≤q ij ≤q B ; log(.) represents logarithmic operation; p(.) is the probability distribution function, defined as:
[0065]
[0066] Among them, in formula (3) represents the set of integers, P L (.) is the Laplace probability mass function, and G(.) is the Gaussian truncated probability density function.
[0067] In formula (3), the Laplace probability mass function P L (.) is defined as:
[0068]
[0069] Among them, in formula (4), ρ ij is the scale parameter, which can be obtained by Calculation is performed, exp(.) represents an exponential function with the natural constant e=2.71828… as the power.
[0070] In formula (3), the Gaussian truncated probability density function G(.) is defined as:
[0071]
[0072] Among them, σ in formula (5) 2 =1 / 12, B=4, the value of Z is π stands for pi.
[0073] S033, according to the likelihood function value L in formula (2) ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ), L(λ t ) can be obtained by the following formula (6):
[0074]
[0075] Where F is the spatial frequency set, and the global likelihood function is the L corresponding to all frequencies in the spatial frequency set F. ij The sum of the maximum values of , the spatial frequency set F is a settable parameter.
[0076] For the unenhanced image, L(λ t ) will be in λ t = 1 to obtain the maximum value; while for the enhanced image, L(λ t ) will reach its maximum value at the true enhancement parameter, which indicates that the value of the global likelihood function contains discriminative information that can be used to implement enhanced detection.
[0077] S04. Set each enhanced parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H, which is used as the enhanced detection feature vector for enhanced detection.
[0078] Traverse the enhanced parameter candidate value set S = {λ1,λ2,...,λ t , ..., λ T}, we obtain a series of corresponding global likelihood function values H = [L(λ1), L(λ2), ..., L(λ T )]. The T-dimensional vector H is used as the enhanced detection feature vector, and a linear discriminant analysis (LDA) is performed to obtain a linear classifier, and then enhanced detection is performed.
[0079] In other implementations, the above-mentioned linear classifier may be replaced with other classifiers, such as a support vector machine or a nearest neighbor classifier, to achieve enhanced detection.
[0080] This embodiment also conducts experimental tests on the above-mentioned JPEG compression domain enhancement detection method, and the specific situation is as follows:
[0081] (1) Selection of test image library: The UCID image library contains a total of 1338 images, of which 338 images constitute the training image set for training the linear classifier, and the remaining 1000 images constitute the test image set for testing the classifier performance.
[0082] (2) Parameter setting: Each image in the training set and the test set is compressed with a quality factor QF of 50, 60, 70, 80, and 90, and then the obtained JPEG image is enhanced in the JPEG compression domain with an enhancement parameter λ of 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 to obtain an image enhanced in the JPEG compression domain; the candidate value set of the enhancement parameter S = {0.6, 0.61, 0.62, …, 1.99, 2.00} is set, which contains 141 candidate values in total. Each candidate value corresponds to a likelihood function value, so the dimension of the enhanced detection feature H is 141; q B is set to 25; the spatial frequency set F is set to include the first 9 AC frequencies, that is, F = {(0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (3, 0)}.
[0083] (3) Test results: The enhanced detection accuracy under different QF conditions is as follows:
[0084] QF 50 60 70 80 90 average Detection accuracy 99.88% 99.70% 99.73% 99.75% 98.91% 99.59%
[0085] It can be seen that for different JPEG compression quality factors QF, the JPEG compression domain enhancement detection method of this embodiment can achieve accurate enhancement detection, which verifies the effectiveness of the method of this embodiment.
[0086] like Figure 2 As shown, the present invention also provides a JPEG compression domain enhancement detection device, which mainly includes a screening module 1, a transformation module 2, a calculation module 3 and an analysis module 4, wherein the screening module 1 is used to divide the pixel matrix of the image to be detected into blocks and select available blocks suitable for enhanced detection; the transformation module 2 is used to perform discrete cosine transformation on each available block to obtain the corresponding coefficient matrix D k ; The operation module 3 is used to calculate the value of each enhanced parameter candidate λ t And the coefficient matrix D k , and obtain the global likelihood function value L(λ t ); the analysis module 4 is used to each enhanced parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H, which is used as the enhanced detection feature vector for enhanced detection.
[0087] Among them, the screening module 1 may specifically include a division module 11 and a screening module 12. The division module 11 is used to divide the pixel matrix of the image to be inspected into 8×8 blocks, and the screening module 12 is used to exclude singular blocks in the blocks. The maximum grayscale value of the singular block is 255, or the minimum grayscale value is 0, or the maximum grayscale value is equal to the minimum grayscale value.
[0088] The operation module 3 may include a reverse enhancement module 21, a likelihood function value calculation module 22 and a global likelihood function value calculation module 23. The reverse enhancement module 21 is used to traverse each enhancement parameter candidate value λ t , for each coefficient Perform a reverse enhancement operation to obtain a reverse enhancement coefficient matrix; the likelihood function value calculation module 22 is used to calculate the likelihood function value L of each spatial frequency (i, j) according to the reverse enhancement coefficient matrix ij (λ t ,q ij ); The global likelihood function value calculation module 23 is used to calculate the likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ).
[0089] The analysis module 4 may further include an arrangement module 41 and a detection module 42. The arrangement module 41 may be used to arrange each enhancement parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H as an enhanced detection feature vector. The detection module 42 can use the vector H to construct a classifier for enhanced detection.
[0090] In addition, the present invention also provides a storage medium and a computing device, wherein the storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned JPEG compression domain enhancement detection method, and the storage medium is a part of the computing device. The processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor is generally used to control the overall operation of the computing device. In this embodiment, the processor is used to run the program code stored in the storage medium or process data.
[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0092] The present invention divides the pixel matrix of the image to be inspected into blocks, designs a suitable likelihood function, uses the global likelihood function values corresponding to a series of enhancement parameter candidate values as the enhancement detection feature vector, and determines whether the image to be inspected has been enhanced in the JPEG compression domain, so as to obtain accurate detection results.
[0093] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for detecting JPEG compression domain enhancement, characterized in that: include: Divide the pixel matrix of the image to be inspected into blocks and select available blocks suitable for enhanced detection; Perform discrete cosine transform on each available block to obtain the corresponding coefficient matrix D k ; According to each enhanced parameter candidate value λ t and the coefficient matrix D k , and obtain the global likelihood function value L(λ t ); Each enhanced parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H, which is used as the enhanced detection feature vector for enhanced detection.
2. The method for detecting JPEG compression domain enhancement according to claim 1, characterized in that: The step of dividing the pixel matrix of the image to be inspected into blocks and selecting available blocks suitable for enhanced detection comprises: Divide the pixel matrix of the image to be inspected into 8×8 blocks; Exclude the singular blocks in the block, the maximum grayscale value of the singular block is 255, or the minimum grayscale value is 0, or the maximum grayscale value is equal to the minimum grayscale value.
3. The method for detecting JPEG compression domain enhancement according to claim 1, characterized in that: According to each enhanced parameter candidate value λ t and the coefficient matrix D k , and obtain the global likelihood function value L(λ t ) steps, including: Traverse each enhanced parameter candidate value λ t , for each coefficient Perform the reverse enhancement operation to obtain the reverse enhancement coefficient matrix, where represents the coefficient at the spatial frequency (i, j) in the coefficient matrix Dk; According to the inverse enhancement coefficient matrix, the likelihood function value L of each spatial frequency (i, j) is calculated ij (λ t ,q ij ); According to the likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ).
4. The method for detecting JPEG compression domain enhancement according to claim 3, characterized in that: The likelihood function value L of each spatial frequency (i, j) is calculated according to the inverse enhancement coefficient matrix. ij (λ t ,q ij ) steps, including: For each spatial frequency (i, j), calculate the corresponding likelihood function value L ij (λ t ,q ij ): Where K is the number of available blocks, k is the block index, 1≤k≤K; 0≤i, j≤7; Represents the enhanced parameter candidate value λ t The discrete cosine transform coefficient after inverse enhancement, q ij is the integer quantization step size at spatial frequency (i, j), and 1≤q ij ≤q B ; p(.) is the probability distribution function, Among them represents the set of integers, P L (.) is the Laplace probability mass function, G(.) is the Gaussian truncated probability density function; Among them, ρ ij is the scale parameter, Among them, σ 2 =1 / 12, B=4, 5. The method for detecting JPEG compression domain enhancement according to claim 4, characterized in that: The likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ), include: Where F is the set of spatial frequencies.
6. A detection device for JPEG compression domain enhancement, characterized in that: include: A screening module is used to divide the pixel matrix of the image to be inspected into blocks and select available blocks suitable for enhanced detection; Transformation module, used to perform discrete cosine transform on each available block to obtain the corresponding coefficient matrix D k ; A calculation module is used to calculate the value of each enhanced parameter candidate λ t and the coefficient matrix D k , and obtain the global likelihood function value L(λ t ); The analysis module is used to convert each enhanced parameter candidate value λ t The corresponding global likelihood function value L(λ t ) are arranged into a vector H, which is used as the enhanced detection feature vector for enhanced detection.
7. The JPEG compression domain enhancement detection device according to claim 6, characterized in that: The screening module comprises: A partitioning module is used to divide the pixel matrix of the image to be inspected into 8×8 blocks; The screening module is used to exclude the singular blocks in the blocks, wherein the maximum grayscale value of the singular blocks is 255, or the minimum grayscale value is 0, or the maximum grayscale value is equal to the minimum grayscale value.
8. The JPEG compression domain enhancement detection device according to claim 6 or 7, characterized in that: The operation module comprises: Reverse enhancement module, used to traverse each enhancement parameter candidate value λ t , for each coefficient Perform a reverse enhancement operation to obtain a reverse enhancement coefficient matrix; The likelihood function value calculation module is used to calculate the likelihood function value L of each spatial frequency (i, j) according to the inverse enhancement coefficient matrix. ij (λ t ,q ij ); A global likelihood function value calculation module is used to calculate the likelihood function value L ij (λ t ,q ij ), calculate the global likelihood function value L(λ t ).
9. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the JPEG compression domain enhancement detection method according to any one of claims 1 to 5.
10. A computing device, characterized in that The invention comprises the storage medium as claimed in claim 9 and a processor suitable for implementing each instruction.