Image classification using SVM Python

Matt picture Matt · Apr 17, 2016 · Viewed 19.1k times · Source

I am currently working on a projet to perform image recognition. There is a big set of images and I have to predict whether or not an image contains given characteristics. For example, the output could be whether or not there is a banana in the picture.

I would like to implement a classifier using SVM with output yes or no the image contains the given characteristics. What is the simplest way to train a SVM classifier on images with 2 outputs? Is there any template to use in Python? Thanks a lot.

Answer

Emmanu picture Emmanu · Apr 18, 2016

With SVM you can classify set of images.For example You can train svm with set of car and plane images.Once you trained it can predict the class of an unknown images as whether it is car or plane.There is also multiclass SVM.

In your case,Make two sets of images for training SVM

  1. Set of images that contain given characteristics(banana)
  2. Set of images that doesn't contain that characteristics

Once your training phase completed it will output to which class the given image belong.If its in banana class you can output as Yes otherwise No.

Usefull links

  1. Hand written Digit Recognition using python opencv
  2. Squirrel and Bird Classifier using java

Edit

  1. Fruit classifier using python