Parameters for traincascade ect. [closed]

asked 2016-07-13 11:52:11 -0500

ThorbjornSomod gravatar image


Im trying to use traincascade to train an XML file for use in a face detector, but I'm having some problems with the parameters for both traincascade and its subfunctions. For my positive examples I have used the mergevec ( tool to make 2000 positive images from the 200 frontal face images I have. I also have 200 negative images, but read somewhere that you can set the numNeg variable to much higher than the actual negative images you possess, since traincascade will make variations of the negatives for use in the function. Because of this I have set the numNeg variable to 4000. Will this work? The function call for traincascade I have used is;

trainlbpcascade.exe -data FaceDetector -vec merged_vector.vec -bg negative/bg.txt -numPos 1600 -numNeg 4000 -numStages 10 -stageType LBP -mem 1024 -featureType LBP -w 24 -h 24 -bt DAB -maxDepth 2 -mode ALL

with these parameters:

PARAMETERS: cascadeDirName: FaceDetector vecFileName: merged_vector.vec bgFileName: negative/bg.txt numPos: 1600 numNeg: 4000 numStages: 10 precalcValBufSize[Mb] : 1024 precalcIdxBufSize[Mb] : 1024 acceptanceRatioBreakValue : -1 stageType: BOOST featureType: LBP sampleWidth: 24 sampleHeight: 24 boostType: DAB minHitRate: 0.995 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 2 maxWeakCount: 100

I am unsure as to what I should set the other parameters (minHitRate, maxFalseAlarmRate ect) to, and would appreciate any help regarding this.

Also, my traincascade call will currently only reach stage 3 and is only using 2 variables. I get the "Required leaf false alarm rate achieved. Branch training terminated." message, which I've read is caused by lack of positive images. Could this be the case, even with 2000 positives?

Sorry if the answers to these questions are self-explanatory, but I'm new to this and the learning curve has so far been steep. Thanks in advance for any help!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-18 10:26:29.263309


Please use the search button of this forum ... I must have answered this a thousand times, but in short

  • mergevec ... oh my god ... run fast, let it behind you, run even faster and never look back. It is simply not interesting to use that tool :D Instead use your 200 natural positives to get a way more decent model.
  • negatives do not transform the image, rather they take window samples at -w -h ratio from the larger negative files. That means you can simply get tons of negatives from a single larger resolution image.
  • the error tells you your model is working just fine under the current parameter settings. As said, use search for more tips on that.

Good luck!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-07-15 09:00:55 -0500 )edit