Convolution

Convolution · node type · Conv, ConvInteger, QLinearConv

Slides a small learned filter over an image or signal, so the same detector runs at every position.

Also called Conv, Conv2D, Conv1D, Convolutional layer

A 3 × 3 kernel slides over the input; each output cell is the sum of the nine products under it.

Input 7 × 7

Kernel

10-110-110-1

Output 5 × 5

-1

out[0,0] = -1×1 = -1

Figure 1. Try it: every number is computed in your browser from the formula below.

What it does

A convolution reuses one small set of weights at every location. At each position it takes a window of the input across all input channels, multiplies it element by element with a learned kernel and sums the result into one output value, once per output channel. Because the same kernel is used everywhere, a pattern learned in one corner is recognized in every other corner, and the parameter count does not grow with the image size. Early layers tend to learn edges and color blobs; deeper layers combine them into textures and parts. Strides shrink the output; padding keeps borders. The same operator works on 1D signals (audio, text features) and 3D volumes.

Formula

Y[n, m, y, x] = Bm + Σc Σi Σj W[m, c, i, j] · X[n, c, s·y + d·i − p, s·x + d·j − p]H' = ⌊(H + 2p − d·(k − 1) − 1) / s⌋ + 1

Shapes and parameters

Shapes
Input [N, C, H, W], kernel [M, C/group, kH, kW], bias [M]; output [N, M, H', W'], where H' and W' follow from stride s, padding p, dilation d and kernel size k.
Parameters
M × (C / group) × kH × kW weights plus M biases. A 3 × 3 convolution from 8 to 16 channels has 16 × 8 × 9 + 16 = 1,168 parameters, whatever the image size.
Used for
Image classifiers and detectors, segmentation and denoising networks, audio models that read spectrograms, and the patch embedding of vision transformers.

Figure 2. Convolution inside Brighten a low-light photo, a real model in WeightSpace. The 3 outlined nodes are Convolution; select any node for its shapes and parameters.

Figure 3. The typed ports of Convolution, in the same format as every model drawing. Letters such as N or C stand for any size.

In WeightSpace

Several catalog models expose the bias of their last convolution as the editable parameter, for example a denoiser’s per-channel noise estimate, a saliency or matting logit, or an image generator’s output color. Edits stay within ±8 of the shipped bias. Kernels themselves are read-only.

Where it appears