Training Data Improvement for Image Forgery Detection using Comprint

Hannes Mareen, Dante Vanden Bussche, Glenn Van Wallendael, Luisa Verdoliva, Peter Lambert

TL;DR

This paper investigates how to optimize training data for Comprint, a tool that detects image forgeries by identifying inconsistencies in JPEG compression "fingerprints." The researchers discovered that while including low-quality images in training doesn't significantly help, incorporating recompression examples is crucial for making the system robust enough for real-world use on platforms like social media.

What Problem Does This Paper Address?

In the era of deepfakes and sophisticated Photoshop edits, verifying image authenticity is a massive challenge. Most digital images are stored as JPEGs, a format that leaves behind specific mathematical traces (fingerprints) based on the "Quality Factor" (QF) used during saving.

When someone manipulates an image—say, by splicing an object from one photo into another—the forged area often has a different compression history than the original background. Comprint is a method designed to detect these invisible boundaries. However, the authors noted a gap: we don't fully understand how the composition of the training data affects the model's accuracy and its ability to handle "recompression" (the common practice of an image being saved multiple times, which often happens when uploading to social media).

Methods

The researchers used a Convolutional Neural Network (CNN) architecture designed to extract "comprints" (compression fingerprints). The process involves three main stages:

  1. Siamese Training: The CNN is trained using pairs of image patches. If the patches have the same compression, the network learns to minimize the "distance" between their fingerprints; if they are different, it maximizes that distance.
  2. Feature Extraction: Once trained, the model extracts co-occurrence-based features from the image.
  3. Localization: These features are fed into an Expectation-Maximization (EM) algorithm, which clusters the pixels into "pristine" or "forged" regions, creating a heatmap that highlights the manipulation.

The study specifically compared three training regimes:

  • HighQF: Trained only on high-quality JPEGs (QF 50-90).
  • WideQF: Trained on a broader range, including low-quality JPEGs (QF 20-90).
  • HighQFRec: Trained on high-quality JPEGs with a 50% chance of recompression.

Datasets

The study utilized the RAISE dataset, a collection of 8,000 high-resolution raw images designed for digital forensics.

  • Training: 1,000 images (resized to 200x200 and grayscaled).
  • Validation: 100 images.
  • Testing: 50 images, used to create 1000x1000 "composite" test cases where one half of the image has a QF exactly 10 points higher than the other half.

Key Insights and Ideas

  • The "Low-Quality" Diminishing Return: Counter-intuitively, adding low-quality images (WideQF) to the training set did not improve the detection of low-quality forgeries. In fact, it actually decreased performance on high-quality images. The takeaway: stick to high-quality training data for general accuracy.
  • The Recompression Wall: Standard models (HighQF) are incredibly fragile. Even a very light recompression (QF 95, which is visually nearly perfect) causes the detection accuracy to plummet.
  • Simulating the "Wild": By simply adding recompression examples to the training set (HighQFRec), the model became significantly more robust. It could accurately detect forgeries even if the final image was recompressed down to a QF of 60.

Key Results

The researchers used the Matthew’s Correlation Coefficient (MCC) to measure accuracy (where 1 is a perfect prediction).

  • Without Recompression: All three models performed well on high QF pairs, though the "HighQFRec" model saw a slight, acceptable dip in performance compared to the pure "HighQF" model.
  • With Recompression: The "HighQF" model's MCC dropped to near zero (useless) as soon as any recompression was applied. In contrast, the HighQFRec model maintained high accuracy until the recompression became very aggressive (below QF 60).
  • Recommendation: For a tool intended for smartphone users or social media verification, training with recompression is non-negotiable.

Limitations and Future Work

While insightful, the paper notes a few limitations:

  • Grayscale Only: The current analysis was limited to grayscale images to simplify the fingerprinting process; color images may introduce more complexity.
  • Dataset Scale: The training was performed on a relatively small set of 1,000 images.
  • Fixed Forgery Types: The testing focused on simple "half-and-half" composites with a fixed QF difference of 10. Real-world forgeries are often much more complex in shape and varying in compression differences.

Future work will likely focus on testing these models "in the wild" against the specific compression algorithms used by platforms like Facebook, Instagram, and WhatsApp.

Summary updated

BibTeX
@inproceedings{mareen2023training,
  author = {Hannes Mareen and Dante Vanden Bussche and Glenn Van Wallendael and Luisa Verdoliva and Peter Lambert},
  title = {{Training Data Improvement for Image Forgery Detection using Comprint}},
  booktitle = {ICCE},
  year = {2023},
  doi = {10.1109/icce56470.2023.10043503},
}
Figure