EventsThe 13th International Electronic Conference on Sensors and Applications
Published
with-doi10.3390/engproc2026163101 (registering DOI)
This submission belongs to the session S5. Smart Agriculture Sensors of the event The 13th International Electronic Conference on Sensors and Applications
Published date
16 Nov, 2026
Academic Editor
author-avatarStefano Mariani
Citation
Kritphon Phanrattanachai, Decha Wongpatsa, Niwat Angkawisittpan, Somchat Sonasang, Reliability of Machine Learning for Soil-Nutrient Estimation from Long-Term IoT Sensing: A Temporal-Validation and SHAP-Based Study under Tropical Conditions, in Proceedings of The 13th International Electronic Conference on Sensors and Applications, 18 November–20 November 2026, MDPI: Basel, Switzerland, doi: 10.3390/engproc2026163101
Share
Email
Facebook
Twitter
LinkedIn

Reliability of Machine Learning for Soil-Nutrient Estimation from Long-Term IoT Sensing: A Temporal-Validation and SHAP-Based Study under Tropical Conditions

image
image
1. Faculty of Agricultural and Industrial Technology, Phetchabun Rajabhat University, Phetchabun 67000, Thailand
2. Interdisciplinary Studies Program, Faculty of Agriculture and Technology, Nakhon Phanom University, Nakhon Phanom 48000, Thailand
3. Research Unit for Electrical and Computer Engineering, Faculty of Engineering, Mahasarakham University, Maha Sarakham 44150, Thailand
4. Electrical Elements and Wireless Devices Unit (EEWDU) Faculty Industrial Technology Nakhon Phanom University, Nakhon Phanom 48000, Thailand
Abstract

Low-cost Internet of Things (IoT) soil sensors are increasingly used in precision agriculture; however, the reliability of machine learning models developed from continuous field data remains uncertain. This study investigated the estimation of soil nitrogen (N), phosphorus (P), and potassium (K) using environmental variables collected from low-cost IoT soil-sensing nodes. A total of 63,769 observations were recorded over 170 days from two LoRa-based soil sensor nodes deployed under tropical field conditions in Thailand. The measured variables included soil moisture, temperature, electrical conductivity (EC), pH, and sensor-based N, P, and K readings.

A multi-output machine learning model was evaluated using two validation approaches: conventional random data splitting and chronological data splitting. SHapley Additive exPlanations (SHAP) were then applied to examine the contribution of each input variable to the nutrient predictions. With random splitting, the model produced high apparent prediction accuracy, with R² values of 0.86–0.88 for N, P, and K. However, when chronological splitting was used to avoid temporal leakage, the model performance decreased substantially, with R² values below zero. This result indicates that the high performance obtained from random splitting was mainly caused by autocorrelated and near-duplicate samples rather than true predictive ability.

The results also showed clear distributional drift between the training and testing periods. SHAP analysis identified EC and soil moisture as the most influential variables, suggesting that the model mainly captured the conductivity-related response of the sensor system rather than independent chemical information. These findings show that random-split validation can overestimate the practical performance of IoT-based soil nutrient prediction models. The study highlights the importance of time-aware validation, laboratory calibration, and careful interpretation when applying machine learning to low-cost soil sensor data in tropical smart agriculture.

Keywords
explainable artificial intelligence
data leakage
non-stationarity
low-cost soil sensors
nitrogen–phosphorus–potassium (NPK)
multi-output regression
precision agriculture
model generalization
Manuscript
sciforum-192295engproc-163-00101.pdf
Poster
ECSA13_Soil_IoT_Poster_Ready.pdf
Adaptive Device Fingerprint-Assisted Authentication for Resource-Constrained IoT Sensor Networks
Textile Organic Electrochemical Transistor: Biosensors for Real-Time Physiological Biofluid Analysis