A Traffic Signs Classifier — My first end to end machine learning app

Tushar Sharma
Analytics Vidhya
Published in
5 min readOct 14, 2019

--

Photo by Franki Chamaki on Unsplash

Well here’s a short introduction just in case you don’t know me yet!( in which case leave a comment below so that we can now) So um.. here goes nothing.. I’m a software developer by profession and I like to challenge myself and love to solve most of the challenges( hey we can’t solve everything now, can we?) I’ve been deep diving into machine learning and artificial intelligence for a while now. I’m quite enamored by computer vision and it’s applications. I do have a published VR game on android app store if you want to check it out.

Oh and I also love video games(the story based kind mmo’s rpg’s action adventure you name it), and music (ranging from Chopin to Slipknot and definitely the epic OST’s from both video games and anime).

Well if this were yet another step by step guide it’d get quite stale so let’s start with the ending to hopefully the first chapter of this story!

Keeping up with the spirit and going through tons of material I’ve decided to work on developing an application. Familiarizing myself with the end to end process of developing and publishing a ML application.

Just so that you know what you’re getting into the application involves the following (each explained in detail in later articles) :
1. A Tensorflow Convolution Neural Network as the model for classifying the output of the image(~60 output classes)
2. A Flask based API for handling model requests A flutter application for cross platform app building Deploying the API to Heroku for handling requests.

As my first end to end yet basic ML application i wanted to create a mobile app( if it works on mobile it should work everywhere). As i scrounged the internet most basic classifiers included either the famed MNIST data-sets or the cats n dogs classifiers. So after a short debate and lots of internet scrounging, I landed on the Belgium traffic signs data-set and decided to proceed with a traffic signs classifier as my first app.

The next logical step was to decide upon the frameworks to be used for the same. I settled on Tensorflow as I’ve had previous encounters with it. Then began the seemingly everlasting process of creating and training the model over and over again to get satisfactory results with the evaluation set results.

After reaching satisfactory results with the model (>90% accuracy), I could finally move onto the next step. To create the front-end interface for the application. To this end there were loads of option to choose from —

  • An Android app(via Android SDK)
  • An IOS app (Swift)
  • A Web Application(any JavaScript based framework)

Web was a no-go as one would need to take pictures on the go of traffic signs to be able to identify them in the end product.
Next was the introduction to the wonderful world of cross platform app development suites like Xamarin, React Native and so on. However, a little tech birdie led me to an article about Flutter. Something about the simple and snappy designs of flutter drew me in(which in no way or part due to the syntactical similarity of dart with java and c#). This made the development process so much faster and fun!

About two weeks in and the basic application was complete. The basic app provides a clean menu and the ability to take pictures from the device camera or gallery to get predictions from the API server. Now, before proceeding further to add features to the application I decided it was time to take the local flask API to the web for testing phase.

And i thought the steps till now were difficult….. But as a silver lining i got to try out a few free hosting services. Two of the plethora that i tried and that worked for me were

  1. PythonAnywhere
  2. Heroku

Although python-anywhere works for almost all flask apps this use case would not come to fruition, the Tensorflow dependency exceeded the free space available. You can deploy here by following their tutorial on the site if you’ve got a premium account.
Heroku was a life saver here and makes the deployment process very easy and fast once you get it set up.

Here’s a quick peek at the application and the following articles will focus on different aspects! Do let me know if you want me to write about a specific part of the process first or for a deep dive into it.

You can find me here or my github repositories here! Thanks for taking the time to read through to the end. Leave a clap if you found the article interesting!

--

--

Tushar Sharma
Analytics Vidhya

An avid reader and voracious consumer of knowledge. Striving to be better every day. Knows some tech stuff too you know!