Simple, Fast, and Scalable Reverse Image Search
canvatechblog.com
canvatechblog.com
I tried to implement a similar reverse image search based on dHash as explained here https://github.com/Rayraegah/dhash . However, I also had lookup performance problems. Exact matches are not a problem but the Hamming distance threshold matching is. Because my project was in Python, I tried to eke out more performance by writing a BK-tree backend module in C++ https://github.com/mxmlnkn/cppbktree It was 2 to 10x faster than an existing similar module but still was too slow when trying to look up something in a database of millions of images. However, as lookup tended to depend on the exact Hamming-distance threshold value, my next step would have been to try and optimize the hash. E.g, make it shorter so that only a short Hamming distance is necessary to be looked up but the mentioned multi-indexing method looks much more promising and tested.
The ML image classification models can be used to extract a good descriptor that can be further reduced into a compact signature.
https://github.com/starkdg/pyphashml
For indexing, I've had some success with distance-based indexing. Here's a comparison of some structures I used:
https://github.com/starkdg/hftrie#comparison
Feel free to contact me, if you want to discuss this further.
AWS price list says reserved instances come in at "$0.00013 per RCU" x 28,800,000 = $3744 per hour. Does this really cost $2.6 mio per month to operate?
If yes, contact me and I'll be happy to save you $2.595 mio monthly by re-implementing things in C++ on bare metal servers.
Seems like a fair amount for them to spend for your efficiency gains and quick ROI for them :)
It seems like a lot of the focus has moved from "find this exact image" to "find similar images," like you give it a picture of a Husky and it'll find more pictures of Huskies.
I think maybe that's part of the picture.
Edit: I looked up the details again. It was an FSB officer named Andrei Burlaka, involved in the shooting down of MH17. Someone in Russia were selling their TV set online, and had taken a picture of the TV for the ad. It just so happened that Burlaka was on TV exactly that moment. Yandex images indexed the ad, leading the investigators to identify him.
Let me give you an example - you have a photo of someone. Should Google give you their facebook profile in the results if you search for the picture? Their AI is certainly capable of this, but some people would be understandably creeped out by it.
To be clear what I'm talking about, with tineye.com you can feed it an image and TinEye will show you all places on the internet that no only use that image - also use parts/portion of that image.
I think what you're describing is just straight up image search.
It used to be much better than it is now though, I don't really bother with it these days.
In contrast, descriptors like perceptual hashes look at the entire image, and so are a _global_ image descriptor.
There are ways to convert local SIFT image descriptors into a single global image descriptor for doing more rapid lookup (Bag of Visual Words is one technique that comes to mind), but SIFT and pHash really are in two categories all their own.
More info on pHash: https://hackerfactor.com/blog/index.php%3F/archives/432-Look...
Example of SIFT for fine-grained image matching: https://docs.opencv.org/3.4/d1/de0/tutorial_py_feature_homog...
I did it here: https://github.com/starkdg/phashml
https://github.com/starkdg/pyphashml
It is available in a python module that uses tensorflow model.
Feel free to message me.
10 billion images x4 rows each in Amazon DynamoDB with 2000 rps sounds like it'll burn through your wallet faster than most explosives...