Feature map

On this page 7

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.

ParameterMeaningEffect on output size
Kernel sizeWidth and height of the filter, often 3×3Larger kernels shrink output without padding
StrideStep between filter positionsStride 2 roughly halves each dimension
PaddingBorder values added around the inputSame padding preserves the input size
DilationSpacing between kernel elementsEnlarges the receptive field at no extra weights
Number of filtersKernels applied in parallelSets the channel count of the output
Parameters that determine feature map size

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 stageTypical size and channelsPatterns detected
Early layers112×112, 64 channelsEdges, color blobs, simple gradients
Middle layers28×28, 256 to 512 channelsTextures, corners, repeated motifs
Late layers7×7, 512 to 2048 channelsObject parts, faces, wheels, whole shapes
After global pooling1×1, same channel countA vector summarizing the image content
Typical feature map behavior across an image classification network

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.

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.

TermWhat it isLearned or computed
Feature mapActivation grid output by one filterComputed for every input
Convolution kernelSmall weight matrix that is slid over the inputLearned during training
Receptive fieldInput region that influences one activationDetermined by architecture
Activation mapOften a synonym; sometimes the map after the nonlinearityComputed for every input
EmbeddingDense vector representation, usually without a spatial gridLearned or computed
Feature map versus related terms

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.

SymptomLikely causeTypical fix
Out-of-memory errorsLarge maps at full resolution in early layersReduce batch size, use gradient checkpointing
Shape mismatch errorsWrong padding or stride arithmeticRecalculate output size per layer
Many all-zero mapsDead ReLU units after poor initializationAdjust learning rate or initialization
Loss of small objectsDownsampling too early or too aggressivelyUse feature pyramids or higher resolution
Common problems involving feature maps

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.