Image classification using SVM Python

19,970

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
Share:
19,970
Matt
Author by

Matt

Updated on August 05, 2022

Comments

  • Matt
    Matt almost 2 years

    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.

  • Matt
    Matt about 8 years
    Thank for your answer. The 1st example is not really adaptable to my case because the pictures in the Hand Written digit Recognition are array of 64 elements. While my pictures are RGB pictures size of 170 * 400. And the second example is in Java but seems to be a great example. Do you know any example as the second but using Python? Thanks a lot