An Interpretable Machine Learning Approach for Soil Fertility Prediction from NPK and pH

Soil fertility assessment is central to sustaining agricultural productivity, because the availability of nutrients such as Nitrogen (N), Phosphorus (P) and Potassium (K), together with soil pH, directly governs crop growth and yield. Conventional laboratory-based soil testing is accurate but slow, costly and dependent on specialised equipment and trained personnel, which limits how often farmers, particularly smallholders, can monitor their fields. Machine learning offers a faster, data-driven alternative for estimating soil fertility from routinely measured nutrient parameters. This paper presents a supervised learning approach that classifies soil samples into Low, Medium and High fertility classes using N, P, K and pH as input features. Two tree-based classifiers are implemented and compared: a Decision Tree, chosen for its transparent and easily interpretable decision rules, and a Random Forest, an ensemble of decision trees that reduces variance and the risk of overfitting. The workflow covers data collection, preprocessing, feature selection, model training and evaluation using accuracy, precision, recall and F1-score. Descriptive statistics, box plot analysis and correlation analysis are used to characterise the dataset before modelling, and feature importance scores are used to examine the contribution of each soil parameter. The experimental results show that both classifiers perform well and that the Random Forest achieves higher accuracy, precision and recall than the Decision Tree. The proposed approach provides a low-cost, interpretable decision-support tool for soil management and precision agriculture.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-07
DOI
https://doi.org/10.5281/zenodo.24030030
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

An Interpretable Machine Learning Approach for Soil Fertility Prediction from NPK and pH

Dr. S. Yazhinian, Theepak T, Akshayakumar A. S.
3 links
Zenodo (CERN European Organization for Nuclear Research)
Smart Agriculture and AI
article

An Interpretable Machine Learning Approach for Soil Fertility Prediction from NPK and pH

Dr. S. Yazhinian, Theepak T, Akshayakumar A. S.
article en

Abstract

Soil fertility assessment is central to sustaining agricultural productivity, because the availability of nutrients such as Nitrogen (N), Phosphorus (P) and Potassium (K), together with soil pH, directly governs crop growth and yield. Conventional laboratory-based soil testing is accurate but slow, costly and dependent on specialised equipment and trained personnel, which limits how often farmers, particularly smallholders, can monitor their fields. Machine learning offers a faster, data-driven alternative for estimating soil fertility from routinely measured nutrient parameters. This paper presents a supervised learning approach that classifies soil samples into Low, Medium and High fertility classes using N, P, K and pH as input features. Two tree-based classifiers are implemented and compared: a Decision Tree, chosen for its transparent and easily interpretable decision rules, and a Random Forest, an ensemble of decision trees that reduces variance and the risk of overfitting. The workflow covers data collection, preprocessing, feature selection, model training and evaluation using accuracy, precision, recall and F1-score. Descriptive statistics, box plot analysis and correlation analysis are used to characterise the dataset before modelling, and feature importance scores are used to examine the contribution of each soil parameter. The experimental results show that both classifiers perform well and that the Random Forest achieves higher accuracy, precision and recall than the Decision Tree. The proposed approach provides a low-cost, interpretable decision-support tool for soil management and precision agriculture.

Zenodo (CERN European Organization for Nuclear Research)
Zero hunger, Life on land
Openalex Percentile: Top 17%
Smart Agriculture and AI
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon