Package pycv :: Package cs :: Package ml :: Package cla :: Package boost :: Module cascade
[hide private]
[frames] | no frames]

Module cascade

source code

Classes [hide private]
  SimpleCascade
A cascade of binary classifiers.
  ScoredCascade
  DirectFilteringCascade
A cascaded rejector of M*N weak rejectors f_1(x), ..., f_{M*N}(x).
  GeneralizedCascade
A cascade of M weak binary classifiers.
  NestedCascade
Nested Cascade
Functions [hide private]
 
train_SC(cd, trainfunc, maxM, maxFR=0.9)
Train a cascade of at most maxM filters (binary classifiers).
source code
 
train_DFC(cd, cdgenerator, initfunc, trainfunc, M, N, alpha)
Train a DirectFilteringCascade using my method in my notebook dated 2 May 2007.
source code
 
main() source code
Function Details [hide private]

train_SC(cd, trainfunc, maxM, maxFR=0.9)

source code 
Train a cascade of at most maxM filters (binary classifiers).

Input:
    cd: a WeightedCDataset -- modifiable
    trainfunc: a function that takes a WeightedCDataset as input
        and returns a BinaryClassifier
    maxM: the maximum number of filters to be trained
    maxFR: if the filtering rate (the number of negatives after training
        divided by the number of negatives before training) rises above
        'maxFR' then stop
Output:
    cascade: a Cascade of filters
    new_classification_dataset: a new WeightedCDataset filtered by the
        cascade, useful for subsequent training

train_DFC(cd, cdgenerator, initfunc, trainfunc, M, N, alpha)

source code 

Train a DirectFilteringCascade using my method in my notebook dated 2 May 2007.

Goal: to train a cascade such that at decisive stages, FAR is minimized
    and FRR is upper-bounded by alpha.
Input:
    cd: a ScoredWCDataset of 2 classes -- modifiable
    cdgenerator: a CDataGenerator for the 'cd'
    initfunc(cd): a function that takes WeightedCDataset 'cd',
        initializes some data, and returns 'data'
    trainfunc(data,minDR): a function that takes initalized 'data'
        and constant 'minDR' as input and returns a BinaryClassifier. The
        function must be able to train to have at least 'minDR' detection
        rate.
    M: the maximum number of stages
    N: the number of weak classifiers per stage
    alpha: the maximum value of an exponential-based upper bound of FRR,
        0 <= alpha <= 1
Output:
    a DirectFilteringCascade