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 and Infographic
Think of a filter (or kernel) like a stencil you run over an image. Let's say you're looking for horizontal lines. Your filter will have high numbers where a horizontal line would be and low numbers elsewhere. When you slide this little matrix over the image, it does basic multiplication and addition at each stop. If the filter matches a pattern on the image, you get a high number in your output. That's feature detection in action! It's not a activation function, and it's not a dense connection. It's just a sliding matrix doing local math. So, Option C is our correct answer.
Full explanation below image
Full Explanation
In a convolutional layer, the filter (or 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 convolving) over the spatial dimensions of the input tensor. At each position, it performs an element-wise multiplication (Hadamard product) between its weights and the corresponding patch of input values, and then sums these 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 (e.g., vertical edges, horizontal lines, textures), which are stacked together to form the output channels of the convolutional layer. Let's look at the distractors: Option A describes a fully connected (dense) layer, where every input neuron is connected to every output neuron. In contrast, convolutional layers utilize sparse connectivity. Option B describes activation functions like ReLU or Sigmoid. Option D describes the operation of a pooling layer (such as Max Pooling), which is specifically used for downsampling and dimensionality reduction. For the exam, make sure you distinguish the convolution operation (filtering) from pooling (downsampling) and activation functions.