OpenViBE forum

The OpenViBE community
It is currently Thu Dec 14, 2017 10:06 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Dec 29, 2015 7:47 pm 
Offline

Joined: Wed Apr 11, 2012 1:31 pm
Posts: 36
Location: Nice - Alpes Maritimes
Hi OpenVibers,
The SVM algorithm (libsvm library) seems to perform very poorly on the standard motor imagery scenario bundled with OV (the one with a preliminary SCP filtering)... versus the standard LDA (Linear Discriminant Analysis): it appears that the feature vectors required by the SVM classifier have to be normalized. Have any of you reached satisfactory results with the SVM classifier ?
I was wondering how to normalize (X transformed into (X-mean(X))/sqrt(var(X)) variables on OV ? Some contributors suggest to use the "simple DSP" box but I don't see how to add inputs on it to inject the Mean and Variance signals computed by the "Univariate Statistics" box. Is there a way to do this ? (without having to create the new box "Normalizer")
Image


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 30, 2015 3:25 am 
Offline

Joined: Wed Apr 11, 2012 1:31 pm
Posts: 36
Location: Nice - Alpes Maritimes
Well, if normalization of the feature vectors is mandatory for the SVM classifier to operate correctly, maybe it would be better if it was implemented directly in ovpCAlgorithmClassifierSVM.cpp directly ? I have inserted the following lines, to activate a normalization of the feature vectors if epsilon=0.001 in the settings, to see if I get better classification results with the SVM (versus LDA which reaches 90% on the motor imagery right/left):

Code:
   if(m_oParam.eps==0.001)
   {
      // Normalization of the feature vectors
      for(uint32 j=0;j<m_ui32NumberOfFeatures;j++)
      {
         double moment1 = 0.0;
         double moment2 = 0.0;
         for(int i=0;i<m_oProb.l;i++)
         {
            moment1 = moment1 +  m_oProb.x[i][j].value;
            moment2 = moment2 + (m_oProb.x[i][j].value)*(m_oProb.x[i][j].value);
         }
         moment1 = moment1/m_oProb.l;         // moment1 stores the mean
         moment2 = moment2/m_oProb.l-moment1;   // moment2 stores the variance
         for(int i=0;i<m_oProb.l;i++)
         {
            m_oProb.x[i][j].value=(m_oProb.x[i][j].value - moment1)/sqrt(moment2)/2;
         }
      }
   }


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.