What is the main purpose of a kernel (filter) in a convolutional layer?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A kernel, or filter, is a small grid of learnable weights that slides across the input, computing a dot product at each position. Here's the deal: different filters learn to respond to different patterns — one might light up for vertical edges, another for a certain texture, another for a color blob — and stacking many filters lets the network build up a rich set of feature detectors. That's exactly what 'extract features' captures, so it's the right answer. Randomly zeroing neurons is dropout, not what a kernel does. Picking the max value in a region is max pooling's job, a separate operation. And flattening 2D maps into a 1D vector is the flattening layer's role, which happens later, right before the fully connected layers.
Full explanation below image
Full Explanation
A kernel, also called a filter, in a convolutional layer is a small matrix of learnable weights (for example, 3x3 or 5x5) that is systematically slid, or convolved, across the width and height of an input feature map. At each position, the kernel computes a weighted sum (dot product) between its weights and the corresponding local patch of the input, producing a single value in the output feature map. Because the same kernel's weights are reused (shared) at every spatial location, the kernel effectively learns to detect a specific pattern, such as a vertical edge, a particular texture, a corner, or a color gradient, wherever that pattern appears in the input. A convolutional layer typically applies many different kernels in parallel, each producing its own feature map, so the layer as a whole builds up a rich, multi-channel representation of the various local features present in the input. In deeper layers, these simple features (edges, textures) are recombined into progressively more complex and abstract features (shapes, object parts, whole objects).
The first distractor describes dropout, a regularization technique that randomly deactivates a fraction of neurons during training to reduce overfitting; this is unrelated to what a convolutional kernel does, since dropout operates on neuron activations rather than sliding a weighted filter across spatial input.
The second distractor describes max pooling, a downsampling operation that reduces the spatial size of a feature map by taking the maximum value within each pooling window; while pooling layers often follow convolutional layers, pooling itself involves no learnable weights and serves a different purpose (downsampling and some translation invariance) than feature extraction via a learned kernel.
The third distractor describes the flattening layer, which reshapes a multi-dimensional feature map (height x width x channels) into a single 1D vector so it can be fed into fully connected layers; this reshaping operation happens after the convolutional and pooling stages and involves no learned filtering at all.
Memory aid: a kernel is the 'feature detective' of a CNN, sliding around the image asking 'is my pattern here?' at every location, and stacking many of these detectives across many layers is how CNNs build understanding from simple edges up to whole objects.