# Analyzing Benford's Law's Powerful Applications in Image Forensics
## 2 Materials and Methods
Moreover, it is performed in a zigzag manner, as shown in Figure 6.  
Therefore, the top left value in our 8 by 8 block, which is the first coefficient of the DCT, has the biggest value [28]. Then, the DCT coefficients decrease. Consequently, the information is concentrated in the area near the top left corner, as suggested by the highlighted area in Figure 7.  
The next step is the quantization, which represents the division with a matrix. This is the step where information is lost by allowing the user to choose a quality factor, QF. Naturally, the higher the QF is, the less information is lost. For example, when choosing a QF of 50, the result is the one shown in Figure 8.  
Figure 2:0 Fixels values in range [\(-128\), \(127\)]. Figure 2:1 The zigzag rule of the discrete cosine transform. Figure 2:2 The DCT coefficients. For each QF in a range of 1 to 100, there is a different quantization matrix. The main one, the one for \(\text{QF}=50\), which was also used in our example, is the one in the following relation. \[\text{Q}_{50}= \begin{array}{cccccccc}16&11&10&16&24&40&51&61\\ 12&12&14&19&26&58&60&55\\ 14&13&16&24&40&57&69&56\\ 14&17&22&29&51&87&80&62\\ 18&22&37&56&68&109&103&77\\ 24&35&55&64&81&104&113&92\\ 49&64&78&87&103&121&120&101\\ 72&92&95&98&112&100&103&99\end{array}  \tag{2}\]  
The other quantization matrices are computed using the following formula [28]:  
\[\text{Q}_{\text{n}}=\frac{\text{S}\cdot\text{Q}_{50}+50}{100},\text{ where }\left\{ \begin{array}{ll}\text{S}=1,&\text{for n}=100\\ \text{S}=200-2\text{n},&\text{for n }\epsilon\text{ (50, 99]}\\ \text{S}=\frac{5000}{\text{n}},&\text{for n }\epsilon\text{ (1, 50)}\end{array} \right. \tag{3}\]  
To sum up, we have now detailed the way in which, from an input image, for a single channel, the DCT coefficients and the JPEG coefficients are calculated. We have established that the JPEG coefficients depend on the QF that was chosen. Since we want to compare them with the NBL, one can easily comprehend that there is not a single form for this law, that is, Equation (1). The generalized Benford's law (GBL), proposed by [PERSON] et al. (2007) [12], is used further. \[F_{a}=\text{N}\log_{10}\biggl{(}1+\frac{1}{\text{s}+\text{a}^{\text{q}}}\biggr{)},\text{ for all }\text{a}=1,\,2,\,\ldots,\,9 \tag{4}\]  
As it can be observed, for the special case when \(\text{N}=1,\,\text{s}\,\,=0\,\) and \(\text{q}\,\,=1\), the formula is indeed the NBL. However, for each QF, the model parameters are different, as shown in Table 1. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Quality Factor**} & \multicolumn{2}{c}{**Normalization Factor N**} & \multicolumn{2}{c}{**Model Parameter**} & \multicolumn{2}{c}{**Model Parameter**} \\  & \multicolumn{2}{c}{**Factor N**} & \multicolumn{2}{c}{**q**} & \multicolumn{2}{c}{**s**} \\ \hline
100 & 1.456 & 1.47 & 0.0372 \\
90 & 1.255 & 1.563 & \(-\)0.3784 \\
80 & 1.324 & 1.653 & \(-\)0.3739 \\
70 & 1.412 & 1.732 & \(-\)0.337 \\
60 & 1.501 & 1.813 & \(-\)0.3025 \\
50 & 1.579 & 1.882 & \(-\)0.2725 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Proposed normalization factor and model parameters. Figure 8: The JPEG coefficients. Considering the above-mentioned assumption that the real data will follow the distribution given by this generalized law, while the compromised data will not, our approach is presented in the following section. Two main cases are considered, the \"single-compressed\" image and the \"double-compressed\" image. The first case is illustrated in Figure 9.  
In this situation, the input image is uncompressed. When obtaining the DCT and the JPEG coefficients, we perform an incomplete JPEG compression. It is incomplete because the encoding step is not made, and the result is not an image because these coefficients are an intermediary step. Consequently, we consider the use of quotes to be appropriate.