Assignment 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CSE343/CSE543/ECE363/ECE563: Machine Learning

Winter 2024

Assignment-3 (24 points)

Release: Mar 19, 2024 (Tuesday) Submission: 11:00 am Mar 26, 2024 (Tuesday)

Instructions
• Institute Plagiarism Policy Applicable. Both programming and theoretical questions will be subjected
to strict plagiarism check.
• This assignment should be attempted individually. All questions are compulsory.
• Theory [T]: For theory questions, only hand-written solutions are acceptable. Attempt each question on a
different sheet & staple them together (for the ease of checking). Do not start a new question at the back of
the previous one. Do not forget to mention page number (bottom centre) and your credentials (bottom right)
on each sheet. It must be submitted in Assignment submission box kept in class during class time.
• Programming [P]: For programming questions, the use of python programming language is allowed only.
You must submit a single .py file named as A3 RollNo.py. Make sure the submission is self-complete &
replicable i.e., you are able to reproduce your results with the submitted files only. Use random seed wherever
applicable to retain reproducability.
• Report.pdf : Create a .pdf report of programming questions that contains your applied approach, pre-
processing, assumptions, analysis, visualizations, etc.. Anything not in the report will not be evaluated. Al-
ternatively, a well-documented .ipynb file (in addition to a single .py file mentioned in the previous bullet) with
answers to all the questions may be submitted as a report. The report must be named as A3 RollNo Report.pdf
or A3 RollNo Report.ipynb.
• File Submission: Submit a .zip named A3 RollNo.zip (e.g., A3 2022112.zip) file containing the report and
code files.
• Submission Policy: Turn-in your submission as early as possible to avoid late submissions. In case of
multiple sibmissions, the latest submission will be evaluated. Late submissions will not be evaluated
and hence will be awarded zero marks.
• Clarifications: Symbols have their usual meaning. Assume the missing information & mention it in the
report. You are allowed to use any machine learning library until exclusively mentioned in the question that
it is supposed to be done from scratch. You can always use basic python libraries such as numpy, pandas,
and matplotlib, unless specified otherwise. Use Google Classroom for any queries. In order to keep it fair for
all, no email queries will be entertained. You may attend office/TA hours for personal resolutions. Start your
assignment early. No queries will be answered in Google Classroom comments during the last time.
• Compliance: The questions in this assignment are structured to meet the Course Outcomes CO1, CO2,
CO3, and CO4, as described in the course directory.

• There could be multiple ways to approach a question. Please justify your answers mathematically in the
theory questions, and via commented text in the programming questions appropriately. Questions without
justification will get zero marks.
1. Overfitting/Underfitting (2+2=4 points)
(a) [T ∥ CO1, CO2, CO4] Overfitting - You are building a convolutional neural network model for
classification. How will you verify if your model is overfitting or not? If overfitting, how will you handle
it? List at least 6 different ways of handling overfitting and justify each of these strategies.
(b) [T ∥ CO1, CO2, CO4] Underfitting - You are building a convolutional neural network model for
classification. How will you verify if your model is underfitting or not? If underfitting, how will you
handle it? List at least 6 different ways of handling underfitting and justify each of these strategies.
2. [P ∥ CO2, CO3, CO4] Implementation of CNN from scratch (8 points)

Dataset: MNIST Handwritten Digit Recognition

Dataset is already divided in train and test sets.

• Implement a CNN from scratch (without using a custom-designed CNN model like AlexNet etc.) for the
MNIST handwritten digit recognition task. Your implementation should include convolutional layers,
pooling layers, and fully connected layers.
• Split the dataset into training and validation. The test set is already given; do not alter that. Generate
a grid of images displaying 5 random images of each class. Ensure that the images are displayed in the
original color palette.
• Implement data augmentation techniques like rotation, scaling, and translation to improve model per-
formance.
• Train your CNN model on the MNIST dataset and report the training and validation accuracy and loss
curves.
• Experiment with different hyper-parameters (e.g., learning rate, batch size, and many more) and analyze
their impact on the model’s performance.
• List the model’s summary with the number of trainable parameters.
• Demonstrate the concepts of overfitting and underfitting with different sized architectures and the meth-
ods to overcome them.

3. [P ∥ CO2, CO3, CO4] Learning latent features using CNN and classifying using SVM (12 points)

Dataset: CIFAR-10 Image Classification

• Download the CIFAR-10 python version. Preprocess the CIFAR-10 dataset and split it into training,
validation, and test sets.
• Implement data augmentation techniques like horizontal flipping, random cropping, etc.
• Implement a CNN model for the CIFAR-10 image classification task. Your model should include convo-
lutional layers, pooling layers, and fully connected layers.
• Train your CNN model on the CIFAR-10 dataset and report the training and validation accuracy and
loss curves. Experiment with different architectures, optimizers, and learning rate schedules to improve
model performance.
• Use the latent features learned using the CNN and feed them to an SVM classifier for the CIFAR-10
image classification task. Experiment with different kernel functions and hyper-parameters, and compare
the performance of your SVM model with the CNN model.
• Analyze the performance of your CNN and SVM models on the CIFAR-10 test set. Discuss the strengths
and weaknesses of each model and suggest potential improvements or extensions.

You might also like