A filter is a pattern written as numbers
That is the Sobel filter for vertical edges. Slid across an image it answers, at every position, how much brighter the right side is than the left.
On a flat region the positive and negative halves cancel and the output is zero. On an edge they do not, and the output is large.
The same nine numbers blur when they average and sharpen when they subtract the surroundings from the centre. Nothing else about the operation changes.
Why the weights sum to what they sum to
A kernel whose weights sum to 1 leaves the average brightness of the image alone, which is what a blur or a sharpen wants.
A kernel summing to zero outputs nothing on any uniform patch, which is what every edge and texture detector wants.
Reading the sum of a learned kernel is therefore a fast way to tell whether it detects something or transmits something.
The part that changed in 2012
Before deep learning these kernels were designed by hand, and a decade of computer vision research was largely the design of better ones.
In a convolutional network the kernel is just parameters, so the same gradient that trains a weight matrix trains the filter itself.
The network is not given edge detectors. It discovers them, and the first layer of a trained image model reliably contains something close to Sobel.
What each layer's filters end up detecting
- Layer one: oriented edges, single colours, and simple gradients.
- Layer two: corners, curves and junctions built from those edges.
- Middle layers: textures, repeated motifs and parts such as wheels or eyes.
- Late layers: whole objects, and configurations of parts.
- The classifier: a weighted vote over which of those appeared.
How many filters a layer has
Each output channel is one filter, so a layer with 64 output channels is looking for 64 different patterns in parallel.
Channel counts usually double as the spatial size halves, which keeps the arithmetic per layer roughly constant while the representation becomes less about where and more about what.
A filter in a later layer is not a picture. It spans every incoming channel, so it is a pattern over detected features rather than over pixels.