fhpkg: Feature Hierarchy Package for CNS

Author:Jim Mutch
Homepage:http://cbcl.mit.edu/jmutch/cns


Description

This is a CNS package that can be used to instantiate a broad class of feedforward object recognition models. The package includes demo scripts to build and run the specific models described in these papers: Note that the work described in the above papers was not originally performed using fhpkg, but rather the older (non-GPU) FHLib. fhpkg is a reimplementation using CNS.


Installation

See the instructions for installing packages in the CNS manual. (CNS itself must be installed first.)

Once the package has been installed, make sure it's working by running the following demo script (described in more detail below):

>> fhpkg_cvpr06_run
The script should just output an elapsed time. The CNS manual contains a troubleshooting section if you encounter problems.


Introduction

Each of the feedforward recognition models described in the above papers computes a hierarchy of increasingly complex features that are increasingly invariant to position and scale. This is done in interleaved levels that perform either tuning or pooling. Tuning levels are named "S1", "S2", etc. and pooling levels are named "C1", "C2", etc. Each level is computed at multiple resolutions (scales), i.e. each such level is a scale pyramid.

Using fhpkg, each of these levels is represented as a CNS group, composed of multiple CNS layers, one layer per scale. This allows all the scales of a group to share common parameters and a common feature dictionary.

Under the directory fhpkg/demo there are several demo scripts.

fhpkg_cvpr06_run
fhpkg_pnas07_run
These demo scripts illustrate the overall process of instantiating a model, learning a feature dictionary, and computing feature vectors for images. When you start looking into the code, look at fhpkg_cvpr06_run first.

fhpkg_cvpr06_run_cal101
fhpkg_cvpr06_run_uiuc
More extensive demo scripts that perform some of the experiments in the above papers.

fhpkg_cvpr06_base_params
fhpkg_cvpr06_full_params
fhpkg_pnas07_params
Each of these contains a compact set of parameters that defines a particular feedforward model (number of "S" and "C" levels, the particular tuning or pooling operation, its parameters, pooling ranges, etc.)

fhpkg provides a function, fhpkg_model, which takes one of these parameter sets and generates a complete CNS network model which you can then instantiate and run on the GPU.

fhpkg_model hands off the generation of each group to the Add method of the corresponding cell type; this method is defined as an additional MATLAB method in each cell type's ".m" file.

The fhpkg/util directory contains a number of helper functions, most of which help manage feature dictionaries (eg., fhpkg_sample).


Additional Documentation

Documentation for fhpkg currently consists of:

Revision History

Rev# Date Changes
r55 2010-03-19 Updated to use simplified CNS field classes.
r58 2010-03-24 Identified many fields as private.
r63 2010-11-01 Added the fhpkg_cvpr06_run_cal101 demo script.
r66 2010-11-07 Added the fhpkg_cvpr06_run_uiuc demo script.
r71 2010-11-13 Updated to use #BLOCKSIZE and #NULL.
r75 2011-01-28 Updated to use FIND_type_dim_... macros.
r76 2011-02-11 Split dimensions are no longer visible to kernels.
r77 2011-02-17 Cell types are now defined using classdef.