This document summarizes work using the Fastai library to classify traffic signs from two datasets. ResNet50 was used as the backbone network with differential learning rates and test time augmentation. On the Belgium Traffic Sign dataset, the model achieved 99.4% accuracy, exceeding previous results. On the smaller rMASTIF dataset, 99.55% accuracy was achieved using only that training set, outperforming previous work that used larger combined datasets. The Fastai library allowed creating high performing classifiers with minimal effort.
2. Acknowledgements
• Thanks to my friend Louis Guthmann for his advice and review
• Thanks to Sylvain Gugger for his great notebook on cyclical learning rates and momentum, that in
particular helped me learn about Leslie Smith’s 1-cycle policy for learning rate scheduling
• Most importantly, a HUGE thanks to the Fastai team for making such an amazing library. It is so
powerful and accessible that I feel like cheating when I’m using it !
4. Notable Algorithms Aspects
• Backbone: ResNet 50 pre-trained on ImageNet
• Image Size: 299
• Data augmentation: basic transforms (see
below). No horizontal or vertical flips.
• Differential Learning Rates (use different
learning rates for different group of layers)
• Test-Time Augmentation: produce 4 slight
variations of each test image and average
• learning rate scheduling with the 1-cycle policy
(greatly explored by S. Gugger here)
5. Belgium Traffic Sign Classification Dataset
• 62 categories
• Number of training examples = 4,575
• Number of testing examples = 2520
6. BTSC Training & Results
First roughly train final layers
Then, “unfreeze” all layers, and
fully train 15 epochs with 1-cycle
learning rate scheduling policy
Evaluate with Test Time
Augmentation
Test Accuracy = 82% Test Accuracy = 99.4% Test Accuracy = 99.4%
7. >50% error reduction Vs state-of-the-art?
Best previous results found on this dataset is 98.77%
Source: https://www.fer.unizg.hr/_download/repository/ACPR_2015_JurisicFilkovicKalafatic.pdf
Belgium Traffic
Signs Classification
My test accuracy = 99.4%
8. rMASTIF Dataset
• 31 categories
• Number of training examples = 4,044
• Number of testing examples = 1784
9. Same strategy on rMASTIF
First roughly train final layers
Then, “unfreeze” all layers, and
fully train with 1-cycle learning rate After Test Time Augmentation
Test Accuracy = 55.7% Test Accuracy = 99.5% Test Accuracy = 99.55%
10. Comparison Vs state-of-the-art
*Source: https://www.fer.unizg.hr/_download/repository/ACPR_2015_JurisicFilkovicKalafatic.pdf
99.55% Test Accuracy
BUT
• In only ~3000 iterations (OneCNN needed at least
20K iterations to reach such results)
• Using only rMASTIF training set (OneCNN trains on
both the German, Belgium and rMASTIF datasets,
i.e. about 10x more data)
My Results Previous State-of-the-art
11. Conclusions
• Deep learning can work well even on very small dataset !
• Even when images do not look like ImageNet, we can still use models pre-trained on
ImageNet
• Interestingly, when using the 1-cycle policy, TTA seems to be much less efficient. Could it
be because it’s so efficient that the optimization finds a very stable minima?
• With fast.ai library, it is possible to create state-of-the-art deep learning classifiers with
minimal efforts