Answered step by step
Verified Expert Solution
Link Copied!

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 pre-trained MobileNetV2 model and train it
on the CIFAR-100 dataset. The rest of the model will remain frozen to leverage the pre-trained
ImageNet weights. This assignment will help you understand how to harness the power of
pre-trained networks for tasks with different datasets and classes.
Dataset:
CIFAR-100 consists of 600003232 color images in 100 classes, with 600 images per class.
There are 500 training images and 100 testing images per class.
Tasks:
Setup Environment (10 marks)
Import necessary libraries and load the CIFAR-100 dataset using torchvision.
Normalize the dataset with mean and standard deviation: mean ,
0.406, std =[0.229,0.224,0.225].
You are free to use any other transforms for data pre-processing.
Prepare MobileNetV2(20 marks)
Load a pre-trained MobileNetV2 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
100 output classes. Justify your design choice.
Training Setup (20 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 (20 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 (20 marks)
Evaluate the model on the test set.
Calculate and report the following metrics:
Accuracy
Precision, Recall, and F1-Score for each class (report the average over
all classes also.)
Provide a confusion matrix of the model predictions.
6. Report (10 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

explain what is meant by the terms unitarism and pluralism

Answered: 1 week ago