Introduction
Digital image forensics often relies on identifying microscopic traces left by the camera's internal processing pipeline. Most digital sensors do not capture full color at every pixel; instead, they utilize a Color Filter Array (CFA)—most commonly the Bayer matrix—to sample only one primary color (Red, Green, or Blue) per pixel. The missing color information is then reconstructed through a process known as demosaicing or interpolation.
This interpolation process leaves a nearly invisible periodic "fingerprint" across the image. When an image is forged—for example, by copying an object from one photo and pasting it into another—the underlying CFA patterns of the two segments rarely align. Statistically, there is a 75% chance that the periodic grid will be shifted or "broken" at the boundary of the forgery. This paper analyzes and improves the "Intermediate Values Algorithm," a technique designed to detect these microscopic misalignments.
The Intermediate Values Algorithm
The core of this forensic approach is the concept of Intermediate Value Detection. An interpolated pixel is statistically more likely to be an "intermediate value" (a value falling between the minimum and maximum of its neighbors) than a pixel originally sampled by the sensor. This is because interpolation is essentially a weighted average, and an average is almost always an intermediate value relative to its inputs.
Bidirectional Filtering
While standard algorithms use an isotropic approach (looking at all neighbors equally), this paper introduces a bidirectional variant. By separately analyzing horizontal and vertical neighbors, the algorithm better accounts for modern demosaicing techniques that avoid interpolating across sharp edges to prevent blurring.
Pattern Identification
The algorithm evaluates the image across four possible Bayer grid offsets. The offset with the fewest intermediate values is identified as the "authentic" grid, as it contains the highest concentration of originally sampled pixels.
Forgery Mapping and Localization
To detect localized forgeries, the image is divided into sliding windows. The algorithm determines the local CFA pattern for each window. If a window's pattern contradicts the global image pattern, it is flagged. These windows are then grouped into connected components to reduce noise and assign a confidence score to the detected forgery.
Experimental Results
The researchers evaluated the method using the Raise Dataset (2,715 high-resolution raw images) for qualitative testing and the Trace Database (1,000 images) for quantitative analysis.
Performance and Sensitivity
The proposed bidirectional filters consistently outperformed the original isotropic method, particularly on complex demosaicing algorithms like PPG and VNG. Using the Matthews Correlation Coefficient (MCC), the method achieved a score of 0.610 with bidirectional filters, compared to the 0.518 baseline.
However, the algorithm's sensitivity is highly dependent on the specific demosaicing algorithm used. While it works effectively on Bilinear, AHD, and DCB algorithms, it struggles with AAHD and DHT, which can sometimes "invert" the signal, making sampled pixels appear more like intermediate values.
The "JPEG Wall"
A critical finding for real-world application is the "JPEG wall." Because CFA traces are high-frequency signals, JPEG compression—which discards high-frequency data—tends to erase these forensic traces. Once an image drops below a quality factor of 95, the effectiveness of the algorithm diminishes significantly.
Conclusion and Future Work
The Intermediate Values Algorithm provides a robust way to localize image forgeries by exploiting the mathematical traces of demosaicing. While highly effective on high-quality images, its vulnerability to JPEG compression remains a limitation for social media forensics. Future research may focus on automatically detecting the demosaicing type before analysis and developing automated thresholding techniques to improve detection consistency across various image textures.
Summary updated