WS08

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

SEA100- Workshop 8

Total Mark: 10 marks


Submission file(s): - WS08.docx

Please work in groups to complete this lab. This lab is worth 2.5% of the total course grade and
will be evaluated through your written submission, as well as the lab demo. During the lab
demo, group members are randomly selected to explain the submitted solution. Group
members not present during the lab demo will lose the demo mark.
Please submit the submission file(s) through Blackboard. Only one person must submit for the
group and only the last submission will be marked.

Part I: Neural Network Playground


1- Visit the following link and familiarize yourself with the settings:
A Neural Network playground
http://playground.tensorflow.org/

Note that you can change the data, the number of hidden layers, the number of neurons in
each hidden layer, as well as the parameters for training this dataset. The visualizations
shows you how well the network learns the task of binary classification for the given
dataset.

2- Select to check “Show test data” and “Discretize output”. Fill out Table 1, as shown in the
example. Keep settings not mentioned in the table unchanged.

3- Answer the following questions based on your findings above.


 What type of problem can a single neuron (0 hidden layers) learn to solve?
ANSWER: A single neuron without any hidden layers can solve linearly separable
problems. These are problems where the classes can be separated by a straight line or
hyperplane in the feature space.

 When are hidden layers needed?

SEA100- Workshop 8 Page 1 of 10


ANSWER: Hidden layers are needed when the problem at hand is not linearly separable
or when the relationships between input and output variables are complex and non-
linear. Hidden layers allow neural networks to learn hierarchical representations of data,
enabling them to tackle more intricate patterns and relationships.

 What is the effect of increasing neurons or hidden layers?


ANSWER: Increasing the number of neurons or adding hidden layers can increase the
capacity and complexity of the neural network. This can potentially lead to better
performance in learning complex patterns and relationships in the data.

 Is the activation function important?


ANSWER: Yes, the activation function is crucial in determining the output of a neuron
and the overall behavior of the neural network. Different activation functions introduce
non-linearity into the network, allowing it to learn and model complex relationships in
the data. Choosing the appropriate activation function based on the problem domain
and network architecture is important for achieving optimal performance.

 How does the training loss change as learning progresses (increasing epochs)?
ANSWER: Typically, as the number of epochs increases during training, the training loss
initially decreases as the network learns to fit the training data. However, after a certain
point, further training may lead to overfitting, causing the training loss to increase again
as the model starts to memorize noise in the training data.

 How does the test loss change as learning progresses?


ANSWER: The test loss generally follows a similar pattern to the training loss initially,
decreasing as the model learns from the training data. However, it is essential to
monitor the test loss to ensure that the model generalizes well to unseen data. If the
test loss starts increasing while the training loss decreases, it indicates that the model is
overfitting and may not perform well on new data. Regularization techniques and
monitoring the test loss are crucial for avoiding overfitting.

Part II: InceptionV3 Playground


4- InceptionV3 is a convolutional network that is trained on ImageNet. Do some research
online to answer the following questions. Include the links to your resources.
 How many images is the ImageNet dataset composed of? How many in the training
subset?
The ImageNet dataset is composed of millions of images. Specifically, it contains
over 14 million images covering more than 20,000 categories or classes.

SEA100- Workshop 8 Page 2 of 10


The training subset of the ImageNet dataset contains approximately 1.2 million
images. Source: ImageNet

 What is the problem type solved by InceptionV3 (regression, classification, or


clustering)?
InceptionV3 is primarily used for image classification tasks. It categorizes images
into different classes or categories based on their visual content.

 How many object categories can InceptionV3 identify? Give a few examples.
InceptionV3 can identify thousands of object categories. It is trained on the
ImageNet dataset, which consists of over 20,000 categories. Examples of
categories include "dog," "cat," "car," "bird," "bicycle," "banana," "airplane," and
many more.

 What is the accuracy of InceptionV3 on ImageNet dataset?

InceptionV3 achieves state-of-the-art accuracy on the ImageNet dataset. As of the latest


research, its top-5 error rate is around 3.46%. This means that in the top 5 predictions for
an image, the correct label is one of them around 96.54% of the time.

Source: Inception-v4, Inception-ResNet and the Impact of Residual Connections on


Learning

5- The following link lets you see how it works on another dataset of images (ICONIC200).
https://convnetplayground.fastforwardlabs.com/#/
Fill out Table 2 similar to the example given.

6- Answer the following questions based on your findings above.


 How are the top 15 images selected?
The top 15 images are likely selected based on their similarity to the input image.
InceptionV3 uses its trained weights to compute features for each image and then
compares these features to determine similarity.

 What does the “search result score” indicate?


