Prediction of Soil Nutrients from Different Soil Textures using Portable Spectrometer and Machine Learning

Open

Harki Himawan, Rut Juniar Nainggolan, Handono Rakhmadi, Gunomo Djoyowasito, Ubaidillah, Lenny Sri Nopriani, Dimas Firmanda Al Riza

2026 Advance Sustainable Science, Engineering and Technology Vol. 8 Issue 1 Article Cited by 0

Abstract

Soil nutrients, such as nitrogen, phosphorus, and potassium, are essential for plant growth and agricultural productivity. Conventional laboratory methods for measuring these nutrients are accurate, but often time-consuming, expensive, and harmful to the environment. This study explores the potential of portable visible-near infrared (Vis-NIR) spectrometers combined with machine learning algorithms as a fast, cost-effective, and environmentally friendly alternative for soil nutrient analysis. The soil samples used consisted of clay, sandy clay, and loamy clay. The machine learning model used was artificial neural network (ANN). The ANN model was developed using the H2O library with the AutoML feature as a hyperparameter tuner to improve accuracy and cross-validation to reduce overfitting. A total of 81 reflectance spectrum data from each soil type were obtained using the AS7265x sensor and processed to develop a predictive model of nutrient content. The ANN model demonstrated high accuracy, with R² values exceeding 0.8 for each soil texture type. This study highlights the potential of integrating portable Vis-NIR spectrometers and machine learning to revolutionize soil nutrient analysis, offering significant improvements in agricultural efficiency and sustainability. © 2026, University of PGRI Semarang. All rights reserved.

Affiliations

Department of Biosystems Engineering, Faculty of Agricultural Technology, Universitas Brawijaya, Jl. Veteran, Ketawanggede, East Java, Malang, 65145, Indonesia; Indonesia Fertilizer Research Institute (IFRI), Indonesia; Department of Soil Science, Faculty of Agriculture, Universitas Brawijaya, Jl. Veteran, Ketawanggede, East Java, Malang, 65145, Indonesia