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