Forgery Detection by Internal Positional Learning of Demosaicing Traces

Quentin Bammey, Rafael Grompone von Gioi, Jean-Michel Morel

Introduction

Digital image forensics faces a constant battle against increasingly sophisticated manipulation techniques, such as splicing and inpainting. While these edits may appear seamless to the human eye, they often disrupt the underlying physical and statistical properties of the image. One such property is the demosaicing trace—a subtle, periodic "fingerprint" left by the camera's sensor and processing pipeline.

A forged image of a red panda where cloned regions (ears) have been added.

Most digital cameras use a Color Filter Array (CFA), typically a Bayer pattern, to capture light. Because each pixel only records one color (Red, Green, or Blue), the missing colors must be interpolated through demosaicing. This process creates a 2x2 periodic pattern across the image. When a portion of an image is moved or altered, this pattern is typically broken or shifted, providing a cue for forgery detection.

The 4Point Framework

The researchers introduce 4Point (Forensics with Positional Internal Training), an unsupervised method designed to detect these inconsistencies with high robustness. The framework relies on two core innovations:

1. Positional Learning

Standard Convolutional Neural Networks (CNNs) are translation-invariant, meaning they do not naturally account for a pixel's absolute position. To overcome this, 4Point "forces" the network to learn the pixel's position modulo-2 (its specific location within the 2x2 Bayer grid). By doing so, the network is compelled to identify the local demosaicing traces as the primary indicator of spatial coordinates.

2. Internal Learning

The most significant contribution of this work is the use of "internal learning." Rather than relying on a static model trained on a broad dataset, 4Point fine-tunes itself on the specific test image being analyzed. Since the majority of a forged image is usually authentic, the model learns the specific demosaicing "rules" of that unique image—accounting for its specific noise levels and compression history.

Visualization of detected demosaicing grids. The forged regions show different grid alignments (colors) compared to the authentic background.

When the model encounters a forged region, the previously learned "rules" no longer apply, resulting in a high prediction error that flags the manipulation.

Robustness and Performance

A major challenge in demosaicing-based forensics is post-processing, particularly JPEG compression, which can smudge these delicate traces. 4Point addresses this by training on images with various JPEG grid alignments, forcing the model to ignore 8x8 JPEG artifacts and focus on the 2x2 color mosaic.

In evaluations using benchmarks like the Dresden Image Database, Korus Dataset, and Trace Dataset, 4Point demonstrated superior performance:

  • Accuracy: On the Trace dataset, it achieved a Matthews Correlation Coefficient (MCC) of 0.709, outperforming the previous best of 0.682.
  • Compression Resilience: Unlike previous methods that fail below JPEG quality 95, 4Point remains effective down to quality 90.
  • Real-world Application: It outperformed existing tools like Noiseprint on complex datasets involving various camera models, particularly Nikon and Sony devices.

Limitations

Despite its strengths, 4Point has limitations. Significant downsampling can permanently erase demosaicing traces, rendering the method ineffective. Additionally, there is a statistical 25% chance (1-in-4) that a forged region might accidentally align perfectly with the original grid. Finally, the internal fine-tuning process makes the method computationally more intensive than standard feed-forward networks, as the model must be optimized for every image it analyzes.

Conclusion

By combining positional learning with image-specific internal adaptation, 4Point represents a significant step forward in unsupervised image forensics. It provides a robust way to detect "invisible" forgeries even in the presence of common post-processing operations, moving closer to a reliable tool for verifying digital authenticity.

Summary updated

BibTeX
@inproceedings{bammey2022forgery,
  author = {Quentin Bammey and Rafael Grompone von Gioi and Jean-Michel Morel},
  title = {{Forgery Detection by Internal Positional Learning of Demosaicing Traces}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2022},
  doi = {10.1109/wacv51458.2022.00109},
}
Figure