There’s a painting on the wall of a dark room, and you’re holding a small torch. You can’t see the whole painting at once. You start in the top-left corner and sweep the beam slowly across. Each time a small patch lights up: a line here, a curve there, a change of colour further along. In the end you put the pieces together in your head and say: “it’s a portrait.”
Convolutional neural networks (CNNs) look at images in exactly this way. A 1998 paper by LeCun and colleagues was a milestone in shaping the idea as we know it today.
Small Templates
Instead of a torch, a CNN has small templates. Each template specialises in finding one thing. One looks for vertical lines, another for horizontal ones, another for a particular colour change. The network slides each template across the whole image and notes, “is what I’m looking for here, and how much of it?”. That sliding is called convolution.
The nice part is that no one designs these templates by hand. As the network sees thousands of examples, it learns for itself which templates are useful.
Meaning, Layer By Layer
Templates in the first layer find very simple things: edges, corners. The second layer combines what the first found. A few edges side by side make the shape of an eye. Higher layers combine those shapes: if two eyes, a nose and a mouth appear together, there’s probably a face.
In between there’s a summarising step (pooling). Think of it as stepping back from the painting. Some detail is lost, but the fact that “there’s an eye here” remains. That way the network doesn’t get hung up on the exact pixel where the eye sits.
So What Does This Have To Do With EEG?
EEG isn’t an image; it’s a signal that changes over time. But we can turn it into a colourful map showing which frequencies grow stronger or weaker over time: a time–frequency image. That map is a picture, and CNNs are very good at spotting patterns in it, such as those typical of an emotional state or a disease. Many studies in our lab, for example on epilepsy, dementia and liking, build on exactly this idea.
In the next post, we’ll look at LSTMs, which process data that arrives in sequence by “remembering” what came before.
References
- LeCun, Y., Bottou, L., Bengio, Y., Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11), 2278–2324. DOI: 10.1109/5.726791
- Epileptic EEG Classification by Using Time-Frequency Images for Deep Learning (2021). International Journal of Neural Systems. DOI: 10.1142/s012906572150026x
- Classification of Dementia EEG Signals by Using Time-Frequency Images for Deep Learning (2023). IEEE ASYU. DOI: 10.1109/asyu58738.2023.10296777
- Liking State Estimation Using Time-Frequency Image Representation of EEG Signals (2025). IEEE SIU. DOI: 10.1109/siu66497.2025.11112167