Anomaly Detection on Resource-Constrained Devices with Reservoir Computing
Authors: Marco Angioli, Mathias Persson, Hiroto Tamura, Hadi Banaee, Amy Loutfi, Gouhei Tanaka, Alberto Giaretta, Denis Kleyko
Organizations: the AI, Robotics and Cybersecurity Center (ARC) and the Department of Computer Science, Örebro University, 70281 Örebro, Sweden. · the Graduate School of Informatics, Osaka Metropolitan University, 558-8585 Osaka Japan · the International Research Center for Neurointelligence (IRCN), the University of Tokyo, 113-0033 Tokyo, Japan · the Department of Science and Technology, Linköping University, 58183 Linköping, Sweden · the Graduate School of Engineering, Nagoya Institute of Technology, 466-8555 Nagoya, Japan · the Intelligent Systems Lab, RISE Research Institutes of Sweden, 16440 Kista, Sweden
Anomaly detection at the edge requires the deployment of models that achieve competitive performance, while minimizing computational cost and memory footprint. In this article, we investigate the suitability of the Mahalanobis Distance of Reservoir States (MDRS), an unsupervised time-series anomaly detection method, for resource-constrained devices and propose two optimizations to reduce its computational requirements. Specifically, we replace random reservoir connectivity (MDRS-Rand) with a circular shift (MDRS-Circ) and show that the anomaly score for an entire time series can be computed from the final reservoir state alone. Furthermore, we show that exploiting the reservoir's temporal memory enables more efficient input preprocessing, further reducing computational cost. We evaluate the MDRS variants on the MLPerf Tiny anomaly detection benchmark against the reference autoencoder and other anomaly detection methods, and deploy their inference kernels on a NUCLEO-F401RE microcontroller to assess latency, estimate energy consumption, and measure memory footprint. Among the evaluated methods, only MDRS and the autoencoder meet the benchmark's performance target, with MDRS requiring fewer operations and smaller models. With optimized preprocessing, MDRS achieves an ROC AUC of 0.869, a model size of 24 KB, an estimated energy consumption of 24 uJ per inference, and a latency of 0.32 ms, corresponding to a 75.9x speedup over the autoencoder with standard preprocessing.
Figures & tables
Hyperparameter
Candidate values
N
{32 , 64 , 96 , 128 , 192 , 256}
Δt
{5×10−5 , 1×10−4 , 2×10−4 , 5×10−4 , 1×10−3}
τ
{0.001 , 0.005 , 0.01 , 0.02 , 0.03}
g
{0.05 , 0.1 , 0.5 , 1 , 3}
h
{0.05 , 0.1 , 0.5 , 1 , 3}
α
{0.001 , 0.005 , 0.01 , 0.02 , 0.03}
TABLE I: Hyperparameter grid search values. Reservoir connectivity is evaluated for both MDRS-Rand and MDRS-Circ .
Reservoir , N
MDRS-Rand
MDRS-Circ
32
0.843 ± 0.021
0.836 ± 0.021
64
0.878 ± 0.012
0.873 ± 0.012
96
0.882 ± 0.009
0.882 ± 0.010
128
0.894 ± 0.004
0.896 ± 0.005
192
0.890 ± 0.004
0.890 ± 0.004
256
0.883 ± 0.004
0.884 ± 0.005
TABLE II: Average AUC ( ± std. deviation over 50 random initializations) on the test set as a function of reservoir size, N , with the per-step aggregation and the MLPerf Tiny preprocessing.
Fig. 1: Test AUC of MDRS ( N=64 , MLPerf Tiny preprocessing) versus the stride of the per-step aggregation (solid lines) and with the end-only score (dashed lines), which coincides with stride 195. Mean over 50 reservoir initializations; bars and bands: 95% confidence interval of the mean.
Reservoir , N
32
64
96
128
192
256
MDRS-Rand , per-step
9.14
19.86
32.19
46.11
78.74
117.77
MDRS-Rand , end-only
8.68 ( ↓ 5.0%)
18.17 ( ↓ 8.5%)
28.46 ( ↓ 11.6%)
39.55 ( ↓ 14.2%)
64.14 ( ↓ 18.6%)
91.94 ( ↓ 21.9%)
MDRS-Circ , per-step
8.65 ( ↓ 5.3%)
18.09 ( ↓ 8.9%)
28.33 ( ↓ 12.0%)
39.37 ( ↓ 14.6%)
63.84 ( ↓ 18.9%)
91.51 ( ↓ 22.3%)
MDRS-Circ , end-only
8.20 ( ↓ 10.3%)
16.40 ( ↓ 17.5%)
24.60 ( ↓ 23.6%)
32.81 ( ↓ 28.8%)
49.23 ( ↓ 37.5%)
65.68 ( ↓ 44.2%)
TABLE III: Number of FLOPs (in millions) per recording during inference by the four MDRS variants as a function of reservoir size, N , measured with hardware performance counters. In parentheses: reduction with respect to MDRS-Rand with per-step aggregation.
Fig. 2: Anomaly detection performance versus computational cost (left) and model size (right) during inference. MDRS ( N=64 , averaged over 50 reservoir initializations) and the autoencoder are shown for six preprocessing configurations: nmels∈{32,64,128} (marker shape), with five stacked frames (filled) or a single frame (hollow) per input sample. The baseline models use the MLPerf Tiny preprocessing.
Model
Training (MB)
Inference (KB)
MDRS-Rand , 128×5
62
720
MDRS-Circ , 128×5
61
708
MDRS-Rand , 32×1
61
556
MDRS-Circ , 32×1
60
372
AutoEncoder-FP32
315
1,168
AutoEncoder-INT8
315
524
TABLE IV: Peak RAM during training (MB) and during inference (KB) for the models that achieve the target performance.
Cycles
Latency
Energy
Flash
Model variant
(k)
(ms)
(µJ)
(KB)
AUC
MDRS-Rand , per-step
92.7
1.10
82
40
0.843
MDRS-Rand , end-only
59.2 ( ↓ 36%)
0.70
53
40
0.868
MDRS-Circ , per-step
60.6 ( ↓ 35%)
0.72
54
24
0.843
MDRS-Circ , end-only
27.1 ( ↓ 71%)
0.32
24
24
0.869
TABLE V: MDRS on the NUCLEO-F401RE ( N=64 , 32×1 input). Latency: median of 21 runs; parentheses: cycle reduction vs. per-step MDRS-Rand ; AUC: mean of 50 initializations (std 0.001).
Model
Cyc. (k)
Latency
Energy
AUC
Flash
AutoEncoder-INT8 , 128×5
2 058.7
24.51 ms
1 828 µJ
0.860
270 KB
MDRS-Circ , 128×5
297.9
3.55 ms
264 µJ
0.897
176 KB
MDRS-Circ , 32×1
27.1
0.32 ms
24 µJ
0.869
24 KB
Ratio ( AE ÷ MDRS), 128×5
6.9×
6.9×
6.9×
—
1.5×
Ratio ( AE ÷ MDRS), 32×1
75.9×
75.9×
75.9×
—
11.3×
TABLE VI: Autoencoder and end-only MDRS-Circ on the NUCLEO-F401RE.
Time-Series Anomaly Detection identifies unusual patterns or events in sequential data, from sensor readings and network traffic to health and industrial telemetry.
Time-series anomaly detection is increasingly important in IoT systems, sensor networks, and edge monitoring applications, where models must operate under strict constraints on memory, latency, and power consumption. While recent deep-learning approaches have improved detection accuracy, many remain computationally expensive and often fail to capture subtle anomalies due to limited multi-scale sensitivity. Autoencoders are widely used for anomaly detection because they reconstruct normal patterns well, leading to elevated reconstruction errors for anomalous inputs. Their simplicity and efficiency also make them suitable lightweight backbones for handling multi-scale inputs. To address these challenges, we propose a Lightweight MultiScale AutoEncoder (LMSAE) network for univariate time-series anomaly detection, designed to be compact and computationally efficient. LMSAE leverages the Discrete Wavelet Transform (DWT) to extract multi-scale features and employs a multi-scale loss function to improve sensitivity to subtle or hidden anomalies. Experiments on benchmark datasets demonstrate competitive or superior detection performance despite using significantly fewer parameters and a model size of less than 500 KB. LMSAE also achieves low-latency, low-power inference on the NVIDIA Jetson Nano, with 9x reduction in inference latency and 2x reduction in power consumption, making it ideal for edge deployment.
Raheen Junaid Wani, Smruti R. Sarangi
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
This paper presents a fully autonomous Tiny Machine Learning (TinyML) Z-Score-based anomaly detection system deployed on a low-power microcontroller for real-time monitoring of appliance behavior using power side-channel data. Unlike existing Internet of Things (IoT) anomaly detection approaches that rely on offline training or cloud-assisted analytics, the proposed system performs both model training and inference directly on a resource-constrained microcontroller without external computation or connectivity. The system continuously samples current consumption, computes Root Mean Square (RMS) values on-device, and derives statistical parameters during an initial training phase. Anomalies are detected using lightweight Z-Score thresholds, enabling interpretable and computationally efficient inference suitable for embedded deployment. The architecture was implemented on an STM32-based platform and evaluated using a 14-day dataset collected from a household mini-fridge under normal operation and controlled anomaly conditions. Results demonstrate perfect detection performance, with Precision and Recall of 1.00, inference latencies on the order of tens of microseconds, and a total memory footprint of approximately 3.3 KB SRAM and 63 KB Flash. These results confirm that robust and fully autonomous TinyML anomaly detection can be achieved on low-cost microcontrollers. Future work includes extending the framework to incorporate additional lightweight models and multi-device learning scenarios.
Abdulrahman Albaiz, Fathi Amsaad
Department of Computer Science & Engineering, Wright State University, Dayton, Ohio, USA
Spacecraft anomaly detection is critical for mission safety, yet deploying sophisticated models on-board presents significant challenges due to hardware constraints. This paper investigates three approaches for spacecraft telemetry anomaly detection -- forecasting & threshold, direct classification, and image classification -- and optimizes them for edge deployment using multi-objective neural architecture optimization on the European Space Agency Anomaly Dataset. Our baseline experiments demonstrate that forecasting & threshold achieves superior detection performance (92.7% Corrected Event-wise F0.5-score (CEF0.5)) [1] compared to alternatives. Through Pareto-optimal architecture optimization, we dramatically reduced computational requirements while maintaining capabilities -- the optimized forecasting & threshold model preserved 88.8% CEF0.5 while reducing RAM usage by 97.1% to just 59 KB and operations by 99.4%. Analysis of deployment viability shows our optimized models require just 0.36-6.25% of CubeSat RAM, making on-board anomaly detection practical even on highly constrained hardware. This research demonstrates that sophisticated anomaly detection capabilities can be successfully deployed within spacecraft edge computing constraints, providing near-instantaneous detection without exceeding hardware limitations or compromising mission safety.
Christopher Goetze, Tim Schlippe, Daniel Lakey
IU International University of Applied Sciences, Germany