Thanh Hai Thai

Member, IEEE Rémi Cogranne
email: remi.cogranne@utt.fr

Florent Retraint
email: flo-rent.retraint@utt.fr

Thi-Ngoc-Canh Doan
email: thingoccanh.doan@utt.fr

Thi-Ngoc-Canh Doan

T.-N.-C Doan

JPEG Quantization Step Estimation and Its Applications to Digital Image Forensics

Keywords: Digital forensics, JPEG compression history, quantization step estimation, statistical image modeling, discrete cosine transform

HAL is

I. INTRODUCTION

T HE evolution of digital imaging and information tech- nologies in the past decades has raised a number of information security challenges. Digital images can be easily edited, altered or falsified due to a large availability of low-cost image editing tools and then transmitted via communication network. The credibility and trustworthiness of digital images have been eroded in consequence. The field of digital image forensics has emerged in response to the increasing need to verify the authenticity of digital images, see [START_REF] Stamm | Information forensics: An overview of the first decade[END_REF] and references therein for a detailed introduction.

A. State of the Art

JPEG is by far the most commonly used image format for image compression due to its efficiency in data storage and low computational cost. Most digital cameras export this format and most image editing softwares support JPEG compression operation. Therefore, JPEG images are involved in many forensics situations. One of the important problems in digital image forensics is JPEG compression history. Basically, JPEG compression history is stored in the JPEG header of the image file [START_REF] Kee | Digital image authentication from JPEG headers[END_REF]. However, this metadata is not reliable for forensic analysis since it can be easily modified using lowcost editing tools such as exiftool software libexif library. Moreover, the metadata can be lost if the JPEG image is transformed into lossless format. Therefore, knowledge about JPEG compression history is of important interest for forensic analysts since it could be a clue indicating that the image might have been altered.

Typically, there are two approaches to address the problems in digital image forensics: active and passive ones. Compared with passive forensics, active forensics that relies on extrinsic security measures such as digital watermarks [START_REF] Podilchuk | Digital watermarking: algorithms and applications[END_REF] and digital signatures [START_REF] Friedman | The trustworthy digital camera: restoring credibility to the photographic image[END_REF] is of limited application due to many strict constraints in its protocols [START_REF] Stamm | Information forensics: An overview of the first decade[END_REF], [START_REF] Sencar | Digital Image Forensics: There is More to a Picture than Meets the Eye[END_REF]. Passive forensics has been increasingly studied because it does not impose any constraint, nor require any prior information; it indeed relies on the inspected image. The common philosophy in passive forensics is to rely on inherent intrinsic fingerprints left within the inspected image by the camera acquisition and post-processing chain.

The authentication of JPEG compression history commonly includes three tasks: JPEG compression identification [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF]- [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF] (i.e. identify whether the image under investigation is uncompressed image or has been previously JPEG-compressed), quantization step estimation from an uncompressed image [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF], [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF]- [START_REF] Li | Statistical model of JPEG noises and its application in quantization step estimation[END_REF], and double JPEG compression detection [START_REF] Pevny | Detection of double compression in JPEG images for applications in steganography[END_REF]- [START_REF] Yang | An effective method for detecting double JPEG compression with the same quantization matrix[END_REF].

This paper mainly addresses the problem of quantization step estimation based on passive approach. As noted above, only a few methods in the literature have been proposed for estimation of quantization step, which can be divided into two categories. The methods in the first category are mainly based on the characteristics of the histogram of DCT coefficients. In [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF], [START_REF] Neelamani | JPEG compression history estimation for color images[END_REF], the Maximum Likelihood Estimation (MLE) of quantization step from a bitmap image was proposed using the Laplacian model of Discrete Cosine Transform (DCT) coefficients [START_REF] Lam | A mathematical analysis of the DCT coefficient distributions for images[END_REF]. The authors in [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF] proposed to estimate the quantization step as the first largest histogram bin of nonzero rounded DCT coefficients. However, this method could fail in case of low frequencies in high-quality JPEG images. Another method proposed in [START_REF] -I. Lin | A passive-blind forgery detection scheme based on content-adaptive quantization table estimation[END_REF] estimates quantization steps by relying on energy density spectrum of the histogram of DCT coefficients. The main drawback of existing histogrambased methods [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF], [START_REF] -I. Lin | A passive-blind forgery detection scheme based on content-adaptive quantization table estimation[END_REF] is a lack of mathematical proof justifying the estimate with the true quantization step. Besides, the Maximum Likelihood (ML) framework used in [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF], [START_REF] Neelamani | JPEG compression history estimation for color images[END_REF] may be statistically rigorous but its performance highly depends on the accuracy of the model used to characterize the data sample. The poor performance of ML estimator in [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF], [START_REF] Neelamani | JPEG compression history estimation for color images[END_REF] is due to the fact that the Laplacian model is not sufficiently accurate to characterize DCT coefficients, as reported in [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF].

The second category proposes to exploit the characteristics of quantization noise introduced during JPEG compression and decompression. The method in [START_REF] Fridrich | Steganalysis based on jpeg compatibility[END_REF] estimates quantization steps from a bitmap image by measuring the compatibility of DCT coefficients for all quantization step candidates. In this approach the compatibility is calculated as the mean of the absolute value of the quantization error. Although this method is quite simple and efficient, its drawbacks also involve the lack of mathematical proof justifying the relation between the position of local minima of the compatibility measure with the true quantization step, and the choice of optimal filtering threshold remains questionable. Recently, the authors in [START_REF] Li | Statistical model of JPEG noises and its application in quantization step estimation[END_REF] have studied the statistics of quantization noise in JPEG images, then applied this statistical analysis for quantization step estimation. This method is based on the same measure as in [START_REF] Fridrich | Steganalysis based on jpeg compatibility[END_REF] but it provides a mathematical foundation for justifying its local minima with the true quantization step and studies its statistics to set the filtering threshold.

B. Main Contributions of the Paper

