Bytes
rocket

Your Success, Our Mission!

3000+ Careers Transformed.

Convolution and Filters

Last Updated: 3rd February, 2026

At the core of every Convolutional Neural Network (CNN) is a mathematical operation called convolution. This operation allows CNNs to detect patterns in images the same way our eyes identify edges, textures, and shapes. Understanding convolution is essential, because it forms the foundation of how CNNs “see.”

What is Convolution?

Convolution is a process that combines two main components:

  1. The input image — represented as a matrix of pixel values.
  2. A filter (or kernel) — a smaller matrix, such as 3 × 3 or 5 × 5, designed to detect specific patterns.

The filter slides across the image like a scanner. At each position, it multiplies its values with the underlying image pixels and sums the result. The output of this operation forms a feature map, which highlights where the filter’s pattern is present in the image.

For example:

Filter (Edge Detector)OperationOutput
[[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]]Detects vertical edgesEdge map highlighting boundaries

CNNs use multiple filters at each layer, allowing them to learn increasingly complex patterns:

  • Early layers: detect lines, edges, and basic curves.
  • Middle layers: detect textures, corners, and abstract shapes.
  • Deep layers: detect full objects like faces, vehicles, or animals.

This hierarchy gives CNNs their superpower — the ability to learn meaningful visual features automatically.

Example:

Image (3x3):      Filter:         Result:
1 2 1             0 1 0           8
0 1 0     *       1 -4 1   =     -4
2 1 2             0 1 0           8

In CNNs:

  • The image is convolved with several filters.
  • Each filter learns a different visual feature.

Picture22.png

Module 2: Inside Convolutional Neural Networks (CNNs)Convolution and Filters

Top Tutorials

Related Articles