How to use SVM for classification September 1, 2008
Posted by whaldsz in : projects, technology , trackbackSupport 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:
- Acquire the image. This could be accomplished by various methods. You can use scanner, digital camera, or video camera.
- 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.
- Extract features (Morphological & Color), one set for training and another set for testing.
- You may need to scale your data, especially if the value of some features are a lot larger than the other.
- 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.
- If you are satisfied with the prediction accuracy of your model, then apply it to your test data, or real data.
- Build your application.
Simple, eh?
Comments»
Hi,
I am using MHI method for action recognition. I have 6 actions from 8 persons. So 48 different videos. From each video, I finally create a feature file or text file having 14 numbers [14 moment values - all are floating numbers]. So this way, I have 48 text files each having 14 moment values.
How can I manage these for SVM for classification? Please kindly guide me, or mail me in-person.
Thanks a lot in adv.
Atq
Hi atq,
from what i understand, you have 48 instances with 14 columns per instance and 6 classes. i think you don’t have enough training data to build your svm classification model.
basically, to use classify your data using svm, you got to have training sets for building your svm model and test set for determining the performance of your classification model. accuracy of your classification depends on the features you use during svm training.
if you need more information, try to google libsvm. They have nice examples and tools to simplify svm classification in your programming language of choice.
vlad