10

I would like to check JPG files if they were manipulated to change the content.

What I consider NOT photoshopped:

  • Cropping
  • Rotating
  • (Scaling)
  • Image resolution
  • Automatic changes smartphones might make

What I consider photoshopping:

  • Adding a new image on top of parts of the old image
  • Changing text of a part of an image

How can this automatically be checked?

(And: Are there ready-to-use libraries for it?)

Martin Thoma
  • 19,540
  • 36
  • 98
  • 170

2 Answers2

3

Error Level Analysis as described Error Level Analysis, found at https://github.com/afsalashyana/FakeImageDetection seems to be one seems to be one way:

You exploit that local compression ratios might be different. And it seems to be possible to train neural networks on it.

I didn't find a paper which says how well this works so far

Martin Thoma
  • 19,540
  • 36
  • 98
  • 170
1

Actually I'm currently not working on this area but I remember something from past that may help you. JPG files use quantization, it is really difficult for forgery detection but I suggest you reading the following paper.

Performance analysis of forgery detection of JPEG image compression

The proposed forensic algorithm to discriminate between original and forged regions in JPEG images, under the hypothesis that the tampered image presents a double JPEG compression, either aligned (A-DJPG) or nonaligned (NA-DJPG). Unlike previous approaches, the proposed algorithm does not need to manually select a suspect region in order to test the presence or the absence of double compression artifacts. Based on an improved and unified statistical model characterizing the artifacts that appear in the presence of both A-DJPG or NA-DJPG, the proposed algorithm automatically computes a likelihood map indicating the probability for each 8 × 8 discrete cosine transform block of being doubly compressed. The validity of the proposed approach has been assessed by evaluating the performance of a detector based on thresholding the likelihood map, considering different forensic scenarios. The effectiveness of the proposed method is also confirmed by tests carried on realistic tampered images. An interesting property of the proposed Bayesian approach is that it can be easily extended to work with traces left by other kinds of processing.

Green Falcon
  • 14,308
  • 10
  • 59
  • 98