Monday, May 17, 2010

Image Error Level Analysis

Image Error Level Analysis is a great online tool for detecting digitally manipulated images. Digital images are ubiquitous. Most cell phones now have a built-in digital camera. Popular internet destinations such as Facebook, Ebay, and dating sites rely almost entirely on digital images. Digital images drive e-commerce, social networking, advertising, dating, and many other web enterprises. Digital images are even admissible in federal and state court in the US. So how do we know if they have been tampered with?

Photo editing software has been available for decades, and it gains more sophisticated capabilities. Everybody knows image editors can be used to tweak the colors of prepared dishes on a recipe web site or enhance photos on dating sites. Adobe Photoshop CS5 has a powerful new tool called "content-aware fill" which is capable of erasing portions of a picture and generating new content to seamlessly patch the missing pieces. One fascinating example can be seen below (images thanks to osici on SomethingAwful). The first image shows the surface of Mars as taken in a series of photographs from a Mars rover. Four rectangular photographs have been stitched together to form a panorama of the Mars surface. Because the camera was not perfectly horizontal, stitching together the images creates a black sawtooth border. The second image has been modified using the content-aware fill tool to generate content to place over the black border. The rocks, dirt, and sky shown in the second photo where there exists only black in the first are generated completely algorithmically. These portions were never part of any picture which was sent back by the rover.



This is very impressive technology which can have many good or bad uses. So how do we know if an image has been tampered with? Aside from noticing small details like a missing shadow or illogical lighting and reflections in the image, the digital encoding of an image file itself can leave many clues. Image Error Level Analysis has an ingenious way of detecting tampered images.

Photographs on the internet are almost always encoded using JPEG compression. This is a lossy compression technique which leaves behind visual artifacts, which act as a signature. Sometimes these artifacts are too subtle to be seen with the naked eye, but image analysis software can detect them. When images are manipulated, often source material from other photos is added in some way. These other photos are also compressed using JPEG compression, and have a slightly different signature. Even edits directly to a single source image often result in the recompression of a portion of the image. This variation in compression level across a single image is a tell-tale indicator that an image has been altered. Image Error Level Analysis is an online tool for detecting if an image has been altered. The user simply supplies a URL to an image, and the program generates a corresponding image which is a mapping of quality level differences.

In the author's words:
"It works by resaving an image at a known quality, and comparing that to the original image. As a jpeg image is resaved over and over again, its image quality decreases. When we resave an image and compare it to the original, we can guess just how many times the image has been resaved. If an image has not been manipulated, all parts of the image should have been saved an equal amount of times. If parts of the image are from different source files, they may have been saved a number of different times, and thus they will stand out as a different colour in the ELA test.

Error level analysis allows you see to see the difference in quality level, represented by brightness. Things which are very bright have been edited most recently, whilst duller parts have been resaved multiple times. This allows you to see not just which parts of the image have been changed, but in what order the changes occurred."


The above image clearly shows where the original photo was digitally manipulated, thus indicating that it is not the original image. This tool does not guarantee conclusive findings, but it can certainly be helpful in detecting manipulated images. Also, the image creator could increase the likelihood of a false negative by monitoring and altering the compression levels. This is definitely a fascinating and well-implemented online tool for attacking a very interesting problem.

3 comments:

  1. This is a very cool tool, which as you point out can be used in ways that have positive and negative impacts. The concept of accurate pictures for data analysis in scientific processes comes to mind (filler data feels like interpolation, which is fine as long as we acknowledge that they are not actual experimental data points).

    Because of the example used, I had to include the following link (sure to bring a tear to your eye): http://xkcd.com/695/

    ReplyDelete
  2. Whoa. I learned something new! The Mars image is insane!

    ReplyDelete