Journal of Mathematical Imaging and Vision

, Volume 54, Issue 3, pp 269–286 | Cite as

Quantization-Unaware Double JPEG Compression Detection

  • Ali Taimori
  • Farbod Razzazi
  • Alireza Behrad
  • Ali Ahmadi
  • Massoud Babaie-Zadeh


The current double JPEG compression detection techniques identify whether or not an JPEG image file has undergone the compression twice, by knowing its embedded quantization table. This paper addresses another forensic scenario in which the quantization table of a JPEG file is not explicitly or reliably known, which may compel the forensic analyst to blindly reveal the recompression clues. To do this, we first statistically analyze the theory behind quantized alternating current (AC) modes in JPEG compression and show that the number of quantized AC modes required to detect double compression is a function of both the image’s block texture and the compression’s quality level in a fresh formulation. Consequently, a new double compression detection algorithm is proposed that exploits footprints introduced by all non-zero and zero AC modes based on Benford’s law in a low-dimensional representation via PCA. Then, some evaluation frameworks are constructed to assess the robustness and generalization of the proposed method on various textured images belonging to three standard databases as well as different compression quality level settings. The average \(F_{1}\text {-measure}\) score on all tested databases in the proposed method is about 74 % much better than the state-of-the-art performance of 67.7 %. The proposed algorithm is also applicable to detect double compression from a JPEG file and localize tampered regions in actual image forgery scenarios. An implementation of our algorithms and used databases are available upon request to fellow researchers.


