Classifying Motion Patterns of Bikes using Machine Learning

University essay from Lunds universitet/Institutionen för reglerteknik

Abstract: Electric bikes have become ubiquitous in traffic, and with a growing user base and expensive prices, a demand for bike protection is increasing. Bike protection applications could include detecting and notifying the owner if their bike has been stolen or fallen over. This thesis aims to develop solutions for recognizing and classifying motion patterns of an electric bike to allow for improvements in bike protection applications. Using accelerometer, gyroscope and magnetometer data as input, machine learning models were developed to perform classification. The data was labeled to six classes of different motions and then normalized, split into time windows and featurized. The different machine learning models built and tested were k-nearest neighbors (KNN), Convolutional neural network (CNN), Long short-term memory (LSTM) and a combined CNN-LSTM network. Time windows with different lengths and overlaps were tested and evaluated to achieve the best accuracy possible. Lastly, a filter was applied to the output to correct misclassifications. To increase the understanding of how decisions were made by the models, Grad-CAM was applied to highlight what parts of the information the model found most crucial. Using the Grad-CAM heatmaps, it was found that the gyroscope data was the most influential for the model’s decisions. The model with the best performance was a CNN-LSTM combination network that uses a time window of 2 seconds and 75% overlap. It performed with an accuracy of 94.65%. When testing the best model with data from other bikes with different mounting positions, the accuracy was 35.23% indicating that different sensor placements or orientations changes the data in a way the current model cannot handle.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)