Get Adobe Flash player

Posts Tagged ‘support vectors’

Support Vector Machine or simply SVM is a machine learning algorithm for data regression and classification.  I have adopted it for use in my project in milled rice kernel classification according to the following categories:

  • Chalky
  • Sound/Good
  • Damaged
  • Red
  • Paddy
  • Discolored

My goal is to share how to build a model, apply this classifier to your test data to determine its accuracy, and finally, implement the model as an application.  The library called LibSVM has made my work a lot simpler.  Why reinvent the wheel?  Here’s how you do it:

  1. Acquire the image.  This could be accomplished by various methods.  You can use scanner, digital camera, or video camera.
  2. Pre-process the captured image.  The goal is to ensure that unimportant objects are discarded, and enhance your region of interests to prevent lost of features.
  3. Extract features (Morphological & Color), one set for training and another set for testing.
  4. You may need to scale your data, especially if the value of some features are a lot  larger than the other.
  5. Train and build the SVM model.  You may need to find the optimal parameters (the penalty, C and kernel parameter, gamma).  This may take a while depending on the type of SVM and kernel you choose.
  6. If you are satisfied with the prediction accuracy of your model, then apply it to your test data, or real data.
  7. Build your application.

Simple, eh?

Technorati Tags: ,,,,