Anomaly Detection Based on Reconstruction Error in High-Frequency Hydroponic Sensor Data
Abstract
In vertical farming and hydroponics, rapid changes in temperature, humidity, light, pH, and electrical conductivity raise the question of how to separate production-relevant deviations from normal operation. While previous studies have enhanced monitoring with IoT and machine learning, many approaches still rely on static thresholds and provide limited support for multivariate, high-frequency, and interpretable field monitoring. This study proposes an end-to-end framework that combines ESP32-based IoT monitoring with unsupervised anomaly detection for hydroponic vertical farming. The analyzed dataset contains seven consecutive days of synchronized 5-second measurements, corresponding to 120,960 raw records and 120,930 windowed sequences after 30-step sliding-window construction. The LSTM-Autoencoder learns normal multivariate temporal patterns and assigns each window a unified reconstruction-error score using mean squared error (MSE). Anomalies are flagged with a validation-derived statistical threshold (μ +2σ), resulting in a threshold of 0.0862 MSE and 3,454 detected anomalous windows (2.86%). To address interpretability, feature-wise reconstruction errors, event-level anomaly grouping, correlation comparison, and PCA of the LSTM latent representation are reported. The detected anomalies are short-lived and episodic rather than a sustained regime shift; 556 event-level groups were obtained, with a median duration of 25 s. Sensor contributions are broadly balanced, with humidity (20.22%), pH (20.18%), light (20.11%), EC (19.95%), and temperature (19.54%) showing no single dominant source. Additional threshold-sensitivity and controlled anomaly-injection baseline analyses clarify the robustness and limitations of the proposed pipeline. Overall, the framework is positioned as an explainable screening layer for anomaly prioritization rather than a fully validated root-cause decision system.
Keywords
Ethical Statement
References
- O. B. Akintuyi, “Vertical farming in urban environments: A review of architectural integration and food security,” Open Access Res. J. Biol. Pharm., vol. 10, no. 2, pp. 114–126, 2024.
- M. S. Mir et al., “Vertical farming: The future of agriculture: A review,” Pharma Innov. J., vol. 11, no. 2S, pp. 1175–1195, 2022.
- S. Oh and C. Lu, “Vertical farming—Smart urban agriculture for enhancing resilience and sustainability in food security,” J. Hortic. Sci. Biotechnol., vol. 98, no. 2, pp. 133–140, 2023.
- P. Mahesh and R. Soundrapandiyan, “Yield prediction for crops by gradient-based algorithms,” PLOS ONE, vol. 19, no. 8, Art. no. e0291928, 2024.
- F. Vizcaíno, F. Cañizares, and E. Jalón, “Internet of Things based predictive crop yield analysis: A distributed approach,” Fusion: Pract. Appl., pp. 106–113, 2023.
- M. Hasan et al., “Ensemble machine learning-based recommendation system for effective prediction of suitable agricultural crop cultivation,” Front. Plant Sci., vol. 14, Art. no. 1234555, 2023.
- C. Catalano et al., “Anomaly detection in smart agriculture systems,” Comput. Ind., vol. 143, Art. no. 103750, 2022.
- A. R. de Araujo Zanella, E. da Silva, and L. C. P. Albini, “CEIFA: A multi-level anomaly detector for smart farming,” Comput. Electron. Agric., vol. 202, Art. no. 107279, 2022.
Details
Primary Language
English
Subjects
Artificial Intelligence (Other), Environmentally Sustainable Engineering, Photogrammetry and Remote Sensing
Journal Section
Research Article
Publication Date
September 30, 2026
Submission Date
January 7, 2026
Acceptance Date
June 2, 2026
Published in Issue
Year 2026 Volume: 9 Number: 4