TinyML for Acoustic Anomaly Detection in IoT Sensor Networks
Authors: Amar Almaini, Jakob Folz, Ghadeer Ashour
Organizations: computer science, Deggendorf Institute of Technology, Deggendorf, Germany · Computer Science and Engineering, University of West Bohemia, Pilsen, Czech Republic · The Applied College, King Abdulaziz University, Jeddah, Saudi Arabia
Tiny Machine Learning enables real-time, energy-efficient data processing directly on microcontrollers, making it ideal for Internet of Things sensor networks. This paper presents a compact TinyML pipeline for detecting anomalies in environmental sound within IoT sensor networks. Acoustic monitoring in IoT systems can enhance safety and context awareness, yet cloud-based processing introduces challenges related to latency, power usage, and privacy. Our pipeline addresses these issues by extracting Mel Frequency Cepstral Coefficients from sound signals and training a lightweight neural network classifier optimized for deployment on edge devices. The model was trained and evaluated using the UrbanSound8K dataset, achieving a test accuracy of 91% and balanced F1-scores of 0.91 across both normal and anomalous sound classes. These results demonstrate the feasibility and reliability of embedded acoustic anomaly detection for scalable and responsive IoT deployments.
Figures & tables
Figure 1: TinyML pipeline for MFCC-based sound anomaly detection on IoT sensor nodes.
Parameter
Value
MFCC coefficients
13
Frame length
40 ms
Frame overlap
50%
Sample rate
16 kHz
Input shape
13 × 32
Hidden layers
[128, 64] (ReLU)
Table I: Model training and preprocessing parameters.
Model
Accuracy
F1-Score
ROC AUC
Avg. Precision
Original (float32)
0.95
0.95
0.991
0.992
Quantized (int8)
0.91
0.91
0.970
0.970
Table II: Model Performance Comparison Before and After Quantization
Class
Precision
Recall
F1-Score
Support
Normal (0)
0.88
0.94
0.91
3996
Anomalous (1)
0.94
0.89
0.91
4283
Accuracy
–
–
0.91
8279
Table III: Class-wise Evaluation Metrics for the Quantized Model
Figure 2: Confusion matrix showing predicted vs. actual labels for the binary classification of urban sounds.
Figure 3: ROC curve showing the model’s ability to separate normal and anomalous audio events.
Figure 4: Precision-Recall curve highlighting the trade-off between detection sensitivity and alert specificity.
Figure 5: Training and validation accuracy across 35 epochs. Early stopping triggered after performance plateaued.
Figure 6: Training and validation loss across 35 epochs. The model exhibits stable learning and generalization.
School of Information Technology Indian Institute of Technology, Delhi New Delhi, India 110016 · Department of Computer Science Indian Institute of Technology, Delhi New Delhi, India 110016