Hopfield network-based approach to detect seam-carved images and identify tampered regions

  • Jyh-Da Wei
  • Hui-Jun Cheng
  • Che-Wen Chang
Original Article


Seam carving is a content-aware algorithm for image resizing and tampering. This algorithm assigns an energy map to an image and removes the seams with low energy from the image. By doing this, seam carving makes it possible to reduce the image size and eliminate specific content from images. The detection of seam carving has lately been an important but challenging area of research. In past work, we had proposed a method that involved analyzing optimal patch types to recover seams and thus to detect seam-carved images. This method yielded highly accurate detection results. In this paper, we introduce an auto-associated Hopfield network to determine the optimal patch type for seam recovery. We use the Hebbian learning rule to choose, among candidate patch types, the one that most closely resembles the relevant target pattern. Experiments showed that the retrieval process usually converged within eight iterations and that the converged patterns improved the detection accuracy, e.g., with rates of 95.97 and 98.55% for 20 and 50% seam-carved images respectively. We also used this enhanced patch analysis method to identify the seam-carved regions of a tampered image. Its accuracy for the identification of tampered regions was higher than 70% for images with < 30% seam carving.


Seam carving Hopfield network Hebbian learning Digital forensics 



This work was supported in part by the Ministry of Science and Technology, Taiwan, R.O.C. (Grant Nos. MOST 103-2221-E-182-049 and MOST-106-2221-E-182-075) and Chang Gung Memorial Hospital (Grant No. BMRPB21).

Compliance with ethical standards

Conflict of interest

