For your handwritten solutions, please scan or take a picture of them. Alternatively, you can write them in markdown if you prefer.
Only .ipynb files will be graded for your code.
Compress all the files into a single .zip file.
Do not submit a printed version of your code, as it will not be graded.
We will create a convolutional neural network to classify images of berries, birds, dogs, and flowers. To get started, we need to download the dataset. This dataset will be utilized for both Problem 2 and Problem 3.
(1) Load the provided dataset.
import cv2
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from google.colab import drive
drive.mount('/content/drive')
## your code here
#
train_image =
train_label =
test_image =
test_label =
(2) Visualize ten randomly selected images from the training dataset.
## your code here
#
We will utilize the VGG16 architecture to train our dataset. As shown in the image below, the VGG16 architecture consists of 16 layer blocks with a substantial number of trainable parameters. Fortunately, deep learning libraries like TensorFlow, Keras, and PyTorch offer pre-trained models for ImageNet, sparing us from the need to design and train a model from the ground up.
(1) Create a VGG16 model using deep learning libraries, such as TensorFlow, Keras, or PyTorch.
## your code here
#
(2) Revise the original VGG16 architecture. As shown in the image below, we will make modifications exclusively to the fully connected layer section. Additionally, given that we are using pre-trained parameters, the parameters of the feature extraction portion must remain fixed.
## your code here
#
## your code here
#
(3) Train the modified VGG16 model.
## your code here
#
(4) Print your accuracy with the test dataset.
## your code here
#
(1) Visualize the Class Activation Mapping (CAM) results as presented in the provided figure.
## your code here
#