CNNs Part II — Improving Generalisability
Related: 8. Convolutional Neural Networks | 6. Loss Functions and Backpropagation | 7. Evaluating ML Models | 10. Transfer Learning and Pre-trained CNNs | Artificial Intelligence
Techniques for Better CNNs
Spatial Dropout
Like standard dropout but drops entire feature maps in convolutional layers rather than individual neurons.
Batch Normalisation
Normalises the output of each layer within a mini-batch to stabilise training.
Why it helps:
- Prevents vanishing/exploding gradients
- Reduces sensitivity to weight initialisation
- Acts as a slight regulariser
Formula:
- Normalise within mini-batch:
where and are the batch mean and variance.
- Scale and shift (learnable parameters):
where (scale) and (shift) are learned during training.
Placement: Typically after the convolutional/dense layer and before the activation function:
Conv2D → BatchNormalization → ReLU