Image Splicing Detection, Localization and Attribution via JPEG Primary Quantization Matrix Estimation and Clustering

Yakun Niu, Benedetta Tondi, Yao Zhao, Rongrong Ni, Mauro Barni

Abstract

This paper presents an end-to-end forensic framework designed to detect image splicing, localize tampered regions, and perform donor attribution. By estimating the primary JPEG quantization matrix ($Q_1$) at a block level, the system identifies inconsistencies even in complex "double JPEG" scenarios where both donor and target images were previously compressed. The proposed multi-stage pipeline leverages a Convolutional Neural Network (CNN) for $Q_1$ estimation, a specialized VGG-16 model to predict the number of source clusters, and spectral clustering to distinguish between multiple source images within a single composite JPEG file.

Introduction

Image splicing—the process of copy-pasting regions from one or more "donor" images into a "target" background—is a prevalent form of digital manipulation. When the resulting composite is saved as a JPEG, it undergoes a second round of compression, creating "double-compression" artifacts. Traditional forensic tools often search for inconsistencies in these artifacts to identify tampered regions. However, most existing methods struggle with two specific challenges: the "DJPEG vs. DJPEG" scenario, where both the donor and target were previously compressed, and the "attribution gap," where tools fail to distinguish if multiple spliced regions originated from the same or different donors.

Illustration of an image splicing scenario involving multiple donor regions, each characterized by a distinct primary quantization matrix ($Q_1$).

This research addresses these gaps by using the primary quantization matrix as a unique "fingerprint" for each source image, allowing for both precise localization and the tracing of an image's phylogeny.

Methodology

The system employs a multi-stage pipeline to process a suspected JPEG image and output a localization map that attributes regions to their respective donors.

The proposed forensic pipeline, from local $Q_1$ estimation to final donor attribution and localization map.

1. Local $Q_1$ Estimation

The system first utilizes a pre-trained CNN to estimate the primary quantization matrix ($Q_1$) for every $8 \times 8$ block in the image. This matrix serves as the fundamental feature for distinguishing between different source materials.

2. Estimating the Number of Donors ($k$)

Determining the number of sources ($k$) is a critical step for clustering. Because standard statistical methods like eigenvalue gap analysis proved unreliable for noisy quantization data, the authors developed a VGG-16 based CNN. This model analyzes the tensor of estimated $Q_1$ values across the image to predict the number of clusters (ranging from $k=1$ to 4).

3. Spectral Clustering and Refinement

Once $k$ is determined, blocks are grouped using Spectral Clustering (SC). SC was selected for its ability to handle high-dimensional, noisy data more effectively than standard K-means. To improve spatial coherence, the system applies Morphological Reconstruction (MR), using erosion and conditional dilation to remove isolated noise blocks and clean up "rings" often found at spliced edges.

Experimental Results

The framework was evaluated using the RAISE8K dataset, alongside benchmark datasets from Bianchi & Piva and Wang et al. To ensure the CNNs were not simply memorizing camera-specific artifacts, the Dresden Dataset was used for mismatched testing conditions.

  • Detection and Localization: The system achieved a True Positive Rate (TPR) of 0.97 at a False Positive Rate (FPR) of 0.05. In difficult "Non-Aligned" JPEG scenarios, it reached a Matthews Correlation Coefficient (MCC) of 0.64, significantly outperforming the state-of-the-art baseline of 0.47.
  • Donor Attribution: The system successfully distinguished between multiple donors with an average Normalized Mutual Information (NMI) of 0.48. While an NMI of 1.0 represents perfect clustering, 0.48 indicates a highly usable result in complex real-world forensic scenarios.
  • Robustness: The method remained effective even when the primary compression quality was higher than the secondary ($QF_1 > QF_2$), a scenario where most other tools fail because the second compression "washes out" the traces of the first.

Conclusion and Future Work

This research provides a robust solution for donor attribution in JPEG splicing forensics. By focusing on raw quantization matrix estimation rather than standard Quality Factors, the system can handle non-standard JPEGs produced by software like Adobe Photoshop.

Future work will focus on expanding the system's capacity beyond four clusters to handle more complex "mega-composites" and improving performance on small spliced regions (below $64 \times 64$ pixels), where statistical evidence is currently limited. Additionally, integrating spatial information more deeply into the clustering process could further enhance localization accuracy.

Summary updated

BibTeX
@article{niu2021image,
  author = {Yakun Niu and Benedetta Tondi and Yao Zhao and Rongrong Ni and Mauro Barni},
  title = {{Image Splicing Detection, Localization and Attribution via JPEG Primary Quantization Matrix Estimation and Clustering}},
  journal = {IEEE Trans. Inf. Forensics Secur.},
  year = {2021},
  doi = {10.1109/tifs.2021.3129654},
}
Figure