/dogs-vs-cats-classifier

Dogs vs Cats classification using Transfer Learning

Primary LanguagePythonMIT LicenseMIT

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)