Skip to content
CNN image classificator based on Cars Dataset from Stanford and pretrained CNN models in Keras
Python
Branch: master
Clone or download
Latest commit c86c8ee May 1, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
car-recognition-aws fixes May 1, 2018
README.md Update README.md May 1, 2018

README.md

Car classificator

This is a car classificator build using pretrained VGG16, VGG19 and InceptionV3 on ImageNet data set.

Requirements

  • Python 3.5.4
  • tensorflow-gpu 1.7.0
  • keras-gpu 2.1.5

Getting the data

The model has been trained on Cars Dataset from Stanford

Processing the data

Download the whole dataset (all images) and use following script to divide into train and test/validatoin python matlabtester.py --process_data=True --car_ims_dir=DIR_WITH_ALL_IMAGES --car_ims_labels=cars_annos.mat If you need to create cross validation set, which I had to create but realized that later, use createTestFromValidation.py. THe script will create cross validation dataset from your test set.

Training the model

In order to train desired model use python matlabtester.py --process_data=False --car_ims_dir=DIR_WITH_ALL_IMAGES --car_ims_labels=cars_annos.mat and choose the model by providing the proper value in --mode selector. On AWS p2.xlarge one steps takes ca. 2 sec. One epoch ca. 200 sec.

The end result

Due to small size of the data set the simplest model turned out to be the most accurate. We used early stopping to get rid of overfitting. I managed to train VGG16 network with 66,11% accuracy on cross validation data set (drop out = 0.8, no learning rate decay). Below you will find the accuracy over epochs (red - val_accuracy, blue - train accuracy). alt text

The more complex model (ex. InceptionV3) the less accurate results are. This is understanable due to bias/variance problem.

Credits

3D Object Representations for Fine-Grained Categorization Jonathan Krause, Michael Stark, Jia Deng, Li Fei-Fei 4th IEEE Workshop on 3D Representation and Recognition, at ICCV 2013 (3dRR-13). Sydney, Australia. Dec. 8, 2013.

The Keras Blog, Building powerful image classification models using very little data

You can’t perform that action at this time.