SVM implementation on a Photon device

Hi!, does anyone have any experience with implementing a Support Vector Machine (SVM) classification algorithm on a Photon device? does anyone know a library that could be adapted to a Photon device?. thanks in adavance

These little processors really don’t have a lot of resources for this type of work but it would be possible, just not fast or small. Once you have trained the classifier, just using it is actually pretty easy so I would recommend offline training.

I think you will have say more about exactly what you are trying to do if you want to get more precise advice.

1 Like

Hi @bko … thanks for your help … as always. yes, i agree, my initial idea is to use libsvm for training and use the model files generated to perform the classification procedure locally on the photon device. i found a java based program called svm-arduino that generates an arduino compatible code for performing the classification procedure. i successfully adapted the generated code for being executed on a photon device, but i would like to know any other experiences on SVM implementation on photon devices before taking a decision about which procedure to follow. thanks in advance for your constant support.

Well that is neat–I didn’t know about svm-arduino (which is says is a beta by the way). I don’t think you really need generated code for a linear svm but maybe it helps with the more complex ones. But when I look at the example code for a polynomial kernel SVM, no attempt is made to optimize for the alpha values which are always +1,0,-1.

It still matters quite a bit if your feature vector is large and if you are doing multiclass. You will also want to think about datatypes. The svm-arduino appears to use float but you might need double or maybe if you have a simple problem, scaled int32 or even uint8 for alpha with if statements.

I certainly don’t know anyone else who is doing this on a Photon.

Hi @bko … my aim is to perform a classification on a photon device with 20 features for, initially 36 targets, but with the latter purpose of increment this amount. it will be integrated in a sign language translator based on the values provided by different sensors, and additionally a gyroscope and an accelerometer … i consider a linear or rbf kernel. to be honest, i have not looked deep into the generated code from SVM-arduino, but i consider it can be a valid initial approach to implement the svm scaling and classification tasks from the LibSVM models and scaling data, and that it can fits the processing capabilities of the Photon device. in any case, any other referece/approach will be appreciated. thanks

1 Like