Convolutional Neural Networks
Level: 2 (Recall — definitions, standard problems, short derivations) Time limit: 30 minutes Total marks: 40
Q1. Define the convolution operation in a CNN and state two key properties (e.g., parameter sharing, local connectivity) that make it efficient compared to a fully connected layer. (4 marks)
Q2. A grayscale input image of size is convolved with a single filter using stride and no padding. (a) Compute the output feature map spatial dimensions. (b) State the general formula for the output size in terms of input size , filter size , padding , and stride . (4 marks)
Q3. Define stride, padding, and dilation. For a input with a filter, stride , and padding , compute the output spatial size. (5 marks)
Q4. Compare max pooling and average pooling. For the input below, apply max pooling with stride and give the output. (4 marks)
Q5. Define the receptive field of a neuron in a CNN. For a network of two stacked convolution layers (stride 1, no dilation), compute the effective receptive field of a neuron in the second layer with respect to the input. (4 marks)
Q6. Briefly describe the LeNet-5 architecture: list its layer types in order and state the task it was designed for. (4 marks)
Q7. State the core design idea of VGG networks and explain why two stacked convolutions are preferred over a single convolution (mention receptive field and parameters). (5 marks)
Q8. Explain the skip (residual) connection used in ResNet. Write the output equation of a residual block and state the problem it solves. (4 marks)
Q9. Define transfer learning and fine-tuning in the context of CNNs. State one situation where you would freeze early layers. (3 marks)
Q10. List any three common data augmentation techniques for images and state one benefit of augmentation. (3 marks)
End of paper.
Answer keyMark scheme & solutions
Q1. (4 marks)
- Convolution: a filter/kernel slides over the input, computing element-wise products and summing them at each spatial location to produce a feature map. (2)
- Properties (any two, 1 each): parameter sharing (same filter weights reused across all spatial positions, reducing parameters); local connectivity/sparse interactions (each output depends only on a small local receptive field); translation equivariance. (2)
Q2. (4 marks)
- (b) Formula: (2)
- (a) . Output = . (2)
Q3. (5 marks)
- Stride: step size (in pixels) by which the filter moves across the input. (1)
- Padding: adding extra (usually zero) pixels around the input border to control output size / preserve edges. (1)
- Dilation: inserting gaps between filter elements to enlarge receptive field without more parameters. (1)
- Computation: . Output = . (2)
Q4. (4 marks)
- Max pooling takes the maximum in each window (keeps strongest activation); average pooling takes the mean (smooths). (2)
- Windows: TL{1,3,5,6}→6, TR{2,4,1,2}→4, BL{7,2,1,4}→7, BR{3,0,8,5}→8. (2)
Q5. (4 marks)
- Receptive field: the region of the input that influences a particular neuron's activation. (2)
- For stacked (stride 1): layer 1 RF = 3; layer 2 RF = . Effective receptive field = . (2)
Q6. (4 marks)
- Task: handwritten digit recognition (MNIST). (1)
- Layer order: Input → Conv → (Sub)Pool → Conv → Pool → Fully Connected → FC → Output(softmax). (3) Accept: C1(conv)–S2(pool)–C3(conv)–S4(pool)–C5(FC)–F6(FC)–Output.
Q7. (5 marks)
- Core idea: use small filters stacked deeply with uniform architecture and increasing depth. (2)
- Two convs give same receptive field. (1)
- Parameters: two weights (per channel pair) vs one ; fewer parameters and an extra non-linearity → more expressive/efficient. (2)
Q8. (4 marks)
- Skip connection adds the block's input directly to its output, bypassing the stacked layers. (1)
- Equation: , where is the residual mapping. (2)
- Solves the vanishing gradient / degradation problem, enabling training of very deep networks. (1)
Q9. (3 marks)
- Transfer learning: reusing a model pretrained on a large dataset (e.g., ImageNet) as a starting point for a new task. (1)
- Fine-tuning: continuing training (updating weights) of some/all layers on the new dataset. (1)
- Freeze early layers when the new dataset is small and/or similar to the source domain (early layers learn generic features like edges). (1)
Q10. (3 marks)
- Any three (½ each, up to 2): horizontal/vertical flip, random rotation, random crop, scaling/zoom, translation, color jitter/brightness, Gaussian noise, cutout/random erasing. (2)
- Benefit: increases effective dataset size and diversity → reduces overfitting / improves generalization. (1)
[
{"claim":"Q2 output size 32x32 with 5x5 filter, stride1, pad0 -> 28","code":"N=32;F=5;P=0;S=1;O=(N-F+2*P)//S+1;result=(O==28)"},
{"claim":"Q3 output 7x7 with 3x3 filter, stride2, pad1 -> 4","code":"N=7;F=3;P=1;S=2;O=(N-F+2*P)//S+1;result=(O==4)"},
{"claim":"Q5 stacked two 3x3 receptive field = 5","code":"rf=3;rf=rf+(3-1);result=(rf==5)"},
{"claim":"Q7 two 3x3 have fewer params than one 5x5","code":"two=2*3*3;one=5*5;result=(two==18 and one==25 and two<one)"},
{"claim":"Q4 max pooling output correct","code":"import numpy as np;a=np.array([[1,3,2,4],[5,6,1,2],[7,2,3,0],[1,4,8,5]]);out=np.array([[a[0:2,0:2].max(),a[0:2,2:4].max()],[a[2:4,0:2].max(),a[2:4,2:4].max()]]);result=(out.tolist()==[[6,4],[7,8]])"}
]