2

I got some questions about the training of a cascade classifier:

  1. On Some of my pictures half of the object is visible. Should I mark the visible part as region of interest, use the picture as negative sample or sort it out completely?
  2. Is the classifier able to detect objects that are just partly visible (using Haar features)?
  3. What should be the ratio of negative and positive samples? Often I read that you should use more negative samples. But for example in this thread it is mentioned that the ratio should be 2:1 (more positive samples).
  4. My current classifier detects to much false positives. According to this tutorial you can either increase the number of stages or decrease the false alarm rate per stage. But I can't increase the number of stages without increasing the false alarm rate. If I just increase the number of stages, the training stops at some point because the classifier runs out of samples. Is the only way to reduce the false positives to increase the number of samples?

Would be glad if someone could answer one of my questions :)

Community
  • 1
  • 1
Phil
  • 213
  • 2
  • 8

1 Answers1

4

In case of cascade classifier I would suggest to throw away the "half" objects. Since are they positive samples? no since they don't contain the object entirely, are they negative samples? no , because they are not something which have nothing to do with our object. In my experience I started with training with almost similar number of negative and positive images, and I had the similar problem. Increasing the number of samples was the first step. You should probably increase the number of negative samples, note that you need to get different images, simply having 100 similar background images are almost the same as having only like 5-10 images. In my case the best ratio was positive:negative = 2:1. You still need to try out though it depends on the classifier you are trying to build. If your object is not something too fancy and comes in simple shapes and sizes (like a company logo or coin, or an orange) you don't have to get too many samples but if you are trying to build a classifier which checks for some complicated objects ( like a chair, yes.. chair is a serious object, since it comes in many different shapes and sizes) than you will need a lot of samples. Hope this helps.

David Safrastyan
  • 725
  • 7
  • 18
  • 1
    Thanks for the quick reply :) I want to detect a steering wheel and side-view mirrors (with 3 different classifiers) I have more than 3500 samples but I still have to label them, so I can't tell you how much of them are negatives/positives. Do you think the detection will work with this amount of data? (It is always the same car and nearly the same viewing angle) – Phil Jul 03 '15 at 08:57
  • 1
    It should be able to detect, in this case take the negative samples as some random pictures taken usually from the place where a car is parked, you see the idea is that the trainer takes the positive samples, rescales rotates them and places them in different bakcgrounds, the more appropriate your background is the better, so if it has to do something with cars so choose background which are pictures of parking lots, garages and other car related background stuff (without the car itself) – David Safrastyan Jul 03 '15 at 09:13
  • @DavidSafrastyan, sir can the cascade classifiers be used to differentiate in between round neck and collar t-shirts.? – Mayank Tiwari Oct 04 '18 at 07:27