ML//CNN

A CNN (convolutional neural network) is a neural network that slides small learned filters over spatial data, and it is the standard tool for images and other grids: defect inspection on a production line, object detection on a drone or a car, classification of vibration spectrograms. Each filter is a FIR filter whose coefficients are learned instead of designed, and every layer applies tens or hundreds of them in parallel. Because the same filter is used at every position (weight sharing), a 3 by 3 layer from 64 to 64 channels has about 37,000 parameters whatever the size of the image, where a fully connected layer on a megapixel image would need a billion.


A CNN (convolutional neural network) is a neural network that slides small learned filters over spatial data, and it is the standard tool for images and other grids: defect inspection on a production line, object detection on a drone or a car, classification of vibration spectrograms. Each filter is a FIR filter whose coefficients are learned instead of designed, and every layer applies tens or hundreds of them in parallel. Because the same filter is used at every position (weight sharing), a 3 by 3 layer from 64 to 64 channels has about 37,000 parameters whatever the size of the image, where a fully connected layer on a megapixel image would need a billion.

Stacking layers lets each neuron see a larger patch of the input, its receptive field, and each layer learns higher-level features than the one before:

1Edges2Textures3Parts4Objects

The second property is translation equivariance: if the crack moves in the image, its response moves with it. That is an inductive bias, an assumption about the world built into the architecture, and it is right for photographs.

Visual inspection is everyday CNN work: defects in welds, paint, moulded parts or labels. Nobody trains from scratch; a network pretrained on millions of generic images is fine-tuned (transfer learning), and then hundreds to a few thousand labelled images usually suffice. The lighting of the station matters as much as the network, and if every defective part was photographed on the same day under another light, the network learns the light (shortcut learning). With controlled lighting and position, classical vision (thresholds, templates) is easier to validate.

On vibration, a spectrogram (spectrogram) turns a signal into an image where harmonics are horizontal lines and impacts vertical streaks, and a small CNN classifies it; a 1D CNN can also work on the raw signal, and its first layer ends up learning band-pass filters. The analogy breaks on the frequency axis: a pattern shifted from 100 Hz to 200 Hz means something else, so equivariance stops being a virtue. Expressing frequency as multiples of shaft speed (orders) keeps each defect's signature fixed as the rpm change (vibration analysis).

A detection CNN takes 10 to 30 ms on an embedded GPU or an NPU, fine for perception at 30 Hz and far too slow for a drone's attitude loop.

In research its dominance ended with the vision transformer: the same data, a simpler architecture and better scaling. In production, CNNs remain the workhorse of inspection and perception.