Filters and Feature Maps

What CNNs Actually Learn

Filters are the learned parameters of a CNN. Each filter detects a specific visual pattern. Feature maps are the outputs — spatial grids showing where each pattern was found and how strongly. These emerge from training; they are never hand-designed.

Feature Hierarchy by Layer Depth

1

Early layers — Simple, low-level filters: horizontal edges, vertical edges, diagonal edges, color gradients, color boundaries. These emerge in the first 1–2 convolutional layers of any CNN trained on images.

2

Middle layers — Combinations of early features: corners, curves, textures, simple shapes. Eyes, wheels, doorknobs, and leaf patterns become detectable here in networks trained on diverse data.

3

Deep layers — High-level semantic features: "face," "dog," "car wheel," "text region." These are what the classification head uses to make its final decision.

Visualizing What Filters Have Learned

Activation Maximization

Find the input image that maximizes a specific feature map's activation. Shows exactly what pattern the filter is looking for in isolation.

Grad-CAM

Produces a heatmap over the input image showing which regions drove the model's classification decision. Used for debugging: "what made the model predict pneumonia in this X-ray?"

Depth and Width Tradeoff

Spatial resolution vs representational depth

As networks deepen, pooling reduces Height × Width while the number of filters increases (32 → 64 → 128 → 256). The network trades spatial resolution for representational richness — losing "where exactly" while gaining "what it is."

Need Help?

Ask the AI assistant about CNN filters, what feature maps represent, or how Grad-CAM helps interpret model decisions.