Skip to content
Dogs vs Cats classification using Transfer Learning
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Apr 5, 2018
README.md add note on directory structure Apr 5, 2018
cnn.py add cnn Apr 5, 2018

README.md

dogs-vs-cats-classifier

Dogs vs Cats classification using Transfer Learning and PyTorch

DATASET

The dataset can be obtained from here

Model

The Convolutional Neural Network will be trained on ResNet18. Transfer Learning is used. A pretrained ResNet18 model is initialied as a fixed feature extractor and training a softmax classifier at the end.

Prediction



Note

The dataset must have the following directory structure:

root/dog/xxx.png
root/dog/xxy.png
root/dog/xxz.png

root/cat/123.png
root/cat/nsdf3.png
root/cat/asd932_.png

If you've trained and saved the model already, then comment the training phase to not to train the model again.

model_conv = train_model(model_conv, criterion, optimizer_conv,
                         exp_lr_scheduler, num_epochs=25)

Useful Links

Confusing the CNN



License

MIT License (MIT)

You can’t perform that action at this time.