# Analyzing Benford's Law's Powerful Applications in Image Forensics
## 1 Introduction  
The empirical gem of statistical folklore [1], a phenomenon well-known by some, yet little known by most, is the Newcomb-Benford law. Since in 1881, pocket calculators had not yet been invented, the Newcomb-Benford law (NBL) was first discovered by [PERSON] while he was looking through the pages of a logarithmic book. When noticing that the earlier pages were much more worn than the other pages, he stated that the first significant figure is more often 1 than any other digit, with the frequency diminishing up to 9 [2]. A further mathematical and experimental analysis was made by [PERSON], who named it The Law of Anomalous Numbers. He stated that the ten digits do not occur with equal frequency, but according to the following logarithmic relation [3]:  
\[F_{a}=\log\left(\frac{\text{a}+1}{\text{a}}\right),\text{ for all }\text{a}=1,\text{ }2,\text{ }\ldots,\text{ }9 \tag{1}\]  
In this formula, \(a\) is the first significant digit and \(F_{a}\) is the frequency of the digit. A visual representation of this law is presented in Figure 1.  
Over the past few years, this law has been gaining traction due to its wide range of applications. For instance, it was used to evaluate financial disclosures in the financial statements of public manufacturing companies in Nigeria and Ghana [4]. Identifying the numerical anomalies of Turkish elections in 2017-2018 was also possible due to [PERSON]'s law [5]. Another political context in which it was used was analyzing the national electionsin Spain in 2015-2016 [6]. Detecting fraud in customs declaration [7] and accounting [8] are two other fields where the NBL was applied. Therefore, the NBL has been proposed to determine fraud in a wide range of domains, varying from elections to financial accounting and international trade. However, when given a closer look, the idea of fraud can be naturally extended to images. Thus, a significant area of study, upon which we have chosen to focus our research, is JPEG compression. In light of JPEG being one of the most popular file formats, the detection of compressed digital images is of great importance for image forensics and crime detection. That is because when a JPEG image is compressed, it is usually because a photo-editing software is used, and the image is re-saved. Considering this, a compressed image is, therefore, compromised, altered, possibly edited, and must not be accepted as evidence, for instance. The Newcomb-Benford law is used in the field of JPEG images, in relationship to discrete cosine transform coefficients, to identify the number of compression stages that have been applied [9] and in image steganalysis to detect hidden messages [10] and to detect double-compressed images [11]. Moreover, this law was used to analyze JPEG coefficients, resulting in a generalized form of the law, which can be applied for each quality factor [12]. Therefore, determining the authenticity of digital images is of great importance, even in the field of radiography. For example, regarding radiographs, the X-ray software allows image enhancement [13]. Moreover, they are exported to common file formats, so they can be easily altered. Therefore, when determining if ultrasound imaging is better than radiographs in differentiating endodontic lesions, for instance [14], the authenticity of the radiographs should be verified beforehand. The same procedure is also valuable in the case of X-ray technology, studied from the point of view of dual-energy imaging, which enhances lesion recognition [15]. Furthermore, digital images are also used for neural networks, where large datasets are needed for training. Since both natural and synthetic data can be used, methods to distinguish between the two categories are needed [16].