Back to the topic

AI · 8.2

Convolutional Networks: From Pixels to Predictions

Section A: 10 multiple choice questions, 10 marks. Section B: 3 written questions, 12 marks. Total 22 marks.

Name

Class

Date

Mark  / 22

Section A

Circle the letter of the correct answer. One mark each.

  1. 1What does 2 × 2 max pooling do to the block [1, 3 / 4, 6]?1
    1. AOutputs 1
    2. BOutputs 3.5
    3. COutputs 6
    4. DOutputs 14
  2. 2How many parameters does a max pooling layer have?1
    1. ANone
    2. BThe same as the convolution before it
    3. CFour for a 2 × 2 window
    4. DOne per window
  3. 3Through a classic CNN, what happens to the feature maps?1
    1. AThey are turned into text before the final layer
    2. BThey stay exactly the same size throughout the network
    3. CThey get smaller in width and height while the channels increase
    4. DThey get larger in width and height while the channels decrease
  4. 4What is a receptive field?1
    1. AThe patch of the original image that one value in a layer depends on
    2. BThe region of an image a person is looking at
    3. CThe number of filters in a convolutional layer
    4. DThe output of the final softmax layer
  5. 5Which features do the first layers of a trained CNN typically detect?1
    1. AWords and letters only
    2. BWhole faces
    3. CThe class labels
    4. DEdges and colour blobs
  6. 6What does a residual connection compute?1
    1. Ax − F(x)
    2. BF(x) + x
    3. CF(F(x))
    4. DF(x) × x
  7. 7Which network introduced residual connections in 2015?1
    1. AVGG-16
    2. BLeNet-5
    3. CAlexNet
    4. DResNet
  8. 8Which is a sensible data augmentation for photos of cats and dogs?1
    1. ADeleting half of the images
    2. BTurning every image upside down and relabelling it
    3. CFlipping each image left to right
    4. DChanging the label to the other animal
  9. 9What is dropout?1
    1. ADeleting training examples that are wrong
    2. BRandomly switching off neurons during training
    3. CRemoving layers that do not learn
    4. DStopping training early
  10. 10A school has 300 labelled photos of local birds. What is the most practical approach?1
    1. ACollecting no data and guessing the labels
    2. BUsing a dense network on the raw pixels instead
    3. CTraining a huge CNN from scratch on the 300 photos
    4. DTransfer learning from a network pretrained on ImageNet

Section B

Answer in the space provided. The number of marks tells you how many separate points to make.

  1. 1DescribeDescribe the structure of a typical convolutional neural network for classifying images.5
  2. 2ExplainExplain how residual connections allow very deep networks to be trained.4
  3. 3ExplainExplain how transfer learning helps when only a small dataset is available.3

Mark scheme

Section A

1C2A3C4A5D6B7D8C9B10D

Section B

1 Describe the structure of a typical convolutional neural network for classifying images. 5

One mark for each of the following, to a maximum of 5.

  • Convolutional layers with filters detect features
  • ReLU activation after each convolution
  • Pooling layers shrink the feature maps
  • Repeated, with spatial size shrinking and channels growing
  • Flatten, dense layers and softmax output

Model answer. A typical CNN starts with convolutional layers, in which many filters slide over the image to detect features, each followed by a ReLU activation. Pooling layers, usually 2 × 2 max pooling, then shrink the feature maps. This pattern of convolution, ReLU and pooling is repeated several times, so the maps get smaller in width and height while the number of channels grows. Finally the volume is flattened into a vector, passed through one or more dense layers, and a softmax output layer gives a probability for each class.

2 Explain how residual connections allow very deep networks to be trained. 4

One mark for each of the following, to a maximum of 4.

  • A shortcut adds the block's input to its output: F(x) + x
  • The block only has to learn the change / can pass the input through
  • Gradients flow back directly along the shortcut
  • So they do not vanish, and early layers still learn

Model answer. A residual connection adds a shortcut around a block of layers, so the block's output is F(x) + x: its input added to whatever the layers compute. The layers therefore only need to learn the change to make to the input, and if nothing helps they can learn to pass the input through unchanged. During backpropagation the gradient flows straight back along the shortcut, so it does not vanish as it passes through many layers, and even the earliest layers receive a strong learning signal. This let networks grow from about 20 layers to more than 150.

3 Explain how transfer learning helps when only a small dataset is available. 3

One mark for each of the following, to a maximum of 3.

  • Start from a network pretrained on a large dataset such as ImageNet
  • Its early layers already detect general features such as edges and shapes
  • Only a new final layer, or a little fine-tuning, is trained on the small dataset

Model answer. Transfer learning starts from a network that has already been trained on a huge dataset such as ImageNet. Its convolutional layers have already learned to detect general features such as edges, textures, shapes and object parts, which are useful for almost any image task. So only a new final layer, plus perhaps a little fine-tuning of the later layers, needs to be trained on the small dataset, which can work well with only a few hundred examples and far less computing.