Image-Based Soil Nutrient Prediction Using Machine Learning and Deep Learning Models
by Preity Mishra, S.K. Chaulya, Vikash Kumar, Naresh Kumar, Abhinek Agarwal, Anant Stephen Besra
Computing and Artificial Intelligence, Vol.4, No.3, 2026;
Recent advances in precision agriculture have enabled the use of machine learning and image processing for rapid soil nutrient assessment. This study presents a non-destructive approach for estimating soil nutrient content from digital soil images captured using a camera and analyzed through specialized software. A dataset of 1,500 soil images was processed using color correction, noise reduction, and feature extraction techniques to improve data quality. Five machine learning models, Random Forest, Extreme Gradient Boosting (XGBoost), Light Gradient Boosting Machine (LightGBM), Gradient Boosting Machine (GBM), and a Stacking Regressor, were evaluated for predicting nitrogen, phosphorus, and potassium levels. A Convolutional Neural Network (CNN) based deep learning model was served as a benchmark. No single model was best for every nutrient and metric. For nitrogen, GBM achieved the lowest test MAE (0.1652), whereas the Stacking Regressor achieved the highest test R² (0.9886). For potassium, Random Forest achieved the lowest test MAE (0.0051), whereas XGBoost achieved the highest test R² (0.9999). For phosphorus, XGBoost achieved both the lowest test MAE (0.1558) and the highest test R² (0.9929). Thus, the best-performing model depends on the nutrient and evaluation metric. Further validation using independent field datasets is required to establish robustness under diverse environmental conditions.
show more