Code Written in Python using Jupyter Notebook. Open the notebook here for code and thorough analysis.
Note: Training/Validation data set not hosted on github, can be downloaded from here.
In this notebook, we aim to build a deep learning model which will classify images according to what sport is being played in them. We have 8 different types of sports - Badminton, Bocce, Croquet, Polo, Rock Climbing, Rowing, Sailing, and Snowboarding.
We will build two models to see which one performs better-
- CNN with the basic architecture - Conv2D layers, Max Pooling Layers, followed by Dense Layers.
- CNN with Transfer Learning - Weights from a pre-trained model, followed by a Dense Layer for our problem.
There are two datasets:
- The training dataset contains 1579 divided into 8 folder (classes). Take 80% of the data for training, the other 20% will serve as a validation set.
- The test dataset is manually created using images from the web to specifically test this model. It has 16 images and can be found in this repository.
The following procedures are carried out in the notebook:
Take a look at images and true labels. Get a feel for the quality of the dataset.
Fit the model using basic CNN architecture, analyze metrics and draw conclusions.
Fit the model using basic transfer learning, analyze metrics and draw conclusions.
Pring out every image in the test dataset, along with their true and predicted labels.
The Basic CNN model had a 74.3% validation accuracy, while the transfer learning model had a 97.5% validation accuracy. The transfer learning model got all 16 predictions right (100% accuracy) on the test dataset.