Resampling detection of recompressed images via dual-stream convolutional neural network

Gang Cao, Antao Zhou, Xianglin Huang, Gege Song, Lifang Yang, Yonggui ZhuarXiv 2019

TL;DR

This paper introduces a dual-stream Convolutional Neural Network (CNN) designed to detect image resampling (like resizing or rotating) even after the image has been recompressed with JPEG. By using a specialized noise extraction layer and an interleaved feature fusion strategy, the model outperforms existing state-of-the-art detectors, particularly in challenging scenarios where high-quality JPEG compression masks manipulation traces.

What Problem Does This Paper Address?

In the world of image forensics, detecting "splicing"—where a part of one image is pasted into another—often relies on finding traces of resampling. When a forger scales or rotates a fragment to make it fit a new scene, they leave behind subtle periodic statistical correlations between pixels.

However, most real-world forged images are saved as JPEGs. JPEG compression is the natural enemy of forensic analysts: it introduces its own blocking artifacts that often "smother" the delicate resampling traces. While existing methods work well on uncompressed or high-quality images, they struggle significantly when the primary or post-processing JPEG quality is medium to low. The authors aim to bridge this gap by creating a robust detector that can "see through" JPEG recompression.

Methods

The authors propose a novel CNN architecture tailored for the "residual domain" rather than raw pixel values.

  1. Noise Extraction Layer: Instead of letting the network learn everything from scratch, the first layer uses fixed, low-order high-pass filters (see Figure 2 below). These filters calculate the difference between adjacent pixels in horizontal and vertical directions. This suppresses the actual image content (like a face or a tree) and highlights the "noise" where manipulation traces hide.

    Figure 2. Low-order highpass filters used in the noise extraction layer of (a) horizontal and (b) vertical streams.
  2. Dual-Stream Architecture: The network splits into two parallel pipelines: a Horizontal Stream and a Vertical Stream. This allows the model to independently capture directional resampling artifacts.

  3. Interleaved Stream: This is the "secret sauce." To capture the correlation between horizontal and vertical features, the authors introduce an interleaved stream that fuses features from the two main pipelines, processes them, and then feeds them back. This cooperative learning ensures the network understands how traces interact across the entire image grid.
  4. Classification: The final features are pooled and passed to a Sigmoid layer for binary detection (Is it resampled?) or a Softmax layer for parameter estimation (By how much was it scaled?).
Figure 1. Proposed dual-stream CNN-based resampling detector. H1-H5, I1-I4 and V1-V5 denote the convolution layers of horizontal, interleaved and vertical streams, respectively. GAP means global average pooling.

Datasets

  • ALASKA Steganography Challenge: Used as the primary source. The authors took 5,000 RAW images, divided them into 512x512 sub-images, and applied various resampling and JPEG compression settings to create a massive training set of 35,000 images.
  • Dersern Dataset: Used to test the model's generalization ability. This ensures the model isn't just "memorizing" the quirks of one specific camera sensor from the ALASKA set.
  • Wild Forensics Dataset: A collection of real-world forged images used to verify the model's performance in detecting actual image splicing.

Key Insights and Ideas

  • Residuals over Pixels: The most important insight is that resampling traces are "irrelevant to image content." By forcing the network to look at prediction residuals (the difference between a pixel and its neighbor), the SNR (Signal-to-Noise Ratio) of the manipulation trace is significantly improved.
  • Directional Sensitivity: Resampling isn't always uniform. By separating horizontal and vertical streams, the model can detect traces that might be stronger in one dimension than the other.
  • Interleaving for Fusion: Simply concatenating features at the end of a network is common, but interleaving them during the feature extraction process allows the model to learn complex spatial correlations that late-stage fusion might miss.

Key Results

The proposed method was compared against the previous state-of-the-art: Bayar’s constrained CNN.

  • Superiority at Low Quality: In the difficult case of a JPEG Quality Factor (QF) of 50, the proposed method improved detection accuracy by nearly 4% over Bayar’s method for both upsampling and downsampling.
  • Small Image Robustness: On tiny 64x64 image blocks, the model maintained an accuracy of 92.49% for upsampling, whereas the baseline dropped to 88.19%.
  • Parameter Estimation: The model is remarkably good at guessing the exact scaling factor. For an image scaled by 200%, the confusion matrix shows a staggering 99.58% accuracy.
  • Generalization: While accuracy dropped slightly on the unseen Dersern dataset (from ~99% to ~85-90%), it remained significantly higher than the baseline, proving the architecture is robust across different camera types.

Limitations and Future Work

The authors acknowledge a few key hurdles:

  • Complex Chains: If an image undergoes a long chain of post-processing (e.g., sharpening, then blurring, then multiple recompressions), the resampling traces may become truly unrecoverable.
  • Anti-Forensics: The model is not currently designed to defeat active anti-forensic techniques specifically designed to fool CNNs.
  • Splicing Scope: The method detects the resampled area of a splice. If a forger manages to splice an image without any resampling (a rare but possible feat), this specific detector would not flag it.

Future work aims to extend this architecture to identify more complex operation chains and improve robustness against intentional anti-forensic attacks.

Summary updated

BibTeX
@misc{cao2019resampling,
  author = {Gang Cao and Antao Zhou and Xianglin Huang and Gege Song and Lifang Yang and Yonggui Zhu},
  title = {{Resampling detection of recompressed images via dual-stream convolutional neural network}},
  year = {2019},
  eprint = {1901.04637},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1901.04637},
}
Figure