Multi-Class Image Classification on Mobile Gallery Images using Transfer Learning in PyTorch.
Using the images present in your mobile gallery to train an Image Classifier using Transfer-Learning ! :D
Dataset that I have used is https://www.kaggle.com/n0obcoder/mobile-gallery-image-classification-data It has 6 classes -
- Cars
- Memes
- Mountains
- Selfies
- Trees
- Whataspp_Screenshots
A few of the sample images form the training set are shown below
Following are the transforms (ordered) applied to the images while training and testing-
- Resizing to (224, 224)
- Random Horizontal Flips (Only applied during the training phase)
- ToTensor (to convert the images into tensors)
- Normalization (using the ImageNet stats)
Architecture : Resnet34 I have replaced the last linear layer of the resnet34 with another linear layer which has 6 neurons present in it (6 is the number of classes present in the Mobile Gallery Image Dataset mentioned above in STEP 1). c
Used pretrained weights of the selected architecture
We freeze the pretrained filter in the early and middle layers and train only the filters in the deep layers.
Loss Function: Cross Entropy Opimizer : Adam
- This Neural Network thinks that the given image belongs to >>> Memes <<< class with confidence of 95.21%