5 This is the documentation for the open-source C++ implementation of
6 the folded hierarchy of classifiers for cat detection described in
8 F. Fleuret and D. Geman, "Stationary Features and Cat Detection",
9 Journal of Machine Learning Research (JMLR), 2008, to appear.
11 Please use that citation when referring to this software.
13 Contact Francois Fleuret at fleuret@idiap.ch for comments and bug
19 If you have installed the RateMyKitten images provided on
21 http://www.idiap.ch/folded-ctf
23 in the source directory, everything should work seamlessly by
24 invoking the ./run.sh script.
28 * Compile the source code entirely
30 * Generate the "pool file" containing the uncompressed images
31 converted to gray levels, labeled with the ground truth.
33 * Run 20 rounds of training / test (ten rounds for each of HB and
34 H+B detectors with different random seeds)
36 You can run the full thing with the following commands if you have
39 > wget http://www.idiap.ch/folded-ctf/data/folding-gpl.tgz
40 > tar zxvf folding-gpl.tgz
42 > wget http://www.idiap.ch/folded-ctf/data/rmk.tgz
46 Note that every one of the twenty rounds of training/testing takes
47 more than three days on a powerful PC. However, the script detects
48 already running computations by looking at the presence of the
49 corresponding result directories. Hence, it can be run in parallel
50 on several machines as long as they see the same result directory.
52 When all or some of the experimental rounds are over, you can
53 generate the ROC curves by invoking the ./graph.sh script. You need
54 a fairly recent version of Gnuplot.
56 This program was developed on Debian GNU/Linux computers with the
57 following main tool versions
59 * GNU bash, version 3.2.39
61 * gnuplot 4.2 patchlevel 4
63 Due to approximations in the optimized arithmetic operations with
64 g++, results may vary with different versions of the compiler and/or
65 different levels of optimization.
70 The main command has to be invoked with a list of parameter values,
71 followed by commands to execute.
73 To set the value of a parameter, just add an argument of the form
74 --parameter-name=value before the commands that should take it into
77 For instance, to open a scene pool ./something.pool, train a
78 detector and save it, you would do
80 ./folding --pool-name=./something.pool open-pool train-detector write-detector
85 For every parameter below, the default value is given between
96 * pictures-for-article ("no")
98 Should the pictures be generated for printing in black and white.
102 The scene pool file name.
104 * test-pool-name (none)
106 Should we use a separate test pool file. If none is given, then
107 the test scenes are taken at random from the main pool file
108 according to proportion-for-test.
110 * detector-name ("default.det")
112 Where to write or from where to read the detector.
114 * result-path ("/tmp/")
116 In what directory should we save all the produced files during the
119 * loss-type ("exponential")
121 What kind of loss to use for the boosting. While different losses
122 are implemented in the code, only the exponential has been
127 How many images to process in list_to_pool or when using the
128 write-pool-images command.
132 Maximum depth of the decision trees used as weak learners in the
133 classifier. The default value of 1 corresponds to stumps.
135 * proportion-negative-cells-for-training (0.025)
137 Overall proportion of negative cells to use during learning (we
138 sample among them for boosting).
140 * nb-negative-samples-per-positive (10)
142 How many negative cells to sample for every positive cell during
145 * nb-features-for-boosting-optimization (10000)
147 How many pose-indexed features to look at for optimization at
148 every step of boosting.
150 * force-head-belly-independence ("no")
152 Should we force the independence between the two levels of the
153 detector (i.e. make an H+B detector)
155 * nb-weak-learners-per-classifier (100)
157 This parameter corresponds to the value U in the article.
159 * nb-classifiers-per-level (25)
161 This parameter corresponds to the value B in the article.
165 How many levels in the hierarchy.
167 * proportion-for-train (0.75)
169 The proportion of scenes from the pool to use for training.
171 * proportion-for-validation (0.25)
173 The proportion of scenes from the pool to use for estimating the
176 * proportion-for-test (0.25)
178 The proportion of scenes from the pool to use to test the
181 * write-validation-rocs ("no")
183 Should we compute and save the ROC curves estimated on the
184 validation set during training.
186 * write-parse-images ("no")
188 Should we save one image for every test scene with the resulting
189 alarms. This option generates a lot of images for every round and
190 is switched off by default. Switch it on to produce images such as
191 the full page of results in the paper.
193 * write-tag-images ("no")
195 Should we save the (very large) tag images when saving the
198 * wanted-true-positive-rate (0.75)
200 What is the target true positive rate. Note that this is the rate
201 without post-processing and without pose tolerance in the
202 definition of a true positive.
204 * nb-wanted-true-positive-rates (10)
206 How many true positive rates to visit to generate the pseudo-ROC.
208 * min-head-radius (25)
210 What is the radius of the smallest heads we are looking for.
212 * max-head-radius (200)
214 What is the radius of the largest heads we are looking for.
216 * root-cell-nb-xy-per-radius (5)
218 What is the size of a (x,y) square cell with respect to the radius
221 * pi-feature-window-min-size (0.1)
223 What is the minimum pose-indexed feature windows size with respect
224 to the frame they are defined in.
226 * nb-scales-per-power-of-two (5)
228 How many scales do we visit between two powers of two.
230 * progress-bar ("yes")
232 Should we display a progress bar during long computations.
239 Open the pool of scenes.
243 Create a new detector from the training scenes.
247 Compute the thresholds of the detector classifiers from the
248 validation set to obtain the required wanted-true-positive-rate.
252 Run the detector on the test scenes.
254 * sequence-test-detector
256 Visit nb-wanted-true-positive-rates rates between 0 and
257 wanted-true-positive-rate, for each compute the detector
258 thresholds on the validation set and estimate the error rate on
263 Write the current detector to the file detector-name
267 Read a detector from the file detector-name
271 For every of the first nb-images of the pool, save one PNG image
272 with the ground truth, one with the corresponding referential at
273 the reference scale, and one with the feature material-feature-nb
274 from the detector. This last image is not saved if either no
275 detector has been read/trained or if no feature number has been