Double JPEG compression Image forgery detection Quality level Quantized AC modes  Sparse signal Texture 


  1. 1.
    Berger, A., Hill, T.P.: A basic theory of Benford’s law. Probab. Surv. 8, 1–126 (2011)CrossRefMathSciNetMATHGoogle Scholar
  2. 2.
    Bianchi, T., Piva, A.: Detection of nonaligned double JPEG compression based on integer periodicity maps. IEEE Trans. Inf. Forensics Secur. 7(2), 842–848 (2012)CrossRefGoogle Scholar
  3. 3.
    Bianchi, T., Piva, A.: Image forgery localization via block-grained analysis of JPEG artifacts. IEEE Trans. Inf. Forensics Secur. 7(3), 1003–1017 (2012)CrossRefGoogle Scholar
  4. 4.
    Chang, C.C., Lin, C.J.: LIBSVM: a library for support vector machines. ACM Trans. Intell. Syst. Technol. 2(3), 27 (2011)CrossRefGoogle Scholar
  5. 5.
    Chen, C., Shi, Y.Q., Su, W.: A machine learning based scheme for double JPEG compression detection. In: IEEE 19th international conference on pattern recognition (ICPR), pp. 1–4 (2008)Google Scholar
  6. 6.
    Dong, L., Kong, X., Wang, B., You, X.: Double compression detection based on Markov model of the first digits of DCT coefficients. In: IEEE 6th international conference on image and graphics (ICIG), pp. 234–237 (2011)Google Scholar
  7. 7.
    Fan, Z., de Queiroz, R.L.: Identification of bitmap compression history: JPEG detection and quantizer estimation. IEEE Trans. Image Process. 12(2), 230–235 (2003)CrossRefGoogle Scholar
  8. 8.
    Farid, H.: Digital image ballistics from JPEG quantization. Technical Report TR2006-583, Department of Computer Science, Dartmouth College (2006)Google Scholar
  9. 9.
    Farid, H.: Exposing digital forgeries from JPEG ghosts. IEEE Trans. Inform. Forensics. Secur. 4(1), 154–160 (2009)CrossRefMathSciNetGoogle Scholar
  10. 10.
    Farid, H.: Image forgery detection. IEEE Signal Process. Mag. 26(2), 16–25 (2009)CrossRefGoogle Scholar
  11. 11.
    Haralick, R.M., Shanmugam, K., Dinstein, I.H.: Textural features for image classification. IEEE Trans. Syst. Man Cybern. SMC–3(6), 610–621 (1973)CrossRefGoogle Scholar
  12. 12.
    Hasimoto-Beltrán, R., Baqai, S., Khokhar, A.: Transform domain inter-block interleaving schemes for robust image and video transmission in ATM networks. J. Vis. Commun. Image Represent. 15(4), 522–547 (2004)CrossRefGoogle Scholar
  13. 13.
    He, H., Garcia, E.A.: Learning from imbalanced data. IEEE Trans. Knowl. Data Eng. 21(9), 1263–1284 (2009)CrossRefGoogle Scholar
  14. 14.
    Huang, F., Huang, J., Shi, Y.Q.: Detecting double JPEG compression with the same quantization matrix. IEEE Trans. Inform. Forensics Secur. 5(4), 848–856 (2010)CrossRefGoogle Scholar
  15. 15.
    Jain, R., Kasturi, R., Schunck, B.G.: Machine Vision. McGraw-Hill, Inc., New York (1995)Google Scholar
  16. 16.
    Jolliffe, I.T.: Principal Component Analysis, 2nd edn. Springer Series in Statistics, Springer (2002)MATHGoogle Scholar
  17. 17.
    Kornblum, J.D.: Using JPEG quantization tables to identify imagery processed by software. The 8th digital forensic research workshop. Digit. Investig. 5, S21–S25 (2008)CrossRefGoogle Scholar
  18. 18.
    Lai, S., Böhme, R.: Block convergence in repeated transform coding: JPEG-100 forensics, carbon dating, and tamper detection. In: IEEE 38th international conference on acoustics, speech and signal processing (ICASSP), pp. 3028–3032. IEEE (2013)Google Scholar
  19. 19.
    Li, B., Ng, T.T., Li, X., Tan, S., Huang, J.: Revealing the trace of high-quality JPEG compression through quantization noise analysis. IEEE Trans. Inf. Forensics Secur. 10(3), 558–573 (2015)CrossRefGoogle Scholar
  20. 20.
    Li, B., Shi, Y.Q., Huang, J.: Detecting doubly compressed JPEG images by using mode based first digit features. In: IEEE 10th workshop on multimedia signal processing, pp. 730–735 (2008)Google Scholar
  21. 21.
    Lin, X.H., Zhao, Y.Q., Huang, J.: Detection of tampered region for JPEG images by using mode-based first digit features. EURASIP J. Adv. Signal. Process. 2012, 1–10 (2012)CrossRefMATHGoogle Scholar
  22. 22.
    Lin, Z., He, J., Tang, X., Tang, C.K.: Fast, automatic and fine-grained tampered JPEG image detection via DCT coefficient analysis. Pattern Recognit. 42(11), 2492–2501 (2009)CrossRefMATHGoogle Scholar
  23. 23.
    Liu, Q., Sung, A.H., Qiao, M.: A method to detect JPEG-based double compression. In: The 8th international conference on advances in neural networks, lecture notes in computer science, Part II, pp. 466–476 (2011)Google Scholar
  24. 24.
    Liu, Q., Sung, A.H., Qiao, M.: Neighboring joint density-based JPEG steganalysis. ACM Trans. Intell. Syst. Technol. 2(2), 16 (2011)CrossRefGoogle Scholar
  25. 25.
    Luo, W., Huang, J., Qiu, G.: JPEG error analysis and its applications to digital image forensics. IEEE Trans. Inf. Forensics Secur. 5(3), 480–491 (2010)CrossRefGoogle Scholar
  26. 26.
    Mahdian, B., Saic, S.: Detecting double compressed JPEG images. In: IEEE 3rd international conference on crime detection and prevention, pp. 1–6 (2009)Google Scholar
  27. 27.
    Milani, S., Tagliasacchi, M., Tubaro, S.: Discriminating multiple JPEG compression using first digit features. In: IEEE 37th international conference on acoustics, speech and signal processing (ICASSP), pp. 2253–2256 (2012)Google Scholar
  28. 28.
    Narayanan, G., Shi, Y.Q.: A statistical model for quantized AC block DCT coefficients in JPEG compression and its application to detecting potential compression history in bitmap images. In: The 9th international workshop on digital watermarking, lecture notes in computer science, vol. 6526, pp. 75–89 (2011)Google Scholar
  29. 29.
    Olmos, A., Kingdom, F.A.A.: A biologically inspired algorithm for the recovery of shading and reflectance images. Perception 33(12), 1463–1473 (2004)CrossRefGoogle Scholar
  30. 30.
    Pérez-González, F., Heileman, G.L., Abdallah, C.T.: Benford’s law in image processing. In: IEEE international conference on image processing (ICIP), vol. 1, pp. I-405–I-408 (2007)Google Scholar
  31. 31.
    Pevný, T., Fridrich, J.: Detection of double-compression in JPEG images for applications in steganography. IEEE Trans. Inf. Forensics Secur. 3(2), 247–258 (2008)CrossRefGoogle Scholar
  32. 32.
    Piva, A.: An overview on image forensics. ISRN Signal Processing p. article ID 496701 (2013)Google Scholar
  33. 33.
    Popescu, A.C., Farid, H.: Statistical Tools for Digital Forensics. In: The 6th international workshop on information hiding, lecture notes in computer science, vol. 3200, pp. 128–147 (2005)Google Scholar
  34. 34.
    Schaefer, G., Stich, M.: UCID: an uncompressed color image database. Storage Retr. Methods Appl. Multimed. 5307, 472–480 (2004)Google Scholar
  35. 35.
    Sencar, H.T., Memon, N.: Identification and recovery of JPEG files with missing fragments. Digit. Investig. 6, S88–S98 (2009)CrossRefGoogle Scholar
  36. 36.
    Taimori, A., Razzazi, F., Behrad, A., Ahmadi, A., Babaie-Zadeh, M.: A proper transform for satisfying Benford’s law and its application to double JPEG image forensics. In: IEEE international symposium on signal processing and information technology (ISSPIT), pp. 000240–000244 (2012)Google Scholar
  37. 37.
    Wallace, G.K.: The JPEG still picture compression standard. IEEE Trans. Consum. Electronics 38(1), 30–44 (1992)CrossRefGoogle Scholar
  38. 38.
    Zach, F., Riess, C., Angelopoulou, E.: Automated image forgery detection through classification of JPEG ghosts. In: Proceedings of joint 34th DAGM and 36th OAGM symposium, lecture notes in computer science, vol. 7476, pp. 185–194 (2012)Google Scholar

Copyright information

© Springer Science+Business Media New York 2015

Authors and Affiliations

  • Ali Taimori
    • 1
  • Farbod Razzazi
    • 1
  • Alireza Behrad
    • 2
  • Ali Ahmadi
    • 3
  • Massoud Babaie-Zadeh
    • 4
  1. 1.Department of Electrical and Computer Engineering, Science and Research BranchIslamic Azad UniversityTehranIran
  2. 2.Faculty of EngineeringShahed UniversityTehranIran
  3. 3.Department of Electrical and Computer EngineeringK. N. Toosi University of TechnologyTehranIran
  4. 4.Department of Electrical EngineeringSharif University of TechnologyTehranIran

Personalised recommendations