Training HAAR classifier takes too long

asked 2014-04-19 01:39:12 -0500

Loam gravatar image
$ traincascade.exe -data classifier1/ -vec samples.vec -bg negatives.txt -numPos 500 -numNeg 1134 -numStages 10 -precalcValBufSize 1024 -precalcIdxBufSize 1024 -featureType HAAR -w 40 -h 90 -minHitRate 0.995 -maxFalseAlarmRate 0.5 -mode ALL
PARAMETERS:
cascadeDirName: classifier1/
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 500
numNeg: 1134
numStages: 10
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: HAAR
sampleWidth: 40
sampleHeight: 90
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   500 : 500
NEG count : acceptanceRatio    1134 : 1
Precalculation time: 37.424
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|    0.996| 0.622575|
+----+---------+---------+
|   4|    0.996| 0.622575|
+----+---------+---------+
|   5|    0.996| 0.623457|
+----+---------+---------+
|   6|    0.998|  0.55291|
+----+---------+---------+
|   7|    0.998| 0.568783|
+----+---------+---------+
|   8|    0.996| 0.539683|
+----+---------+---------+
|   9|    0.996| 0.428571|
+----+---------+---------+
END>
Training until now has taken 0 days **14 hours 15 minutes 46 seconds**.

===== TRAINING 1-stage =====
<BEGIN
POS count : consumed   500 : 502
NEG count : acceptanceRatio    1134 : 0.584838
Precalculation time: 38.191
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+

14 hours just for 1 stage, is it normal?

This is what my task manager shows. It seems to me all cores are working, but only 20% of my CPU is under load: image description image description

Is it possible to make it work faster?

edit retag flag offensive close merge delete

Comments

Actually, I should file this as a bug report. I have noticed that using the timer code under linux systems isn't correct ... I added the measurement but am getting now all of a sudden wrong measurements back. Are you sure it actually took that long for the stage, or is it just saying that?

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-19 04:54:10 -0500 )edit

@StevenPuttemans I'm working under Windows 8.1, and it actually really have took that long for 1 stage . I started this process yesterday at 15:00, more than 24 hours left, and it's still training second stage (stage 1) (almost finished).

Loam gravatar imageLoam ( 2014-04-19 06:44:21 -0500 )edit

@StevenPuttemans Here is my samples.vec, which can be opened with createsamples.exe -vec samples.vec -w 40 -h 90 -show

Loam gravatar imageLoam ( 2014-04-19 06:54:30 -0500 )edit
1

Well first of allm you are using HAAR wavelets, which are known to take alot of time to process in a boosting process, especially with complex data. Could you try -featureType LBP to see if this goes faster? I have LBP models training in a day, where the HAAR counterpart takes two weeks ...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-22 03:26:07 -0500 )edit