Indrasyach
Indrasyach

Reputation: 147

Improve the accuracy performance on SVM

I am working on people detecting using two different features HOG and LBP. I used SVM to train the positive and negative samples. Here, I wanna ask how to improve the accuracy of SVM itself? Because, everytime I added up more positives and negatives sample, the accuracy is always decreasing. Currently my positive samples are 1500 and negative samples are 700.

%extract features
[fpos,fneg] = features(pathPos, pathNeg);  
%train SVM
HOG_featV = loadingV(fpos,fneg);   % loading and labeling each training example
fprintf('Training SVM..\n');
%L = ones(length(SV),1);
T = cell2mat(HOG_featV(2,:));
HOGtP = HOG_featV(3,:)';
C = cell2mat(HOGtP); % each row of P correspond to a training example 


%extract features from LBP
[LBPpos,LBPneg] = LBPfeatures(pathPos, pathNeg);
LBP_featV = loadingV(LBPpos, LBPneg);
LBPlabel = cell2mat(LBP_featV(2,:));
LBPtP = LBP_featV(3,:);
M = cell2mat(LBPtP)'; % each row of P correspond to a training example

featureVector = [C M];
model = svmlearn(featureVector, T','-t 2 -g 0.3 -c 0.5');

Anyone knows how to find best C and Gamma value for improving SVM accuracy?

Thank you,

Upvotes: 2

Views: 2114

Answers (2)

foresea
foresea

Reputation: 73

I followed ASantosRibeiro's method to optimize the parameters before and it works well. In addition, you could try to add more negative samples until the proportion of the negative and positive reach 2:1. The reason is that when you implement real-time application, you should scan the whole image step by step and commonly the negative extracted samples would be much more than the people-contained samples. Thus, add more negative training samples is a quite straightforward but effective way to improve overall accuracy(Both false positive and true negative).

Upvotes: 0

ASantosRibeiro
ASantosRibeiro

Reputation: 1257

To find best C and Gamma value for improving SVM accuracy you typically perform cross-validation. In sum you can leave-one-out (1 sample) and test the VBM for that sample using the different parameters (2 parameters define a 2d grid). Typically you would test each decade of the parameters for a certain range. For example: C = [0.01, 0.1, 1, ..., 10^9]; G= [1^-5, 1^-4, ..., 1000]. This should also improve your SVM accuracy by optimizing the hyper-parameters.

By looking again to your question it seems you are using the svmlearn of the machine learning toolbox (statistics toolbox) of Matlab. Therefore you have already built-in functions for cross-validation. Give a look at: http://www.mathworks.co.uk/help/stats/support-vector-machines-svm.html

Upvotes: 1

Related Questions