Journal of King Saud University – Engineering Sciences

TinyML-based daily biogas nowcasting on ESP32: an ultra-compact edge inference framework for anaerobic digestion

Amine Chiguer, Mohammed Sadik, Abderrahim Fail

Computational

Key points

From the paper's conclusion
  • These findings support a reproducible embedded pipeline and a rigorous benchmark, rather than claims of superior accuracy or field-system validation.

Abstract

This study presents a compact machine-learning model for same-day biogas nowcasting in anaerobic digestion on edge-computing hardware. Implemented with Tiny Machine Learning (TinyML) and executed on an ESP32 low-cost microcontroller, the model was trained on a public dataset of 287 daily observations from a mesophilic reactor at 37 °C, using five biochemical variables, their one-day lags, and previous-day biogas production. To avoid optimistic bias, models were evaluated retrospectively with rolling-origin validation over five temporal windows, and the embedded demonstration architecture was fixed a priori rather than selected on the test data. Additional compact architectures showed discordant internal-validation and future-test rankings. A previous-day persistence baseline achieved a mean R² of 0.572 and linear autoregression 0.573, whereas the predefined 16–8 network achieved a mean R² of 0.343, showing that biogas dynamics in this stable reactor were dominated by process inertia and that biochemical variables did not improve prediction beyond the simple temporal baselines. On-device inference verification reproduced the Python reference across all 58 test vectors to within 1.67 × 10⁻⁵ NL/d at a mean latency of 48.899 µs at 240 MHz; persistence and autoregression ran in under 0.2 µs. A reduced-feature farm-scale evaluation with supervised recalibration, after meter-consistency quality control, showed a weak positive correlation but no positive skill on the later test segment (r = + 0.365, R² = −0.237, MAE = 0.30 L/d). These findings support a reproducible embedded pipeline and a rigorous benchmark, rather than claims of superior accuracy or field-system validation.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers

TinyML-based daily biogas nowcasting on ESP32: an ultra-compact edge inference framework for anaerobic digestion — Science Skim