Dog Breed Identification

Eyebrow, 02 January 2018

dog This project is uses Pytorch to classified dog breed. Model used is Resnet50.

Steps:

  1. Use LabelEncoder to encode each classes
  2. Split the train class to train and validate
  3. Image normalization and augmentation
  4. Load image as Dataset with DataLoader
  5. Setup your model (uses Resnet50)
  6. Create FC layer with 120 class (dog breed count)and freeze all previous layers (Resnet50). Only train the last layer
  7. Optimizer = SGD (Stochastic Gradient Descent)
  8. Train for 24 Epoch

ps: This steps can be used for almost all image classification problem. But you will need to fine tune the parameters. The most important parameters of alls is learning rate.

Improvement and minor mistake:

  1. We should not freeze all Resnet50 layer and only train the last layer. The ideal case would be freeze all previous layer and train the last layer for a few epoch. Then unfreeze all previous layer so we can fine tune the previous layer. At the same time, we should use smaller learning rate for previous layer and higher learning rate for FC layer.
  2. You can cheat the competition by downloading full image from ImageNet and use it for training. =)

Codes are written in Jupyter Notebook: here