Ask Your Question

Martin93's profile - activity

2017-02-02 07:59:39 -0500 received badge  Enthusiast
2017-01-25 07:47:26 -0500 commented answer Traincascade - still confused about acceptanceRatio

Hello Steven thanks for the quick answer, you are right i misswrote there.
0.3^8 is smaller than the given acceptanceRatio but im confused based on the statement wrote in "OpenCV 3 Blueprints" that a break occurs if acceptanceRatio < then maxFalseAlarmRate^NumStages
In my case it is maxFalseAlarmRate^NumStages < then acceptanceRatio so why did my training broke in this case.

2017-01-23 08:39:27 -0500 asked a question Traincascade - still confused about acceptanceRatio

Hello,
i know this was asked already several times but i am still confused about how the acceptanceRatio based on the maxFalseAlarmRate training parameter breaks my model training with showing the message "Required leaf false alarm rate achieved. Branch training terminated"

I also read the book "OpenCV 3 Blueprints" wroten by Joseph Howse,Steven Puttemans,Quan which tells :
The training breaks if the acceptanceRatio < then maxFalseAlarmRate^NumStages

But i can't apply this statement to my training, for example:
I used to detect some arizona bottles using the traincascade with the following parameters:

opencv_traincascade.exe -data data -vec bottle.vec -bg bg.txt -numPos 1000 -numNeg 2100 -numStages 8 -minHitRate 0.995 -maxFalseAlarmRate 0.3 -w 40 -h 100 -featureType HAAR

I got in total:
Pos Pictures: 1071
Neg Pictures: 2165
I trained my cascade about one day ending up with 7 stages because of the break statement:

===== TRAINING 6-stage =====
<BEGIN
POS count : consumed   1000 : 1009
NEG count : acceptanceRatio    2100 : 0.000171474
Precalculation time: 30.145
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|    0.996| 0.447143|
+----+---------+---------+
|   4|    0.999|  0.35381|
+----+---------+---------+
|   5|    0.997| 0.267619|
+----+---------+---------+
END>
Training until now has taken 0 days 23 hours 9 minutes 46 seconds.

===== TRAINING 7-stage =====
<BEGIN
POS count : consumed   1000 : 1012
NEG count : acceptanceRatio    0 : 0
Required leaf false alarm rate achieved. Branch training terminated.

But i still dont understand why it broke the training.
If i take from the parameters maxFalseAlarmRate^NumStages = 0.3^8 this is still bigger than the last given acceptanceRatio : 0.000171474
Did i maybe thought wrong and its maxFalseAlarmRate^CurrentStageDepth= 0.3^7 ?

Although my cascade is very decent in detecting arizona bottles (sometimes 1-2 false positives) and i know it will only detect them at least on the dimensions -w 40 -h 100 but if there are any suggestions to improve my detection parameterwise please feel free to tell me (increasing overall dataset is planned in future)