Ask Your Question

belgraviton's profile - activity

2016-01-15 00:37:28 -0600 received badge  Enthusiast
2015-12-12 18:04:28 -0600 received badge  Necromancer (source)
2015-11-26 05:12:51 -0600 commented question Cascade classifier stage construction looping

What number of stages is typical for trained cascades with 100 classifiers in a stage? My task requires 10-12 stages with 150-250 classifiers.

2015-11-26 00:26:34 -0600 commented question Cascade classifier stage construction looping

I have OpenCV 3.0.0. I meet this behaviour twice.

2015-11-25 07:27:35 -0600 asked a question Cascade classifier stage construction looping

I detect looping of cascade classifier construction on last stages. I use script:

g:\Programs\opencv_3_64\bin\Release\opencv_traincascade.exe -data "d:\data\5_train_LHaar12" -vec positives.vec -bg tB4_negSamples.dat -numPos 10000 -numNeg 20000 -numStages 12 -w 16 -h 16 -minHitRate 0.995 -maxFalseAlarmRate 0.5 -weightTrimRate 0.95 -maxDepth 1 -maxWeakCount 800 -precalcValBufSize 1024 -precalcIdxBufSize 1024  -numThreads 7  -mode ALL

Results for stage N 11:

image description

...........

image description

Stage N 11 was constructed successfully for lower values of samples: -numPos 5000 -numNeg 10000

What are the reasons for looping? Insufficient number of data samples? There is no possibility to improve discriminative ability of cascade classifier? Or something else?

2015-11-25 05:49:05 -0600 commented answer What are Stages in traincascade.exe?

Yes. I agree. Link only answer is not a good answer. I made my answer a bit larger :)

2015-11-25 05:47:17 -0600 received badge  Editor (source)
2015-11-25 00:56:18 -0600 answered a question What are Stages in traincascade.exe?

Matlab Cascade Classifier is a wrapper over OpenCV one. There is a good tutorial for Matlab classifier.

Total hit and false alarm rates calculated using hit (stageHR) and false alarm (stageFAR) rates for each stage:

totalHR = stageHR^NumStages;    
totalFAR = stageFAR^NumStages.

Thus values of hit and false alarm rates for each stage depend on number of stages.

Number of stages influences the amount of training data: number of positive samples to use at each stage can be estimated using the following formula (see link):

number of positive samples = floor(totalPositiveSamples / (1 + (NumStages- 1) * (1 - stageHR)))

Following information is useful for choosing a number of stages:

  • "Stages with a lower false positive rate are more complex because they contain a greater number of weak learners."
  • "Stages with a higher false positive rate contain fewer weak learners."
  • "Generally, it is better to have a greater number of simple stages because at each stage the overall false positive rate decreases exponentially. For example, if the false positive rate at each stage is 50%, then the overall false positive rate of a cascade classifier with two stages is 25%. With three stages, it becomes 12.5%, and so on."
2015-11-24 02:15:42 -0600 answered a question Detect certain object that is partly cluttered

I think that your task is Anomaly Detection problem. You can read details in paper: Varun Chandola et. al. "Anomaly detection: A survey" ACM Computing Surveys (CSUR), Volume 41, Issue 3, July 2009, Article No. 15

2015-11-23 01:17:04 -0600 answered a question Evaluation model of Haar cascade classifier

You can use cv::BaseCascadeClassifier::detectMultiScale() function in C++ program. Another method is to use python or Matlab interface to CascadeClassifier.

2014-06-20 01:46:17 -0600 received badge  Supporter (source)