Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

DTS101TC Introduction to Neural Network

COURSEWORK

Q1. Short Answer Questions [30 marks]

The  questions  test  general  knowledge  and  understanding  of central  concepts  in  the  course .    The  answers should be short.  Any calculations need to  be presented.

1.  Draw a diagram of a simple perceptron with 3 inputs.  Compare this with a biological neuron, stating the biological equivalents of the important parts. [5 marks]

2.  Consider the perceptron you drew above.   If those three inputs x =  (x1 ,x2 ,x3 ) receive only binary signals.  How many different input patterns this perceptron can receive?  What if the node had four inputs? Please list those input patterns of three and four inputs. Can you give a formula that computes the number of binary input patterns for a given number of inputs? [5 marks]

3. Why are the following two functions not useful in the hidden layers in a backpropagation neural network? [5 marks]

• y = sign(s)

• y = s

4.  Consider a three-layer backpropagation network with d input units, nH  hidden units, c output units, and bias. the network has activation function f(.), with input to hidden weights labelled wji  and hidden to output weights labelled wkj .  For a single input vector x = (x1 , ...,xd ) with associated target vector t = (t1 , ...,tc ), write down expressions for: [10 marks]

(i.) the output activation yk  of an output unit                                              (3)

(iii.)  using the chain rule, calculate expressions for the derivative of ∂J/∂wkj                                                         (3)

(iv.) the number of weights in the network                                                                                               (2)

5. What is typically the main difference between a CNN designed for regression and for classification? Why? Please give one real-world application for regression and classification respectively. [5 marks]

Q2. Image Classification Programming [40 marks]

For this question, you will implement two neural networks .  The question is split in a number of steps .  Every step gives  you some  marks .  Answer the  questions for each step  and include  the  screenshot  of code  outputs in your answer sheet.

- Language and Platform Python (version 3. 5 or above) and Tensorflow with Keras or Pytorch (newest version) . You  may use  any  libraries  available  on Python platform,  such  as  numpy,  scipy,  matplotlib,  etc . You need to run the code in the jupyter notebook.

- Dataset Fashion MNIST. Link:  https://github . com/zalandoresearch/fashion-mnist

- Code Submission All of your code  (Python files  and ipynb files) should be  a package in  a single ZIP file, with a PDF of your IPython notebook with output cells . Do NOT include datasets in your zip file .

1. Data Loading [5 marks]

Load the test set of Fashion MNIST, and randomly select 5000 images. Randomly split the set of 5000 images into training set (3500 images), validation set (1000 images) and test set (500 images).

For each set, use python commands to display the number of data entries, the number of classes, the number of data entries for each classes, the shape of the image size.  Randomly plot 10 images in the training set with their corresponding labels.

2. 1-D Convolutional Network Model Build [5 marks]

Create a three-layer 1-D convolutional network with two 1-D convolutional layers, one maxpooling layer between those two convolutional layers, and one fully connection layer.  Please define the kernel size, channel number, stride, padding, and other parameters by yourself.

Compute the size of the feature map after the first and second convolutional layers. How many trainable parameters does the model have?  What should you do with the image set before feeding it into this model?

3. 2-D Convolutional Network Model Build [5 marks]

Implement below convolutional network,

Layer

# Filters

Kernel Size

Stride

Padding

Size of Feature Map

Activation Function

Input

112 × 112 × 3

Conv1

32

5 × 5

2

-

ReLU

MaxPool

-

3 × 3

2

-

-

Conv2

64

3 × 3

1

1

ReLU

Conv3

64

3 × 3

1

1

ReLU

MaxPool

-

3 × 3

2

-

-

Conv4

128

3 × 3

1

1

ReLU

Conv5

128

3 × 3

1

1

ReLU

FC

2048

-

-

-

ReLU

FC

1024

-

-

-

Softmax

Calculate the size of the associated feature maps and complete the above form.  What should you do with the image set before feeding it into this model?  What is the difference between this model and AlexNet?

4. Training [10 marks] Train above two models at least 50 epochs.  For each model, explain what the lost function is, which optimizer do you use, and other training parameters, e.g., learning rate, epoch number etc.  Plot the

training history, e.g., produce two graphs (one for training and validation losses, one for training and validation accuracy) that each contains 2 curves. Have those two models converged?

5. Test [10 marks] Test and compare those two trained models on the test set. Show the accuracies and confusion matrices using python commands. Which model achieves a better accuracy? Briefly explain why this happened.

Q3. Real-world Application Questions [30 marks]

Computer vision is the scientific field which defines how machine interpret the meaning of images and videos . The figure below shows three different tasks in computer vision.  Answer the questions below (answer to each question should not exceed 200 words .)

1. Which three kinds of tasks are shown in the above figure?  Briefly describe those three tasks and the differences each others. [5 marks]

2.  Choose one of the tasks you answered above, and give ONE specific real-world problem that pertains to this task. Detail the issues raised by this real-world problem. [5 marks]

3.  Explain how neural networks can be used to address the problem you stated above.   Find THREE different published neural network models that can solve this problem. [5 marks]

4.  Draw a diagram of the workflow for the algorithm you proposed, and describe in details. [5 marks]

5. You start prototyping by training your chosen network on a small set of 1,000 images. Training converges, but the training loss is high.  A colleague suggests to solve this by increasing the training set.  Is this approach likely to help? Explain. [5 marks]

6.  Later you use the full set of the dataset, but find that the dataset is unbalanced. How will the training results be affected? How can you solve this? [5 marks]

Marking Criteria

(1). The marks for each step in Q2 are divided into two parts

Rubrics

Marking Scheme

Marks

Program [60%]

The code works with clear layout and some comments. The out- puts make some sense.

60%

The code works and outputs make some sense.

40%

Some of the component parts of the problem can be seen in the solution, but the program wont produce any outcome. The code is difficult to read in places

20%

The component parts of the program are incorrect or incomplete, providing a program of limited functionality that meets some of the given requirements. The code is difficult to read.

0%

Question Answer [40%]

All question are answered correctly, plentiful evidence of clear understanding of the CNN

40%

Some of the answers not correct, convincing evidence of under- standing of the CNN

20%

Answers are incorrect, very little evidence of understanding of the CNN

0%