/TrafficSignsClassif

A deep classifier of the Belgium Traffic Sign dataset using the Fast.ai library

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Traffic Sign Classification using fast.ai library and course

Introduction

This repo contains 2 notebooks that build and train deep classifiers on both the Belgium and rMASTIF traffic sign classification datasets using fast.ai lesson 1 course and notebook .

If you're less interested in the code, and just looking for a high-level overview of the work done, I recommend to rather look at my SlideShare.

Note: I did not train or apply this classifier on the German traffic signs dataset, since Pavel Surmenok already built a very accurate fast.ai classifier for this dataset (more details can be found on his Medium post).

Traffic Signs Classes

Here is a visualization of the Belgian traffic signs classes:

BTS

And below a visualization of the rMASTIF (Croatian Traffic Signs) classes:

rMASTIF

Notable difference with fast.ai's lesson 1 notebook

The main changes that were made compared to fast.ai lesson 1 notebook are:

  • Resnet50 was used instead of Resnet34 as backbone
  • No horizontal flips are performed in data augmentation (don't forget we're talking about traffic signs!)
  • A very strong Dropout was used given the small size of the dataset in order to prevent from overfitting
  • The 1-cycle policy was used here with learning rates and weight decay derived from Sylvain Gugger's notebook to train the networks as efficiently as possible.
  • The part where we train the final layers only (without unfreezing the ResNet layers) using data augmentation was removed, because it did not seem to add value (but I might have missed something).

Results

Prior art

The state-of-the-art on these 2 datasets was mentioned in 2015 by the paper "OneCNN".

ResultsTable

I could not find more recent and better results on one of these 2 datasets. Below is their results table:

Results obtained

Using the aforementioned adaptations of the Dog Vs Cat course and notebook, I was able to:

  • Reach 99.4% test accuracy on the BTSC dataset, which means that the error is more than 2x smaller than the best result in the table above (Zhu et al., "Traffic sign classification using two-layer image representation", which scored 98.77% accuracy).
  • Reach 99.5% accuracy on the rMASTIF dataset. This is approximately the result that was obtained by OneCNN, which is the best result to my knowledge, but this notebook achieves it in ~3000 iterations (compared to 25K for OneCNN), and using only the rMASTIF dataset (OneCNN trains on the German, Belgian, and rMASTIF datasets).