Convolution is a mathematical operation that slides a small filter, also called a kernel, across an input and combines the values under it, and it is the foundation of convolutional neural networks (CNNs), which excel at identifying edges and objects in images. Each position the filter visits produces one output value, and together those values form a map of where a feature appears.
This page is for data scientists, engineers and technology leaders who need a clear definition of convolution. It covers how the operation works, the key terms, how it differs from pooling and fully connected layers, and where it fits when you build AI agents that work with images.
In a convolutional layer, a small tensor called a kernel is slid across the input. As the Dive into Deep Learning textbook notes, the kernel values are learned during training, and the layer's output is often called a feature map.
The same book points out that the term is a slight misnomer. Strictly, the operation is cross-correlation, and a true convolution flips the kernel first. Because kernels are learned from data, the outputs are the same either way, so deep learning uses the word convolution for both.
Images have local structure: nearby pixels tend to belong together. Convolution exploits this by connecting each output to a small region of the input instead of to every pixel. The Stanford CS231n notes call this local connectivity, and the small region is the neuron's receptive field.
Convolution also shares parameters. All neurons in one depth slice use the same weights, which, as the same notes explain, greatly reduces the number of parameters compared with connecting every input to every neuron.
For an input of width W, filter size F, stride S and padding P, CS231n gives the output width as (W minus F plus 2P) divided by S, plus 1. A 7 by 7 input with a 3 by 3 filter, stride 1 and no padding gives a 5 by 5 output.
| Layer | What it does | Learnable parameters |
|---|---|---|
| Convolution | Slides shared filters over the input to detect local features | Yes, the kernel weights and biases |
| Pooling | Reduces spatial size, often by taking the maximum in each window | None |
| Fully connected | Connects every input to every neuron | Yes, one weight per connection |
CS231n notes that pooling is usually inserted between convolutional layers to reduce spatial size, computation and overfitting.
Agents that inspect images, such as scanned documents, photographs or camera feeds, rely on vision models that are built from convolutional layers or related designs. The agent still needs governed access to the data and decisions around that model. For teams building and running agents, ElixirClaw is XenonStack's AI agents computing platform.
To map one decision your agents make from image analysis, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.
It is an operation that slides a small filter across an input and combines the values under it at each position. The results form a map showing where a feature appears.
A kernel is a small tensor of learned weights that is slid across the input. Its height and width define the convolution window.
Strictly no, because a true convolution flips the kernel first. In deep learning the kernels are learned, so the outputs are the same and both are called convolution.
Stride is the step size of the filter as it slides across the input. Padding adds zeros around the border so the kernel can reach the edges and the output size can be preserved.
They connect each output to a small local region and share the same filter weights across the image. This suits the local structure of images and reduces the number of parameters.