The present paper proposes a histogram-based method for quantization step estimation. The main contributions of the paper are the followings:

• In contrast to prior histogram-based methods, this paper establishes a mathematical analysis of quantization effect during JPEG compression and decompression in order to justify the relation of local maxima of the number of integer quantized forward (IQF) coefficients with the true quantization step. This analysis reveals that the number of IQF coefficients can be exploited as intrinsic quantization fingerprint for the problem of JPEG compression history. The IQF fingerprint-based technique can provide a set of candidates of the true quantization step. • Instead of using the Laplacian model, the paper incorporates the state-of-the-art statistical model of DCT coefficients into the estimation algorithm in order to enhance the accuracy. This model has been proposed in our previous works [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF]- [START_REF] Thai | Steganalysis of Jsteg algorithm based on a novel statistical model of quantized DCT coefficients[END_REF]. The model is used to provide the optimal estimate of quantization step from the set of candidates given by the above technique.

C. Organization of the Paper

The rest of the paper is organized as follows. Section II briefly describes the main steps in the JPEG compression pipeline, which is vital to understand how the JPEG image is created before dealing with the JPEG compression history estimation. Section III presents the state-of-the-art statistical model of DCT coefficients, that was established in our previous works, and provides the ML estimation of the model parameters. Section IV presents the IQF fingerprint and designs the algorithm for estimating quantization steps employed in the JPEG compression scheme. Section V presents numerical results on large real image databases to highlight the accuracy of the proposed algorithm. Finally, Section VI provides some discussions and concludes the paper.

II. JPEG COMPRESSION PIPELINE

This section briefly describes the JPEG compression pipeline [START_REF] Pennebaker | JPEG Still Image Compression Data[END_REF]. The main notations used in this paper are summerized in Table I.

Given an uncompressed image X, the JPEG compression algorithm starts by dividing the image X into 8 × 8 blocks1 and performing the DCT operation on each block separately:

U = DCT(X), (1)
where U = (u i,j ), i ∈ {0, . . . , 7}, j ∈ {0, . . . , 7} denotes the image of unquantized DCT coefficients. The coefficient at location (0, 0) in the matrix U is called the Direct Current (DC) coefficient, the remaining 63 coefficients are called the Alternating Current (AC) coefficients. It is noted that priors step of color space transformation and chroma subsampling are not presented for the sake of simplicity. The next step is the quantization operation that is carried out by simply dividing each DCT coefficient u by a corresponding quantization step q extracted from the quantization table Q, then rounding to the nearest integer:

c = round u q , (2)
where c denotes a quantized DCT coefficient. Here the index of location (or frequency) is omitted for clarity. This quantization operation is the main cause of a loss of information in the JPEG compression scheme. The steps of entropy encoding and decoding are not considered in this paper as they are lossless compression steps that can be restored without error. The JPEG decompression process could be performed by applying the inverse of previous operations in the reverse order: dequantization and inverse DCT (IDCT). Dequantization involves multiplying the quantized DCT coefficient c by the corresponding quantization

q: d = c • q, (3)
where d denotes the dequantized DCT coefficient. The JPEGdecompressed image Y results from applying IDCT operation on the image of dequantized DCT coefficient D to return to the spatial domain, and performing the rounding operation:

Y = round (IDCT(D)) . (4)
The quantization and rounding steps are known as irreversible operations. Therefore, the JPEG-decompressed image Y differs from the uncompressed input image X.

III. STATISTICAL MODELING OF DCT COEFFICIENTS AND PARAMETER ESTIMATION

A. Statistical modeling of DCT coefficients

This subsection briefly recalls the statistical model of DCT coefficient that was proposed in our previous works [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF]- [START_REF] Thai | Steganalysis of Jsteg algorithm based on a novel statistical model of quantized DCT coefficients[END_REF]. The reader is referred to [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF]- [START_REF] Thai | Steganalysis of Jsteg algorithm based on a novel statistical model of quantized DCT coefficients[END_REF] for more details, proofs and justifications.

In order to account for the non-stationarity and heterogeneity in a natural image, the unquantized DCT coefficient U can be characterized by the doubly stochastic model [START_REF] Lam | A mathematical analysis of the DCT coefficient distributions for images[END_REF] as:

f U (x) = ∞ 0 f U |σ 2 (x|t)f σ 2 (t)dt, x ∈ R, (5)
where σ 2 denotes the variance of 8 × 8 block, f U denotes the probability density function (pdf) of the unquantized DCT coefficient U , f U |σ 2 denotes the conditional pdf of U given the block variance σ 2 , and f σ 2 stands for the pdf of block variance σ 2 . Our previous works [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF], [START_REF] Thai | Statistical model of natural images[END_REF] showed that the conditional unquantized DCT coefficient U |σ 2 is modeled by the zero-mean Gaussian distribution in virtue of Central Limit Theorem (CLT) and the block variance σ 2 is modeled by the Gamma distribution G(α, β) using the moment matching method. Finally, the pdf f U is given by [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF], [START_REF] Thai | Statistical model of natural images[END_REF]:

f U (x) = 2 π |x| β 2 α-1 2 β α Γ(α) K α-1 2 |x| 2 β , (6)
where α is a positive shape parameter, β is a positive scale parameter, Γ(•) denotes the gamma function and K ν denotes the modified Bessel function of second kind of order ν [22, chap. 5.5]. The proposed model of DCT coefficient includes Laplacian model as special case (as α = 1) and Gaussian model as limiting case (as α → ∞). Moreover, by taking into account the impact of quantization, the probability mass function (pmf) of the quantized DCT coefficient C is given by [START_REF] Thai | Statistical model of quantized DCT coefficients: Application in the steganalysis of Jsteg algorithm[END_REF], [START_REF] Thai | Steganalysis of Jsteg algorithm based on a novel statistical model of quantized DCT coefficients[END_REF]

P C (k) = G |k| -G |k| -1 ∀k ∈ Z * 2G(0) k = 0, (7)
where

