Apps · Computer vision

Spectrogram Image Classifier

Each vibration recording becomes a 32 × 32 picture of frequency over time. A small convolutional neural network learns to recognise faults from the pictures alone, with no hand-made features.

Runs in your browserTensorFlow.js
Training imagesfrequency ↑ (log scale) · time →
Learning curveper epoch
Network layers32×32 input
Test one new signalWhat did the network look at?

How it works

  1. Signal to image. Two seconds of vibration are cut into 32 overlapping slices. Each slice's spectrum is grouped into 32 frequency bands on a log scale from 15 Hz to 2.5 kHz and converted to decibels relative to the loudest point, so sensor gain does not matter.
  2. Convolution. The first layer slides small 3 × 3 filters over the image. Each filter learns to respond to a pattern: a horizontal line at running speed, a band of high-frequency energy, a stack of harmonics.
  3. Pooling and dense layers. Max pooling keeps the strongest responses, a second convolution combines them, and a dense layer turns them into one probability per condition.
  4. Saliency. The gradient of the predicted class with respect to each pixel shows which parts of the image would change the decision most. Highlighted pixels are where the network "looked".

The comparison model is a Random Forest on 13 hand-made vibration features computed from the same recordings. With a few hundred images the feature model usually wins by several points: its features were designed by people who know the physics of bearings and shafts, while the CNN has to discover those patterns from examples. The CNN needed no feature design at all. Try more images or more epochs and see how the gap changes. The CNN's reasons are also harder to read, which is what the saliency map helps with. Read more in Computer vision for maintenance.