2 iCTLab s.r.l. Spinoff of University of Catania, Italy
3 Banca d'Italia, Rome, Italy
4 Department of Mathematics and Computer Science, University of Cagliari, Via Ospedale 72, Cagliari 09124, Italy
battiato@dmi.unict.it, oliver.giudice@bancaditalia.it, francesco.guarnera@unict.it, puglisi@unica.it
title={CNN-based first quantization estimation of double compressed JPEG images},
author={Battiato, Sebastiano and Giudice, Oliver and Guarnera, Francesco and Puglisi, Giovanni},
journal={Journal of Visual Communication and Image Representation},
pages={103635}
year={2022}
}
This program is free software: it is distributed WITHOUT ANY WARRANTY.
If you are using this software, please cite:
Battiato, Sebastiano and Giudice, Oliver and Guarnera, Francesco and Puglisi, Giovanni: “CNN-based first quantization estimation of double compressed JPEG images", Journal of Visual Communication and Image Representation, 2022
The software estimates the first 15 quantization factors (in zig-zag order) of an aligned Double compressed JPEG image.
Given the double JPEG compressed image I, the software read the second quantization matrix Q2 from I and for each second quantization factor q2 select the rigth trained model to predict the first quantization factor q1. The method is built with an ensable of 2 network trained with different items which calculate the averages of softmax to choose the q1 predicted.
IMPORTANT: the models were trained through items with a maximum value of 22 between the first 15 quantization factors q1 and then the prediction will give always values between 1 and 22. To test the same method with higher values you need to re-train the models. If you want to re-train the models please contact one of the author to ask the right code for training.
128_128.jpg: 128X128 image compressed with QF1=60 e QF2=90
4288_2848.jpg: 4288X2484 image compressed with QF1=60 e QF2=90
The JPEG files (128_128.jpg and 4288_2848.jpg) have the first 15 quantization factors (in zig-zag order) equal to [13, 9, 10, 11, 10, 8, 13, 11, 10, 11, 14, 14, 13, 15, 19]
cnn_v1.py: python file to predict the quantization factor (function get_coefficients_first_compression in the main).
jpeg: executable file for DCT values extraction from file (without IDCT); it needs the executable permissions.
We tested our codes on Python 2.7 and Python 3 under Ubuntu 16.04 and 18.04 (64 bit).
Just launch the installation of requirements.txt and then execute:
python cnn_v1.py -i image_name.jpg