G(k) = 1 2 g(k) K α-1 2 (g(k))L α-3 2 (g(k)) + K α-3 2 (g(k))L α-1 2 (g(k)) (8)
with g(k) = q(k + 1 2 ) 2 β and L ν (•) is the modified Struve function [START_REF] Ryzhik | Tables of Integrals, Series, and Products[END_REF].

B. Estimation of DCT Coefficient Model Parameter

This subsection proposes to estimate the parameters (α, β) from unquantized DCT coefficients using the ML method. By definition, the ML estimates (α ML , βML ) are defined as the solution that maximizes the likelihood function:

αML , βML = arg max (α,β) N i=1 log f U (u i ), (9)
where N denotes all the unquantized DCT coefficients at the same subband. However, this maximization problem has no closed-form solution, hence the ML estimates ( αML , βML ) can not be analytically provided. It is proposed to resolve the maximization problem numerically by using the Nelder-Mead optimization method [START_REF] Nelder | A simplex method for function minimization[END_REF] and taking the solution given by the method of moments (MM) as initial guess.

In order to provide MM estimates (α MM , βMM ), we propose to calculate the variance and the kurtosis coefficient of U . Based on the law of total expectation, the variance of U can be written as

Var U U = E U U 2 = E σ 2 E U |σ 2 U 2 |σ 2 = E σ 2 σ 2 = αβ, (10)
where E X and Var X represents the mathematical expectation and variance with respect to a random variable X. Similarly, the kurtosis of U is given by

E U U 4 Var 2 U U = E σ 2 3σ 4 E 2 σ 2 σ 2 = 3 αβ 2 (α + 1) α 2 β 2 = 3 1 + 1 α . (11)
Therefore, the MM estimates (α MM , βMM ) can be given by

αMM = 3 m4 m 2 2 -3 , and βMM = m 2 αMM , (12)
where m k denotes the k-th sample moment of U .

IV. QUANTIZATION STEP ESTIMATION ALGORITHM

A. Quantization Effect Analysis

Due to the spatial-domain round-off error, when performing the DCT operation on the JPEG-decompressed image Y, we only obtain the forward coefficient ũ that is an approximated version of dequantized coefficient d:

ũ = d + ε = c • q + ε, (13)
where ε represents the so-called round-off error in the DCT domain as a linear combination of spatial-domain round-off error. It should be noted that the impact of the truncation error, which is involved in the phenomenon where the value exceeds the quantizer's bound, is assumed to be negligible in this paper.

In fact, the truncation error can be removed by excluding saturated blocks in the image [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF], [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF]. Therefore it is not taken into account in the proposed algorithm of quantization step estimation.

In virtue of CLT, the round-off error ε is assumed to be Gaussian distributed with zero-mean and variance 1 12 [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF], [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF],

ε ∼ N 0, 1 12 . ( 14
)
As a result, the forward coefficient ũ would cluster around integer multiples of the quantization step q as illustrated in Fig. 1. Performing the rounding operation on the forward coefficient ũ, we obtain the rounded forward coefficient, denoted v. Most of the rounded forward coefficients v will become the original dequantized ones d, except that some of the forward coefficients ũ are rounded to the neighborhoods of d (i.e. d-1 and d+1). It follows from ( 14) that the probability that the round-off error ε lies outside the interval [-3 2 , 3 2 ] is negligible and

P[v = cq] = P cq - 1 2 < ũ ≤ cq + 1 2 = P - 1 2 < ε ≤ 1 2 = 1 2 -1 2 6 π exp(-6t 2 )dt = 0.916. (15)
In this paper, the rounded forward coefficient v that becomes the original dequantized one d is called convenient forward coefficient. Let Ñ be the number of convenient forward coefficients:

Ñ = 1[v = cq], (16)
where 1[A] denotes the indicator function of an event A.

It follows from ( 15) that the expected value of the ratio Ñ N is equal to 0.916. The next step involves dividing rounded forward coefficients v by a certain quantization step q to obtain a so-called quantized forward coefficient c. However, the quantized forward coefficient c could be integer or not because of the division of cq and q. Let n q denote the number of integer quantized forward (IQF) coefficients c with respect to the quantization step q:

n q = 1[c ∈ Z]. (17)
Let us investigate the following three cases:

• Case 1: q = 1
It is straightforward to derive n q = N .

• Case 2: q ≥ 2 and q | q In this paper, a | b denotes that a divides b and a b denotes that a does not divide b. The number of IQF coefficients n q can be given as:

n q = 1 cq q ∈ Z 1 [v = cq] + 1 cq ± 1 q ∈ Z 1 [v = cq ± 1] = 1 [v = cq] (because q cq ± 1) = Ñ . (18)
• Case 3: q ≥ 2 and q q Let l = gcd(q, q) be the greatest common divisor of q and q. Then we can rewrite q = l•p and q = l• p where (l, p, p) ∈ Z 3 * , gcd(p, p) = 1. In this case, n q is given as

n q = 1 cp p ∈ Z 1 [v = cq] + 1 clp ± 1 l p ∈ Z 1 [v = cq ± 1] . (19)
If p = 1, it follows from gcd(p, p) = 1 that p = 1, which results in q = q = l. This is absurd because q q. Therefore, we derive that p ≥ 2. Since gcd(p, p) = 1, we have

P cp p ∈ Z = P [p | c] and P clp ± 1 l p ∈ Z = P [p c] . (20
) Then, n q can be rewritten as 2. The values of q for different quantization steps q when the true quantization step q = 4. The analysis is performed on the subband (1,0) of the lena image compressed with quality factor of 85.

n q = 1 [c = r p] 1 [v = cq]+ 1 [c = r p] 1 [v = cq ± 1] . (21) with r ∈ Z * . It is noted that P [c = r p]P [v = cq] + P [c = r p] P [v = cq ± 1] = 0.916 • P [c = r p] + 0.084 • P [c = r p] = 0.916 • P [c = r p] + 0.084 • (1 -P [c = r p]) = 0.832 • P [c = r p] + 0.084 < 0.916 (22)
As a result, the number of IQF coefficients n q is always smaller than number of convenient forward coefficients Ñ , i.e. n q < Ñ .

