README
By: Minh Hoai Nguyen (minhhoai@gmail.com)
Date: 7 July 2011
=======================================================================================================

* Requirements:
	+ Cplex librabry
	+ GSL CBLAS library
	+ LibSVM library

* Compilation:
	+ type: make
	
* Demo functions:
	+ m_main_synData1D.m: experiments on synthetic 1D data.
	+ m_main_falling.m: experiments on accelerometer data for walking/falling, for discovering falling events. 
			This is only for qualitative evaluation only.
	+ m_main_kitchen_MC.m: experiments on the CMU-MMAC (kitchen) dataset, for recipe classification
	+ m_main_cmuFace.m: experiments on CMU Face dataset, for finding sun-glasses. 

* Main learning functions and how to write new code:
	+ m_learnSegSVM.m: main optimization function for joint localization and classification, binary case.
	+ m_learnSegMCSVM.m: main optimization function for joint localization and classification, multi-class case. 
	
	These function requires metaD structure as input. metaD requires some subfields. Please
	take a look at the begging of each files to see specific fields that they requires. 
	In both cases, metaD requires the following fileds: cmpInitFeats, cmpSegFeats. 
	cmpInitFeats and cmpSegFeats are the names of the functions to compute initial and segmentation features
	The function cmpInitFeats must take exactly 2 input arguments (metaD, posOrNeg) 
	  and returns a matrix of feature vectors.
	The function cmpSegFeats must take exactly 3 input arguments (metaD, binW/Ws, posOrNeg)
		and returns a matrix of feature vectors (computed on the foreground windows/segments).
		Basically, given the current weight vector(s) binW/Ws, compute the feature vectors of the
		most violated constraints.
	Note that the interface of cmpInitFeats and cmpSegFeats functions must strictly conform to the above requirements
	  The input metaD of m_learnSegSVM must also has all the required fields. Extra data
	  to support feature computation are fine (and should be included).

  To implement a new instance of SegSVM, you need to provide two functions cmpInitFeats and cmpSegFeats.

	Examples of these functions are included in the code are: 
	+ m_cmpInitFeats_1D.m: for 1D data, binary case
	+ m_cmpSegFeats_1D.m: for 1D data, binary case
	+ m_cmpInitFeats_2D.m: for 2D data, binary case
	+ m_cmpSegFeats_2D.m: for 2D data, binary case   
	+ m_cmpInitFeats_1D_MC.m: for 1D data, multi-class case
	+ m_cmpSegFeats_1D_MC.m: for 1D data, multi-class case
		                                                                                                                     
* main C++ code, the .cpp and .h files should not be touched unless you know what you are doing.
	+ m_mexLearnSegSVM.cpp: Code for training SegSVM, binary case, asymetric treatment for positive and negative data.
	+ m_mexLearnSegMCSVM.cpp: Code for traing SegSVM, multi-class case
	+ m_SegSVM_CCCP.cpp: optimiation routine, Convex-Concave Constraint Programming for SegSVM
	+ m_SegMCSVM_CCCP.cpp: optimiation routine, Convex-Concave Constraint Programming for SegSVM
	+ m_utils.cpp, m_utils.h: contain utility functions
                       
* OTHER FILES:
	+ m_main_synData1D_MC.m: experiments on another synthetic data set, for multi-class situation.
	+ m_cmpBaoIntilleFeats.m: function to compute Bao-Intille features
	+ m_getConfMat.m: compute confusion matrix. 
	

* OTHER DEPENDENCY:
BeyondSlideWin/mexSrc/ml_findBox1b -> m_mexFindBox1b.mex*
BeyondSlideWin/mexSrc/ml_findMulti1DSegs.m -> m_mexFindMulti1DSegs.mex*
SegMMC/bin/m_mexMCSVM.mex
MyGradFuncs/Cosegment/ml_cmpLeafHists.m
MyGradFuncs/Cosegment/ml_leafHists2histPyr.m
MyGradFuncs/DataAccess/ml_getFilesInDir.m
MyGradFuncs/Classifier/ml_roc.m
MyGradFuncs/Misc/ml_rand


