Dogs vs Cats classification using Transfer Learning and PyTorch
The dataset can be obtained from here
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.
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)
MIT License (MIT)