title: SIFT Fisher Vector GMM
body: <p>I am trying to extract SIFT Features with vl_feat implementation in Matlab and compute then the GMM model as well as the Fisher Vector. I have two subsets train and test images from DTD Dataset. </p>
  
  <ol>
  <li>run vl_sift on each split (train&amp;test) and save the 128xN Features </li>
  <li>Apply the cell Array each consists of 128xN Features to vl_gmm and get for each Feature [mean covarinace weight] and then apply the Features with calculated gmm model values to vl_fisher for each Feature.</li>
  <li>Make PCA</li>
  <li>Put all in SVM</li>
  </ol>
  
  <p>My problem is that I dont know in step 2. how to transform the Feature values of each image to fit in into vl_gmm and vl_fisher.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>%% SIFT Feature Extraction
  
  FV_train = cell(size(train_name, 1), 1);
  FV_test = cell(size(test_name, 1), 1);
  
  parfor_progress(size(train_name, 1));
  
  parfor n = 1:size(train_name, 1) 
  
  [~, FV_train{n}] = vl_sift(single(histeq(imresize(rgb2gray(imread(strcat(pwd, '/DTD/images', '/', train_name{n}))), [512 512]))));
  [~, FV_test{n}] = vl_sift(single(histeq(imresize(rgb2gray(imread(strcat(pwd, '/DTD/images', '/', test_name{n}))), [512 512]))));
  parfor_progress;
  
  end
  
  parfor_progress(0);
  
  FV_train = FV_train(~cellfun('isempty',FV_train));
  FV_test = FV_test(~cellfun('isempty',FV_test));
  
  FV_train = adaptFV(FV_train);
  FV_test = adaptFV(FV_test);
  
  parfor n = 1:size(FV_train, 1) 
  
  FV_train{n} = double(reshape(FV_train{n},1,size(FV_train{n},2)*size(FV_train{n},1)));
  FV_test{n} = double(reshape(FV_test{n},1,size(FV_test{n},2)*size(FV_test{n},1)));
  
  end
  </code></pre>
  
  <p>There exists two other problems:</p>
  
  <ul>
  <li><p>One ist that SIFT fails on some images, therefore I rejected them</p></li>
  <li><p>Due to the fact of the different dimensionality of SIFT Feature I have taken the longest one and fill the others with zeros to an 1xN Feature Vector.</p></li>
  </ul>