/jetbot-autonomous-driving

A classifier model designed to recognise traffic signs on the Jetbot autonomous vehicle platform.

Primary LanguagePythonMIT LicenseMIT

This README file gives a brief overview on the different files contained in this folder.

Contents

jetbot_traffic_sign_detection.ipynb is our main notebook file containing scripts to run the jetbot autonomously.

robot_control.py is a 'fork' of lfrobot that allows us to turn line following on or off. This was in an attempt to work around the jetbot sometimes following the black lines around the STOP and SPEED UP signs when it was pointing slightly off-centre. Instead of just line-following, we instead move forward "blindly" for a short period of time - hopefully just enough time for the sensors to clear the erroneous lines and come in contact with the actual centre line.

sign_classifier.py intends to encapsulate our classifier model. It aims to provide a simple interface for the actual robot logic code to access predictions through. It mainly defines image-preprocessing (i.e. contrast stretching) and SVM model related functions.

train_model.py is the training script we used to train the data. Currently, the script is setup such that it first runs a grid search with 5 cross validation folds for each combination of parameters. Then, the full model is trained with the full dataset, then tested against a completly unseen dataset to provide us with a final classification report.

Data

We found that mixing data collected over multiple days and collection runs resulted in more varied data and better classification results. (Data collection code can also be found within jetbot_traffic_sign_detection.ipynb, commented out). We found a balanced dataset of 250 samples for each class were sufficient for our classification task.

Model

We used a flattened CMYK image as our feature vector. The logic behind this was that it could better separate the colours commonly used in classification tasks. The lights are cyan, magenta, yellow and the lines are black. We hoped that this could make it easier for SVM to better separate the classes.