0Pricing
Deep Learning Academy · Lesson

Convolution: Kernels Slide Over Pixels

How filters detect edges and textures.

Convolution: Kernels Slide Over Pixels is a free Deep Learning Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Deep Learning Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

An Image Is Just Numbers

To a network, a photo is a grid of pixel values. A small grayscale image might be 28x28 numbers, each from 0 (black) to 255 (white).

Why Not Just Flatten It?

Flattening an image into one long vector throws away the spatial layout. Pixels near each other matter, and a plain dense layer ignores that.

Meet the Kernel

A kernel is a tiny grid of weights, often 3x3. It slides across the image, looking at one small patch at a time.

The Sliding Window

At each position the kernel covers a patch, multiplies overlapping values, and sums them into one number. Then it slides over and repeats. 🔍

That Sum Is the Output Pixel

Each weighted sum becomes a single pixel in the result. Slide across the whole image and you build a fresh grid called a feature map.

Kernels Detect Patterns

A well-tuned kernel lights up where its pattern appears. One kernel might fire on vertical edges, another on bright corners or smooth textures.

An Edge Detector by Hand

This classic 3x3 kernel responds strongly to vertical edges, where light meets dark across a column.

edge_kernel = [
    [-1, 0, 1],
    [-1, 0, 1],
    [-1, 0, 1],
]

The Weights Are Learned

You do not hand-pick kernel numbers. Training adjusts them so each filter learns whatever pattern helps the network classify images.

Same Kernel, Everywhere

One kernel reuses the same weights across the whole image. This weight sharing means far fewer parameters than a dense layer would need.

A Conv Layer in PyTorch

nn.Conv2d wraps all of this. Here a Conv2d takes 1 input channel and learns 8 different 3x3 kernels.

import torch.nn as nn
conv = nn.Conv2d(1, 8, kernel_size=3)

Many Kernels, Many Maps

That layer learns 8 kernels, so it outputs 8 feature maps. Each one highlights a different pattern the network found useful.

Quick Check

Let us check what a convolution kernel actually produces.

Recap: Kernels Slide

You learned that a kernel slides over pixels, summing weighted patches into a feature map. Its weights are learned, shared, and tuned to spot edges and textures. 🎉

Frequently asked questions

Is the “Convolution: Kernels Slide Over Pixels” lesson free?

Yes — the full text of “Convolution: Kernels Slide Over Pixels” is free to read here on the web, and the Deep Learning Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Deep Learning Academy course, upgrade to CoddyKit PRO.

What will I learn in “Convolution: Kernels Slide Over Pixels”?

How filters detect edges and textures. You practise Deep Learning Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Deep Learning Academy?

No prior experience is required. Deep Learning Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Convolution: Kernels Slide Over Pixels” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Deep Learning Academy lesson?

Yes. Every Deep Learning Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Convolution: Kernels Slide Over Pixels
  2. Stride, Padding & Pooling
  3. Channels, Feature Maps & Receptive Fields
  4. Assemble a CNN Image Classifier
← Back to Deep Learning Academy