Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

Classifying Motion Patterns of Bikes using Machine Learning

Larsson, Filip and Hallqvist, Pontus (2023)
Department of Automatic Control
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... (More)
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. (Less)
Please use this url to cite or link to this publication:
author
Larsson, Filip and Hallqvist, Pontus
supervisor
organization
year
type
H3 - Professional qualifications (4 Years - )
subject
report number
TFRT-6192
ISSN
0280-5316
language
English
id
9112491
date added to LUP
2023-03-16 14:25:31
date last changed
2023-03-16 14:25:31
@misc{9112491,
  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.}},
  author       = {{Larsson, Filip and Hallqvist, Pontus}},
  issn         = {{0280-5316}},
  language     = {{eng}},
  note         = {{Student Paper}},
  title        = {{Classifying Motion Patterns of Bikes using Machine Learning}},
  year         = {{2023}},
}