This technical report outlines the process of training a deep learning model for dog breed classification
using a dataset of dog images.
The goal is to create a model that can classify dog images into one of 120 different breeds, which in
actual, achieving high accuracy (93%).
The code provided utilizes several pre-trained convolutional neural networks (CNNs) as feature extractors
and a simple deep neural network (DNN) for classification.
The dataset used for this task consists of dog images categorized into 120 different breeds. The dataset contains a list of image filenames and their corresponding breed labels. Key components of the dataset processing include:
to_categorical
function from Keras.Training Dataset (Source: Kaggle)
Streamlit Deployment UI
Feature extraction is a crucial step in deep learning when working with pre-trained models.
The code uses the following pre-trained CNN architectures as feature extractors:
A simple DNN is used for classification on top of the extracted features.
The DNN architecture includes the following layers:
Adam optimizer
and
categorical cross-entropy loss
, which is suitable for multi-class classification tasks.
softmax activation
function for multi-class classification.
The training process involves splitting the dataset into multiple folds using
stratified k-fold cross-validation
(in this case, 3 folds). Each fold is used as both the
training and validation set in different iterations.
Training includes the following steps:
early stopping callback
is used to prevent overfitting and to save the best
model.
The training process is repeated for each fold, resulting in three separate trained models.
The results are evaluated using the following metrics:
The model is deployed on Streamlit.