Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective: The objective of this assignment is to familiarize you with the concept of transfer learning using PyTorch. You will modify the classification head of
Objective:
The objective of this assignment is to familiarize you with the concept of transfer learning using
PyTorch. You will modify the classification head of a pretrained MobileNetV model and train it
on the CIFAR dataset. The rest of the model will remain frozen to leverage the pretrained
ImageNet weights. This assignment will help you understand how to harness the power of
pretrained networks for tasks with different datasets and classes.
Dataset:
CIFAR consists of color images in classes, with images per class.
There are training images and testing images per class.
Tasks:
Setup Environment marks
Import necessary libraries and load the CIFAR dataset using torchvision.
Normalize the dataset with mean and standard deviation: mean
std
You are free to use any other transforms for data preprocessing.
Prepare MobileNetV marks
Load a pretrained MobileNetV model from torchvision.models.
Freeze all layers of the model except the classification head.
Replace the classification head with new layers of your choice to accommodate
output classes. Justify your design choice.
Training Setup marks
Define the loss function and optimizer. You are only allowed to train the
parameters of the new classification head.
Configure the training parameters: batch size, number of epochs, learning rate
justify your choices
Training Process marks
Implement training and validation loops. Ensure to only update the weights of the
new classification head.
Save checkpoints after every epoch.
Use appropriate device handling cpu or cuda
Evaluation and Metrics marks
Evaluate the model on the test set.
Calculate and report the following metrics:
Accuracy
Precision, Recall, and FScore for each class report the average over
all classes also.
Provide a confusion matrix of the model predictions.
Report marks
Provide a detailed report including:
Introduction to the problem and the model architecture.
Explanation of your design choices for the new classification head.
Discussion on the training process, including any challenges faced and
how you overcame them.
Analysis of the results with insights and possible improvements.
Your colab file link.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started