Live data from Hacker News

Perceptual Image Hashing

bertolami.com

1–10 of 35 posts

Re: Perceptual Image Hashing

#2
Very interesting approach.

I have worked with image feature extraction in the past. Although using DCT coefficients has been used as a way to analyze texture features, the idea idea of generating the hash (step 5) seems to be new.

I am curious however on why you are discarding color information. Usually for reverse image search this kind of information can be quite useful.

Re: Perceptual Image Hashing

#3
This made me think of something, so bear with me for a second. I took Andrew Ng's Machine Learning class on Coursera, and one of the things he talked about was how, given a certain data set and a logistic regression approach, the algorithm might decide to just always give it a value of 1, since 98% of the time the value is one.

The examples given here were all predicted to have 95%+ similarity, but it seems to me that given this dataset, I could be reasonably convinced that it just assumes all images are reasonably similar. In other words, the author provides no counter-examples that demonstrate that the algorithm can detect dissimilar images, such as a photo of a car and a clipart of pizza. I would expect that to have very low similarity, and given the algorithm's demonstrated ability to discern between similar and dissimilar images, I would be more convinced of perceptual image hashing as a viable technique.

Re: Perceptual Image Hashing

#5
post #3

This made me think of something, so bear with me for a second. I took Andrew Ng's Machine Learning class on Coursera, and one of the things he talked about was how, given a certain data set and a logistic regression approach, the algorithm might decide to just always give it a value of 1, since 98% of the time the value is one. The examples given here were all predicted to have 95%+ similarity, but it seems to me tha…

It works, at least the examples above work fairly well-- I've tested a few for an automated image processing app I'm working on.

Re: Perceptual Image Hashing

#6
Does the term "perceptual hashing" only apply to the domain of images? What would you call this concept applied to text files? I am familiar with Levenshtein distance, but that family of algorithms provide a similarity score or value whereas I'd like a hash as the output.

Re: Perceptual Image Hashing

#7
post #4

Is it different from existing implementations? Am I missing something? http://phash.org/ http://hzqtc.github.io/2013/04/image-duplication-detection.h... http://www.hackerfactor.com/blog/?/archives/432-Looks-Like-I...

A more tactful question might be, "How is it different from existing implementations?" And then don't ask "Am I missing something?"

Best practices for engineering is always to see what else is out there, so to assume the author hasn't conducted a review of the field might be read as rudeness or snark.

Many developers, even when they do compare and contrast their own work as they develop it, don't write up the results or list their peer projects, so it's otherwise not an unfair question to ask.

Re: Perceptual Image Hashing

#8

Does the term "perceptual hashing" only apply to the domain of images? What would you call this concept applied to text files? I am familiar with Levenshtein distance, but that family of algorithms provide a similarity score or value whereas I'd like a hash as the output.

a similar concept exists in audio hashing called acoustic fingerprinting [1]. i've used software like Picard [2] to de-dupe my music library based on similarity. Also Simiilarity [3] incorporates this as does Shazam.

[1] http://en.wikipedia.org/wiki/Acoustic_fingerprint

[2] https://musicbrainz.org/doc/MusicBrainz_Picard

[3] http://www.similarityapp.com/

Re: Perceptual Image Hashing

#9
How would an adversary break this?

My first idea would be to rotate it by something that's halfway between the steps used. Say, 360/32 degrees. How does that compare?

Also: because it discards the high frequency data one should be able to construct something like this: http://cvcl.mit.edu/hybrid/CatDogHybrid.jpg - where to us at a close distance it looks like one thing but to this it looks like something else.

Re: Perceptual Image Hashing

#10
post #4

Is it different from existing implementations? Am I missing something? http://phash.org/ http://hzqtc.github.io/2013/04/image-duplication-detection.h... http://www.hackerfactor.com/blog/?/archives/432-Looks-Like-I...

The article directly describes the phash algorithm presented in the Hacker Factor post, while your second link is an implementation of the ahash algorithm in the same post.

libpHash's implementation is slightly more sophisticated (and slower) as it adds a box filter over the image before downscaling and uses the median of the AC coefficients rather than mean for computing the hash bits. It also offers a few alternative hashing methods.

Post reply on HN