Ask Your Question
0

LBP for vehicle detection

asked 2014-06-02 06:09:31 -0600

Tariq gravatar image

updated 2014-06-02 06:28:27 -0600

berak gravatar image

My question is related to this thread by @StevenPuttemans. I need to train LBP classifier for vehicle detection from video streams and answer to the following question would be of great help for me.

1) How much time does it take to train a classifier using LBP for detecting cars?

2) What was the ratio of positive and negative images?

3) Which dataset did you use to train your LBP classifier?

4) How long does it take to train the classifier?

5) Were you able to make a comparison of HaarCascade Classifier and LBP?

6) Is it possible to share the classifier?

edit retag flag offensive close merge delete

Comments

There's already a cascade for vehicle detection (though it's haar, not lbp).

https://www.youtube.com/watch?v=c4LobbqeKZc

GilLevi gravatar imageGilLevi ( 2014-06-02 12:48:16 -0600 )edit

@GilLevi this is ugly cascade, it selects big areas around cars and gives false results

user12551 gravatar imageuser12551 ( 2017-07-16 05:09:38 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
5

answered 2014-06-03 02:48:02 -0600

Ok lets take the time to answer some of your questions. As mentioned before by @GilLevi, always try out the available models first before going into training your own detector model. It will take time and parameter tuning to reach an effective model.

1) How much time does it take to train a classifier using LBP for detecting cars?

I trained an LBP model in a couple of hours, resulting in a 20 stage classifier with poorer performance. In order to increase the performance you can use hard negative mining and retraining using those negatives to reach better results.

However it all depends on the situation where you want to detect cars. Is it aerial like in the topic mentioned, then you need to train your own model. Is it sideways? Then you can use prebuilt models that are already available in openCV.

2) What was the ratio of positive and negative images?

As far as I understand the training of object models, it depends on the variance in the data. If you cannot isolate the important training data that will form the decision border of your classifier, then a ratio of 1.000 positives and 10.000 negatives will get you quite far. If you however use just a plain set without prior knowledge, getting a decent classifier could lead you to data amounts of 10.000 positives and 100.000 negatives.

3) Which dataset did you use to train your LBP classifier? 6) Is it possible to share the classifier?

A private dataset of a company I am working together with. Due to this and the NDA I have signed I cannot share any data nor the trained model.

4) How long does it take to train the classifier?

It took me about 2-3 days to train a decent basic classifier adjusting parameters and performing hard negative mining.

5) Were you able to make a comparison of HaarCascade Classifier and LBP?

Yes. I always start training using LBP. If your context of the application is less complex, several hunderd of training images can result in a very nice detector in only a couple of hours. Compared to that the HAAR training takes up to a week and longer for the same result. It depends on many things, including the current implementation which is far from optimal.

edit flag offensive delete link more

Comments

How to do hard negative mining? The false positive created by detector can not use as negative immediately while the opencv_traincascade will use a slide window to extracted all candidates from the negative image. I have tried to scale the false positive down to the window size, but I find that the opencv_traincascade does not think this is a valid negative so does not take it into training.

I'm looking forward for your help, thank you very much!

acgtyrant gravatar imageacgtyrant ( 2017-02-20 19:48:31 -0600 )edit

For hard negatives do the following

  • Train an initial detector
  • Let it run on a negative dataset, collect all detections
  • Add them to the negatives folder and make sure their listing is at the top of bg.txt file.
  • Then rerun the training

That should do the trick! Could you comment how OpenCV rejects the windows? If so, make them slightly bigger, like 110x110 pixels for a 100x100 pixel model.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-02-21 03:11:38 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-06-02 06:09:31 -0600

Seen: 2,499 times

Last updated: Jun 03 '14