The authors declare no potential conflicts of interest with respect to the research, authorship, and publication of this article.


  1. 1.
    Dong W, Zhou N, Paul JC, Zhang X (2009) Optimized image resizing using seam carving and scaling. ACM Trans Graph 28(10):125:1–125:10Google Scholar
  2. 2.
    Elliott T (2003) An analysis of synaptic normalization in a general class of hebbian models. Neural Comput 15(4):937–963CrossRefzbMATHGoogle Scholar
  3. 3.
    Fillion C, Sharma G (2010) Detecting content adaptive scaling of images for forensic applications. Proc SPIE: Media Forensics Secur 7541:36–47Google Scholar
  4. 4.
    Galtier MN, Faugeras OD, Bressloff PC (2012) Hebbian learning of recurrent connections: a geometrical perspective. Neural Comput 24(9):2346–2383MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Gonzalez RC, Woods RE (2001) Digital image processing, 2nd edn. Prentice Hall, Englewood CliffsGoogle Scholar
  6. 6.
    Goodall TR, Katsavounidis I, Li Z, Aaron A, Bovik AC (2016) Blind picture upscaling ratio prediction. IEEE Signal Process Lett 23:1801–1805CrossRefGoogle Scholar
  7. 7.
    Jacyna GM, Malaret ER (1989) Classification performance of a hopfield neural network based on a hebbian-like learning rule. IEEE Trans Inf Theory 35(2):263–280MathSciNetCrossRefGoogle Scholar
  8. 8.
    Krizhevsky A, Sutskever I, Hinton GE (2017) Imagenet classification with deep convolutional neural networks. Commun ACM 60(6):84–90CrossRefGoogle Scholar
  9. 9.
    Li ZN, Drew MS, Liu J (2014) Image compression standards. In: Fundamentals of multimedia, 2 edn, chap. 9. Springer, Berlin, pp 281–315Google Scholar
  10. 10.
    Liu Q (2016) An approach to detecting jpeg down-recompression and seam carving forgery under recompression anti-forensics. Pattern Recognit 65:35–46CrossRefGoogle Scholar
  11. 11.
    Liu Q, Chen Z (2014) Improved approaches with calibrated neighboring joint density to steganalysis and seam-carved forgery detection in jpeg images. ACM Trans Intell Syst Technol 5(4):63:1–63:30Google Scholar
  12. 12.
    Liu Q, Sung AH, Qiao M (2011) Neighboring joint density-based jpeg steganalysis. ACM Trans Intell Syst Technol 2(2):16:1–16:16CrossRefGoogle Scholar
  13. 13.
    Lu W, Varna AL, Wu M (2010) Forensic hash for multimedia information. In: SPIE Media Forensics and Security, pp 75410–75419Google Scholar
  14. 14.
    Palmieri F, Zhu J (1995) Self-association and hebbian learning in linear neural networks. IEEE Trans Neural Netw 6(5):1165–1184CrossRefGoogle Scholar
  15. 15.
    Rubinstein M, Gutierrez D, Sorkine O, Shamir A (2010) A comparative study of image retargeting. ACM Trans Graph 29:160:1–160:10CrossRefGoogle Scholar
  16. 16.
    Rubinstein M, Shamir A, Avidan S (2008) Improved seam carving for video retargeting. ACM Trans Graph 27(3):16:1–16:9CrossRefGoogle Scholar
  17. 17.
    Ryu SJ, Lee HY, Lee HK (2013) Detection of content-aware image resizing using seam properties. Appl Mech Mater 284:3074–3078CrossRefGoogle Scholar
  18. 18.
    Sarkar A, Nataraj L, Manjunath BS (2009) Detection of seam carving and localization of seam insertions in digital images. In: Proceedings of 11th ACM workshop on multimedia and security, pp 107–116Google Scholar
  19. 19.
    Schaefer G, Stich M (2003) UCID: an uncompressed color image database. In: Proceedings of SPIE 5307, pp 472–480Google Scholar
  20. 20.
    Shamir A, Avidan S (2007) Seam carving for content aware image resizing. ACM Trans Graph 26(3):107–216CrossRefGoogle Scholar
  21. 21.
    Sheng G, Li T, Su Q, Chen B, Tang Y (2016) Detection of content-aware image resizing based on benfords law. Soft Computing, pp 1–9Google Scholar
  22. 22.
    Shi Y.Q, Chen C, Chen W (2006) A markov process based approach to effective attacking jpeg steganography. In: Lecture notes in computer science, pp 249–264Google Scholar
  23. 23.
    Wang Y, Liu J, Li Y, Yan J, Lu H (2016) Objectness-aware semantic segmentation. In: Proceedings of the 2016 ACM on multimedia conference (ACM MM 2016), pp 307–311Google Scholar
  24. 24.
    Wattanachote K, Shih TK, Chang WL, Chang HH (2015) Tamper detection of jpeg image due to seam modifications. IEEE Trans Inf Forensics Secur 10(12):2477–2491CrossRefGoogle Scholar
  25. 25.
    Wei JD, Lin YJ, Wu YJ (2014) A patch analysis method to detect seam carved images. Pattern Recognit Lett 36:100–106CrossRefGoogle Scholar
  26. 26.
    Wei JD, Lin YJ, Wu YJ, Kang LW (2013) A patch analysis approach for seam carved image detection. In: Proceedings of 40th international conference and exhibition on computer graphics and interactive techniques (ACM SIGGRAPH 2013)Google Scholar
  27. 27.
    Yan B, Yang X, Li K (2014) Efficient image retargeting via adaptive pixel fusion. In: Proceedings of ACM international conference on multimedia, pp 929–932Google Scholar
  28. 28.
    Ye J, Shi YQ (2017) An effective method to detect seam carving. J Inf Secur Appl 35:13–22Google Scholar
  29. 29.
    Yin T, Yang G, Li L, Zhang D, Sun X (2015) Detecting seam carving based image resizing using local binary patterns. Comput Secur 55:130–141CrossRefGoogle Scholar
  30. 30.
    Zhang D, Li Q, Yang G, Li L, Sun X (2017) Detection of image seam carving by using weber local descriptor and local binary patterns. J Inf Secur Appl 36:135–144Google Scholar
  31. 31.
    Zhang D, Yin T, Yang G, Xia M, Li L, Sun X (2017) Detecting image seam carving with low scaling ratio using multi-scale spatial and spectral entropies. J Vis Commun Image Represent 48:281–291CrossRefGoogle Scholar
  32. 32.
    Zhu N, Deng C, Gao X (2016) A learning-to-rank approach for image scaling factor estimation. Neurocomputing 204(C):33–40CrossRefGoogle Scholar

Copyright information

© The Natural Computing Applications Forum 2018

Authors and Affiliations

  1. 1.Department of Computer Science and Information Engineering, School of Electrical and Computer Engineering, College of EngineeringChang Gung UniversityTaoyuanTaiwan
  2. 2.Department of OphthalmologyKeelung Chang Gung Memorial HospitalKeelungTaiwan

Personalised recommendations