Back to Curriculum
IntermediateDeep Learning

CNNs

Convolutional Neural Networks for image recognition.

Interactive Playground

Initializing Interactive Playground...

Research-Level Deep Dive & Equations

In mathematical analysis, a **convolution** between a continuous input signal and a filter kernel is defined as the integral of the product of the two functions after one is reflected and shifted: For discrete 2D applications like computer vision, a 2D convolution of an image with a kernel is defined as: where . The spatial reflection of the kernel (represented by the minus sign in index subtraction) is necessary for convolution to satisfy the mathematical property of **associativity**: .
### Cross-Correlation in Deep Learning: In practical deep learning libraries (e.g., PyTorch, TensorFlow), the operation implemented under the name "convolution" is actually **cross-correlation**, which omits the spatial reflection step:
Because the kernel parameters are learned from scratch during backpropagation, spatial reflection is mathematically redundant. If reflection were applied, the network would simply learn a flipped version of the kernel. Omitting the flip saves computational overhead.
### Output Size Formula with Dilation: The spatial dimensions of a convolutional layer's output feature map depend on input width , kernel size , padding , stride , and **dilation rate** (which inserts spaces between kernel elements): Dilation allows the filter to cover a much larger receptive field without increasing the number of trainable parameters or FLOPS, which is highly useful in semantic segmentation (e.g., Dilated Convolutions in DeepLab).

Key Equations

Test Your Knowledge

Check whether you have mastered this concept with a quick quiz.

Was this lesson helpful?

Your feedback helps us continuously improve the curriculum and interactive visualizations.