Skip to content

Machine Learning project to classify car models by photos

License

Notifications You must be signed in to change notification settings

kulich-ua/car-classifier

Repository files navigation

Car classifier

Machine Learning project to classify car models by photos. Inspired by fastai course & code. So far this is just the first version and a proof of concept. Current version classifies cars by 8 categories, which represents 8 generations of Volkswagen Golf model.

Try it! (on mobile or desktop)

All parts of this application are written in python in form of Jupyter Notebooks. Further I will describe the main steps of this project and point out which notebooks are responsible for them.

Table of Contents

Data

Gathering

Data for this project was collected from Internet. Partially using scripts and search engines (Bing & DuckDuckGo). But mostly by searching & downloading by hand.
1500 images there collected in total. Approximately 190 images per category (so far there are 8 VW Golf generations). In addition, 67 photos were collected on the street with the iPhone camera.

The training data is not a part of this repo.

Splitting

The data was then split in 3 sets: training (67%), validation (19%) & test (14%).

Training

Model

A pre-trained ResNet50 model was selected for the training. Then it was fine tuned using training data for 100 epochs using MacBook Pro (2018, i7, 16 GB) and only CPU (the training took about 6 hours). A standard set of augmentations from fastai library were applied to the training data.

You can download the model here.

Accuracy

Validation set - 96%
Test set - 95%
Own iPhone photos taken on street - 88%

Example of predictions

predictions example

Application

A web application is build using Gradio library.

older alternative

A web application (Inference.ipynb) is rendered from Jupyter Notebook using Voilà library.

Deployment

Hugging Face

The Gradio web application is deployed for free on Hugging Face platform.

Heroku (not active)

The Voila web application is deployed for free(not anymore) on Heroku platform. The model is hosted on Google Drive and downloaded at runtime to bypass storage limits for free hosting.

Main dependencies

About

Machine Learning project to classify car models by photos

Topics

Resources

License

Stars

Watchers

Forks