I am working on a project that involves recognizing gestures people perform during interaction with a fur-like prototype made up of conductive threads. These gestures could include patting, stroking, scratching, etc. I'd like to try a machine learning approach from my Arduino code (possibly a Hidden Markov model using sequences of circuit resistance as input data, or a neural network using total resistance change and other temporal circuit attributes as features).

First, I was thinking about using Weka, is that a reasonable choice for implementing data mining routines from Arduino?

Second, if it does make sense to use Weka with Arduino, is there any sample code someone could direct me to? I've looked but so far haven't been able to find any myself.

While I don't doubt that you could implement some form of artificial intelligence in an Arduino, with only 2K of RAM it would be a tight squeeze (and you wouldn't end up with much).

AnnaFlagg - are you certain that this project isn't just a wee bit beyond your level of expertise? I mean, seriously - how does someone think to themselves "Yeah - I'll implement a machine learning algorithm on a harvard architecture that has only 2 kb of RAM and 32 kb of program space"? I mean, if you have any understanding of how neural networks or other machine learning algorithms are implemented, you would know that attempting such a thing would be verging on madness, if not near impossibility.

Like I said, though - you could probably get something to work, but not likely anything close to your aspirations (and certainly you're not going to be running this in Java on the Arduino - that isn't happenning).

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

What is probably possible is to use the Arduino to get the sensor data and send it over to something more powerfull to process. Thats what Arduino's can do very well.

I can imagine that a first level of processing is done on the Arduino. Gestures are in the order 0.1-10 seconds (I guess) so all signals smaller than 0.1 seconds could be filtered out.

Another thing the arduino can do is add duration tags to gestures. E.g. So the generates records like { duration, wireID } so instead of sending 1000 messages per second that a wire is touched, the Arduino just sends 10 times "100, 5". By maximizing the duration you can tune the sensitiveness.

Another way is to make a record which wire is touched in the last 100 millisec. This would result in something like:

Thanks for the replies. While I am fairly new to this area, I am aware that Arduino would likely not have enough RAM to carry out the whole project. However this approach was suggested to me, specifically combining Weka with Arduino, with the possibility of connecting to a more powerful processor as well. I'm interested in whether on a high level this approach makes sense, or if I should think along other lines.

Thanks for the replies. While I am fairly new to this area, I am aware that Arduino would likely not have enough RAM to carry out the whole project. However this approach was suggested to me, specifically combining Weka with Arduino, with the possibility of connecting to a more powerful processor as well. I'm interested in whether on a high level this approach makes sense, or if I should think along other lines.

Thanks again!

The approach of using the Arduino as an interface to a larger system (PC or otherwise), where that PC would be doing the bulk of the processing - wasn't made abundantly clear in your original post. Its a perfectly reasonable solution, though.

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

if you have any understanding of how neural networks or other machine learning algorithms are implemented, you would know that attempting such a thing would be verging on madness, if not near impossibility.

I'm not convinced that 2k of RAM is unreasonable for machine learning. Ok, so maybe neural networks would be tricky, but RL? e-greedy doesn't take up that much RAM or program space, as long as your state space isn't huge. e-greedy is also relatively easy to implement.

This is something I've been meaning to play with, so I'm going to try it. If I get around to actually doing it, I'll post the code here.