lbp cascade training to detect traffic signs

asked 2018-08-16 11:45:10 -0500

yoggiee gravatar image

updated 2018-08-16 11:56:40 -0500

Hello, I'm trying to train a classifier which detects all these kinds of traffic signs. image description

I've trained a classifier (9 stages) that detects all these signs, but it also detects other types of signs or background. I got many false detects. Im using 300 cropped images of signs (around 15 for each type of sign) and 5900 neg images of roads, cities(without signs ofc). What Im doing wrong? Maybe it's not good idea to use cascade classifier for my purpose? My parameters:

opencv_createsamples.exe -info info.txt -vec vector.vec -w 30 -h 30

opencv_traincascade.exe -data cascade/ -vec vector.vec -bg bg.txt -numPos 300 -numNeg 5900 -numStages 20 -featureType LBP -mode ALL -w 30 -h 30 -precalcValBufSize 2048 -precalcIdxBufSize 2048 -numThreads 4
edit retag flag offensive close merge delete

Comments

and now, you found out, that it detects anything, which is round and blue ( which is exactly, what you trained it for ! ) ?

berak gravatar imageberak ( 2018-08-16 11:50:41 -0500 )edit

actually it detects almost everything. I need to detect only these signs. What should I do? Train a cascades for each type of sign or what?

yoggiee gravatar imageyoggiee ( 2018-08-16 11:53:26 -0500 )edit
1

don't ever expect to do anything successfully with 300 positives only, especially, if your constraints are that vague (inner class variance)

maybe you can (re)train some SSD style cnn with your data ?

berak gravatar imageberak ( 2018-08-16 12:10:53 -0500 )edit
1

Its impossible with boosted cascades. The only succesfull solution we got working at our lab, based on research of Daimler, is 2folded

  • Train a cascade for traffic sign shapes (one for round, one for triangle, ...)
  • After that apply a classifier on the found detector using color and edge information, to distiguish between different classes.

But in the long run, you are better of these day with indeed applying transfer learning on a pretrained network, using either SSD or YOLOv2. Those nets incorporate localization and classification in a single run and beat all previous solutions.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-17 06:53:50 -0500 )edit

I was thinking about creating a cascade classifier that detects round shapes and train svm or knn to recognize these detected signs. How about this??

yoggiee gravatar imageyoggiee ( 2018-08-18 10:24:15 -0500 )edit

yea, try that. part 2 will work like a charm (and even for that i'd prefer retraining an existing cnn). but again since the description of part 1 is still so vague -- you'll need a ton of positives

berak gravatar imageberak ( 2018-08-18 11:35:14 -0500 )edit