Feature Map in CNN
Slide a kernel across an image to perform multiplications and generate a feature map.
Slide a kernel across an image to perform multiplications and generate a feature map.
The core building block of how Convolutional Neural Networks (CNNs) see the world.
The convolution operation is the heart of Convolutional Neural Networks (CNNs), the models that power most modern computer vision. This interactive visualizes that exact process. A small matrix, called a kernel or filter, slides over an input image. At each position, it performs an element-wise multiplication and sums the results to produce a single pixel in the output, known as a feature map.
Why do this? Because different kernels are designed to detect different features. One kernel might be good at finding vertical edges. Another might detect horizontal edges. A more complex one might activate when it sees a certain texture or curve. The resulting feature map is an image that shows "where" in the input the kernel found the feature it's looking for.
In a real CNN, the network learns the best kernel values during training to solve a specific task (like classifying cats vs. dogs). Here, you can manually set the kernel to build intuition for how they work.
Select the Identity kernel. Notice the output feature map is identical to the input image. This is because the kernel has a '1' in the center and '0's elsewhere. It's a perfect baseline—it doesn't change anything.
Draw a vertical line. Now, select the Edge Detection (Vert) kernel. The feature map will light up strongly along the line you drew. Now, select the Edge Detection (Horz) kernel. The feature map will be much darker. This demonstrates how specific kernels are tuned to find specific orientations.
Draw a simple shape. Apply the Sharpen kernel. The output will look like a crisper, more defined version of your drawing. This kernel emphasizes differences between a pixel and its neighbors.
Reset to the Identity kernel. Now, set the Bias to 50. The entire feature map becomes brighter. A positive bias increases the activation of every output pixel, while a negative bias decreases it. It's a simple way to make the neuron more or less likely to fire.
Select the Edge Detection (Vert) kernel and check the Apply ReLU box. ReLU (Rectified Linear Unit) is an activation function that clips all negative values to zero. Notice how all the red areas (negative values) in the feature map disappear, leaving only the green (positive) ones. This is a crucial step in real neural networks to introduce non-linearity.
Click the Animate Matrix button. This is the most important part! Watch how the 3x3 kernel slides over the input, and how the highlighted 3x3 grid of input pixels is multiplied by the kernel to produce the single highlighted pixel in the output. This is the convolution operation in action.
By stacking layers of these feature detectors, CNNs can learn to recognize increasingly complex patterns, from simple edges to eyes, faces, and entire objects.
The convolution operation is the heart of Convolutional Neural Networks (CNNs), the models that power most modern computer vision. This interactive visualizes that exact process. A small matrix, called a kernel or filter, slides over an input image. At each position, it performs an element-wise multiplication and sums the results to produce a single pixel in the output, known as a feature map.