Image-Based Soil Nutrient Prediction Using Machine Learning and Deep Learning Models
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.
Authors
- Preity Mishra (ORCID: https://orcid.org/0009-0003-3510-829X)
- Naresh Kumar
- S.K. Chaulya
- Vikash Kumar
- Abhinek Agarwal
- Anant Stephen Besra
Institutions
- Central Institute of Mining and Fuel Research (IN)
Publication Details
- Journal
- Computing and artificial intelligence.
- Published
- 2026-10-28
- DOI
- https://doi.org/10.59400/cai4241
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Ministry of Electronics and Information technology
- CSIR-Central Institute of Mining and Fuel Research