title: Head detection using HOG and SVM
body: <p>I am currently trying to detect heads in a sequence of real-footage images and am using HOG feature descriptor and SVM as classifier.</p>
  
  <p>Currently I am using <strong>Dalal's HOG implementation</strong> code in MATLAB found in this link:
  <a href="http://www.mathworks.com/matlabcentral/fileexchange/46408-histogram-of-oriented-gradients--hog--code-using-matlab" rel="nofollow">http://www.mathworks.com/matlabcentral/fileexchange/46408-histogram-of-oriented-gradients--hog--code-using-matlab</a></p>
  
  <p>Currently I am using <strong>libSVM MATLAB</strong> version found in this link:
  <a href="http://www.csie.ntu.edu.tw/~cjlin/libsvm/" rel="nofollow">http://www.csie.ntu.edu.tw/~cjlin/libsvm/</a></p>
  
  <p>I prepared 350 positive training images and 1243 negative training images.</p>
  
  <p>The hog feature vectors extracted from the training images are converted to libsvmFormat and inputted in the libsvm training method, to obtain a model. The hog vector length is that of 1764.</p>
  
  <p>Regarding the libSVM I chose these as parameters:</p>
  
  <ul>
  <li><code>-s 0  (i.e. C-SVC)</code></li>
  <li><code>-c 1  (i.e. cost = 1)</code></li>
  <li><code>-t 2  (i.e. kernel = RBF)</code></li>
  <li><code>-g 3  (i.e. gamma = 3 (this is for kernel))</code></li>
  </ul>
  
  <p>Regarding the HOG version, I left the cell, bin &amp; block parameters as they were in the implementation shown in the link above.</p>
  
  <p>I am using a scanning window of size 128x128 and 256x256 to scan through the whole image to detect possible heads.  At each window, the hog feature vector is extracted for each image and is inputted in libsvm predict, to test whether it should be classified as a head or not.</p>
  
  <p>However, after doing all the above, I have a numerous amount of false negatives and can't figure out what I am doing wrong. </p>
  
  <p>Can someone experience please offer some advice on what is possibly wrong?  I really need to figure this out please.  Much appreciated!</p>