Thursday, May 12, 2016

Data analysis, formatting and neuronal network

Once we achieved to successfully receive data frames from the Leap Motion, we decided to format the data so that we could use it for later processing, analysis and feature extraction.

This parsing process involved creating our own data structure during the reading process from the Leap Motion in order to output a JSON file we could store in the end.

This is an example of how our data structure looks like for a gesture in time:



With this very format, we created a list of five first gestures we would use for training during the creation of the neuronal network. For these gestures, we captured up to 10 times the same gesture, so that we had enough data to see differences and use it for training.

During the data analysis, we decided to base our machine learning algorithm on the difference in specific features of the hand and its fingers. You can read further about the features selected in future blog posts.

Using the principle of difference in features, we crated another parser to turn our JSON input structure to the final datasets we were going to use for the neuronal network. This is an example of a line of dataset refering to an specific gesture to train or test:

[1, -78.42485301863498, -11.56365593923438, -2.682151848258158, -79.59669543723484, -72.97278368984328, -65.2333200146023]

Once the data was ready to be fed to any neuronal network, we decided to use PyBrain for the network and the machine learning algorithm. First trials were successful, and we could difference and recognize the gestures we had recorded and trained with great confidence.

After all this process, we decided to create the first usable command-line application which applies the complete process (feeding the network from our structured files, training the network and testing the network against files of gestures).



|||||||||||||||||
Choose an option:
|||||||||||||||||

1. Feed from folder
2. Train
3. Test from file


> 3
File path: test/test_rnr.txt
 -> Results:
     pistol: 7%
     rnr: 85%
     rock: 3%
     scissors: 1%
     yaw: 2%

 -> Match: rnr



No comments:

Post a Comment