3

None of the questions posted in stackoverflow have mentioned this situation, hence this question is posted. I am training a haar-cascade classifier for face detection. The fae data was generated by me. The parameters are provided below.

NUmber of positive samples = 2500
Num pos: 2000
Num neg: 2580
Num stages: 14
Num splits: 2 (tree as weak classifier)
Mem: 1024 MB
Symmetric: FALSE
Min hit rate: 0.995000
Max false alarm rate: 0.500000
Weight trimming: 0.950000
Equal weights: FALSE
Mode: ALL
Width: 25
Height: 25
Applied boosting algorithm: RAB
Error (valid only for Discrete and Real AdaBoost): misclass
Max number of splits in tree cascade: 3
Min number of positive samples per cluster: 100
Required leaf false alarm rate: 1.52588e-05


Tree Classifier
Stage
+---+---+---+---+---+---+---+---+---+---+---+---+
|  0|  1|  2|  3|  4|  5|  6|  7|  8|  9| 10| 11|
+---+---+---+---+---+---+---+---+---+---+---+---+

   0---1---2---3---4---5---6---7---8--10--12--14
                                   |           |
                                   |          15
                                   |           |
                                   |          16
                                   |
                                   9--11--13--17
Parent node: 14

*** 1 cluster ***
POS: 669 2500 0.267600
NEG: 863 5.50567e-05of 863 required, 15674000 images tested
BACKGROUND PROCESSING TIME: 297.00
Precalculation time: 0.00
+----+----+-+---------+---------+---------+---------+
|  N |%SMP|F|  ST.THR |    HR   |    FA   | EXP. ERR|
+----+----+-+---------+---------+---------+---------+
|   1|100%|-|-1.590536| 1.000000| 1.000000| 0.161227|
+----+----+-+---------+---------+---------+---------+
|   2|100%|-|-3.158675| 1.000000| 1.000000| 0.180157|
+----+----+-+---------+---------+---------+---------+
.
.
.
.
+----+----+-+---------+---------+---------+---------+
|  16|  6%|-|-13.162083| 0.995516| 0.805330| 0.353133|
+----+----+-+---------+---------+---------+---------+
|  17| 14%|-|-24.674999| 0.997010| 0.877173| 0.266971|
+----+----+-+---------+---------+---------+---------+
|  18|  0%|-|-13.163441| 0.995516| 0.805330| 0.353133|
+----+----+-+---------+---------+---------+---------+
|  19| 14%|-|-24.676357| 0.997010| 0.877173| 0.266971|
+----+----+-+---------+---------+---------+---------+
.
.
.
.

+----+----+-+---------+---------+---------+---------+
| 760|  0%|-|-13.667271| 0.995516| 0.805330| 0.341384|
+----+----+-+---------+---------+---------+---------+
| 761| 14%|-|-25.180187| 0.997010| 0.877173| 0.267624|
+----+----+-+---------+---------+---------+---------+
| 762|  0%|-|-13.668629| 0.995516| 0.805330| 0.341384|
+----+----+-+---------+---------+---------+---------+
| 763| 14%|-|-25.181545| 0.997010| 0.877173| 0.267624|
+----+----+-+---------+---------+---------+---------+
| 764|  0%|-|-13.669987| 0.995516| 0.805330| 0.341384|
+----+----+-+---------+---------+---------+---------+
| 765| 14%|-|-25.182903| 0.997010| 0.877173| 0.267624|
+----+----+-+---------+---------+---------+---------+
| 766|  0%|-|-13.671345| 0.995516| 0.805330| 0.341384|
+----+----+-+---------+---------+---------+---------+

As one can see that it is alternating between two states. Finally, I had to kill the program. Now I am clueless here of what went wrong.

magarwal
  • 564
  • 4
  • 17

1 Answers1

0

I've encountered the same problem 1-1,5 year ago, but i didn't manage to solve it completely - only partially. So here are you possibilities (at least those which i know):

  • kill training program and start again. It should continue from last finished stage. There is a tiny chance (i'm not sure whether it has ever solve my problem...) that this will solve you problem.
  • kill training program, modify parameters and start again. It will continue from last finished step, but now it will use new parameters, so you can change a bit hit rate and/or max false alarm rate and than try to the problematic stage (and most likelt other left stages too). Of course your classifier will be a little worse than you wanted it while starting training, but at least it will have correct number of stages.

//edit:
If it won;t solve you problem, consider asking this question on http://answers.opencv.org/questions/ - there is bigger chance that you will get answer directly from OpenCV developers.

cyriel
  • 3,522
  • 17
  • 34