# Analyzing Benford's Law's Powerful Applications in Image Forensics
## 3 Results
### The JPEG Coefficients--\(Y\), \(R\), \(G\) and \(B\) Channels  
In what follows, we analyze the JPEG coefficients for the channels Y, R, G and B, in relationship with the GBL. Firstly, we compare these coefficients with the generalized Benford's law, using a large number of random, uncompressed images from the UCID database. The results are shown in Table 3, along with the p-values obtained by performing the chi square test for the coefficients and the GBL. The results show that indeed these coefficients follow the Benford distribution. An important aspect is also the sample size of the JPEG coefficients. In our case, the images from the UCID database have a size of 340 \(\times\) 512 pixels, resulting in 3072 JPEG coefficients, and therefore, 3072 most significant digits to be analyzed. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Quality Factor** & \multicolumn{6}{c}{_p-Value for the_} \\ \cline{2-7}
**for the Initial** & **Y** & \(\mathrm{C_{B}}\) & \(\mathrm{C_{R}}\) & **R** & **G** & **B** \\
**Compression** & **Channel** & **Channel** & **Channel** & **Channel** & **Channel** & **Channel** \\ \hline Initially uncompressed & 0.99989 & 0.99993 & 0.99993 & 0.99996 & 0.99994 & 0.99994 \\
90 & 1 & 0.99934 & 0.99934 & 0.99998 & 0.99994 & 0.99984 \\
80 & 0.99384 & 0.99978 & 0.99978 & 0.9974 & 0.98726 & 0.99952 \\
70 & 0.99063 & 0.99991 & 0.99991 & 0.99807 & 0.98733 & 0.99904 \\
60 & 0.99054 & 0.99992 & 0.99992 & 0.99886 & 0.98903 & 0.99908 \\
50 & 0.98903 & 0.99997 & 0.99997 & 0.99872 & 0.98879 & 0.99937 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison between DCT coefficients and the NBL. Figure 13: The JPEG coefficients compared to the GBL, using the \(\mathrm{C_{B}}\) channel. Next, regarding these channels, we make the following statement, verified for the images in the UCID: for an originally compressed image with \(\text{QF}_{1}\), using the above-mentioned method of obtaining the JPEG coefficients with a \(\text{QF}_{2}\), with \(\text{QF}_{1}-\text{QF}_{2}\geq 10\), the \(p\)-value obtained by performing the chi square test for the coefficients and the GBL has the following property:  
\[ \begin{array}{llll}\text{for}\ \text{QF}_{2}>\ \text{QF}_{1}&\text{p}<\text{n}\\ \text{for}\ \text{QF}_{2}\leq\ \text{QF}_{1}&\text{p}>\text{n}\\ n=0.6&\end{array}  \tag{5}\]  
Thus, if an imaginary threshold line is set at \(\text{n}=0.6\), the first \(\text{QF}_{2}\) under it is the second compression quality factor. Different values for this threshold are analyzed in what follows. Before continuing the reasoning, an example is given. In our research, the following quality factors were used: \(\text{QF}\in\{90,\ 80,\ 70,\ 60,\ 50\}\). Therefore, considering the above-mentioned property, two cases must be discussed first. When the input image is initially uncompressed or compressed with \(\text{QF}_{1}=90\), there is no \(\text{QF}_{2}\) such that \(\text{QF}_{2}>\text{QF}_{1}\). Consequently, all \(p\)-values satisfy \(\text{p}>\text{n}\), \(\text{n}=0.6\), as exemplified in Table 3.  
As it can be observed from Table 4, this method cannot distinguish between uncompressed images and images that are originally compressed with \(\text{QF}_{1}=90\). Therefore, our algorithm is used to determine \(\text{QF}_{1}\), provided that the original image is already compressed. For a different quality factor, such as \(\text{QF}_{1}=60\), the property can be easily observed in an example, in Table 5. Thus, by establishing the threshold at \(p\)-value \(\text{n}=0.6\), suggested by the green line, the first \(\text{QF}_{2}\) under it, is \(\text{QF}_{2}=60\), which is indeed the second compression quality factor.