Learning Blocks
Anomaly Detection (Audio)
Learn what normal sound looks like and flag sounds that don't fit.
Try it in StudioOn this page
What is this learning block?
Anomaly Detection is an autoencoder: a network that squeezes the features of a window into a few numbers and then tries to rebuild the original features from them. It learns to rebuild normal sounds well. When it hears something unusual, the rebuilt features are poor, and that tells you something is different.
What does it do?
For each window it gives an anomaly score: the reconstruction error, measured as the average squared difference (MSE) between the real features and the rebuilt ones. A score above the Anomaly threshold means "unusual".
How does it learn?
- You train it with recordings of normal sound only, for example a fan running correctly.
- For each window it compresses the features, rebuilds them and measures the error.
- It adjusts its weights to make the error smaller (Adam optimizer, MSE loss).
- After training, normal sounds give low scores. New, different sounds give higher scores.
What model architecture does it use?
- 1InputFeature grid of one window
- 2Encoder1-D convolutions (32, then 16 filters)
- 3BottleneckDense layers down to 32 numbers
- 4DecoderDense layers back to the full size
- 5OutputRebuilt features → anomaly score
What settings can I configure?
| Setting | Default | What it does |
|---|---|---|
| Number of training cycles | 50 | Passes over the normal training data. |
| Learning rate | 0.001 | Size of each weight adjustment. |
| Anomaly threshold | 0.15 | Scores above this are flagged as anomalies. Set it with the slider in the Anomaly explorer after training. |
Select Start Training to begin. This block always trains on the CPU.
What problems can it solve?
- A machine, pump or fan that starts to sound different.
- Unusual noise in a room that is normally quiet.
- Any case where you have plenty of normal recordings but few or no examples of faults.
Simple example
Record 5 minutes of a desk fan running normally, in 1-second clips, under one label such as normal. Train Anomaly Detection. In the Anomaly explorer, all points sit at low scores; move the Anomaly threshold slider just above the highest normal points to see where "unusual" would start. Then open Live classification, set its Anomaly Gate slider to a similar level, and tap the fan or block its air flow: the score jumps and Studio shows Acoustic Anomaly Flagged.
How do I understand the training results?
- Mean Recon. Loss and Max Recon. Loss: the average and highest anomaly score on the validation clips. For normal sounds these should be low and close together.
- Anomaly explorer: each point is one validation sample, placed on a 2-D map. Points above the Anomaly threshold are flagged. Hover a point to see its score.
- Set the threshold just above most normal points. Too low flags normal sounds; too high misses real anomalies.