From above mathematical analysis, the ratio q = nq N achieves the maximum value for all divisors of q, including q. Therefore, among the values maximizing the ratio q , the maximum value is best candidate of the true quantization step q:

Q = max arg max q≥2 q . (23)
In other words, the candidate Q given in ( 23) is likely the true quantization step q. An illustration of our theoretical study is shown in Fig. 2. This figure shows the values of q when analyzing the subband (1,0) of the lena image compressed with quality factor of 85. It is easily seen that as q ≥ 2, the ratio q achieves maximum as q ∈ {2, 4}, the best candidate Q = 4 for the true quantization step q = 4.

B. Proposed Estimation Algorithm

The above theoretical study is based on the assumption that transformed round-off ε perfectly follows the Gaussian distribution as in [START_REF] Bianchi | Image forgery localization via block-grained analysis of JPEG artifacts[END_REF]. However the use of the CLT on a small sample (e.g. 64 values in 8 × 8 blocks) could lead to a slight modeling error, as also noted in [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF]. Consequently, the probability that the round-off error ε lies outside the interval [- 3 2 , 3 2 ] might not be negligible and the forward coefficient ũ could be rounded to more neighborhoods of d. An example is given in Fig. 3 to illustrate this point. In the same context in which the lena image is compressed with quality factor of 85, we study the coefficients at the subband (7,0). The calculation shows that 2 = 0.9136, 11 = 0.9133, 22 = 0.9133 while the true quantization step q = 22. This is due to the fact that one more coefficient is quantized to 2. It follows from ( 23) that Q = 2 is unexpectedly the output estimate from above framework. This unexpected error may happen in case of a large quantization step, where most coefficients ũ are quantized to 0 and the number of coefficients ũ at neighborhoods of 0 are more than the ones at the true quantization step q. Fig. 3. The values of q for different quantization steps q when the true quantization step q = 22. The analysis is performed on the subband (7,0) of the lena image compressed with quality factor of 85.

In order to avoid that situation, we propose to set Q as the histogram bin containing the most nonzero rounded coefficients v [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF]. Then we filter all possible candidates of the true quantization step as follows:

S = {q, q | Q and q ≥ t}, (24)
where t, 0 ≤ t ≤ 1 is an empirical threshold. This strategy proposes to filter all integer divisors of Q whose the ratio q is larger than a threshold t. Empirically, the threshold t is set to t = 0.75 in this paper. In other words, this strategy proposes to start from the value Q and refine all integer divisors of Q to select suitable candidates of the true quantization steps for further processing.

Next, we verify each possible candidate q in the set S by relying on the DCT coefficient statistics in order to provide an optimal estimate. Given the vector of IQF coefficients at the same subband, c = (c i ), 1 ≤ i ≤ n q , the optimal candidate q * is the value maximizing the likelihood function

q * = arg max q∈S L (c | α, β, q) = arg max q∈S nq i=1 log P C (c i | α, β, q), (25)
where P C is the pmf of the quantized DCT coefficient given in [START_REF] Fu | A generalized Benford's law for JPEG coefficients and its applications in image forensics[END_REF]. We can note that the parameters (α, β) in ( 25) are unknown. In order to overcome this difficulty, we propose to estimate the parameters (α, β) from rounded forward coefficients v following the approach proposed in Section III-B. Consequently, the likelihood function L now only depends on one unknown parameter q, which leads to that the optimal candidate q * can be given by

q * = arg max q∈S nq i=1 log P C (c i | α, β, q). (26)
Finally, the main steps of the algorithm for quantization step estimation from a given image are in the followings: value is 255 or the minimum value is 0 [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF]. These two kinds of blocks are excluded for subsequent processing.

• Step 2: Perform DCT and rounding operation on the remaining blocks, and arrange the rounded forward DCT coefficients v into 64 vectors of coefficients of length N in the zig-zag order. • Step 3: For each subband k, 1 ≤ k ≤ 64, extract the vector v k , estimate the parameters (α k , β k ) relying on the approach in Section III-B, and determine the set S k in (24). • Step 4: Determine the optimal quantization step estimate q * k as in [START_REF] Gloe | The Dresden image database for benchmarking digital image forensics[END_REF].

C. Application to Other Forensic Scenarios 1) JPEG Compression Identification:

The detection of JPEG presence is based on the clue that if all quantization steps provided by the proposed method are unity, the image in question might has not been previously JPEG-compressed. Otherwise, if an quantization step is larger than 2 or undetermined, the image could be gone through JPEG compression. Therefore, this paper proposes to employ the number of unities in the estimated quantization table for JPEG compression identification.

Given an arbitrary image Z under investigation, the problem of JPEG compression identification can be formulated as follows:

H 0 : Z is uncompressed H 1 : Z has been previously JPEG-compressed. ( 27
)
We define the false alarm rate (FAR) as the probability of uncompressed images being wrongly detected as JPEG images and the identification accuracy (true positive rate or TPR) as the probability of JPEG images being correctly detected as JPEG images. Based on the number of unities in the estimated quantization table, the proposed decision rule is given by

δ(Z) = H 0 if Λ = 64 k=1 1 q * k = 1 ≥ τ H 1 if Λ = 64 k=1 1 q * k = 1 < τ, ( 28
)
where Λ is the decision statistics and τ is the decision threshold. In order to show the discriminability of the proposed decision statistics Λ, we carry out an experiment on 10000 uncompressed images in the BOSSBase dataset [START_REF] Bas | Break our steganographic systemthe ins and outs of organizing boss[END_REF] and their different JPEG-compressed versions. The size of the test images in this experiment is 32 × 32 where the images are center-cropped from the original images. The histogram of the decision statistics Λ is shown in Fig. 4. We can note that the histogram of Λ for uncompressed images and the one for JPEG images are mostly discriminative. Moreover, the smaller the quality factor is, the more the histogram is discarded from the one for uncompressed images.