The "search result score" likely indicates the degree of similarity between the
input image and the top 15 images retrieved by the model. A higher score implies
a higher degree of similarity.

SEA100- Workshop 8 Page 3 of 10


 Does a high similarity to the top 15 images correlate with high search result score?
Typically, yes. A high similarity to the top 15 images should correlate with a high
search result score because the search result score is likely based on the similarity
between the input image and the retrieved images.

 In your opinion, which images are easier to identify? In other words, what attributes
make it more likely to have a high search result score?
Images with clear, distinct objects in the foreground, minimal clutter or
background noise, and good lighting conditions are likely to have a high search
result score. High-resolution images with well-defined shapes and textures would
also be easier to identify.

 In your opinion, which images are harder to identify? In other words, what attributes
make it more likely to have a low search result score?
Images with complex backgrounds, occlusions, or multiple objects in close
proximity may be harder to identify. Low-resolution images with blurry or
ambiguous content would also likely have a lower search result score.

Part III: Group work


7- Complete this declaration by adding your names:
We, - GROUP 3 (SAMUEL ASEFA, FATHIMA SHAJAHAN, SHRAVAN KIZHAKKITTIL, YISHAK
ABRAHAM) ----------- (mention your names), declare that the attached assignment is our
own work in accordance with the Seneca Academic Policy. We have not copied any part of
this assignment, manually or electronically, from any other source including web sites,
unless specified as references. We have not distributed our work to other students.

8- Specify what each member has done towards the completion of this work:

Name Task(s)
1 SAMUEL ASEFA HELPED THE GROUP TO COMPLETE PART 1
2 FATHIMA SHAJAHAN HELPED THE GROUP TO COMPLETE PART 1
3 SHRAVAN HELPED THE GROUP TO COMPLETE PART 2
KIZHAKKITTIL
4 YISHAK ABRAHAM HELPED THE GROUP TO COMPLETE PART 2

SEA100- Workshop 8 Page 4 of 10


Table 1: Neural Network Playground
Data Structure Activation Training & Training visualization at Training & Train & Test visualization at
Function Test Loss at low epochs Test Loss at >500 epochs
low epochs >500 epochs (select ‘show test data’)
(pause at
low values)
2 hidden Tanh (29 (540 epochs)
layers: epochs)
- 4 neurons Test loss
in 1st Test loss 0.001
- 2 neurons 0.218
in 2nd Training loss
Training 0.001
loss 0.165

1 hidden Tanh (15 (539 epochs)


layer: epochs)
- 4 neurons Test loss
in 1st Test loss 0.015
0.308
Training loss
Training 0.006
loss
0.293

SEA100- Workshop 8 Page 5 of 10


1 hidden Tanh (15 (529 epochs)
layer: epochs)
- 1 neurons Test loss
in 1st Test loss 0.401
0.308
Training loss
Training 0.384
loss
0.293

SEA100- Workshop 8 Page 6 of 10


1 hidden Tanh (22 (546 epochs)
layer: epochs)
- 2 neurons Test loss
in 1st Test loss 0.254
0.467
Training loss
Training 0.173
loss
0.466

O hidden Tanh (20 (539 epochs)


layers epochs)
Test loss
Test loss 0.000
0.002
Training loss
Training 0.000
loss
0.002

1 hidden Tanh (18 (534 epochs)


layer: epochs)
- 2 neurons Test loss
in 1st Test loss 0.299
0.450
Training loss
Training 0.263
loss
0.416

SEA100- Workshop 8 Page 7 of 10


1 hidden Tanh (16 (537 epochs)
layer: epochs)
- 4 neurons Test loss
in 1st Test loss 0.018
0.273
Training loss
Training 0.010
loss
0.261

2 hidden Sigmoid (14 (543 epochs)


layers: epochs)
- 4 neurons Test loss
in 1st Test loss 0.475
- 2 neurons 0.500
in 2nd Training loss
Training 0.456
loss
0.500

2 hidden ReLU (14 (545 epochs)


layers: epochs)
- 4 neurons Test loss
in 1st Test loss 0.002
- 2 neurons 0.430
in 2nd Training loss
Training 0.000
loss
0.425

SEA100- Workshop 8 Page 8 of 10


SEA100- Workshop 8 Page 9 of 10
Table 2. InceptionV3
Selected image Category Search Highest Lowest
result similarity similarity
score (dst) (among
top 15)
Banana 100.0% 0.56 0.39

Beetle 63.3% 0.60 0.51

EmpireStateBuilding 51.7% 0.57 0.50

Sedan 51.7% 0.58 0.50

SEA100- Workshop 8 Page 10 of 10

You might also like