Image Classification on Caltech-101 based on VGG16/19, SIFT and gray histogram

This project provides image classification code by python and matlab. My experimental environment is Matlab R2019a on Windows 10 / Tensorflow 1.14.0, keras 2.3.1, and nivdia 2080Ti on Ubuntu 18.04.

For Python

  • This code basically refers to here. It will take basically less than 2 hours to train the whole dataset with 2080Ti.

  • Accuracy for reference:

Model VGG16 VGG19
Accuracy 59.02% 54.86%
  • Steps
  1. Download caltech-101 and locate it in 'data/'.
  2. Change the 'path' to the path where the data located.
  3. run 'Train_caltech.py' for VGG19, or run 'Train_caltech_vgg16.py' for VGG16.

For Matlab

  • This code is basically based on feature extraction, SVM and vlfeat.

  • Accuracy for reference: Higher accuracy by almost 20% than the above in Python. I guess the VGG model in the matlab toolkit is pre-trained, while I train the model from scratch in Python.

Model VGG16 VGG19
Accuracy 78.95% 78.56%

vgg16_result.jpg vgg19_result.jpg

  • Steps
  1. Download caltech-101 and locate it in 'data/'.
  2. Install Add-Ons related to VGG16 and VGG19, simply enter 'vgg16' or 'vgg19' in the command line window for information.
  3. Change the path in line 2 to the path where vlfeat located in.
  4. Run the 'main.m'.
  5. Remove files in '\data' generated by the last running if you want to re-run.
  6. If you want to use VGG16 model, replace 'vgg19' in line 131 to 'vgg16'.
  7. If you want to further try feature like SIFT or gray histogram, comment line 137 and uncomment line 136 and 138 respectively.