Dogs Vs. Cats Classification Use the Kaggle Dogs vs. Cats dataset (https://www.kaggle.com/c/dogs-vs-cats/data) to train a Convolutional Neural Network model capable to distinguishing an image of a dog from that of a cat. You are free to architect your network in any way you like (e.g. 2D Conv; Max Pool; 2D Conv; Max Pool; Dense Network etc.). You should detail your intuition for your choice of each layer of the model architecture. Note that it may take several hundred epochs to train your model sufficiently, so make sure to save it and reload it as needed. Tune hyper parameters and use the ROC curve to select best performing hyper parameters (it’s up to you to chose the parameters to tune). Display the precision, recall, and F1 score for this model operating on the test data and produce a plot of your training data showing the predicted labels Display the certainty of classification for each testing sample (not shown). Extra Credit (+25): Compare the results (and training time) of your CNN model with a Stochastic Gradient Descent (SGD) classifier. Build a SGD classifier to predict the class of the dogs vs cats data set. Display the precision, recall and F1 score of the classifier.

When building a Convolutional Neural Network (CNN) model for the Dogs vs. Cats classification task using the Kaggle dataset, several considerations need to be taken into account in order to achieve the best performance. In this assignment, we will explore the choice of network architecture, hyperparameter tuning, performance evaluation, and optional comparison with a Stochastic Gradient Descent (SGD) classifier.

Firstly, the network architecture is essential in capturing the complex features and patterns in the images. A common approach is to use a series of 2D convolutional layers followed by max pooling layers to progressively extract and downsample features. This hierarchical representation helps in learning both low-level features (e.g., edges, textures) and high-level features (e.g., shapes, objects). The choice of the specific number and size of the convolutional and pooling layers can vary based on the complexity of the dataset. Intuitively, more convolutional layers allow for the network to learn increasingly abstract representations, while pooling layers help reduce computational burden and increase translation invariance.

After the convolutional and pooling layers, a dense network is typically used to perform the final classification. This part of the network can include fully connected layers, which connect every neuron from the previous layer to the current one. In these layers, non-linear activation functions (e.g., ReLU) are commonly used to introduce non-linearity and improve the model’s ability to capture complex relationships.

During the training process, hyperparameter tuning is crucial to optimize the performance of the CNN model. Some important hyperparameters to consider include the learning rate, batch size, number of epochs, and dropout rate. The learning rate determines the step size taken during weight updates and can impact the convergence of the model. The batch size controls the number of samples used in each iteration of gradient descent, affecting the stability and speed of training. The number of epochs determines the number of times the entire dataset is passed through the network, and can be adjusted to prevent overfitting. Dropout rate is a regularization technique used to prevent overfitting by randomly disabling neurons during training.

To select the best performing hyperparameters, the Receiver Operating Characteristic (ROC) curve can be utilized. The ROC curve visualizes the trade-off between true positive rate and false positive rate at various threshold settings. By tuning the hyperparameters and observing the resulting ROC curve, we can choose the configuration that provides the best overall performance.

In order to evaluate the performance of the CNN model, precision, recall, and F1 score can be calculated using the test data. The precision measures the proportion of true positives among the predicted positive samples, while recall measures the proportion of true positives among the actual positive samples. The F1 score is the harmonic mean of precision and recall and provides a balanced measure of overall performance.

Additionally, plotting the training data with the predicted labels can help visualize the learning progress of the model. By observing the changes in accuracy and loss over the training epochs, we can gain insights into how well the model is improving.

For extra credit, a comparison can be made with a Stochastic Gradient Descent (SGD) classifier. The SGD classifier is a linear model trained with SGD optimization, which can provide a baseline performance for the Dogs vs. Cats classification task. Similar performance evaluation metrics, such as precision, recall, and F1 score, can be calculated to compare the performance of the CNN model and the SGD classifier.

In summary, this assignment involves building a CNN model with an appropriate network architecture, tuning hyperparameters using the ROC curve, evaluating performance using precision, recall, and F1 score, plotting the training data with predicted labels, and potentially comparing with an SGD classifier.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer