Ask Your Question
2

Training a soft cascade classifier

asked 2013-05-20 17:57:49 -0600

Hello

I've built an algorithm for pedestrian detection using openCV tools. To perform classification I use a boosted classifier trained with the CvBoost class.

The problem of this implementation is that I need to feed my classifier the whole set of features I used for training. This makes the algorithm extremely slow, so much that each image takes around 20 seconds to be fully analysed.

I need a different detection structure, and openCV has this Soft Cascade class that seems like exactly what I need. Its basic principle is that there is no need to examine all the features of a testing sample, since a detector can reject most negative samples using a small number of features. The problem is that I have no idea how to train one given a fully labeled set of negative and positive examples.

I find no information about this online, so I am looking for any tips you can give me on how to use this soft cascade to make classification.

Best regards

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2013-05-21 08:59:01 -0600

I am guessing he is talking about the Soft Cascade approach which is actually derived from cascade classifiers but only using a single stage with lots of weak classifiers to get more accurate detections. However this is functionality for openCV 2.4.9 which is not yet delivered as stable.

However it is quite logical that a soft cascade is indeed slow. It has to verify every single feature inside the softcascade structure before a detection gets accepted or rejected. A cascade classifier on its own could perform much faster due to the early reject stages.

edit flag offensive delete link more

Comments

1

Ah, didn't know about that one. According to the documentation it seems to be pretty fast and the 2nd paper "Pedestrian detection at 100 frames per second." indicates that too, or is it not speeded up?

Guanta gravatar imageGuanta ( 2013-05-21 13:59:55 -0600 )edit
1

The 100 Hz detector is developed at the computervision research group I am associated with at our University. To actually get those speeds, you need to combine the softcascade with the stixels approach and use ground plane assumptions. I do not think that this will be completely implemented in OpenCV, only the softcascade part.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-21 15:25:16 -0600 )edit

The problem is that I need to create a cascade of boosted classifiers to verify my own features, and, as far as I know, OpenCV only provides this application to be used with the Haar-like features using the Viola-Jones approach.

My alogrithm performs nicely in the pedestrian datasets i've tried, but the problem is that I am using a single boosted classifier for decision-making, so I need to evaluate a huge amount of features to get a decision, and this takes about 20 seconds per image. What I need is a number of boosted classifiers that grow in complexity as a sample advances in the structure, so I don't need to evaluate all the features.

Can you help me some how?

Pedro Batista gravatar imagePedro Batista ( 2013-05-21 23:08:38 -0600 )edit

What you just described is the links that guanta provided. Just select 20 stages or such as stage parameter, which indicates the amount of weak classifiers.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-22 14:12:29 -0600 )edit

Hey, @StevenPuttemans! I have one question about this paper. I thought that the Soft Cascade by itself provided a speedup of 20 times (Table 1 of the paper). The impression it gives is that by using only Soft Cascade we already can achieve this 20x speed up. Using the stixels and ground plane assumptions, we can increase this speed up even further. Is that correct? I mean, shouldn't the speed up provided by the Soft Cascade be independent of the other optimization approaches?

Yamaneko gravatar imageYamaneko ( 2014-01-13 12:03:07 -0600 )edit

Ofcourse, the softcascade can increase a speedup on itself. However the increase reported is on the test application provided. It all depends on the amount of weak features you want to evaluate. It is correct that the softcascade can introduce an optimization without the ground plane and stixel assumption. However to reach the full 100Hz detector speed, you need the three parts combined.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-14 02:50:15 -0600 )edit

So basically my remark is incorrect. At that time I didn't look at the paper well enough. Have done it for my own research now and it is faster due to faster early rejecting instead of depending on stages with multiple feature evaluation.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-14 02:51:48 -0600 )edit

Hi Steven, could you provide or recommend some links and directions on how to train and use soft cascade? I didn't find related documents in it. Thanks!

Sheng Liu gravatar imageSheng Liu ( 2015-08-14 07:59:47 -0600 )edit
0

answered 2013-05-21 08:26:07 -0600

Guanta gravatar image

If you mean the cascade-classifier with soft-cascade, you'll find a documentation how to train it at http://docs.opencv.org/doc/user_guide/ug_traincascade.html and how to use it can be seen in this example: http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html#cascade-classifier

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-20 17:57:49 -0600

Seen: 3,529 times

Last updated: May 21 '13