Skip to content

Commit ee8fdbf

Browse files
author
Robert Coleman
authored
Update README.md
1 parent 2147781 commit ee8fdbf

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

README.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Classifies an image as containing either a dog or a cat (using Kaggle's <a href=
55
To run these scripts/notebooks, you must have keras, numpy, scipy, and h5py installed, and enabling GPU acceleration is highly recommended if that's an option.
66

77
## img_clf.py
8+
After playing around with hyperparameters a bit, this reaches around 96-98% accuracy on the validation data, and when tested on Kaggle's hidden test data achieved a log loss score around 0.18.
9+
10+
Most of the code / strategy here was based on <a href="https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html">this</a> Keras tutorial.
11+
12+
Pre-trained VGG16 model weights can be downloaded <a href="https://gist.github.com/baraldilorenzo/07d7802847aaad0a35d3">here</a>.
13+
814
The data directory structure I used was:
915

1016
* project
@@ -17,12 +23,6 @@ The data directory structure I used was:
1723
* cats
1824
* test
1925
* test
20-
21-
After playing around with hyperparameters a bit, this reaches around 96-98% accuracy on the validation data, and when tested in Kaggle's competition maxed out with a log loss score around 0.18.
22-
23-
Most of the code / strategy here was based on <a href="https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html">this</a> Keras tutorial.
24-
25-
Pre-trained VGG16 model weights can be downloaded <a href="https://gist.github.com/baraldilorenzo/07d7802847aaad0a35d3">here</a>.
2626

2727
## cats_n_dogs.ipynb:
2828
This produced a slightly better score (.161 log loss on kaggle test set). The better score most likely comes from having larger images and ensembling a few models, despite the fact there's no image augmentation in the notebook.
@@ -37,4 +37,20 @@ Might run into memory errors because of the large image dimensions -- if so redu
3737
* test
3838
* test
3939

40+
## cats_n_dogs_BN.ipynb:
41+
This produced the best score (0.069 loss without any ensembling). The notebook incorporates some of the techniques from Jeremy Howard's <a href="http://course.fast.ai/">deep learning class</a> , with the inclusion of batch normalization being the biggest factor. I also added extra layers of augmentation to the prediction script, which greatly improved performance.
42+
43+
Pre-trained model weights for VGG16 w/ batch normalization can be downloaded <a href="http://www.platform.ai/models/">here</a>.
44+
45+
The VGG16BN class is defined in <em>vgg_bn.py</em>, and the data directory structure used was:
4046

47+
* project
48+
* data
49+
* train
50+
* dogs
51+
* cats
52+
* validation
53+
* dogs
54+
* cats
55+
* test
56+
* test

0 commit comments

Comments
 (0)