Python-based classification model creation for rock, paper, scissors Gesture Recognition
Neurotechnology: Brains and Machines
November 2023
KD Vo and Mo Ampane
KD Vo and Mo Ampane
This project aimed to go through all the stages of implementing a machine learning classifier (data collection, data analysis, training the classifier, and improving the classifier’s performance). The classifier and process were applied to sEMG (surface electromyography) signals to classify whether a person threw rock, paper, or scissors when playing the classic game. Potential applications of EMG analysis, classification for ASL translation, and some of the impacts of this theoretical model were also explored. The game title “Rock, Paper, Scissors” will be shortened to "RPS" for easier explanation.
Using armbands that recorded sEMG data and a data collection script given to us, we recorded training data to help train our classifier. We built our classifier with three models: a neural network, a K-nearest neighbors model, and a Random Forest Classifier model. In the end, we primarily used the Random Forest Classifier model since it yielded higher accuracy for live/testing data. The training accuracy for the Random Forest Classifier was lower due to the myriad of training conditions produced for the training data. For emphasis, our training data included trials of wearing the armband on different wrists, how the gesture was thrown out by the user, and more conditions.
The tables below show the actual gesture thrown and the model prediction during our live testing.
To increase the accuracy of our classifier, we explored different algorithms, collected more robust data, and conducted some post-processing for our live classification. With our goal of optimizing our classifier to have the best accuracy it can, we found that our classifier performed well with an algorithm using the Random Forest Classifier trained on unfiltered data. These changes heavily increased our accuracy performance.
For data collection, we were limited due to the lack of filter processing on the data. We trained our model on unfiltered data and only on 5 rounds of data (150 data points) from one person. This means that our model was not trained on a large set of data, which affects how accurate our model is if and when another user has the armband on. This was fortunately not the case during the live classification; however, we only used one person for all the testing instead of letting other people use the armband with our classifier.
To make our classifier better, we would want to introduce more pre-processing (filtering) to the data we obtain live. Since we did not pass the data through filtering for both the training data and the live data, this would affect how our classifier works, and ultimately make our model less robust. By adding the additional preprocessing step, our classifier would probably have a higher accuracy due to the signal analysis being more accurate. This would mean we would not need to switch the training labels since our accuracy would likely be higher. All of these changes would help move our classifier from only classifying gestures for RPS toward ASL gestures.