Convolutional Neural Networks (CNN): Convolutions, Pooling, Feature Maps
Introduction: Why standard neural networks fail on images
A fully connected network (every neuron wired to every input) sees an image as a long vector.
Example: a 100x100 pixel color image (RGB, the three red, green, blue channels) = 10,000 pixels x 3 channels = 30,000 values.
The first hidden neuron has 30,000 inputs. With 1,000 hidden neurons, you have 30 million parameters. Huge. Slow. Inefficient. And each neuron uses every pixel in the image, regardless of where it is.
Convolutional Neural Networks (CNNs) exploit a simple property: nearby pixels are related.
An edge or important texture only occupies a few pixels. The appearance of a pattern (an eye, a wheel) is the same regardless of its position in the image. No need to learn separately for each position.
CNNs are inspired by the biological visual cortex: neurons don't receive the entire image, just a small local region.
Three operations recur throughout a CNN, and the diagram below chains them together:
- the convolution, which looks for a pattern inside a small window;
- the ReLU (Rectified Linear Unit), which passes positive values through unchanged and replaces every negative value with zero: either "this pattern is present, this strongly" or "it isn't here", with no negative values left to interpret;
- the pooling, which shrinks what gets handed to the next layer.
All three are covered below.

The convolution operation: the core mechanism
A convolution slides a small filter (kernel) over the image and computes a dot product (a kind of similarity score) at each position.
Every symbol:
- and : the position at which the filter has been placed on the image (row , column );
- and : coordinates inside the filter. For a 3x3 filter they run over the 9 cells;
- : "sum over every cell of the filter";
- : the image pixel sitting under cell of the filter.
In one sentence: at each position on the image, multiply the pixels by the filter's numbers cell by cell, add it all up, and that single value becomes one pixel of the output image.
The result is a feature map: a new "image" that shows where that particular pattern appears and how intensely.

Concrete example: a filter that detects vertical edges:
This filter has a name: it is the vertical Sobel filter, an edge detector used in image processing long before neural networks. Read it column by column: the left column counts negatively, the right column positively, the middle one not at all. So the result is near zero over a uniform area (left and right cancel out) and strongly positive or negative wherever intensity changes abruptly from one side to the other, that is, on a vertical edge.

Filters learn patterns
The Sobel filter above was written by hand, by a human. In a CNN nobody writes it: the network discovers its filters on its own.
Each filter (typically 3x3 or 5x5) is a set of learned weights. One distinction to keep in mind from here on: the filter's weights are learned parameters, tuned during training and then frozen; the feature map is computed every time, on whichever image you are currently looking at. The filter is the tool, the map is the result of running it over the image.
Emergent hierarchy
Low layers (near the input): detect simple primitives. Horizontal edges, vertical edges, colors, contrast.
Middle layers: combine primitives to detect textures, simple shapes.
Deep layers: recognize complex structures. Eyes, wheels, faces.
This hierarchy emerges automatically without being coded.
The same filter is applied everywhere in the image. This is powerful: few parameters (a 3x3 = 9 weights), and the network learns translation invariance (a pattern is detected no matter where it is in the image).