2) Estimation of Secondary Quantization Table in Double-JPEG Compressed Images: The forensic scenario to be studied is that an image that has been previously double-JPEG compressed is stored in lossless format, which causes the secondary quantization table stored with the JPEG image file to be lost. Besides, even though the image in question is saved in JPEG format, however the quantization table extracted from the JPEG file is not reliable. Furthermore, the secondary quantization table is assumed to be known in advance in most methods proposed for double-JPEG compression detection [START_REF] Pevny | Detection of double compression in JPEG images for applications in steganography[END_REF], [START_REF] Bianchi | Image forgery localization via block-grained analysis of JPEG artifacts[END_REF]. Therefore, the estimation of secondary quantization table is of important interest. The proposed method performed on the double-JPEG compressed image in question can provide the secondary quantization table. V. EXPERIMENTS

A. JPEG Quantization Step Estimation

This subsection presents numerical results for quantization step estimation from images that have been previously single-JPEG compressed and stored in lossless format.

In order to highlight the accuracy of the proposed method for quantization step estimation, the experiment is firstly conducted on the large BOSSBase dataset [START_REF] Bas | Break our steganographic systemthe ins and outs of organizing boss[END_REF] (version 1.02). This dataset includes 10000 grayscale images of size 512 × 512 in PGM format. These images are center-cropped into images of small sizes 256 × 256, 128 × 128, 64 × 64 and 32 × 32, and then JPEG-compressed using the Matlab JPEG Toolbox [START_REF] Sallee | Matlab JPEG Toolbox[END_REF] with 9 different quality factors QF = {60, 65, 70, 75, 80, 85, 90, 95, 100} and stored in lossless format.

In this experiment, it is proposed to include in the comparison three prior-art methods. Fan et al.'s method [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF] (denoted as FANE) whose approach is similar to the one proposed in this paper, but employs a different statistical model of DCT coefficients, namely the Laplacian model. Another representative of histogram-based method in [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF] (denoted as LUOE) and a quantization noise-based method in [START_REF] Fridrich | Steganalysis based on jpeg compatibility[END_REF] (denoted as FRID) are also included in order to enlarge the comparison.

In the problem of quantization step estimation, it could lead to a situation in which all coefficients are quantized to a value smaller than or equal to 1 due to large quantization steps when the image is compressed with low quality factors. Moreover, this situation mostly occurs in high frequencies. In this situation, the estimation is declared undetermined. To the best of our knowledge, no existing method (including the present one) can deal with this situation. Therefore, this paper mainly focuses on evaluating the performance using determinably estimated quantization steps.

The performance of all methods is evaluated on accuracy metric that is calculated as percentage of the number of correctly estimated quantization steps over the number of determinably estimated quantization steps in the 8×8 quantization table. Average accuracy indicates the average percentage over the number of tested images.

Firstly, we evaluate the performances on a few particular subbands for different quality factors. The average accuracy of all methods for DC coefficients, AC coefficients at the subband (1,1), and AC coefficients at the subband [START_REF] Podilchuk | Digital watermarking: algorithms and applications[END_REF][START_REF] Podilchuk | Digital watermarking: algorithms and applications[END_REF] are shown in Fig. 5, Fig. 6 and Fig. 7, respectively. This experiment is performed on images of size 128×128. The FANE and LUOE methods are not designed to be applied on DC coefficients, hence their estimation accuracy is zero for all quality factors. Therefore, we do not present their performance in Fig. 5. It must be noted that while other methods fail in case of DC coefficients, the proposed one still shows high estimation performance even though the DC coefficients are not perfectly modeled. Moreover, Fig. 6 shows that the FRID and LUOE method fail for low-frequency coefficients with high quality factors (e.g. QF = 90, 95). The proposed method outperforms prior methods in all cases (e.g. different frequencies and different quality factors), but for the sake of space, this paper only shows three cases (Fig. 5, Fig. 6, Fig. 7) for illustration. We can also note that the accuracy of the proposed method is relatively stable for different quality factors.

Secondly, we evaluate the overall performances of the four methods on the whole quantization table of images with different sizes and quality factors. Table II shows the average accuracies for the original image size of 512 × 512. Table III show the average accuracies for smaller image sizes, e.g. 256 × 256, 128 × 128, 64 × 64 and 32 × 32. The proposed method outperforms prior-art methods, even in case of smallsize images or heavily compressed images.

Finally, in order to emphasize the effectiveness of the proposed algorithm in practice, we apply it on real JPEG images in the publicly Dresden database [START_REF] Gloe | The Dresden image database for benchmarking digital image forensics[END_REF]. This database includes 16958 color JPEG images acquired from 73 different camera devices of different models/brands with the highest available resolution and JPEG quality setting, see more details in [START_REF] Gloe | The Dresden image database for benchmarking digital image forensics[END_REF]. The color JPEG compression introduces some additional steps such as color space transformation (e.g. RGB to YCbCr and inverse) and chrominance component downsampling. These steps generate noise into the color components. By conducting experiment on real color JPEG images, we do not only verify the robustness of the proposed method to color noise, but also show its effectiveness in the real JPEG compression scheme designed by different manufacturers. In this experiment, the luminance component of the images is extracted and centercropped into images of small sizes 256 × 256, 128 × 128, [START_REF] Neelamani | JPEG compression history estimation for color images[END_REF] that is typically designed for color JPEG images. It should be noted that a small image of size 32×32 occupies on average only about 0.01% of the original image. Despite the poor performance of the other methods, the average accuracy of the proposed method is relatively high. This also shows the robustness of the proposed method to color noise even though it is not yet incorporated in our estimation algorithm.

