Does time of Cascade Classifying depend on number of training images? [closed]

asked 2014-04-10 05:42:59 -0500

Cesans gravatar image

Hi,

I have been training some LBP Cascade Classifiers and I have noticied that when I use them to detect an object the calculation time depends on the number of images used and also their size.

Is that correct? For exmaple, a trained classifier with 500 positive and 500 negative images gives me about 6 FPS while another classifier trained with they same parameters but only 150 positive and 250 negative images is giving me about 15 FPS.

The detection is done with the same parameters for both of them and fixed min and max size. I thought that that would make the time independent of the training set but, apart from the number of images, when I use images of size 100x100 the time is twice the time it takes when using 40x40 images.

I don't really understand how that can be possible. Any ideas?

Thank you! Carlos.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-09-07 16:40:43.798295

Comments

I think you are mixing something up. It is not the training images, but the amount of features and stages used that lead to the time needed for detection ... it also depends how deep each window reaches inside your cascade...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-11 04:36:49 -0500 )edit

The only difference is the size of the training images, so maybe the algorithm resizes each window to the size of the training images before detecting features? If that happens the detector would detect more features and because of that it will take longer to detect them?

Thank you!

Cesans gravatar imageCesans ( 2014-04-21 08:50:31 -0500 )edit

@Cesans, again your are mixing up two things. There is the detection speed for EACH window of your sliding window approach, which is dependant of the amount of stages and features. However a larger image, contains more windows of your model size, so YES it will take longer, since each window is subjected to the cascade classifier. Depending on the complexity of the windows, this can increase alot, but it is not a linear increase!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-22 03:33:10 -0500 )edit

And that is for the detections part, for the training part, all input is resized to your model dimensions, so it doesn't differ if you use 100x100 or 40x40 pixel images since they will result in a modelWidthxmodelHeight size!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-22 03:34:29 -0500 )edit

I think I didn't explain myself properly, the difference was in the model size (actually all the images were the same size). When I trained it with a model size of 40x40 it was approximatelly twice as fast as the one trained with 100x100 images, the rest of the parameters were exactly the same, including the number of stages.

The size of the images in the detection part was also the same (taken from a camera), that's why I didnt expect one to be faster than the other.

Thats why I asked if bigger training images (after resizing to the model size) could result in slower detection, as the window will be more complex, am I wrong with that?

Cesans gravatar imageCesans ( 2014-04-22 07:12:48 -0500 )edit

Anyway, I think I will check everything again although I tried several times and the results were the same, bigger images in the training model resulting in slower detection.

Thank you very much, @StevenPuttemans. I will tell you back about the results.

Cesans gravatar imageCesans ( 2014-04-22 07:13:00 -0500 )edit