A convolution kernel is a small grid of weights that moves across an image. At each location, it multiplies its weights by the corresponding input values and adds the results to produce one output value. Reusing the same weights across the image lets a filter respond to a local pattern wherever it appears. section 8.1.1
o11 = i11 * w00 + i12 * w01 + i13 * w02 +
i21 * w10 + i22 * w11 + i23 * w12 +
i31 * w20 + i32 * w21 + i33 * w22
A 3 × 3 example shows how one output value is calculated from nine nearby input values and nine kernel weights. section 8.1.1
The weights can be learned rather than chosen by hand: they start with random values and change through backpropagation. For an RGB image, a kernel has weights for all three input channels. In PyTorch, `nn.Conv2d(3, 16, kernel_size=3)` applies 16 filters to three-channel input, producing 16 output channels; its weight tensor has shape `[16, 3, 3, 3]`. Here, `kernel_size=3` means a 3 × 3 window. section 8.1.1 section 8.2
Blur or detect an edge
Set every weight in a 3 × 3 kernel to `1/9`, with zero bias, and each output value averages a neighborhood: the image blurs. Instead, negative weights on the left and positive weights on the right make vertical boundaries stand out. These hand-set filters demonstrate what kernels can detect; training normally learns the useful weights. section 8.2.2
Small kernels keep the operation local, but one small window cannot capture every large shape. Stacking convolutions and downsampling between them lets later layers work with a broader view. Making a kernel as large as the whole image would lose the useful locality of convolution. section 8.2.3










