How to find similar images using deep learning algorithms

deep_learning

#1

I have 70 images , from which I have to find which images are similar . I am using convolution neural network but cnn used for classification , my problem is related to similar images. if I passed 1.jpg image then output will be in the format of how many images are similar to 1.jpg.

thanks in advance.


#2

It is not very clear, what class of images you have.
You have to use triple loss to compare the images and get the related images.
Refer Deep Learning Coursera course, Convolutional neural networks Week 4 classes, to understand the background.

  1. Build a model to predict the right class. Ex: Dog, Cat, Iron Man, Superman etc (or Use pretrained model)
  2. For reach image, get the last but one layer weights and flatten it into a matrix
  3. When a new image is fed, get the flattened matrix of it using feedforward mechanism.
  4. Calculate distance between new image matrix vs the ones already in the database. All the images with shortest distance to new image can be pulled out from the point 2 database.

I can help you in pointing to right code, if you confirm the approach works for you.