How i built a bus board classifier (Chennai KKNagar route) using Fast ai with a small dataset.

Bhuvana Kundumani
3 min readApr 11, 2019

I started learning Deep learning with Fast ai founded by @jeremyphoward and /@racheltho last year. Fast ai makes learning fun. It follows a top down approach — Build something to learn. After working on image classification tasks — dogs vs cats, identifying dog breeds, i was interested in building a bus name board classifier using fast ai.

Why Bus name board classifier?

India is a diverse country with many different regional languages. During my recent visits to Hyderabad and Bengaluru, I was a bit surprised to see buses with name boards in regional languages. As a tourist, it was very hard to use public transport in these cities. I can imagine how it would be in the rural areas.

WANT TO BOARD A BUS TO YOUR DESTINATION ? GOOD LUCK !!

I was interested in solving this particular problem using Deep Learning with fast ai. I picked up KK nagar in Chennai and identified 5 routes — 5E , 11H, 11G, 12 G, 17D. I started collecting images of busboards. It took me almost two weeks to collect the images. I collected images at different times during the day and night. Your Deep learning model is only as good as your dataset. The busboards alone were cut and resized from the images collected. Dataset has five folders labelled 5E , 11H, 11G, 12 G and17D with images of the respective bus board images.

The dataset has less than hundred images for three categories and two categories had hundred and odd images. I used the resnet34 architecture to build the model. Without unfreezing the layers, i was able to get an accuracy of 86% while training for 13 epochs . It took less than a minute for training with fast ai.

I used lr_find() to find the learning rate.After unfreezing the layers, i trained for 5 epochs with max_lr=slice(1e-5,1e-3). I was able to achieve an accuracy of 90.35%.

To deploy this app locally on your machine, please refer this repo -https://github.com/bhuvanakundumani/bus_project_production

The code for the project is available at https://github.com/bhuvanakundumani/busboard_blog.git

--

--