Spectrogram-Based CNN Autoencoder for One-Class Anomaly Detection in Machining Vibration Signals
Organizations: Forst Technologie GmbH & Co. KG, 42659 Solingen, Germany. · FB Informatik & Naturwissenschaften, Fachhochschule Südwestfalen, 58636 Iserlohn, Germany.
Abstract
This work presents a one-class anomaly detection framework for vibration-based condition monitoring in machining processes using a convolutional neural network autoencoder. Three-axis vibration signals acquired during industrial broaching are transformed into time--frequency spectrograms and combined into a compact three-channel representation, enabling convolutional feature learning on multivariate time-series data. The autoencoder is trained exclusively on normal process data and detects anomalous strokes based on reconstruction errors. Labeled validation data are used for threshold calibration and an independent test set is reserved for final performance evaluation. To improve sensitivity to short-lived process instabilities such as chatter, a localized residual-based metric termed Segmented Vertical Error (SVE) is introduced. Experimental results on approximately 10{,}000 broaching strokes show a clear separation between normal and anomalous process conditions under strong class imbalance. The processing pipeline is additionally evaluated on an external public turning dataset as a proof of concept, indicating preliminary applicability beyond the original broaching setup. The results suggest that spectrogram-based autoencoder models can provide a practical and scalable basis for one-class anomaly detection in industrial vibration monitoring.
Figures & tables
| Parameter | Value |
|---|---|
| Sampling rate | |
| Window length | samples |
| Window function | Hann |
| Overlap | |
| Frequency range | |
| Output resolution | pixels |
| Stage | Layer Configuration | Output Size |
|---|---|---|
| Input | RGB spectrogram image | |
| Encoder | Conv (4) Pool ( ) | |
| Conv (8) Pool ( ) | ||
| Conv (12) | ||
| Bottleneck | Dense | |
| Decoder | Dense Reshape |
| Method | PR-AUC | F1-Score | Precision | Recall |
|---|---|---|---|---|
| Global MSE | 0.593 | 0.667 | 1.000 | 0.500 |
| Global MAE | 0.465 | 0.516 | 0.889 | 0.364 |
| SVE (5 Segments) | 0.945 | 0.909 | 0.909 | 0.909 |
| SVE (7 Segments) | 0.979 | 0.850 | 0.944 | 0.773 |
| Method | PR-AUC | F1-Score | Precision | Recall |
|---|---|---|---|---|
| Isolation Forest | 0.641 | 0.531 | 0.481 | 0.591 |
| One-Class SVM | 0.838 | 0.700 | 0.778 | 0.636 |
| PCA Reconstruction | 0.982 | 0.842 | 1.000 | 0.727 |
| Global MSE | 0.593 | 0.667 | 1.000 | 0.500 |
| Global MAE | 0.465 | 0.516 | 0.889 | 0.364 |
| SVE (5 Segments) | 0.945 | 0.909 | 0.909 | 0.909 |
| Parameter | Value |
|---|---|
| Sampling rate | |
| Input window | |
| Window function | Tukey ( ) |
| Segment length | samples |
| FFT length | samples |
| Overlap/hop length | samples ( overlap) |
| Method | PR-AUC | F1 | Precision | Recall | ||||
|---|---|---|---|---|---|---|---|---|
| Mean | SD | Mean | SD | Mean | SD | Mean | SD | |
| CNN-AE Global MAE | 0.819 | 0.230 | 0.634 | 0.267 | 0.699 | 0.140 | 0.657 | 0.387 |
| CNN-AE Global MSE | 0.788 | 0.221 | 0.603 | 0.269 | 0.633 | 0.202 | 0.657 | 0.387 |
| CNN-AE SVE Max | 0.775 | 0.215 | 0.633 | 0.224 | 0.705 | 0.222 | 0.731 | 0.354 |
| CNN-AE SVE Top-k | 0.788 | 0.219 | 0.581 | 0.263 | 0.592 | 0.223 | 0.657 | 0.387 |
| Isolation Forest | 0.882 | 0.138 | 0.747 | 0.193 | 0.879 | 0.132 | 0.716 | 0.279 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Stage | Layer | Kernel/Size | Stride | Padding | Activation | Output Shape | Parameters |
| Input | Input | – | – | – | – | 0 | |
| Encoder | Conv2D (4) | same | ReLU | 112 | |||
| MaxPooling2D | same | – | 0 | ||||
| Conv2D (8) | same | ReLU | 296 | ||||
| MaxPooling2D | same | – | 0 | ||||
| Conv2D (12) | same | ReLU | 876 |
| Item | Setting |
|---|---|
| Training objective | Self-reconstruction of nominal samples using MSE loss |
| Input preprocessing | RGB images resized to pixels (width height), represented internally as , and scaled to |
| Data split | nominal training and nominal validation; shuffled with random_state=42 |
| Batch size | |
| Optimizer | Adam with learning rate , , , and ; no weight decay; AMSGrad disabled |
| Epochs (fixed split) | Maximum of epochs; the reference model was trained for all epochs without early stopping |
| Method | Precision | Recall | F1-Score | PR-AUC |
|---|---|---|---|---|
| One-class SVM | 0.728 0.099 | 0.822 0.127 | 0.770 0.098 | 0.881 0.073 |
| Isolation Forest | 0.713 0.205 | 0.556 0.176 | 0.586 0.089 | 0.730 0.097 |
| PCA Reconstruction | 0.900 0.141 | 0.822 0.099 | 0.852 0.089 | 0.915 0.086 |
| Method | Precision | Recall | F1-Score | PR-AUC |
|---|---|---|---|---|
| AE-SVE-7 | 0.845 0.100 | 0.876 0.145 | 0.849 0.101 | 0.926 0.046 |
| AE-SVE-5 | 0.845 0.100 | 0.889 0.101 | 0.861 0.071 | 0.907 0.072 |
| Global MSE | 1.000 0.000 | 0.507 0.154 | 0.659 0.144 | 0.643 0.131 |
| Global MAE | 0.880 0.146 | 0.462 0.166 | 0.589 0.161 | 0.539 0.140 |
| Platform | Prepro. [ms] | Infer. [ms] | Score [ms ] | Total [ms] | TP [Samples/s] |
|---|---|---|---|---|---|
| Workstation | 128.7 | 4.9 | 0.4 | 134.0 | 7.5 |
| Nanobox | 156.2 | 4.5 | 0.5 | 161.2 | 6.2 |
| Rasp. Pi 4 | 704.1 | 44.4 | 1.7 | 750.2 | 1.3 |
| RevPi Connect+ | 1472.5 | 49.6 | 4.7 | 1526.8 | 0.65 |
| Method | Score | Precision | Recall | F1 | PR-AUC |
|---|---|---|---|---|---|
| CNN-AE (BN = 8) | global_mae | 0.835 0.105 | 0.849 0.099 | 0.837 0.076 | 0.848 0.123 |
| CNN-AE (BN = 8) | global_mse | 0.613 0.332 | 0.703 0.361 | 0.645 0.332 | 0.849 0.119 |
| CNN-AE (BN = 8) | sve_max | 0.785 0.152 | 0.641 0.369 | 0.600 0.261 | 0.800 0.126 |
| CNN-AE (BN = 8) | sve_topk | 0.766 0.166 | 0.661 0.342 | 0.619 0.213 | 0.825 0.140 |
| CNN-AE (BN = 16) | global_mae | 0.638 0.329 | 0.545 0.372 | 0.534 0.314 | 0.855 0.127 |
| CNN-AE (BN = 16) | global_mse | 0.597 0.323 | 0.539 0.350 | 0.520 0.288 | 0.824 0.127 |
| Outer Fold | CNN-AE (Global MAE) | Isolation Forest | One-Class SVM | PCA |
|---|---|---|---|---|
| 1 | 1.0000 | 0.9914 | 0.9838 | 0.9098 |
| 2 | 0.5170 | 0.6894 | 0.6962 | 0.6187 |
| 3 | 0.8672 | 0.9421 | 0.6406 | 0.5198 |
| 4 | 0.9758 | 1.0000 | 0.8788 | 0.9473 |
| 5 | 0.7053 | 0.7870 | 0.5691 | 0.6223 |
Anomaly Detection
Anomaly detection finds rare or unexpected patterns in data, from defective products and system faults to fraud and security threats.
See all 706 papers