Explainable Physics-Informed LSTM with Attention for Dissolved Oxygen Prediction in Aquaponics Systems

PDF (1402KB), PP.24-41

Views: 0 Downloads: 0

Author(s)

Amr H. Abdelhaliem 1,* Mohammed Tawfik 2 Islam S. Fathi 3

1. Department of Cyber Security, Faculty of Science and Information Technology, Irbid National University, Irbid, Jordan

2. Department of Cyber Security, Faculty of Information Technology, Ajloun National University, Ajloun, 26810, Jordan

3. Department of Computer Science, Faculty of Information Technology, Ajloun National University, P.O. Box 43, 26810, Ajloun, Jordan; Department of Information Systems, Al Alson Higher Institute, Cairo, Egypt

* Corresponding author.

DOI: https://doi.org/10.5815/ijem.2026.06.02

Received: 3 Apr. 2026 / Revised: 26 Jun. 2026 / Accepted: 22 Jul. 2026 / Published: 8 Dec. 2026

Index Terms

Physics-informed neural network, Dissolved oxygen, Aquaponics, LSTM, Explainable AI, Integrated Gradients, Attention mechanism, Conformal prediction, Two-film model

Abstract

Accurate real-time prediction of dissolved oxygen (DO) concentration is critical for maintaining aquatic health in aquaponics systems. However, purely data-driven deep learning models often fail to capture the underlying physicochemical dynamics governing oxygen transfer and consumption, leading to physically inconsistent predictions and poor generalisation under distribution shift. This paper presents a novel Physics-Informed Neural Network (PINN) framework that integrates a two-film oxygen transfer model — including Arrhenius-corrected gas transfer kinetics and Benson–Krause saturation — as a differentiable physics loss within a stacked LSTM architecture augmented with multi-head self-attention and Integrated Gradients (IG) based post-hoc explainability. The proposed model jointly learns neural network weights and physically interpretable parameters (k_La, r_base) through a curriculum-based training strategy with a warmup–ramp–plateau physics weight schedule. We further incorporate Integrated Gradients for post-hoc explainability (XAI), providing transparent attribution maps over temporal input features. The framework is evaluated on a chronologically ordered aquaponics sensor dataset comprising approximately 10,000 hourly observations of water temperature and dissolved oxygen concentration. A comprehensive benchmark against five baseline architectures (Standard LSTM, BiLSTM, CNN-LSTM, TCN, Attention-LSTM) across five random seeds demonstrates that the proposed PINN-LSTM achieves an R² of 0.9890 ± 0.0008, MAE of 0.0932 ± 0.0038 mg/L, and NSE of 0.9885 ± 0.0009 — representing a 67.1% MAE reduction over the Standard LSTM baseline. Statistical significance is confirmed via Diebold–Mariano (p < 0.001) and Wilcoxon signed-rank tests (p < 0.05). Ablation analysis validates the contribution of each component: physics regularisation, attention mechanism, warmup scheduling, and Arrhenius temperature correction. Conformal prediction intervals achieve 91.4% empirical coverage at a 90% target with narrow prediction bands of 0.702 mg/L. The learned physics parameters (k_La = 0.342 ± 0.021 h⁻¹, r_base = 0.127 ± 0.018 mg/L/h) fall within established literature ranges, confirming physical plausibility.

Cite This Paper

Amr H. Abdelhaliem, Mohammed Tawfik, Islam S. Fathi, "Explainable Physics-Informed LSTM with Attention for Dissolved Oxygen Prediction in Aquaponics Systems", International Journal of Engineering and Manufacturing (IJEM), Vol.16, No.6, pp.24-41, 2026. DOI:10.5815/ijem.2026.06.02

Reference

