Design and Implementation of an Artificial Neural Network Model for Soil Nitrogen Prediction
Abstract
The availability of nitrogen in soil is a crucial factor determining crop productivity. However, the measurement of total nitrogen (N-total) content requires considerable time and cost. Therefore, a fast, accurate, and easy prediction method is needed to support the agricultural development. This study aims to develop an Artificial Neural Network (ANN) model based on the backpropagation algorithm to identify soil N-total content using soil pH, moisture content, and soil resistance as input parameters. The model was trained using the trainbr training function with variations of logsig and tansig activation functions and hidden layer structures of 5–5, 8–8, and 12–12 to obtain the best configuration. The training results indicate that the tansig–tansig combination with 8–8 hidden layer structure achieved the highest performance, with a R2 training of 0.953 and a R2 testing of 0.911. The model was implemented in the form of a Graphical User Interface (GUI) application to facilitate field-level prediction. Validation using 40 testing data samples showed a classification accuracy of 70% and an R² value of 0.932 for nitrogen prediction. The model correctly classified 28 data samples out of the total 40 tested data. These results indicate that the proposed model is capable of predicting soil nitrogen content accurately and reliably.
Downloads
References
Acosta, J.A., Gabarrón, M., Martínez-Segura, M., Martínez-Martínez, S., Faz, Á., Pérez-Pastor, A., Gómez-López, M.D., & Zornoza, R. (2022). Soil water content prediction using electrical resistivity tomography (ERT) in Mediterranean Tree Orchard Soils. Sensors, 22(4), 1365. https://doi.org/10.3390/s22041365
Agustina, R.M. (2022). Kajian Unsur Hara Makro dan Mikro Pada Pertumbuhan Tanaman. [Undergraduated Thesis]. UIN Raden Intan Lampung.
Chicco, D., Warrens, M.J., & Jurman, G. (2021). The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. PeerJ Computer Science, 7, e623. https://doi.org/10.7717/peerj-cs.623
Devianti, Sufardi, Bulan, R., & Sitorus, A. (2022). Vis-NIR spectra combined with machine learning for predicting soil nutrients in cropland from Aceh Province, Indonesia. Case Studies in Chemical and Environmental Engineering, 6, 100268. https://doi.org/10.1016/j.cscee.2022.100268
Ding, C., Lv, C., Chen, H., Zhou, J., & Ren, H. (2024). Evaluation of soil total nitrogen as an indicator of soil bacterial community response to biochar and plant growth-promoting rhizobacteria applications. Agronomy, 14(3), 428. https://doi.org/10.3390/agronomy14030428
Elakiya, N., & Keerthana, G. (2024). Application of artificial neural networks in soil science research. Archives of Current Research International, 24(5), 1–15. https://doi.org/10.9734/ACRI/2024/v24i5674
Hermantoro. (2011). Aplikasi pengolahan citra digital dan jaringan syaraf tiruan untuk memprediksi kadar bahan organik dalam tanah. Jurnal Keteknikan Pertanian, 25(1), 1–8.
Indraningsih, K.S. (2016). Faktor-faktor yang memengaruhi kinerja usahatani petani sebagai representasi strategi penyuluhan pertanian berkelanjutan di lahan marjinal. Jurnal Agro Ekonomi, 31(1), 71–95.
Kamau, P., Ndirangu, I., Richardson, S., Pamme, N., & Gitaka, J. (2024). Gendered farmer perceptions towards soil nutrition and willingness to pay for a cafetière-style filter system for in-situ soil testing: Evidence from Central Kenya. Heliyon, 10(18), e37568. https://doi.org/10.1016/j.heliyon.2024.e37568
Kumar, S., Kumar, S., & Mohapatra, T. (2021). Interaction between macro- and micro-nutrients in plants. Frontiers in Plant Science, 12, 665583. https://doi.org/10.3389/fpls.2021.665583
Kuusemets, L., Mander, Ü., Escuer-Gatius, J., Astover, A., Kauer, K., Soosaar, K., & Espenberg, M. (2025). Interactions of fertilisation and crop productivity in soil nitrogen cycle microbiome and gas emissions. SOIL, 11, 1–15. https://doi.org/10.5194/soil-11-1-2025
Lai, H., Gao, F., Su, H., Zheng, P., Li, Y., & Yao, H. (2022). Nitrogen distribution and soil microbial community characteristics in a legume–cereal intercropping system: A review. Agronomy, 12(8), 1900. https://doi.org/10.3390/agronomy12081900
Li, M., Han, X., & Li, L.-J. (2022). Total nitrogen stock in soil profile affected by land use and soil type in three counties of Mollisols. Frontiers in Environmental Science, 10. https://doi.org/10.3389/fenvs.2022.945305
Liu, H., Wang, J., Liu, S., Hu, Q., & Huang, D. (2024). Study on soil total nitrogen content prediction method based on synthetic neural network model. Sustainability, 16(8), 3195. https://doi.org/10.3390/su16083195
Liu, J., Cai, H., Chen, S., Pi, J., & Zhao, L. (2023). A review on soil nitrogen sensing technologies: Challenges, progress and perspectives. Agriculture, 13(4), 743. https://doi.org/10.3390/agriculture13040743
Norton, J., & Ouyang, Y. (2019). Controls and adaptive management of nitrification in agricultural soils. Frontiers in Microbiology, 10, 1931. https://doi.org/10.3389/fmicb.2019.01931
Sangprasat, K., Puttiwongrak, A., & Inazumi, S. (2025). Review of correlations between soil electrical resistivity and geotechnical properties. Geosciences, 15(5), 166. https://doi.org/10.3390/geosciences15050166
Troiano, M., Nobile, E., Mangini, F., Mastrogiuseppe, M., Conati Barbaro, C., & Frezza, F. (2024). A comparative analysis of the Bayesian Regularization and Levenberg–Marquardt training algorithms in neural networks for small datasets: A metrics prediction of neolithic laminar artefacts. Information, 15(5), 270. https://doi.org/10.3390/info15050270
Wang, X.-W., Xu, J.-C., Long, C.-Z., Zhu, S.-W., Lu, M.-J., & Yang, W.-T. (2018). Effect of nitrogen rates and soil water contents on soil nitrogen mineralization under ryegrass returning into red soil. Journal of Plant Nutrition and Fertilizers, 24(2), 365–374. https://doi.org/10.11674/zwyf.17373
Zhai, J., Zhang, Y., Zhang, G., Xu, W., Xie, R., Ming, B., Hou, P., Wang, K., Xue, J., & Li, S. (2022). Nitrogen application and dense planting to obtain high yields from maize. Agronomy, 12(6), 1308. https://doi.org/10.3390/agronomy12061308

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


