A feature map is the two-dimensional grid of activations produced when one convolution kernel slides across the input of a layer, so that each value records how strongly a learned pattern is present at a particular spatial position. In neural networks for images, audio and other grid-structured data, feature maps are the intermediate representations that carry information from one layer to the next.
A convolutional layer with many filters outputs a stack of feature maps, one per filter, usually described as a tensor of height, width and channels. Reading those maps layer by layer shows how a network moves from edges and textures to object parts and whole objects.
How a convolution produces a feature map
A feature map is created by computing a dot product between a kernel and each local patch of the input, adding a bias and usually passing the result through an activation function such as ReLU. The kernel weights are shared across all positions, which is why the same pattern can be detected anywhere in the image.
This weight sharing gives convolution its key property, translation equivariance: if an edge moves ten pixels to the right in the input, its response moves ten positions to the right in the feature map. Each value depends only on a small region of the input, called its receptive field, which grows as layers are stacked.
The spatial size of the output is controlled by a few hyperparameters, summarized below.
| Parameter | Meaning | Effect on output size |
|---|---|---|
| Kernel size | Width and height of the filter, often 3×3 | Larger kernels shrink output without padding |
| Stride | Step between filter positions | Stride 2 roughly halves each dimension |
| Padding | Border values added around the input | Same padding preserves the input size |
| Dilation | Spacing between kernel elements | Enlarges the receptive field at no extra weights |
| Number of filters | Kernels applied in parallel | Sets the channel count of the output |
For one spatial dimension, the output size equals (input + 2 x padding – dilated kernel) / stride + 1, rounded down. A 224×224 input with a 3×3 kernel, padding 1 and stride 1 therefore yields a 224×224 map, while stride 2 yields 112×112.
What feature maps represent at different depths
Feature maps form a hierarchy of abstraction: early layers respond to simple local patterns, and deeper layers respond to complex, semantically meaningful structures. This progression is the main reason convolutional neural networks learn useful visual representations without hand-designed features.
As depth increases, networks typically reduce spatial resolution and increase channel count, using strided convolutions or pooling layers. The maps become smaller but richer, trading precise location for more descriptive content.
| Network stage | Typical size and channels | Patterns detected |
|---|---|---|
| Early layers | 112×112, 64 channels | Edges, color blobs, simple gradients |
| Middle layers | 28×28, 256 to 512 channels | Textures, corners, repeated motifs |
| Late layers | 7×7, 512 to 2048 channels | Object parts, faces, wheels, whole shapes |
| After global pooling | 1×1, same channel count | A vector summarizing the image content |
The figures above are typical of architectures such as ResNet on 224×224 inputs; exact values differ by design. Individual channels in late layers are not always cleanly interpretable, because many concepts are distributed across several channels rather than stored in one.
Feature maps compared with related concepts
The term feature map is often confused with neighboring Terms, but it names an output tensor slice, not a set of weights or an input region. The table separates the most frequently mixed-up concepts.
| Term | What it is | Learned or computed |
|---|---|---|
| Feature map | Activation grid output by one filter | Computed for every input |
| Convolution kernel | Small weight matrix that is slid over the input | Learned during training |
| Receptive field | Input region that influences one activation | Determined by architecture |
| Activation map | Often a synonym; sometimes the map after the nonlinearity | Computed for every input |
| Embedding | Dense vector representation, usually without a spatial grid | Learned or computed |
In kernel methods, a different usage exists: a feature map is a function that projects inputs into a higher-dimensional space, as in the kernel trick of support vector machines. In deep learning, the spatial activation meaning is the standard one.
Practical uses of feature maps
Feature maps are directly reused in many architectures and tools, not only passed silently between layers. Engineers inspect, combine and transfer them for several purposes.
- Transfer learning: maps from a pretrained backbone serve as general features for a new task.
- Feature pyramids: detectors combine maps from several depths to find both small and large objects.
- Skip connections: U-Net copies encoder maps to the decoder to restore fine spatial detail.
- Visual explanations: methods such as Grad-CAM weight late maps by gradients to show which regions drove a prediction.
- Perceptual losses: style transfer and super-resolution compare feature maps instead of raw pixels.
Vision transformers do not use convolution, yet their patch token outputs can be reshaped into spatial maps and used in the same way, which allows detection and segmentation heads to work with both families.
Memory cost and common mistakes
Feature maps, not weights, often dominate memory use during training, because every activation must be stored for backpropagation. A batch of high-resolution images with wide early layers can require several gigabytes of activation memory.
| Symptom | Likely cause | Typical fix |
|---|---|---|
| Out-of-memory errors | Large maps at full resolution in early layers | Reduce batch size, use gradient checkpointing |
| Shape mismatch errors | Wrong padding or stride arithmetic | Recalculate output size per layer |
| Many all-zero maps | Dead ReLU units after poor initialization | Adjust learning rate or initialization |
| Loss of small objects | Downsampling too early or too aggressively | Use feature pyramids or higher resolution |
A frequent interpretive mistake is treating one visualized channel as proof of what the network has learned. Feature visualizations are useful hints, but robust conclusions require systematic evaluation across many inputs.
Explained without jargon
Think of a feature map as a heat map for one specific pattern. A neural network looking at a photo uses many small detectors, and each detector scans the whole picture. Where it finds its pattern, such as a vertical edge or a patch of fur, it marks a bright spot; where it finds nothing, the spot stays dark.
Each detector produces its own map, and the next layer reads all those maps together to spot larger shapes. Layer after layer, simple marks combine into eyes, wheels or letters, until the network can decide what the picture shows.
A typical use case
A quality-control team at an electronics factory trains a convolutional network to find solder defects on circuit boards. The camera captures 1024×1024 images, and the network turns each image into feature maps at four scales, from 256×256 down to 32×32.
Small defects such as solder bridges only a few pixels wide are visible in the high-resolution early maps, while missing components appear clearly in the coarse late maps. By combining all four scales in a feature pyramid, the detector catches both kinds of fault. When an engineer questions a rejection, a Grad-CAM overlay built from the last feature maps highlights the exact solder joint that triggered the decision, which helps the team trust and tune the system.