Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv_traincascade keeps failing. Suspect is NEG count: acceptanceRatio

I have tried several times now to use opencv_traincascade (using vc12 and vc11 from Windows build), but I keep running into the error:

BEGIN

POS count : consumed 40 : 40

Train dataset for temp stage can not be filled. Branch training terminated.

What is odd is that this error seems to occur at different stages. I have tinkered with my command, varying a number of the different parameters and the one that results in the most change is varying -numNeg. The more I reduce -numNeg, the higher number of stages will be computed.

So, I started to suspect that maybe I had an issue with end of file and I just needed to lower the number of negatives to be: totalNumNeg (297) / desiredNumStages.

So, I tried lowering the -numNeg to 5. With -featureType LBP I was able to get through 9 stages and successfully complete, but the final NEG cont : acceptance Ratio was 5 : 0.185185 (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType LBP)

Then, for kicks and giggles I tried to do -featureType HAAR with the same parameters otherwise. This time it only made it through stage 2. The NEG count : acceptanceRatio was 5 : 0.0202429 on Stage 2. (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType HAAR)

Since, I didn't change the -numNeg and it still failed using HAAR instead of LBP, that leads me to believe that it has something to do with the acceptanceRatio. Is it possible that I am hitting a weird error after achieving some level of accuracy?

Only once, I got this finish instead: BEGIN POS count : consumed 40 : 40 NEG count : acceptanceRatio 4 : 0.025 Required leaf false alarm rate achieved. Branch training terminated.

with the command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 5 -numPos 40 -numNeg 45 -w 112 -h 20 -featureType LBP

Any advice would be greatly appreciated. Urgency is appreciated. I have spent every free moment this week trying to get this working and my final project is due next Friday. Thanks!

opencv_traincascade keeps failing. Suspect is NEG count: acceptanceRatioOpencv_traincascade failing on precalculation for negatives

I have tried several times now to use opencv_traincascade (using vc12 and vc11 from Windows build), but I keep running into the error:

BEGIN

POS count : consumed 40 : 40

Train dataset for temp stage can not be filled. Branch training terminated.

What is odd is that this error seems to occur at different stages. I have tinkered with my command, varying a number of the different parameters and the one that results in the most change is varying -numNeg. The more I reduce -numNeg, the higher number of stages will be computed.

So, I started to suspect that maybe I had an issue with end of file and I just needed to lower the number of negatives to be: totalNumNeg (297) / desiredNumStages.

So, I tried lowering the -numNeg to 5. With -featureType LBP I was able to get through 9 stages and successfully complete, but the final NEG cont : acceptance Ratio was 5 : 0.185185 (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType LBP)

Then, for kicks and giggles I tried to do -featureType HAAR with the same parameters otherwise. This time it only made it through stage 2. The NEG count : acceptanceRatio was 5 : 0.0202429 on Stage 2. (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType HAAR)

Since, I didn't change the -numNeg and it still failed using HAAR instead of LBP, that leads me to believe that it has something to do with the acceptanceRatio. Is it possible that I am hitting a weird error after achieving some level of accuracy?

Only once, I got this finish instead: BEGIN POS count : consumed 40 : 40 NEG count : acceptanceRatio 4 : 0.025 Required leaf false alarm rate achieved. Branch training terminated.

with the command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 5 -numPos 40 -numNeg 45 -w 112 -h 20 -featureType LBP

Any advice would be greatly appreciated. Urgency is appreciated. I have spent every free moment this week trying to get this working and my final project is due next Friday. Thanks!