k-NN classifier for image classification