From above experiments, we can note that the accuracy of the proposed method is dependent on the image size and the quality factor. For a fixed quality factor, the larger the image size is, the larger the accuracy is because of more statistics for the estimation of model parameters (α, β). Moreover, for a fixed image size, the larger the quality factor is, the smaller the accuracy is. For the sake of simplicity, in this paper, experiments are conducted on the image size 512 × 512. In practice, the user should employ the whole image for the best possible estimation of quantization step.

B. Estimation of Secondary Quantization Table in Double-JPEG Compressed Images

In order to generate double-JPEG compressed images, we conduct the second JPEG compression round with 8 different quality factors on previous JPEG images. Therefore, we obtain 64 (8x8) datasets where each dataset includes 10000 double-JPEG compressed images. Here this paper mainly conducts experiments on 512 × 512 images because in the problem of double-JPEG compression, one needs to gather sufficient statistics to provide reliable estimation of secondary quantization table. Table V shows the average accuracy of the four methods on those 64 datasets. The first JPEG compression is given along the vertical line and the second along the horizontal line. In each 2 × 2 rectangular in Table V, the proposed, FRID, FANE and LUOE methods are shown at (1,1), (1,2), (2,1), (2,2) locations, respectively. On the one hand, the estimation performance of all methods in case of QF 1 ≥ QF 2 is similar to the one in case of single-JPEG compression. Furthermore, the proposed method outperforms prior-art ones in this case. On the other hand, all the methods fail when QF 1 < QF 2 . This may be justified due to the fact that the first JPEG compression with lower quality disturbs the estimation of parameters (α, β), which causes the estimation inaccuracy. However, this clue could be used in future works to identify whether the image has been previously double-JPEG compressed, even indicate that the quality factor of the first JPEG compression is smaller than the second one.

C. JPEG Compression Identification

As noted in the literature, few methods have been proposed for JPEG compression identification. Fan et al. [START_REF] Fan | Identification of bitmap compression history: JPEG detection and quantizer estimation[END_REF] (denoted as FANI) proposed to measure the blocking boundary strength in the spatial domain. Luo et al. [START_REF] Luo | JPEG error analysis and its application to digital image forensics[END_REF] (denoted as LUOI) relied on the fact that the AC coefficients increase in the range of (-1, 1) while decrease significantly in the union regions of (-2, -1] ∪ [1, 2) due to JPEG compression. Another method is to use the generalized Benford's law [START_REF] Fu | A generalized Benford's law for JPEG coefficients and its applications in image forensics[END_REF] modeling the distribution of the first digits of all the AC coefficients in order to detect the presence of JPEG compression. An improvement of the use of the generalized Benford's law was proposed in [START_REF] Li | Detecting doubly compressed JPEG images by using mode based first digit features[END_REF], namely Mode Based First Digit Features (MBFDF) method. The FANI, LUOI and MBFDF methods are included in the comparison.

The experiments in this subsection are mainly conducted on small-size images, e.g. 64×64 and 32×32. Firstly, we conduct experiments on images that are center-cropped from original uncompressed images in the BOSSBase dataset. Those images are then JPEG-compressed with different quality factors. The identification accuracy of the three methods on center-cropped uncompressed images of size 32 × 32 and their different JPEG compressed versions is illustrated in Fig. 8 using the Receiver Operating Characteristic (ROC) curve which presents the identification accuracy as a function of FAR when the decision threshold τ varies. This figure is shown in log-log scale for better visibility. We can note that the proposed method is slightly better than the LUOI method in this case, especially for very small false alarm rates.

Moreover, Table VI shows the identification accuracies of the four methods on center-cropped images with different sizes and quality factors. For this experiment, the decision threshold τ is set to τ = 43 since the number of unities in the quantization table of Independent JPEG Group (IJG) quality factor of 99 equals to 42. It should be noted that the identification problem in [START_REF] Lehmann | Testing Statistical Hypotheses[END_REF] is cast in the hypothesis testing framework [START_REF] Lehmann | Testing Statistical Hypotheses[END_REF]. In order to establish a mathematical expression of τ , one needs to characterize the statistical distribution of Λ. However, this is very complicated (see Fig. 4). Therefore, this paper proposes to employ the empirical threshold τ = 43. In practice, this threshold can be tuned up easily for every camera manufacturer and model.

It must be noted that when applying the proposed method on an uncompressed image, all the elements of the resulting table are unity, which is the same case of JPEG images compressed with quality factor of 100. Therefore, we do not conduct the experiments for the quality factor of 100. Furthermore, in order to conduct a fair comparison, we use uncompressed images of each size to train the threshold for the feature of the FANI and LUO method such that these two methods share the same FAR with that of the proposed method corresponding to the threshold τ = 43 (FAR = 5% for the size of 32 × 32 and FAR = 1.5% for the size of 64 × 64). Therefore, their performance can be evaluated on the TPR. As also noted in Table VI, the proposed method slightly outperforms the LUOI and MBFDF methods for QF < 98 and significantly outperforms for QF ≥ 98. The performance of the FANI method is far from satisfactory.

Furthermore, in this paper, the decision threshold τ is always fixed for any image size. Moreover, the estimation accuracy of the proposed method increases with the increasing image size. Therefore, the larger the image size is, the smaller the FAR is, as illustrated in Fig. 9. The experiment in Fig. 9 is performed on center-cropped JPEG images in the BOSSBase database.

Secondly, instead of extracting the central portion of the images like the first experiment, we propose to extract randomly a portion from original images in the BOSSBase database. Moreover, the quality factor used for JPEG compression is also randomly selected in the range of 60 ∼ 99. The identification accuracy on this dataset is shown in Table VII.

