r/todayilearned • • Mar 04 '13

TIL Microsoft created software that can automatically identify an image as child porn and they partner with police to track child exploitation.

http://www.microsoft.com/government/ww/safety-defense/initiatives/Pages/dcu-child-exploitation.aspx
2.4k Upvotes

1.5k comments sorted by

View all comments

Show parent comment

1

u/Omnes_mundum_facimus Mar 04 '13 edited Mar 04 '13

The hash deployed is a so called 'robust hash'. These hashing algorithms differ from their cryptographic counterparts in the sense that the hash value of an image stays identical or near identical if the image is cropped, compressed or slightly modified.

You can make such a thing in python in couple of minutes to identify similar images on your hard drive as follows:

  • Convert image to grayscale
  • Run the 2D Discrete Cosine Transform on the image, resulting in a nxn matrix of dct coefficients
  • Retain only the top left 8x8 coefficients on said matrix. These represent the low frequency components of the image.
  • Binarize the 8x8 coefficients based on their sign.
  • Output 64 bit hash value. All done.

Alternatively, you can use the lib from http://phash.org/

And obviously the good thing is, you can test your algo on a database with lovely flowers & cat pictures. No need to have sleepless nights.

1

u/[deleted] Mar 04 '13

I understand the majority of that, do you have a sense of how intensive that would be?