Stride and padding: controlling the sliding
Two settings: the stride (the filter's step size) and the padding (the border added around the image).

Stride

It's the step size of the filter.
- Stride 1: the filter moves one pixel at a time. Feature map of similar size.
- Stride 2: the filter moves 2 pixels. Feature map half the size.
Larger stride = size reduction, fewer computations, but you lose local information.
Padding
Adding zeros around the image.
- "Same" padding: adds enough zeros to maintain the dimensions
- "Valid" padding: no zeros, dimensions shrink naturally
Padding helps when you want to keep the feature map size, or to treat border pixels properly (without a margin, a corner pixel is seen only once by a 3x3 filter, against nine times for a pixel in the middle).
Pooling: reducing resolution
Pooling (a downsampling step) reduces the size of feature maps. Three benefits:
- Fewer computations: subsequent layers work on less data
- Invariance: if a pattern shifts slightly, the max stays similar. Robustness to small translations
- Implicit regularization: fewer dimensions = less overfitting

Max Pooling
Takes the maximum in each window (typically 2x2). Preserves strong activations (salient patterns).
Average Pooling
Takes the average in each window. Used at the end to convert feature maps into a fixed-size vector.
Global Average Pooling (GAP) replaces the fully connected layers at the end: take the average of each entire feature map, which gives one number per map. Dramatically fewer parameters, and it limits overfitting. Introduced in 2013 and popularized by GoogLeNet and ResNet (2014-2015), it has been the usual arrangement in classification CNNs ever since.
Hierarchy of representations: layer by layer
Each layer receives the feature maps from the previous layer. It applies multiple filters in parallel. If a layer has 64 filters, it produces 64 feature maps.
Each filter captures a different aspect. Together, they build a complete understanding.
Receptive field: the region we "see"
A deep neuron doesn't look at a single position. It "sees" a region of the input image. The deeper you are in the network, the larger this region becomes.
This is the receptive field. It grows with depth, allowing deep neurons to detect large objects and whole-image patterns.
A powerful technique to enlarge the receptive field without losing resolution or blowing up the number of parameters is dilated convolutions. Instead of sliding a 3x3 filter over adjacent pixels, you space out the sampled pixels, a 3x3 filter with dilation 2 samples every other pixel, so it covers a 5x5 area with only 9 weights. This is widely used in image segmentation and audio processing (WaveNet uses it to capture long-range dependencies in the signal).
Multi-Scale Context Aggregation by Dilated Convolutions (Yu & Koltun, 2015)Example: a deep CNN can have a receptive field of 100x100 pixels. Each neuron in the deep layers "sees" a large area of the image.
Typical CNN architecture
Part 1: feature extractor
Convolution β ReLU β Pooling β Convolution β ReLU β Pooling β Convolution β ReLU β Pooling
A reminder of what each does: the convolution looks for patterns, the ReLU zeroes out anything negative, the pooling shrinks the result. Features become progressively more abstract, resolution decreases.
Part 2: classifier
Flattened features (the 3D maps are laid end to end into one long list of numbers) β fully connected layers β softmax, a function that turns raw output scores into probabilities summing to 1 ("87% cat, 11% dog, 2% everything else").
Or more modern: Global Average Pooling + 1x1 convolutions instead of fully connected layers (fewer parameters).
Beyond 2D images
CNNs are not limited to 2D images:
1D convolutions: process text, audio signals, time series. The filter slides along one dimension.
3D convolutions: process videos (two spatial dimensions plus time) and volumetric medical imaging, MRI (Magnetic Resonance Imaging) and CT (Computed Tomography, what people commonly call a scanner).
The principle remains: exploit the local structure of the data.
Common use cases
- Classification: is it a cat or a dog?
- Detection: where are all the cats in the image?
- Segmentation: which class for each pixel?
- Facial recognition: who is this face?
- Medical imaging: detecting tumors
- Autonomous vehicles: understanding the road
- Style transfer: applying the style of a painting to a photo
NLP (Natural Language Processing) used CNNs for text classification for a long time: the filter slides along the sentence instead of across the image. Effective and simple. Transformers (the architecture that has dominated language since 2017, see Transformer overview) took over, but CNNs are still used when short texts have to be classified fast.
Summary: why CNNs are revolutionary
CNNs made image analysis practical by keeping the number of parameters reasonable. An elegant architecture:
- Few parameters thanks to weight sharing
- Computationally efficient
- Naturally captures the spatial structure of data
- Learns a hierarchy of patterns automatically
That is what handed them computer vision from 2012 onward (AlexNet, see Classic CNN architectures).
CNNs dominated computer vision from 2012 to roughly 2021. Since then Vision Transformers (the transformer architecture applied to image patches instead of words) have taken the top spot on large vision tasks, provided you have plenty of data and plenty of compute. Convolution has not gone away: it remains the usual choice when training data is scarce, when the model has to fit on a device, and inside hybrid models that mix convolutions with attention.
Why this matters
Images are everywhere. CNNs give you the tools to analyze them. And two ideas introduced here (weight sharing, and a hierarchy of representations that emerges from training rather than being programmed) reappear, in other forms, in every architecture that followed.
1. Why is a fully connected network a poor fit for images?
2. In an already-trained CNN, what is frozen and what gets recomputed for each new image?
3. The same 3x3 filter is applied everywhere in the image. What is the double benefit of this weight sharing?
4. Are CNNs only for images?
5. In 2026, which statement best describes where CNNs stand in computer vision?