Finally, we conduct an experiment on the publicly Dresden database [START_REF] Gloe | The Dresden image database for benchmarking digital image forensics[END_REF]. We convert the color JPEG images to grayscale, then extract randomly portions of small size from original images for JPEG compression identification. Furthermore, the extracted portions should be aligned with the 8 × 8 DCT grid. The identification accuracy on this dataset is also shown in Table VII. The proposed method still achieves high accuracy on the large real image database. VI. CONCLUSION, DISCUSSION AND POSSIBLE FUTURE WORKS This paper proposes an accurate method for quantization step estimation from a given image. By analyzing the quan-tization effect during JPEG compression and decompression pipeline, the paper proposes a quantization fingerprint, namely the number of integer quantized forward coefficients, and provides a mathematical justification to show the relation of local maxima of that measure with the true quantization step. The estimation algorithm is designed by relying on that quantization fingerprint and incorporating the statistical model of DCT coefficients that has been given in our previous works. Numerical experiments on large image database highlight the relevance of the proposed approach.

The strength of the proposed method is the high estimation accuracy for a wide variety of images with different image contents, image sizes, and quality factors. Moreover, the proposed method can provide reliable estimation of quantization steps for DC coefficients while some existing methods fail. The accuracy of the proposed method is emphasized when applying on real color JPEG images acquired from different camera models/brands. The high performance on the color images shows the robustness of the proposed method to color noise introduced during JPEG compression pipeline. Despite its high performance in terms of estimation accuracy, the proposed method is more time-consuming than prior-art ones. This drawback is due to the fact that the ML estimation of DCT model parameters is accomplished using a numerical optimization method, see Table VIII.

The proposed method also shows its accuracy in other practical forensic scenarios such as estimation of the secondary quantization table in a double-JPEG compressed image stored in lossless format, and JPEG compression identification. Future researches could explore this approach for more forensic scenarios. The first possible application is to extend this approach for detection of double-JPEG compression presence and estimation of primary quantization table in a double-JPEG compressed image by analyzing characteristics of double-JPEG compression and deriving the corresponding version of the IQF fingerprint. The second forensic application is to detect and localize copy-paste forgery using inconsistencies in JPEG compression history among different parts in the image under investigation, thanks to the high performance of the proposed method for JPEG compression identification on small-size images. Another forensic application is for image origin identification [START_REF] Kee | Digital image authentication from JPEG headers[END_REF], [START_REF] Thai | Camera model identification based on the heteroscedastic noise model[END_REF]- [START_REF] Thai | Camera model identification based on the generalized noise model in natural images[END_REF], which aims to verify whether the image in question was acquired by a certain source (camera device, model, brand), since different manufacturers design their own compression scheme.

Fig. 1 .

 1 Fig. 1. Histogram of the forward DCT coefficients ũ at the subband (1,0) of the lena image compressed with quality factor of 85. The corresponding quantization step is 4.

  Fig.2. The values of q for different quantization steps q when the true quantization step q = 4. The analysis is performed on the subband (1,0) of the lena image compressed with quality factor of 85.

• Step 1 :Fig. 4 .

 14 Fig. 4. Histogram of the decision statistics Λ for center-cropped uncompressed images of size 32 × 32 and their different JPEG compressed versions.

Fig. 5 .Fig. 6 .

 56 Fig. 5. Average accuracy as a function of quality factors when the estimation is performed on DC coefficients of images of size 128 × 128.

Fig. 7 .

 7 Fig. 7. Average accuracy as a function of quality factors when the estimation is performed on AC coefficients at the subband (3,3) of images of size 128 × 128.

Fig. 8 .

 8 Fig. 8. ROC curve for JPEG compression identification on center-cropped uncompressed images of size 32 × 32 and their JPEG version with quality factor of 95.

Fig. 9 .

 9 Fig. 9. False alarm rate as a function of image size.

TABLE III AVERAGE

 III ACCURACY FOR QUANTIZATION STEP ESTIMATION ON CENTER-CROPPED GRAYSCALE IMAGES OF SIZES 256 × 256, 128 × 128, 64 × 64 AND 32 × 32.

			256 × 256			128 × 128			64 × 64			32 × 32
		Prp.	FRID	FANE	LUOE	Prp.	FRID	FANE	LUOE	Prp.	FRID	FANE	LUOE	Prp.	FRID	FANE	LUOE
	QF = 100	99.87	92.22	91.99	7.72	99.69	89.57	82.04	14.44	99.33	85.64	66.04	23.24	94.59	77.53	45.54	26.21
	QF = 95	99.70	80.17	69.70	85.23	99.24	79.94	69.36	86.38	98.57	77.93	66.57	81.48	93.04	73.86	60.48	68.26
	QF = 90	98.21	84.72	57.71	90.62	98.56	82.62	54.15	90.22	97.59	86.89	55.72	85.13	92.11	80.96	50.66	70.77
	QF = 85	96.01	83.77	45.22	91.11	95.31	82.02	44.78	90.37	95.22	81.66	41.23	85.77	92.05	81.04	40.43	71.47
	QF = 80	95.80	72.37	44.40	88.75	94.99	71.01	41.21	87.35	93.24	69.39	40.34	85.55	92.07	65.07	39.99	70.48
	QF = 75	92.10	77.02	42.27	87.31	92.03	75.53	40.54	84.74	91.45	70.98	39.64	83.33	90.91	66.76	38.97	71.26
	QF = 70	92.07	71.31	40.96	84.44	91.72	70.78	38.85	83.74	91.49	68.85	36.67	80.88	91.12	64.52	36.10	67.80
	QF = 65	91.95	70.88	39.26	82.45	90.86	68.01	34.14	79.93	90.01	62.41	33.48	76.51	89.67	60.38	31.12	61.09
	QF = 60	88.45	69.58	37.75	80.48	88.08	63.22	31.01	76.47	87.18	60.07	30.52	72.96	87.01	58.23	29.13	60.36

TABLE IV AVERAGE

 IV ACCURACY FOR QUANTIZATION STEP ESTIMATION ON CENTER-CROPPED LUMINANCE COMPONENT OF COLOR JPEG IMAGES FROM THE DRESDEN IMAGE DATABASE.

		256 × 256			128 × 128			64 × 64			32 × 32
	Prp.	FRID	NEE	LUOE	Prp.	FRID	NEE	LUOE	Prp.	FRID	NEE	LUOE	Prp.	FRID	NEE	LUOE
	92.91	68.27	72.77	58.52	91.49	67.17	70.32	58.67	90.41	65.64	60.43	56.90	86.43	58.18	58.54	50.26

