SlideShare a Scribd company logo
1 of 11
Traffic Sign Classification Using Fastai Library
https://github.com/sebderhy/TrafficSignsClassif
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 !
Configuration
Backbone Network:
• ResNet 50
Software:
• PyTorch (back-end)
• Fastai (high-level API)
Backbone:
• ResNet 50
Jupyter reference notebook:
• Fastai Lesson 1, classifying dogs Vs cats
Hardware:
• GPU Nvidia GTX-1070
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)
Belgium Traffic Sign Classification Dataset
• 62 categories
• Number of training examples = 4,575
• Number of testing examples = 2520
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%
>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%
rMASTIF Dataset
• 31 categories
• Number of training examples = 4,044
• Number of testing examples = 1784
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%
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
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

More Related Content

Similar to Traffic Sign Classification with Fastai Library

Системный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестовСистемный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестов
COMAQA.BY
 
StarWest2016_T24_ExploratoryAutomation_DawnJardine_Final
StarWest2016_T24_ExploratoryAutomation_DawnJardine_FinalStarWest2016_T24_ExploratoryAutomation_DawnJardine_Final
StarWest2016_T24_ExploratoryAutomation_DawnJardine_Final
Dawn Jardine
 
Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)
DVClub
 

Similar to Traffic Sign Classification with Fastai Library (20)

Agile Testing
Agile TestingAgile Testing
Agile Testing
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing Process
 
Test Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdfTest Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdf
 
Системный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестовСистемный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестов
 
How to Guarantee Continuous Value from your Test Automation
How to Guarantee Continuous Value from your Test AutomationHow to Guarantee Continuous Value from your Test Automation
How to Guarantee Continuous Value from your Test Automation
 
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
 
Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdf
 
Test automation principles, terminologies and implementations
Test automation principles, terminologies and implementationsTest automation principles, terminologies and implementations
Test automation principles, terminologies and implementations
 
StarWest2016_T24_ExploratoryAutomation_DawnJardine_Final
StarWest2016_T24_ExploratoryAutomation_DawnJardine_FinalStarWest2016_T24_ExploratoryAutomation_DawnJardine_Final
StarWest2016_T24_ExploratoryAutomation_DawnJardine_Final
 
QualiSystems-Brief TestShell
QualiSystems-Brief TestShellQualiSystems-Brief TestShell
QualiSystems-Brief TestShell
 
MIPI DevCon 2016: Robust Debug and Conformance Verification Ensures Interoper...
MIPI DevCon 2016: Robust Debug and Conformance Verification Ensures Interoper...MIPI DevCon 2016: Robust Debug and Conformance Verification Ensures Interoper...
MIPI DevCon 2016: Robust Debug and Conformance Verification Ensures Interoper...
 
Continuous testing webinar 041017 slideshare
Continuous testing webinar 041017 slideshareContinuous testing webinar 041017 slideshare
Continuous testing webinar 041017 slideshare
 
Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)
 
DevOps 101
DevOps 101DevOps 101
DevOps 101
 
Small is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignSmall is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case Design
 
Webinar: "5 semplici passi per migliorare la Quality e i processi di Test".
Webinar: "5 semplici passi per migliorare la Quality e i processi di Test".Webinar: "5 semplici passi per migliorare la Quality e i processi di Test".
Webinar: "5 semplici passi per migliorare la Quality e i processi di Test".
 
How To Build Auto-Adaptive Machine Learning Models with Kubernetes
How To Build Auto-Adaptive Machine Learning Models with KubernetesHow To Build Auto-Adaptive Machine Learning Models with Kubernetes
How To Build Auto-Adaptive Machine Learning Models with Kubernetes
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 

Recently uploaded

HIV AND INFULENZA VIRUS PPT HIV PPT INFULENZA VIRUS PPT
HIV AND INFULENZA VIRUS PPT HIV PPT  INFULENZA VIRUS PPTHIV AND INFULENZA VIRUS PPT HIV PPT  INFULENZA VIRUS PPT
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
US Environmental Protection Agency (EPA), Center for Computational Toxicology and Exposure
 
Electricity and Circuits for Grade 9 students
Electricity and Circuits for Grade 9 studentsElectricity and Circuits for Grade 9 students
Electricity and Circuits for Grade 9 students
levieagacer
 

Recently uploaded (20)

Introduction and significance of Symbiotic algae
Introduction and significance of  Symbiotic algaeIntroduction and significance of  Symbiotic algae
Introduction and significance of Symbiotic algae
 
Taphonomy and Quality of the Fossil Record
Taphonomy and Quality of the  Fossil RecordTaphonomy and Quality of the  Fossil Record
Taphonomy and Quality of the Fossil Record
 
Costs to heap leach gold ore tailings in Karamoja region of Uganda
Costs to heap leach gold ore tailings in Karamoja region of UgandaCosts to heap leach gold ore tailings in Karamoja region of Uganda
Costs to heap leach gold ore tailings in Karamoja region of Uganda
 
