liveBook · Manning

Convolution kernel

As explained in Deep Learning with R, Third Edition

A convolution kernel is a learned weight matrix that transforms each extracted input patch into an output feature vector.

A convolution kernel is a learned weight matrix that transforms each extracted input patch into an output feature vector. Sliding across an image, the same kernel evaluates the same local pattern at every position, producing a response map. Early kernels commonly respond to edges or textures; later kernels can respond to increasingly abstract visual concepts. section 8.1.1 section 10.4

A convolution layer is characterized by:

  • Patch size, typically 3 × 3 or 5 × 5, defining the local region examined at each position. section 8.1.1
  • Output depth, which determines how many kernels are learned and therefore how many output channels are produced. section 8.1.1
  • A response map for each kernel, showing where its learned pattern appears across the input. section 8.1.1
  • Window placement controlled by valid locations, padding, and strides, which affect the output dimensions. section 8.1.1

MNIST convolution layer

A first convolution layer can transform a 28 × 28 × 1 grayscale input into a 26 × 26 × 64 feature map. It applies 64 learned kernels over 3 × 3 patches; each output channel is a spatial response map for one kernel. A later stack can increase depth from 64 to 128 to 256, while successive layers represent more complex visual patterns. section 8.1.1

Figure 8.3 The concept of a response map: a 2D map of the presence of a pattern at different locations in an input
figure

Use the response-map figure to see how one kernel records the presence of a learned pattern at different image locations. section 8.1.1

Kernel behavior can be inspected through intermediate activations. Plotting each channel separately reveals which patterns respond to an input; a first-layer channel may behave like a diagonal-edge detector, although learned channels can vary between training runs. section 10.1

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains patches, channels, response maps, padding, and strides, but stops short of formal weight calculations.
Examples
Uses MNIST dimensions, 3 × 3 and 5 × 5 windows, and channel visualizations of a cat image.
What it assumes
Assumes image tensors with height, width, and channels, while introducing filters, feature maps, and response maps.
What you can do after
Evaluate learned patterns by inspecting convolutional activations and their spatial response maps.
How it connects
Connects convolution kernels to feature maps, response maps, intermediate activations, pooling layers, and Grad-CAM.

Also explained in

Compare how 11 books explain convolution kernel →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.