64 × 64 and 32 × 32. Table IV shows the average accuracies on center-cropped luminance component of color JPEG images from the Dresden image database with different sizes. The FANE method is replaced by Neelamani et al. (denoted as NEE)

TABLE V AVERAGE

 V ACCURACY FOR SECONDARY QUANTIZATION TABLE ESTIMATION ON PREVIOUSLY DOUBLE-JPEG COMPRESSED IMAGES.

	X X QF 1 X X 95	X QF 2 X X	99.79 72.02	95	81.14 86.31	99.35 62.63	90	86.80 96.96	96.50 48.70	85	85.62 94.35	93.78 46.62	80	74.94 92.27	92.35 42.76	75	80.32 90.75	90.98 42.16	70	74.37 89.46	88.19 40.00	65	75.07 87.20	85.50 39.66	60	73.93 84.78
	90		10.90 2.75		19.49 2.85	98.77 56.74		85.13 96.30	98.10 58.20		88.70 96.19	94.77 47.65		73.66 92.65	90.98 39.61		78.87 88.99	91.06 40.89		75.88 89.65	89.25 42.01		75.68 88.30	85.32 39.62		74.24 84.52
	85		12.97 2.42		22.78 2.40	53.65 20.35		75.09 43.47	96.55 49.64		86.41 94.86	95.38 47.79		78.13 91.69	95.24 50.86		85.76 93.64	92.42 43.26		76.11 90.82	85.85 36.18		72.10 84.06	82.96 36.78		71.07 81.40
	80		6.07 3.26		20.81 2.79	6.60 0		8.96 0	94.70 41.24		84.99 89.76	93.60 45.06		75.08 92.05	94.10 43.39		83.49 90.47	93.88 46.56		79.03 92.31	92.51 46.62		80.26 90.34	87.61 39.42		76.36 85.02
	75		6.21 2.57		19.14 2.40	13.46 0		56.21 4.77	15.16 2.31		51.56 2.32	91.49 41.65		74.19 88.84	92.49 43.14		80.84 90.90	91.92 41.15		76.15 89.01	90.94 44.01		79.36 89.98	89.55 43.61		79.97 88.94
	70		5.70 3.90		24.66 3.36	15.97 0		30.25 5.72	5.59 0		12.33 0	60.69 24.99		60.53 52.09	91.53 41.95		79.47 89.93	91.15 41.40		74.74 89.64	89.57 40.16		76.97 87.41	88.47 40.86		78.56 86.90
	65		10.56 4.52		27.57 4.03	10.23 2.83		46.76 3.37	13.08 0		44.70 0	13.75 0		34.33 4.00	90.94 40.90		77.19 89.36	89.77 40.28		72.36 88.33	88.38 40.36		75.10 87.37	86.32 38.33		75.45 84.34
	60		7.87 4.04		19.58 4.53	12.51 0		32.19 9.36	15.64 3.03		46.99 0	7.69 0		9.23 0	20.39 3.20		44.85 3.63	88.20 39.86		68.77 86.85	86.97 39.83		72.88 85.90	85.42 39.31		74.04 84.72
	0.06
	FAR
	0.05
	0.04
	0.03
	0.02
	0.01
	32 × 32 0	64 × 64	128 × 128	256 × 256	size	512 × 512

TABLE VI IDENTIFICATION

 VI ACCURACY OF JPEG COMPRESSION ON CENTER-CROPPED IMAGES WITH FIXED QUALITY FACTORS.

			64 × 64			32 × 32
		Prp.	LUOI	FANI	MBFDF	Prp.	LUOI	FANI	MBFDF
	QF = 99	99.75	2.12	2.24	72.77	91.82	2.25	2.02	63.49
	QF = 98	99.99	9.76	8.66	85.24	99.85	6.64	5.62	79.96
	QF = 95	100.00	99.79	12.73	99.82	99.88	99.37	11.42	99.02
	QF = 90	100.00	99.99	15.68	100.00	99.91	99.42	12.55	99.57
	QF = 85	100.00	100.00	19.82	100.00	99.95	99.55	16.17	99.64
	QF = 80	100.00	100.00	27.83	100.00	99.99	99.71	18.33	99.72
	QF = 75	100.00	100.00	38.35	100.00	99.99	99.79	20.91	99.87
	QF = 70	100.00	100.00	42.38	100.00	100.00	99.89	21.32	100.00
	QF = 65	100.00	100.00	49.73	100.00	100.00	99.99	27.21	100.00
	QF = 60	100.00	100.00	59.77	100.00	100.00	99.99	27.25	100.00

TABLE VII IDENTIFICATION

 VII ACCURACY OF JPEG COMPRESSION ON RANDOMLY EXTRACTED IMAGES.

			64 × 64			32 × 32
		Prp.	LUOI	FANI	MBFDF	Prp.	LUOI	FANI	MBFDF
	BOSSBase	99.98	97.98	41.55	98.42	99.88	96.95	24.96	96.34
	Dresden	99.69	82.01	32.25	89.23	99.21	81.39	20.12	85.31

TABLE VIII AVERAGE

 VIII PROCESSING TIME (IN SECONDS) ON 10000 IMAGES OF DIFFERENT SIZES WITH QUALITY FACTOR OF 75.

		Prp.	FRID FANE LUOE
	512 × 512	11.81	0.41	0.45	0.08
	256 × 256	3.41	0.22	0.08	0.04
	128 × 128	0.98	0.08	0.01	0.005
	64 × 64	0.39	0.04	0.009	0.003
	32 × 32	0.28	0.02	0.009	0.002

In this paper, it is assumed that the size of the given image is multiple of 8. Otherwise, the JPEG compression standard uses the padding by mirroring the very last pixels.