Computer Vision & Deep Learning

0 of 18 lessons complete (0%)

Convolutional Neural Networks from Scratch

How Convolutions Turn Pixels into Features

This is a preview lesson

Register or sign in to take this lesson.

A digital image is just a grid of numbers, and a convolutional neural network is a machine for turning that grid into meaning. Before reaching for pretrained models, it pays to understand the one operation the whole field is built on, because every later architecture then becomes easier to reason about.

The Sliding Window Idea

A convolution slides a small grid of learned weights, called a kernel or filter, across the image and computes a weighted sum at every position. The output is a feature map showing where that filter found its pattern. Early filters learn simple patterns like edges and color transitions; deeper layers combine them into textures, parts, and eventually whole objects.

Why Convolutions Beat Dense Layers on Images

A fully connected layer treats every pixel independently, which explodes the parameter count and ignores spatial structure. Convolutions share one small set of weights across the whole image, so a cat detector works wherever the cat sits. This weight sharing gives translation tolerance and keeps models small enough to train on realistic hardware.

Channels Stride and Padding

Real layers work on stacks of channels: an RGB input has three, and each layer outputs as many channels as it has filters. Stride controls how far the kernel jumps between positions, shrinking the output. Padding adds a border of zeros so edges are not undersampled and sizes stay predictable. These three knobs shape every network you will build.

Action Step

In PyTorch or NumPy, apply a hand-written three-by-three edge detection kernel to a grayscale photo and visualize the result. Then change stride and padding, note how the output dimensions change, and write the size formula in your notes.

Educational content only. The AI tooling landscape changes quickly — verify current library versions, APIs, and best practices in official documentation. This course does not certify anyone.