While training a classifier why are we using negative or background images? How are they used in training an object classifier? And can anyone explain the general procedure how training is being done using any programming language like MATLAB?
-
Please provide example images or other information. You can use anything to train a classifier... Without a context you won't get a good answer – Piglet Mar 25 '16 at 09:39
-
1Because you want to give the learning algorithm examples of what NOT to look for. Providing a machine learning system with all positive images would mean that it would just assume that everything is positive. Think about it in terms of the human brain... how exactly do we know what a car does and doesn't look like? We look at images that aren't cars and are and we learn from there. – rayryeng Apr 05 '16 at 15:34
2 Answers
First, I doubt you will get any answer for how to train a classifier in matlab
. It is a very vague question. Depends a lot in your data and your goal, and essentially there are tens to hundreds of algorithms out there to perform classification, it is not that simple.
To the main question, why are negative samples given to the classifier. It again depends a lot in the classifier you use, but in short, there are two kind of classification models (there are more, but to summarize): generative models and discriminative models.
Generative models aim to model statistics (appearance or any other kind of features) of the target class (e.g. you are trying to model a car). A generative model will then learn a way (from training data of only positive examples) to identify a car. This is, given a random sample, it will tell you the likelihood of that sample being created by your car model. As a dumb example, imaging your model is an Univariate Gaussian, the model will then tell you the likelihood of that data sample (point) of being sampled from the Gaussian distribution you have learned.
Generative models are useful when you don't have negative training data, or where your data can be modelled by simple distributions.. but the model only learns how does a car look like, it doesn't learn how does a car not look like.
Discriminative models, on the other hand, learn much more complicated (and usually robust) rules to differentiate between target classes. Having a set of target objects (e.g. Cars and Background, or Cars, Bicycles, Houses and Sky), rather than learning how does a car look like, the algorithm tries to learn how is a car different from background.
If all your memory contains only 100 pictures of cars, and then you are given a picture of a motorbike, it is very hard for you to say that a motorbike is not a car (you have never seen one before), both pictures will have a background and wheels. However, if you are given 50 images of cars, and another 50 of random street pictures (including e.g. a bicycle), you can learn stronger relations to try to identify cars in the future.

- 15,366
- 2
- 49
- 67
-
Great explanation. +1. I particularly like your mention of both generative and discriminative models. – rayryeng Apr 06 '16 at 07:43
Training itself is an optimization problem. This optimization problem tries to optimize the classification accuracy. If there is no -ve samples , there will be no optimization problem and the boundaries can be set to +,- infinite, with classifying all samples as positive

- 369
- 2
- 10