GitXplorerGitXplorer
R

dogs-vs-cats-redux

public
11 stars
7 forks
0 issues

Commits

List of commits on branch master.
Verified
02274e78d368cb15abba78f8c1664b3440b8649f

[FIX] Requirements, usage examples

RRomanKornev committed 7 years ago
Verified
6cd6e2da079e025fc01709663d75b3df73420473

[FIX] Formatting fix

RRomanKornev committed 7 years ago
Unverified
03b1a37c0c6276a18995f8eae1579b270426438c

Merge remote-tracking branch 'refs/remotes/origin/dev'

RRomanKornev committed 7 years ago
Unverified
e64fdb9714edcd1f0e98526cb8e21040bd68d219

Merge remote-tracking branch 'refs/remotes/origin/master' into dev

RRomanKornev committed 7 years ago
Unverified
0021fbbe324db542ba80a49873dec62785ffe034

[ADD] Ensemble Xception+ResNet50+InceptionResNetV2

RRomanKornev committed 7 years ago
Verified
e71d5bd1bd4833a153d8347c2ec8931efdcd2cde

[UPD] Kaggle link

RRomanKornev committed 7 years ago

README

The README file for this repository.

Dogs vs Cats

Predict whether a given image is of a cat or a dog with 99.7% accuracy.

Kaggle: https://www.kaggle.com/c/dogs-vs-cats-redux-kernels-edition

Partially based on Fast.ai course.

Intro

  • [ ] TODO: The goals
  • [ ] TODO: Though process and methods in creating the project
  • [ ] TODO: Some bullet points with interesting observations
  • [ ] TODO: Any interesting charts or diagrams

Model info

Final prediction is made from an ensemble of Xception, ResNet50, Inception-ResNetV2.

Training is done using bottlenecks on a data augmented [x6] training set (138000 299x299x3 pictures).

Precomputed bottleneck features are feeded into 2 hidden dense layers [x2048] and 1 output softmax layer.

Size

Training set size = 2.5GB. Model size = 1GB per model (saved precomputed weights).

Speed

Time to precompute bottlenecks: 2hr per model on a GTX 770.

Time to train: 5sec/epoch with 10000 batch size.

Error rates

Ensemble reaches 99.7% accuracy on the validation set (only 6/2000 incorrect).

0.03893 leaderboard score (15th place from 1,314 teams).

Requirements

  • keras==2.0.9
  • tensorflow==1.2.0
  • pandas
  • seaborn
  • sklearn

Data

Download the data

pip install kaggle-cli
kg config -g -u <username> -p <password> -c dogs-vs-cats-redux-kernels-edition
kg download
7z x *.zip

I split the data into 23000 train and 2000 validation sets.

File structure

dogs-vs-cats-redux
├── data ─── dogscats
│             ├── train
│             │    ├── cats
│             │    └── dogs
│             ├── valid
│             │    ├── cats
│             │    └── dogs
│             ├── test
│             │    └── unknown
│             ├── models
│             └── results
├── submissions
│   └── submission1.csv
├── dogs_cats_redux_ensemble.ipynb
└── README.md

Usage

dogs_cats_redux_ensemble.ipynb for final model

xception_example.py - example of Xception prediction

resnet50_example.py - example of ResNet50 prediction

inception_resnet_v2_example.py - example of Inception-ResNet-V2 prediction