High model performance degradation on use of cosine as distance function in machine learning compare to Euclidean

34 Views Asked by At

I was working on classification of images based on similarity using machine learning. I am experimenting with both Euclidean and cosine distance. I found that as the no of classes grows, cosine as distance measure performance degrades quickly. For example, when I had 25 class there is a difference of just 3-5% in accuracy between them (63% for Euclidean vs 59% with Cosine). However, when I had 40 classes then this difference grows to 41 % (92 % with Euclidean vs 51% with cosine). What could be the reason for such behaviour/degradation. Is there any paper/resource where I can look for explanation.