Skip to content

ChaitanyaNarva/image-similarity-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Image Similarity Model

Finding N similar images from the dataset given on a query image.

Plan of Action

plan

  • We have nearly ~5K images with 512x512 resolution gives ~1,310,720,000 pixels. Loading into RAM and processing each image with every other image will be computationally expensive and may crashes the system(GPU or TPU).
  • So as a solution I integrated both convolutional neural networks and autoencoder ideas for information reduction from image based data.
  • That would be pre-processing step for clustering.

Convolutional AutoEncoders:

  • We can call left to centroid side as convolution whereas centroid to right side as deconvolution.
  • Deconvolution side is also known as unsampling or transpose convolution. It is a basic reduction operation.
  • Reverse operation using upsampling to decode the encoded image.
  • Building an autoencoder model, grabing the compressed image from the intermediate layers, then feed that lower-dimension array into KMeans clustering.

convo;utional_autoencoders

K-Means Clustering

  • We can then apply clustering to compressed representation. I would like to apply k-means clustering to cluster the images into 4 groups.
  • This could fasten labeling process for unlabeled data.

clustering

Dimensionality Reduction Through T-SNE: To visualize the clustering we need to perform dimensionality reduction through T-SNE. Which helps us to decide the optimal hyperparameter.

K-Nearest Neighbors(KNN):

  • Model training to find N similar images.
  • Finding Nearest neighbors and taking N nearest points as similar images given on a query image.

knn

Prediction Algorithm:

Step-1: taking either filename or url and converting that image into image array.

Step-2: Using that array finding the feature from the intermediate layers of the trained autoencoder model.

Step-3: From the extracted features finding the label to which that image belongs using K-Means clustering.

Step-4: Using KNN model finding N similar images using predict images and finally plotting the result.

Real Time Testing1:

query

Real Time Testing2:

testing3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages