In a Convolutional Neural Network (CNN), what is the primary purpose and operation of a filter (also known as a kernel) within a convolutional layer?
Select an answer to reveal the explanation.
Short Explanation
Think of a filter like a stencil you run over an image. You slide a small matrix of weights across the input, multiply and add at each stop, and a high output means it found a local pattern. That’s feature detection, not a dense layer, activation function, or max-pooling window.
Full Explanation
The correct answer is the description of a small weight matrix that slides across the input data to detect local features through element-wise multiplication and summation. In a convolutional layer, the filter, also called a kernel, is the fundamental operator used for feature extraction. A filter is a small, learnable matrix of weights, typically of size 3x3 or 5x5, that represents a specific spatial pattern such as an edge, texture, or corner. During the forward pass, the filter slides, or convolves, over the spatial dimensions of the input tensor. At each position, it performs an element-wise multiplication, also called a Hadamard product, between its weights and the corresponding patch of input values, then sums those products into a single scalar value. This process is repeated across the entire input, generating a two-dimensional output map called a feature map, or activation map. Multiple filters are used in a single layer, each learning to detect different features such as vertical edges, horizontal lines, or textures, and these feature maps are stacked together to form the output channels of the convolutional layer. The description of a dense, fully connected layer that links every input neuron to the output is wrong because that describes a fully connected layer, while convolutional layers use sparse connectivity. The description of applying non-linear thresholding to the outputs of the previous layer is wrong because that describes activation functions such as ReLU or Sigmoid, not the convolution operation itself. The description of downsampling the image resolution by selecting the maximum value in a window is wrong because that describes a pooling layer, such as max pooling, which is used for downsampling and dimensionality reduction. For the exam, make sure you distinguish the convolution operation, or filtering, from pooling downsampling and activation functions.