Neural Network learning project based on 8 wave signals over 1 second at 1 sample every 10 ms ( hence 100Hz )

I'm currentely trying to train a neural network that can decide wether a pattern produced by the movement of a hand near capacitive sensors is as expected, or random. I have an MPR121 microchip linked with an arduino, providing me 8 signals ( ranging from 0 to 255 ), that stays at baseline ( around 135 for my current conditions ) when nothing is near or perturbating the conductances. The value lowers when something conductive approaches it. Here is some pictures to help you represent the thing. The pattern of the eight channels together give information on the postion of the hand on one axis. The neural network is supposed to learn himself how the different channels react, in wich order, so i don't have to tell anything to the programm concerning the physical distance between two electrodes or whatever.

The fact is that i would like to learn how to do neural networks but i have no idea how to feed the data ( especially for data over time, which differs from typical image analysis tutorials often seen for neural networks over the internet ), considering that there is 100*8 values to analyse for each frame (100 values for 1 sec frame, for the eight channels ) and i don't know if i should have a network with 800 input nodes.... seems to me like i miss something...? Can i pass a list as one input to a neural network ,hence reducing the amount of input nodes to 8 ?

And another question i had, once trained, will th algorithm be exportable on an arduino ? I read somewhere that once trained, the weight of the nodes can be gathered, alowing to make an equation to choose from inputs to output, here yes or no. Arduino should be able to perform the calculation of this equation quite complex in a short amount of time i guess ?

( If you want to know, the labelisation of the data will be performed afterward, with a button connected to the arduino, telling him to record an d labellise as positive on an SD card the past 1 sec recording of the 8 channels. Everytime i will perform the hand pattern to be learnt, i will push this button. The randoms signals wich are labelled negative are 1 sec recordings, picked randomly over time of the day, to catch changes in baseline and hopefully some false positive noises due to people wandering around )

Thank you in advance for your help and advices on my project. =) And by the way, sorry for my english, hope i didn't shocked anyone.

...a neural network that can decide wether a pattern produced by the movement of a hand near capacitive sensors is as expected, or random.

The neural network is supposed to learn himself how the different channels react, in wich order, so i don't have to tell anything to the programm concerning the physical distance between two electrodes or whatever.

At this point, I am not sure if you wanted to create a neural network that can learn how to interpret the readings from the 8 capacitive sensors to infer the position of the hand over the sensor overall, or, a classifier that can understand a specific gesture.

I think that what you are trying to do is the latter. That is, you want to move your hand in a particular gesture above the sensor "bar" and have a classifier recognising if this was one of the "known" gestures or someone just passing nearby.

If this is indeed what you are trying to achieve then you would need to look more closely into types of neural networks that can take into account time such as recurrent neural networks.

In this case, the input layer of the network would have 8 nodes, the hidden layer would have a number of neurons / layers that would depend on how long is the gesture to be learned and the output layer could well be a single node with a 0-1 output.

And another question i had, once trained, will th algorithm be exportable on an arduino ?

You can train this "offline" and then try to run the network on an Arduino, but I am not sure if you will get the same performance as you would get on a desktop computer. For two reasons:

1. You might run out of memory quickly on the Arduino depending on the number of nodes your network will end up having; and

2. The Arduino does not do floating point arithmetic. Yes, float does exist as a data type but in most boards it is emulated in software. If you have a board with a CPU that has a Floating Point Unit and the compiler can "see" it, then you might be in luck. But, without an FPU, without 32 (or at least 16) bit architecture and without much memory, then, the Arduino does not do floating point arithmetic.

There is however another way by which you can do gesture recognition with less computational complexity so that it is easier for an Arduino to run it.

Sum the outputs of all 8 capacitive sensors to produce one output and then run a "traditional" pattern recognition technique which would basically try to recognise a single waveform. In this way, you still do not have to make any additional specifications regarding the geometry of the bar.

Suppose that you configure your sensor "bar" in this way. If you run your hand from left to right, you will get an output with 8 "bumps" as your hand passes closely from each one of the sensing elements. If you move your hand from left to right and also do a "wave" in mid-air, then you will get an output with 8 "bumps" whose amplitude will vary depending on the distance of your hand from the sensors.

Obviously, the problem that this method has is that it cannot discriminate symmetrical gestures. For example, moving horizontally left to right and right to left. But, it can still discriminate between non-symmetric gestures (for example, moving left to right horizontally and moving left to right in an increasing "line" (or ramp). These two gestures would produce 2 distinct waveforms that it is fairly easy to classify.

You can do this with a number of ways from very simple to very complex with varying degrees of accuracy (and of course computational complexity).

One of the easiest (for Arduino too) would be to use a k-NN classifier.

By the way, a resource you might find useful is the Gesture Recognition Toolkit. In addition to the software itself, the wiki contains a lot of information on materials and methods it uses.

Hope this helps.