Ask Your Question
0

Traincascade cannot reach False Alarm Rate?

asked 2017-06-28 07:42:31 -0500

milko gravatar image

updated 2017-09-06 09:56:32 -0500

I am trying to train a cascade to recognize objects with following parameters:

  1. boostType: GAB
  2. minHitRate: 0.998
  3. maxFalseAlarm: 0.5
  4. maxDepth: 1
  5. maxWeakCount: 2000
  6. TrimRate: 0.95

Sometimes it happens that a certain stage (not always the last stage) cannot reach FAR. If I understand correctly, this means that the stage almost cannot separate positives from negatives. It reaches 2000 weak classifiers. Hit rate remains 1, while FAR is 0.999.

+----+---------+---------+
    |1989|        1| 0.999685|
    +----+---------+---------+
    |1990|        1| 0.999449|
    +----+---------+---------+
    |1991|        1| 0.999685|
    +----+---------+---------+
    |1992|        1| 0.999528|
    +----+---------+---------+
    |1993|        1| 0.999685|
    +----+---------+---------+
    |1994|        1| 0.999449|
    +----+---------+---------+
    |1995|        1| 0.999685|
    +----+---------+---------+
    |1996|        1| 0.999528|
    +----+---------+---------+
    |1997|        1| 0.999685|
    +----+---------+---------+
    |1998|        1| 0.999449|
    +----+---------+---------+
    |1999|        1| 0.999685|
    +----+---------+---------+
    |2000|        1| 0.999528|
    +----+---------+---------+

Does somebody has an idea why this could happen and what can I try to avoid this behavior?

Here, OpenCV 2.4.4 was used, does it make sense to try a newer version?

Many thanks!

edit retag flag offensive close merge delete

Comments

I tried this with OpenCV 3.2 and observed the same behavior

milko gravatar imagemilko ( 2017-07-15 04:48:28 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-07 02:31:24 -0500

I am trying to train a cascade to recognize objects

This could be your first issue, a cascade classifier is an object detector, not an object recognition interface, so please explain your case on what you exactly are trying to do.

Does somebody has an idea why this could happen and what can I try to avoid this behavior?

Basically what happens is your algorithm is not able to meet your demands. It can only make 2 mistakes on a 1000 possible samples at it weak classifier. This is already a very harsh requirement. There is simply no feature in your feature set you provided (and from which boosting already selected the best 2000 ones), that is able to do this. This results in a very complex weak classifier that basically does nothing useful.

Can you try with for example 0.95 hit rate to start? I am sure this will not happen in that case. If it does, I am pretty sure you are using the wrong solution for your task because that would mean your 2 classes are inseparable using either HAAR or LBP features of the grayscale input image.

edit flag offensive delete link more

Comments

1

Steven thanks! The problem that I am trying to solve is actually a detection problem, not recognition. That is - I am trying to detect whether an object exists in the image. Sorry - I did not clearly express my problem :). The solution that you propose is indeed a "logical" one. I will play with these parameters. Thanks again for your thoughts.

milko gravatar imagemilko ( 2017-09-07 03:01:57 -0500 )edit

Hmm but what is the percentage of the object inside the image? If it is over 50% it might be better to go for a classification approach rather than a localization approach.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-09-07 03:16:31 -0500 )edit

The objects are small compared to image size. E.g. detection of motorcycles from the camera mounted on the road, so localization is necessary

milko gravatar imagemilko ( 2017-09-07 04:57:06 -0500 )edit

Steven, I am wondering about this - say if I put hit rate 0.99 for example. If I train say 20 stages that would actually result on performance of cca 80% on the entire training set (0.99^20), right? Do you feel this may be to low? This is probably hard to say without evaluating how it generalizes on test set, but I feel the error on the training set is actually pretty high.

milko gravatar imagemilko ( 2017-09-07 05:16:14 -0500 )edit

If I train say 20 stages that would actually result on performance of cca 80%

ONLY in the worst case. In my experience I never reached that. Your model could be perfectly fine of finding a combination of features that does better or does not make that much mistakes at the hit rate.

About the generalization, you can only tell that by evaluating on a large and meaningful validation set ... and making predictions on that is quite hard.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-09-07 06:57:17 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-06-28 07:42:31 -0500

Seen: 230 times

Last updated: Sep 07 '17