Question about numPos, S in traincascade, and hard negative

asked 2014-07-24 14:16:02 -0600

Shiloh gravatar image

updated 2014-07-24 14:17:06 -0600

I read the thread about numPos here, and I got a little bit confused, I know it soo long explanation but please help me if I wrong..

numPos isn't the total of positive samples I have, but some of it.. It must be lower, if it equal can make error such insufficient new positive samples..

so let's begin in training stage, I assuming:

minHitRate=0.9
numStages =2

stage 0:

start -> numPos

finish ->

minimum : 0.9*numPos recognize as positive I called it numPos0
assuming: 0.1*numPos recognize as negative, or background

stage 1:

start->

So in this case to get a training set of positive samples for the 1-stage training we have to select (1 - minHitRate) * numPose new samples from vec-file that are recognized as positive by the cascade with 0-stage only. While the selection, some new positive samples from vec-file can be recognized as background right away by the current cascade and we skip such samples.

I assuming:

(1-0.9)*numPos0->0.1*numPos0 which equal with 0.09*numPos
So the 0.91*numPos is getting from new positive sample (unused before) from vec file

The count of skipped sample depends on your vec-file (how different samples are in it) and other training parameters. By analogy, for each i-stage training (i=1,..numStages-1) in the worse case we have to select (1 - minHitRate) * numPose new positive samples and several positive samples will be skipped in the process.

Skipped positive samples:

0.1*[(0.1*numPos0)+(0.91*numPos)] -> 0.01*numPos0+0.091*numPos

So numPos need for stage-1 is

0.1*numPos0+0.91*numPos-0.01*numPos0-0.091*numPos -> 0.99*numPos0+0.819*numPos

finish->

0.9*numPos -> 0.9*[(0.99*numPos0)+(0.819*numPos)] ,I called it numPos1

my question:

  1. Am I wrong in something??
  2. In stage-2 for the start, is it (1-0.9)*numPos1?
  3. Am I right and understand about the skipped file?
  4. I want ask about hard negative what I already read, that I need to crop and resize the negative images as size of my windows classifier, and I just need to re-training it again?? If I finish and re-training it again, will the result better?

I'm so sorry if my explanation bad, and my bad grammar..

edit retag flag offensive close merge delete