如何正确训练级联 [英] How to train cascade properly

查看:94
本文介绍了如何正确训练级联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"Required leaf false alarm rate achieved. Branch training terminated."的可能原因是什么 以下训练命令:

What is the posible reason of "Required leaf false alarm rate achieved. Branch training terminated." The folowing command for training:

用于创建样本

-img imgs/CHE_one_wb.jpg -num 300 -bg imgs/negat.dat -vec imgs/vector.vec -info imgs/smpl/info.txt -maxxangle 0.1 -maxyangle 0 -maxzangle 0.1 -maxidev 100 -bgcolor 255 -bgthresh 0 -w 20 -h 35

-img imgs/CHE_one_wb.jpg -num 300 -bg imgs/negat.dat -vec imgs/vector.vec -info imgs/smpl/info.txt -maxxangle 0.1 -maxyangle 0 -maxzangle 0.1 -maxidev 100 -bgcolor 255 -bgthresh 0 -w 20 -h 35

-img imgs/CHE_one_wb.jpg -num 300 -bg imgs/negat.dat -info imgs/smpl/info.txt -maxxangle 0.1 -maxyangle 0.1 -maxzangle 0.1 -maxidev 100 -bgcolor 255 -bgthresh 0 -w 20 -h 35

-img imgs/CHE_one_wb.jpg -num 300 -bg imgs/negat.dat -info imgs/smpl/info.txt -maxxangle 0.1 -maxyangle 0.1 -maxzangle 0.1 -maxidev 100 -bgcolor 255 -bgthresh 0 -w 20 -h 35

火车

-data imgs/cascade/-vec imgs/vector.vec -bg imgs/negat.dat -numPos 200 -numNeg 40 -numStages 10 -featureType LBP -maxFalseAlarmRate 0.9 -w 20 -h 35

-data imgs/cascade/ -vec imgs/vector.vec -bg imgs/negat.dat -numPos 200 -numNeg 40 -numStages 10 -featureType LBP -maxFalseAlarmRate 0.9 -w 20 -h 35

培训结果

推荐答案

我已经实现了自己的目标并训练了良好的级联.

I have achieved my goal and trained good cascade.

  1. 首先,您需要几个原始样本(不要使用一个样本并将其与创建样本相乘).我用了10张不同的啤酒瓶照片,每张照片创建了200个样本,然后将所有样本合并到一个矢量文件中,并包含2000个样本.
  2. -w 20 -h 35应该匹配原始图像的长宽比
  3. 阳性样本与阴性样本的比例应该在2:1左右(应该有更多阳性样本)
  4. 您应自行选择的阶段数(对我来说是12-13).您设置的阶段越多,级联就越精确,但是您也可以过度训练级联,它将找不到任何东西.最后一级的 acceptanceRatio 显示了级联的精度,该精度应在此值0.000412662或更小.
  1. First you need a couple of original samples (don't use one and multiply it with create samples). I have used 10 different photos of beer bottles, for each I have created 200 hundred samples, then I have combined all samples in one vector file with 2000 samples.
  2. -w 20 -h 35 should match aspect ratio of your original image
  3. Relation of positive samples to negative should be around 2:1 (there should be more positive samples)
  4. Number of stages you should chose by yourself (for me it is 12-13). The more stages you set the more precisely will be your cascade, but you can also overtrain your cascade and it won't find anything. The precision of your cascade is shown by acceptanceRatio on the last stage it should be around this value 0.000412662 or less.

但是,如果您像7.83885e-07这样得到 acceptanceRatio ,则您的级联可能已受到过度训练,并且找不到任何东西,请尝试设置更少的阶段.

But if you get acceptanceRatio like this 7.83885e-07 your cascade is probably overtrained and it wont find anything, try to set less stages.

!!! 还有一件重要的事情,当您训练级联时,从2或3个阶段开始,您的阶段应该具有多个功能.如果只有一项功能,您将无法获得良好的级联.您应该处理自己的训练图像(负样本和正样本).普通培训如下所示:

!!! And one more important thing, when you train your cascade you should have more than one feature on your stage beginning from 2 or 3 stage. If you have only one feature you wont get good cascade. You should work on your training images (negative and positive samples). Normal training will look like this:

为了训练,我使用了-data imgs/cascade/ -vec imgs/vector.vec -bg imgs/negat.dat -numPos 1900 -numNeg 900 -numStages 12 -featureType HAAR -minHitRate 0.999 -maxFalseAlarmRate 0.5 -w 24 -h 30命令

For training I have used -data imgs/cascade/ -vec imgs/vector.vec -bg imgs/negat.dat -numPos 1900 -numNeg 900 -numStages 12 -featureType HAAR -minHitRate 0.999 -maxFalseAlarmRate 0.5 -w 24 -h 30 command

两种功能类型几乎都可以工作,有时HAAR会好一点,但比LBP慢得多.

Both features types work almost equals sometimes HAAR is a little bit better but it is significant slower than LBP.

这篇关于如何正确训练级联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