0

When I execute a SVM with a training set and a validation set i check results with a confusion matrix, and all is good.

After that, how can i implement a system "query by example": i give a picture and return most similar image in an image set ( based on a threshold)? There are example in python (with scikit-learn module)?

postgres
  • 2,242
  • 5
  • 34
  • 50
  • Can you include the actual code you are using ? This should be easy if you understood how your classifier is distinguishing the inputs and putting them into certain classes. Since your new input ends in some of the classes, then you can perform a k-nearest neighbor in this class to return the relevant results. – mmgp Jan 19 '13 at 00:59

1 Answers1

1

Retrieving similar images does not need a classifier. It is usually a Nearest Neighbor Problem, most likely have features with high-dimensions. The keys are to find:

  • What character of image you care most? shape? colors? color distribution? object?
  • What are the best features to describe the character of image? If it's color, then you might want R/G/B values or histograms.
  • How do you want to measure the similarity? i.e., the distance function.
  • Which algorithm you want to use in such a NearestNeighbor problem setup? Options include and not limited to: kd-tree, locality-sensitive-hashing, etc. Here has some good discussions.
Community
  • 1
  • 1
greeness
  • 15,956
  • 5
  • 50
  • 80
  • shapes i uses invariant rotation features like Humoment, solidity and i'm trying to implement elongation (but i don't know how). I implement Nearest Neighbour with scikit module in python http://scikit-learn.org/dev/modules/generated/sklearn.neighbors.NearestNeighbors.html, but it doesn't ask me a distance function, it's possible has got one default inside? Thank you for the link now i read it – postgres Jan 29 '13 at 10:13
  • professor said us we need a classifier and a training set for recognizing similar image, isn't true? – postgres Jan 29 '13 at 10:27
  • It's not wrong. If you do have labels for each image, then `NearestNeighbors` can be used as a classifier. – greeness Jan 29 '13 at 19:32
  • but how can i choose the best classifier suitable for my purpose? simply trying?first time i read about SVM, but if also NearestNeighbour could be a candidate! – postgres Jan 29 '13 at 23:34