[1]S. Goddek, A. Joyce, B. Kotzen, and G. M. Burnell, Eds., Aquaponics Food Production Systems. Cham, Switzerland: Springer, 2019, DOI: 10.1007/978-3-030-15943-6.
[2]B. Yep and Y. Zheng, "Aquaponic trends and challenges — A review," J. Cleaner Prod., vol. 228, pp. 1586–1599, 2019, DOI: 10.1016/j.jclepro.2019.04.290.
[3]Q. Ren, L. Zhang, Y. Wei, and D. Li, "A method for predicting dissolved oxygen in aquaculture water in an aquaponics system," Comput. Electron. Agric., vol. 151, pp. 384–391, 2018, DOI: 10.1016/j.compag.2018.06.013.
[4]W. K. Lewis and W. G. Whitman, "Principles of gas absorption," Ind. Eng. Chem., vol. 16, no. 12, pp. 1215–1220, 1924, DOI: 10.1021/ie50180a002.
[5]P. Shi, L. Kuang, L. Yuan, Q. Wang, G. Li, Y. Yuan, Y. Zhang, and G. Huang, "Dissolved oxygen prediction using regularized extreme learning machine with clustering mechanism in a black bass aquaculture pond," Aquacultural Engineering, vol. 105, art. 102408, 2024, DOI: 10.1016/j.aquaeng.2024.102408.
[6]A. A. M. Ahmed, S. J. J. Jui, M. A. I. Chowdhury, O. Ahmed, and A. Sutradhar, "The development of dissolved oxygen forecast model using hybrid machine learning algorithm with hydro-meteorological variables," Environmental Science and Pollution Research, vol. 30, no. 3, pp. 7851–7873, 2023, DOI: 10.1007/s11356-022-22601-z.
[7]S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural Comput., vol. 9, no. 8, pp. 1735–1780, 1997, DOI: 10.1162/neco.1997.9.8.1735.
[8]Y. Liu, Q. Zhang, L. Song, and Y. Chen, "Attention-based recurrent neural networks for accurate short-term and long-term dissolved oxygen prediction," Computers and Electronics in Agriculture, vol. 165, art. 104964, 2019, DOI: 10.1016/j.compag.2019.104964.
[9]W. Li, Y. Wei, D. An, Y. Jiao, and Q. Wei, "LSTM-TCN: Dissolved oxygen prediction in aquaculture, based on combined model of long short-term memory network and temporal convolutional network," Environmental Science and Pollution Research, vol. 29, no. 26, pp. 39545–39556, 2022, DOI: 10.1007/s11356-022-18914-8.
[10]Q. Ren, X. Wang, W. Li, Y. Wei, and D. An, "Research of dissolved oxygen prediction in recirculating aquaculture systems based on deep belief network," Aquacult. Eng., vol. 90, p. 102085, 2020, DOI: 10.1016/j.aquaeng.2020.102085.
[11]W. Yang, W. Liu, and Q. Gao, "Prediction of dissolved oxygen concentration in aquaculture based on attention mechanism and combined neural network," Mathematical Biosciences and Engineering, vol. 20, no. 1, pp. 998–1017, 2023, DOI: 10.3934/mbe.2023046.
[12]P. A. Costa Rocha, V. Oliveira Santos, J. Van Griensven Thé, and B. Gharabaghi, "New graph-based and transformer deep learning models for river dissolved oxygen forecasting," Environments, vol. 10, no. 12, art. 217, 2023, DOI: 10.3390/environments10120217.
[13]Y. Wang et al., "A dissolved oxygen prediction model based on GRU-N-Beats," Front. Mar. Sci., vol. 11, p. 1365047, 2024, DOI: 10.3389/fmars.2024.1365047.
[14]M. Raissi, P. Perdikaris, and G. E. Karniadakis, "Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations," J. Comput. Phys., vol. 378, pp. 686–707, 2019, DOI: 10.1016/j.jcp.2018.10.045.
[15]G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, and L. Yang, "Physics-informed machine learning," Nature Reviews Physics, vol. 3, no. 6, pp. 422–440, 2021, DOI: 10.1038/s42254-021-00314-5.
[16]S. Rashid, H. Abbas, I. Ali, A. Khalid, F. T. Agama, and M. S. Aldien, "Evaluating physics informed neural networks for water contamination risk prediction and environmental sustainability," Scientific Reports, vol. 16, art. 603, 2025, DOI: 10.1038/s41598-025-30196-x.
[17]M. Frankel, M. De Florio, E. Schiassi, L. E. Katz, K. Kinney, C. J. Werth, C. Zigler, and L. Sela, "Enhancing drinking water quality modeling: Leveraging physics informed neural networks for learning with imperfect reaction models and partial data," Environmental Science: Water Research & Technology, vol. 11, no. 11, pp. 2684–2697, 2025, DOI: 10.1039/D5EW00682A.
[18]T. Asrav and E. Aydin, "Physics-informed neural network based modeling of an industrial wastewater treatment unit," in Comput.-Aided Chem. Eng., vol. 52, Elsevier, 2023, pp. 2275–2280.
[19]S. M. Lundberg and S.-I. Lee, "A unified approach to interpreting model predictions," in Advances in Neural Information Processing Systems (NeurIPS), 2017, pp. 4765–4774, DOI: 10.48550/arXiv.1705.07874.
[20]M. T. Ribeiro, S. Singh, and C. Guestrin, "Why should I trust you? Explaining the predictions of any classifier," in Proc. 22nd ACM SIGKDD Int. Conf. Knowl. Discov. Data Min., 2016, pp. 1135–1144, DOI: 10.1145/2939672.2939778.
[21]M. Sundararajan, A. Taly, and Q. Yan, "Axiomatic attribution for deep networks," in Proc. 34th Int. Conf. Mach. Learn. (ICML), 2017, pp. 3319–3328, DOI: 10.48550/arXiv.1703.01365.
[22]W. Zhi, A. P. Appling, H. E. Golden, J. Podgorski, and L. Li, "Deep learning for water quality," Nature Water, vol. 2, no. 3, pp. 228–241, 2024, DOI: 10.1038/s44221-024-00202-z.
[23]K. Merabet, F. Di Nunno, F. Granata, S. Kim, R. M. Adnan, S. Heddam, O. Kisi, and M. Zounemat-Kermani, "Predicting water quality variables using gradient boosting machine: Global versus local explainability using SHapley Additive Explanations (SHAP)," Earth Science Informatics, vol. 18, no. 3, art. 298, 2025, DOI: 10.1007/s12145-025-01796-y.
[24]S. Li, S. N. Qasem, S. S. Band, R. Ameri, H.-T. Pai, and S. Mehdizadeh, "Explainable machine learning models for estimating daily dissolved oxygen concentration of the Tualatin River," Eng. Appl. Comput. Fluid Mech., vol. 18, no. 1, art. 2304094, 2024, DOI: 10.1080/19942060.2024.2304094.
[25]A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, "Attention is all you need," in Advances in Neural Information Processing Systems (NeurIPS), 2017, pp. 5998–6008, DOI: 10.48550/arXiv.1706.03762.
[26]J. D. Willard, X. Jia, S. Xu, M. Steinbach, and V. Kumar, "Integrating scientific knowledge with machine learning for engineering and environmental systems," ACM Comput. Surv., vol. 55, no. 4, pp. 1–37, 2022, DOI: 10.1145/3514228.
[27]F. X. Diebold and R. S. Mariano, "Comparing predictive accuracy," J. Bus. Econ. Statist., vol. 13, no. 3, pp. 253–263, 1995, DOI: 10.1080/07350015.1995.10524599.
[28]V. Vovk, A. Gammerman, and G. Shafer, Algorithmic Learning in a Random World. New York, NY, USA: Springer, 2005, DOI: 10.1007/b106715.
[29]A. N. Angelopoulos and S. Bates, "Conformal prediction: A gentle introduction," Found. Trends Mach. Learn., vol. 16, no. 4, pp. 494–591, 2023, DOI: 10.1561/2200000101.
[30]X. Ta and Y. Wei, "Research on a dissolved oxygen prediction method for recirculating aquaculture systems based on a convolution neural network," Comput. Electron. Agric., vol. 145, pp. 302–310, 2018, DOI: 10.1016/j.compag.2017.12.037.
[31]T. Mu, F. Duan, B. Ning, B. Zhou, J. Liu, and M. Huang, "ST-GPINN: A spatio-temporal graph physics-informed neural network for enhanced water quality prediction in water distribution systems," npj Clean Water, vol. 8, no. 1, art. 74, 2025, DOI: 10.1038/s41545-025-00499-7.
[32]B. B. Benson and D. Krause, "The concentration and isotopic fractionation of oxygen dissolved in freshwater and seawater in equilibrium with the atmosphere," Limnol. Oceanogr., vol. 29, no. 3, pp. 620–632, 1984, DOI: 10.4319/lo.1984.29.3.0620.
[33]R. Choudhary, A. Kumar, P. C., M. M. Naik, M. Choudhury, and N. A. Khan, "Predicting water quality index using stacked ensemble regression and SHAP based explainable artificial intelligence," Scientific Reports, vol. 15, no. 1, art. 31139, 2025, DOI: 10.1038/s41598-025-09463-4.
[34]J. E. Nash and J. V. Sutcliffe, "River flow forecasting through conceptual models part I — A discussion of principles," J. Hydrol., vol. 10, no. 3, pp. 282–290, 1970, DOI: 10.1016/0022-1694(70)90255-6.
[35]I. Gibbs and E. Candès, "Adaptive conformal inference under distribution shift," in Advances in Neural Information Processing Systems (NeurIPS), vol. 34, 2021, pp. 1660–1672, DOI: 10.48550/arXiv.2106.00170.
[36]M. Zaffran, O. Féron, Y. Goude, J. Josse, and A. Dieuleveut, "Adaptive conformal predictions for time series," in Proc. 39th Int. Conf. Machine Learning (ICML), 2022, pp. 25834–25866, DOI: 10.48550/arXiv.2202.07282.
[37]C. Xu and Y. Xie, "Sequential predictive conformal inference for time series," in Proc. 40th Int. Conf. Machine Learning (ICML), 2023, pp. 38707–38727, DOI: 10.48550/arXiv.2212.03463.