Love affair with CBIR (Content base image retrieval system) Part 1
I never figure out, this would be series of article, here are links to rest of it
Love affair with CBIR – Part 1 (The one you are reading)
Recently, I was architecting for the project for one of the American client, and they had the one simple requirement, “Ability to detect duplicate images from set of image files during upload”.
I was thinking, common, this is simple. When the user uploads an image to website, just check if the image already exists, that all. What the big deal in it. If this was some string, it would be
Same thing, I need to do with Image. It here, I was stump! In MS SQL, I can’t compare images, as image if store in table, would be the blob object. I can’t just compare the byte size of two blob object, as there would be possibility, where two different images could have same byte size. See below example
Now, the challenges start increasing, what if there are two identical image, but of different file type. Say, one is jpg, other is png
There are other challenges too, invariance
Different type of invariance
So now, things started to complicate, there is no simple way to compare two images, as you do for string, integer and any primitive type. This was the start of love affair. It mystical, it esoteric and magical, you don’t know ‘HOW’ to get it, just follow the with ‘WHAT’
For the solution, there are two angle to it, De-duplication and similar. With this, there are two new terms,
- De-duplication: Identical images, multiple copies of the same photo in with different names, different format. This is simple and everybody understands this.
- Similar Image: This is important one, and this defines the game, what do you call similar? Is same color similar for you? Is same shape similar for you? Is same texture similar for you? Or is mix bag of all. For my love affair, it’s invariance which was shown above, which are visually appears to be same, but different exposure plus slight difference in rotation, angle and scale.
In the next post, we will see how we will address each of it.