GBSN - Biochemistry (Unit 3) Metabolism
GBSN - Biochemistry (Unit 3) MetabolismGBSN - Biochemistry (Unit 3) Metabolism
GBSN - Biochemistry (Unit 3) Metabolism
 
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
 
X-rays from a Central “Exhaust Vent” of the Galactic Center Chimney
X-rays from a Central “Exhaust Vent” of the Galactic Center ChimneyX-rays from a Central “Exhaust Vent” of the Galactic Center Chimney
X-rays from a Central “Exhaust Vent” of the Galactic Center Chimney
 
Fun for mover student's book- English book for teaching.pdf
Fun for mover student's book- English book for teaching.pdfFun for mover student's book- English book for teaching.pdf
Fun for mover student's book- English book for teaching.pdf
 
HIV AND INFULENZA VIRUS PPT HIV PPT INFULENZA VIRUS PPT
HIV AND INFULENZA VIRUS PPT HIV PPT  INFULENZA VIRUS PPTHIV AND INFULENZA VIRUS PPT HIV PPT  INFULENZA VIRUS PPT
HIV AND INFULENZA VIRUS PPT HIV PPT INFULENZA VIRUS PPT
 
ANATOMY OF DICOT AND MONOCOT LEAVES.pptx
ANATOMY OF DICOT AND MONOCOT LEAVES.pptxANATOMY OF DICOT AND MONOCOT LEAVES.pptx
ANATOMY OF DICOT AND MONOCOT LEAVES.pptx
 
ANITINUTRITION FACTOR GYLCOSIDES SAPONINS CYANODENS
ANITINUTRITION FACTOR GYLCOSIDES SAPONINS CYANODENSANITINUTRITION FACTOR GYLCOSIDES SAPONINS CYANODENS
ANITINUTRITION FACTOR GYLCOSIDES SAPONINS CYANODENS
 
RACEMIzATION AND ISOMERISATION completed.pptx
RACEMIzATION AND ISOMERISATION completed.pptxRACEMIzATION AND ISOMERISATION completed.pptx
RACEMIzATION AND ISOMERISATION completed.pptx
 
MSCII_ FCT UNIT 5 TOXICOLOGY.pdf
MSCII_              FCT UNIT 5 TOXICOLOGY.pdfMSCII_              FCT UNIT 5 TOXICOLOGY.pdf
MSCII_ FCT UNIT 5 TOXICOLOGY.pdf
 
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
 
Factor Causing low production and physiology of mamary Gland
Factor Causing low production and physiology of mamary GlandFactor Causing low production and physiology of mamary Gland
Factor Causing low production and physiology of mamary Gland
 
EU START PROJECT. START-Newsletter_Issue_4.pdf
EU START PROJECT. START-Newsletter_Issue_4.pdfEU START PROJECT. START-Newsletter_Issue_4.pdf
EU START PROJECT. START-Newsletter_Issue_4.pdf
 
GBSN - Microbiology (Unit 4) Concept of Asepsis
GBSN - Microbiology (Unit 4) Concept of AsepsisGBSN - Microbiology (Unit 4) Concept of Asepsis
GBSN - Microbiology (Unit 4) Concept of Asepsis
 
Terpineol and it's characterization pptx
Terpineol and it's characterization pptxTerpineol and it's characterization pptx
Terpineol and it's characterization pptx
 
Electricity and Circuits for Grade 9 students
Electricity and Circuits for Grade 9 studentsElectricity and Circuits for Grade 9 students
Electricity and Circuits for Grade 9 students
 
PHOTOSYNTHETIC BACTERIA (OXYGENIC AND ANOXYGENIC)
PHOTOSYNTHETIC BACTERIA  (OXYGENIC AND ANOXYGENIC)PHOTOSYNTHETIC BACTERIA  (OXYGENIC AND ANOXYGENIC)
PHOTOSYNTHETIC BACTERIA (OXYGENIC AND ANOXYGENIC)
 
Heads-Up Multitasker: CHI 2024 Presentation.pdf
Heads-Up Multitasker: CHI 2024 Presentation.pdfHeads-Up Multitasker: CHI 2024 Presentation.pdf
Heads-Up Multitasker: CHI 2024 Presentation.pdf
 

Traffic Sign Classification with Fastai Library

  • 1. Traffic Sign Classification Using Fastai Library https://github.com/sebderhy/TrafficSignsClassif
  • 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 !
  • 3. Configuration Backbone Network: • ResNet 50 Software: • PyTorch (back-end) • Fastai (high-level API) Backbone: • ResNet 50 Jupyter reference notebook: • Fastai Lesson 1, classifying dogs Vs cats Hardware: • GPU Nvidia GTX-1070
  • 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