From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

London LabVIEW User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiclass classification in LabVIEW using SVM and one-vs-all method

Dr Bo Fu is a Certified LabVIEW Developer and joined the Austin Consultants team in December 2013 as a Systems Engineer. Dr Fu joins us from the University of Nottingham where he completed his PhD and did a Postdoc in Electronic Engineering, developing a high-speed dynamic-sampling camera and a real-time control spatial light modulator.

Dr Fu is currently working on a very exciting project involving a combination of different AI techniques including Neural Networks, K-means and SVN to name a few. Dr Fu posts regularly on his  blog and has written the post below about using SVM to do multi-class classification.

Dr Fu explains:

“Today I came across a problem to use  SVM to do multi-class classification. The  toolkit downloaded from NI did not provide the ability to do multi-class classification with SVM but only for two classes (it’s quite a useful tool still). So I took use of the SVM VIs and made a multi-class version using one-vs-all method.

There is a good  tutorial on one-vs-all or one-vs-rest classification by Andrew Ng. We pick one class each iteration as Class A and make the rest classes as Class B. Only the test data that locate in Class A are allocated to the known class. Here is the code:

LabVIEW_Machine_Learning

The original trained labelled data are classified as Class 0, 1, 2, … N. In the i-th iteration, only the data from Class i are re-classified to Class 1 and the rest data are re-classified to Class 0. When the test data locate in class 1 area, they are classified as Class i. Any unsorted data are left in Class -1.

When I test the performance of this one-vs-all classifier, the result seems fine.

LabVIEW_Machine_Learning

Message 1 of 5
(10,428 Views)

is this supported in the labview version 2013

can you please expline me detail about this code

my mail id : rathodrajesha0@gmail.com

please send me to this mail....

0 Kudos
Message 2 of 5
(7,160 Views)
Hi Rathod,

Thanks for your comment on  https://decibel.ni.com/content/groups/london-labview-user-group/blog/2014/01/13/multiclass-classific...

The original post is in my blog http://foolooo.wordpress.com/2014/01/11/multiclass-classification-in-labview-using-svm-and-one-vs-al... where you can find a clearer picture. You can save that picture as the code. To run this piece of code you need to download the machine learning toolkit from LabVIEW (https://decibel.ni.com/content/docs/DOC-19328 ). And yes, it supports LabVIEW 2013.

The SVM classification algorithm in the toolkit supports only two-class classification and I expanded it to a multi-class algorithm using one-vs-all classification method. This video https://www.youtube.com/watch?v=p5rTio1G4ys gives a good explanation of this sorting algorithm. It may be easier you take a look at this 6 min video.

It may help if you describe your application and we can discuss if SVM is the best solution. Please feel free to drop me an email if more questions. Cheers.

I sent an email to your inbox as well.

Regards,

Bo

------------------------
My blog Let's LabVIEW.
0 Kudos
Message 3 of 5
(7,160 Views)

Sir,

Thanks for the above information about multi-class SVM. I have to classifiy the fault samples in multiple classes using SVM. I tried the method discussed above.  I had to change some data-types due to data type errors. Unfortunately, I'm not getting the desired results. Can you please provide the VI used or any email id to contact..

Best regards!

0 Kudos
Message 4 of 5
(7,160 Views)

Hi akanksha,

We added a link to download the code in http://www.austinconsultants.co.uk/multiclass-classification-in-labview-using-svm-and-one-vs-all-met... Hope that will help. Cheers.

Regards,

Bo

------------------------
My blog Let's LabVIEW.
0 Kudos
Message 5 of 5
(7,160 Views)