Double JPEG Compression Detection by Exploring the Correlations in DCT Domain

Pengpeng Yang, Rongrong Ni, Yao Zhao

Introduction

Digital image forensics plays a vital role in verifying the authenticity of visual media. A common indicator of image manipulation is "double JPEG compression." Since most editing tools save images in JPEG format, a tampered image typically undergoes compression twice: once during initial capture and again after modification. Detecting this process is particularly challenging when the first compression quality factor ($Q_1$) differs from the second ($Q_2$), especially in cases where $Q_1 > Q_2$. This paper proposes a novel machine-learning framework that leverages multi-directional and frequency-specific (MODE) correlations in the Discrete Cosine Transform (DCT) domain to robustly identify double-compressed images.

Methodology

The core of the proposed approach lies in extracting highly discriminative features from quantized DCT coefficients. The authors implement a two-pronged strategy to capture artifacts left by re-compression:

  1. Global Multi-Directional Correlations: To detect shifts in how adjacent DCT coefficients relate, 12 directional high-pass filters (using 5x5 windows) are applied to the DCT matrix. Transition probability matrices are then computed from these filtered outputs to quantify directional correlation changes.
  2. Local MODE-based Correlations: Recognizing that global features can be masked by heavy secondary compression, the authors analyze specific frequencies across DCT blocks, termed "MODEs." The first 20 MODEs in zig-zag order are used to build sub-matrices, from which transition probabilities are extracted.
Proposed feature extraction framework showing global (top) and local MODE-based (bottom) correlation analysis.

Due to the high dimensionality of the raw features (up to 17,010 for MODEs), Principal Component Analysis (PCA) is employed to reduce the feature set to 1,300 dimensions. These are then fed into a Support Vector Machine (SVM) classifier with a 2nd-degree polynomial kernel for final classification.

Results and Discussion

The performance was evaluated using the UCID dataset, with images compressed across a wide range of quality factors ($Q \in \{50, \dots, 95\}$). The results demonstrate that the multi-directional approach consistently outperforms standard baseline methods.

A key finding is the effectiveness of MODE-based features in the "hard" scenario where $Q_1 > Q_2$. In these cases, a low-quality second compression often overwrites global artifacts. However, local frequency analysis (MODEs) preserves subtle traces of the initial compression. Visual analysis of these features reveals a clear distinction between single and double compressed instances.

Comparison of feature values for single and double compressed images across different quality factor combinations.

In the most difficult test case ($Q_1 = 95$), the MODE-based method achieved accuracies between 79% and 100%, significantly outperforming global multi-directional analysis (72%–100%) and slightly exceeding Benford’s Law-based techniques.

Conclusion

This research highlights that analyzing DCT domain correlations across multiple directions and isolated frequencies provides a powerful tool for image forensics. While global features are effective for many scenarios, MODE-based local features are essential for overcoming the $Q_1 > Q_2$ challenge. Future work will focus on fusing these global and local perspectives into a unified detector to further enhance robustness in diverse forensic environments.

Summary updated

BibTeX
@inproceedings{yang2018double,
  author = {Pengpeng Yang and Rongrong Ni and Yao Zhao},
  title = {{Double JPEG Compression Detection by Exploring the Correlations in DCT Domain}},
  booktitle = {APSIPA},
  year = {2018},
  doi = {10.23919/apsipa.2018.8659485},
}
Figure