Search code examples
imagealgorithmimage-processingsimilaritynearest-neighbor

k-Nearest Neighbor VS Similarity Search


Is there any difference in these two algorithms? In a glance, they seem identical to me.

Let's say we are searching for images, then given a query image, one can search for k (=10 e.g.) images with a k-NN algorithm. In a Similarity Search algorithm one can search for for 10 images as well (10 something like a threshold I guess) and the results should be the same as with the k-NN algorithm, right?

Example of Similarity Search.


Solution

  • The main difference is Similarity Search is the feature/product, while k-NN is an algorithm.

    Similarity Search is just saying "Give me the similar items", this is the feature. It does not say how it should be done.

    k-NN on the other hand is an algorithm. It is not a feature, it is a classification algorithm. It is possible (though unlikely) that Similarity Search will actually use k-NN under the hood.