2
$\begingroup$

I am new to computer vision so please excuse me if this question is very simple.

I am trying to learn how to use the Haar Cascade creation tool provided with OpenCV to train a cascade classifier. It seems relatively easy, with the tools provided, but I was wondering if there was a way to improve the network after the initial training. I plan to gather an initial set of positive images and train the cascade on those, but afterwards, continue collection and feed new positive images into the cascade to improve detection rates, reduce false positives and allow for better results in more difficult scenarios. Instead of retraining the cascade every time a new batch of positive images is produced, it would be extremely helpful if the cascade could prune itself and improve predictions based on the new images. I was wondering if this is possible, and how one would go about implementing it.

(Note: In this tutorial, the author discusses the use of more than one training epochs in a Deep Belief Network to improve detection rates by strengthening connections that result don't. I'm not sure how this works, but I would assume that if new images are added in each epoch, they could be incorporated without a full retraining, just a pruning. I would like to apply a similar approach to the cascade classifier.)

(Note on Note: The reason that I am using a cascade classifier and not a DBN is because I don't want to be restricted to defining a set number of output neurons. There may any number of detectable objects in the image, in addition to the fact that some results may be a plain boolean value. It doesn't seem that a DBN will work well. However, I have relatively little knowledge of the subjects and any suggestions on what approach to take to achieve the above implementation would be helpful.)

Thank you.

$\endgroup$
1
$\begingroup$

Sadly, I don't know of any simple way to achieve this, for Haar cascades.

The problem is that Haar cascades are trained using boosting. A cascade is a multi-stage classifier: we use the first stage to quickly discard candidates: if the first stage says "no", we immediately reject, and only go on to process the input with the second stage if the first stage says "yes". That means that the second stage is trained on only images that the first stage classifies "yes". If you add some more training examples and want to update the first stage, then now this has cascading effects on all of the subsequent stages: naively, you need to re-train all subsequent stages, because the set of images they should be trained on has now changed.

There might be a clever way to do it, but it's not straightforward.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.