Love affair with CBIR – Part 1

Love affair with CBIR (Content base image retrieval system) Part 1

Update:
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)

Love affair with CBIR – Part 2

Love affair with CBIR – Part 3

Love affair with CBIR – Part 4

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

   1: SELECT * FROM TABLEA WHERE Field1 = ‘String’

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

SimilarImageSameSize

Now, the challenges start increasing, what if there are two identical image, but of different file type. Say, one is jpg, other is png

IdenticalImageDifferentSize

There are other challenges too, invariance

Different type of invariance

  1. Illumination
     
    image image
  2. Scale
    image image
  3. Rotation
    image image
  4. Affine
    image image
  5. Full Perspective
    image image

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, 

  1. De-duplication: Identical images, multiple copies of the same photo in with different names, different format. This is simple and everybody understands this.
  2. 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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s