Machine Learning in Soil Testing for Nutrient Analysis
Main Article Content
Abstract
This study presents a novel Bidirectional Long Short-Term Memory (BiLSTM) neural network enhanced with an attention mechanism and optimized using Grey Wolf Optimization (GWO) for predicting soil electrical conductivity (EC) from spectral reflectance data. The BiLSTM architecture captures sequential dependencies in the spectral data, while the attention mechanism enables the model to focus on the most informative wavelengths, particularly those around 489 to 511 nm. GWO is employed to optimize the model's weights and biases, demonstrating faster convergence and superior performance compared to the traditional Adam optimizer. The model's effectiveness is validated through various metrics, including a consistent decrease in training and validation Root Mean Squared Error (RMSE) over 100 epochs and a high coefficient of determination (R²) on the test set. The results indicate that the proposed model achieves high predictive accuracy and generalization capability, making it a valuable tool for soil nutrient analysis and supporting precision agriculture practices.
