Find similar images in dataset for a new image using Resnet50+KNN
. In order to solve curse of dimensionality
using PCA to reduce the dimensionality of features.
- Create Resnet50 from keras without toplayer to get convolutional features(2048 dimension) as output instead of the image classification probability.
- Extract the convolutional features for every images of dataset( Feature_size:[number_images, 2048] ).
- Fit the nearest neighbor algorithm to the extracted features from dataset
- Extract convolutional feature of test image(new), and calculate the distance(image_Similarity) between the test image and each image of dataset.
- Apply PCA to extracted features and reduce the dimensions.
- Fit the nearest neighbor algorithm to the new features