Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Confidence scores for cascade classifiers (revisited)

Hi!

I have trained a couple of highly successful local binary pattern (LBP) cascade classifiers for object detection using OpenCV 3.2. So far I have used the classifiers sequentially and used the combined output as a "semi" multi-class classifier. This approach is flawed however, as an area can obviously be detected as multiple objects, which should be impossible. Because of this I am now interested in acquiring a form of confidence score for each detection by the individual cascade classifiers. With such a confidence score I could compare the overlapping regions of interest as proposed by each classifier and remove the regions with the lowest confidence score. I realize that this method is somewhat crude, but it is the best I could think of for the cascade classifiers supplied by OpenCV.

So far I have browsed a bit trying to find something that provides such a score, and I stumbled upon this thread that discusses the overloaded version of the detectMultiScale function (as found here). This discussion combined with another source makes me think that a sort of confidence measure could be calculated for each of the output Rect() objects (after non-maximum suppression) of detectMultiScale. In the last linked source the author quotes a paper that mentions a possible way of doing this:

"In the OpenCV implementation, stage_sum is computed and compared against the i stage_threshold for each stage to accept/reject a candidate window. We define the detection score for a candidate window as Kstage_when_rejected + stage_sum_for_stage_when_rejected. If a window is accepted by the cascade, we just Klast_stage + stage_sum_for_last_stage. Choosing K as a large value e.g., 1000, we ensure that windows rejected at stage i have higher score than those rejected at stage i-1." from http://vis-www.cs.umass.edu/fddb/faq.html

Does this seem like a possible solution to my problem? If so, how could I go about implementing it?

PS: I know a multi-class SVM is better for this sort of a problem, so I have implemented that too. The reason I want the confidence measure is so I can compare my two implementations.

click to hide/show revision 2
No.2 Revision

updated 2017-06-25 00:57:04 -0600

berak gravatar image

Confidence scores for cascade classifiers (revisited)

Hi!

I have trained a couple of highly successful local binary pattern (LBP) cascade classifiers for object detection using OpenCV 3.2. So far I have used the classifiers sequentially and used the combined output as a "semi" multi-class classifier. This approach is flawed however, as an area can obviously be detected as multiple objects, which should be impossible. Because of this I am now interested in acquiring a form of confidence score for each detection by the individual cascade classifiers. With such a confidence score I could compare the overlapping regions of interest as proposed by each classifier and remove the regions with the lowest confidence score. I realize that this method is somewhat crude, but it is the best I could think of for the cascade classifiers supplied by OpenCV.

So far I have browsed a bit trying to find something that provides such a score, and I stumbled upon this thread that discusses the overloaded version of the detectMultiScale function (as found here). This discussion combined with another source makes me think that a sort of confidence measure could be calculated for each of the output Rect() objects (after non-maximum suppression) of detectMultiScale. In the last linked source the author quotes a paper that mentions a possible way of doing this:

"In the OpenCV implementation, stage_sum is computed and compared against the i stage_threshold for each stage to accept/reject a candidate window. We define the detection score for a candidate window as Kstage_when_rejected K*stage_when_rejected + stage_sum_for_stage_when_rejected. stage_sum_for_stage_when_rejected. If a window is accepted by the cascade, we just Klast_stage K*last_stage + stage_sum_for_last_stage. stage_sum_for_last_stage. Choosing K as a large value e.g., 1000, we ensure that windows rejected at stage i have higher score than those rejected at stage i-1." from http://vis-www.cs.umass.edu/fddb/faq.html

Does this seem like a possible solution to my problem? If so, how could I go about implementing it?

PS: I know a multi-class SVM is better for this sort of a problem, so I have implemented that too. The reason I want the confidence measure is so I can compare my two implementations.