Monday, February 19, 2007

KNN Distance Metric Comparisons

I just finished running a comparison of K-nearest neighbor using euclidean distance and chi-squared (I've been using euclidean this whole time). And what do you know, using chi-squared distance got me consistently better results. Here's the results of the tests:

KNN (k=3)

Night Images:

Euclidean Distance:

  1. 92% accuracy, # test images = 41
  2. 85% accuracy, # test images = 41
  3. 87% accuracy, # test images = 41
  4. 85% accuracy, # test images = 41
  5. 90% accuracy, # test images = 41
Chi-Squared Distance:
  1. 92% accuracy, # test images = 41
  2. 90% accuracy, # test images = 41
  3. 90% accuracy, # test images = 41
  4. 90% accuracy, # test images = 41
  5. 95% accuracy, # test images = 41
Day Images:

Euclidean Distance:

  1. 75% accuracy, # test images = 41
  2. 76% accuracy, # test images = 41
  3. 81% accuracy, # test images = 41
  4. 76% accuracy, # test images = 41
  5. 84% accuracy, # test images = 41
Chi-Squared Distance:
  1. 77% accuracy, # test images = 41
  2. 84% accuracy, # test images = 41
  3. 85% accuracy, # test images = 41
  4. 78% accuracy, # test images = 41
  5. 85% accuracy, # test images = 41
Here are some visual examples of the differences in the results from Chi-Squared and Euclidean Distances:

Chi-Square 1

Euclidean 1

Chi-Square 2

Euclidean 2

Chi-Square 3

Euclidean 3

4 comments:

CHAMS said...

Hi,
i'm student from tunsia.
I need this in my project.
Please, Could you help me.
my mail: chamssun@gmail.com
thank's.

NguyenTan said...

i also need this in your project. can you help me. i'm student from VietNam. my mail: tannguyen7993@gmail.com. thanks very much

Renjith.R said...

I am a student from India. I need this project, as almost this technology comes in my project, could you help me.
My email:- rajkumar.renjith@gmail.com

Unknown said...

hi, Im student from Indonesia, would you help me with this project code
justnewxxx5@gmail.com
thanks