Field experiments conducted at an experimental farm in southern Nigeria demonstrate that pairing Internet of Things edge devices with supervised machine learning algorithms can predict agricultural soil moisture up to seven days in advance. Researchers deployed a sensor-equipped edge platform on a 0.684-acre rain-fed cassava plot at the Faculty of Agriculture within the University of Port Harcourt between February and March 2026. By developing a causal, leakage-free data reconstruction methodology to overcome an eighteen-day hardware outage, the engineering team demonstrated that nonlinear algorithms could achieve coefficients of determination reaching up to 0.94 during multi-horizon holdout evaluations. Cassava represents a primary nutritional and industrial staple across sub-Saharan Africa, accounting for roughly twenty-four percent of Nigeria’s gross domestic product, yet producers frequently encounter severe yield limitations caused by unpredictable rainfall, fluctuating soil moisture content, and an absence of localized microclimate data. The investigation shows that continuous physical monitoring and predictive modeling provide actionable advance estimates that could transform traditional schedule-based field irrigation into data-driven precision water management.
The physical deployment relied on an autonomous edge computing architecture designed to gather multivariate microclimate time series under real-world agricultural conditions. Central to the field node was a Raspberry Pi 5 Model B single-board computer operating Raspberry Pi OS from a 64-gigabyte microSD card and powered continuously by a 10,000-milliampere-hour portable battery pack. The edge system interfaced with several external monitoring instruments housed inside a protective polyvinyl chloride enclosure that offered ventilation while shielding sensitive electronic components from ambient heat, precipitation, and dust. Analog readings from a capacitive soil moisture sensor, installed vertically between five and ten centimeters below the soil surface directly within the loamy crop root zone, were digitized at high resolution using an ADS1115 sixteen-bit analog-to-digital converter. Concurrently, a DHT11 sensor gathered atmospheric temperature and relative humidity readings, an MQ-135 sensor monitored gas concentrations, and a dedicated camera module captured periodic leaf images. The software pipeline automated sensor polling every five seconds using automated cron scheduling, writing observations locally to a lightweight SQLite database before transmitting records across a 5G mobile communications network.
Field operations produced 753,440 continuous multivariate records over the two-month monitoring window, but practical deployment challenges revealed critical obstacles common to long-term agricultural telemetry. When researchers inspected the sequential timestamps, they identified an extended nineteen-day data disruption extending from February 19 to March 8, 2026, caused by operational interruption. In conventional time-series research, investigators frequently apply bidirectional interpolation or forward-and-backward imputation to fill missing intervals. However, the study authors emphasize that utilizing measurements collected after an outage introduces future information into past estimates, creating temporal information leakage that artificially inflates downstream model accuracy. To preserve strict physical causality, the researchers formulated a unidirectional reconstruction technique that relied exclusively on observations gathered prior to the outage. Each missing timestamp was converted into a diurnal seconds-of-day metric representing elapsed seconds since midnight, allowing missing values to be imputed using historical averages recorded at that precise second during preceding operational days.
For a minority of gap timestamps where an exact matching second was absent from the historical record, the team applied linear interpolation strictly within the boundaries of the pre-outage temporal profile rather than across chronological gap endpoints. This mathematical formulation ensured that every reconstructed data point remained equivalent to an estimate that an edge processor could have generated in real time without access to subsequent field conditions. In total, 196,960 data points were reconstructed to establish an unbroken time series. To preserve experimental integrity, the engineers assigned an explicit binary flag to every imputed value, ensuring that reconstructed figures could be tracked and excluded during validation phases. In addition, quality filtering isolated and removed 935 anomalous temperature records that registered between 70 and 137 degrees Celsius, which reflected sensor exposure anomalies rather than authentic atmospheric phenomena. Meanwhile, carbon dioxide measurements recorded by the MQ-135 sensor remained static at a 300 parts per million baseline with zero variance, leading researchers to exclude gas readings entirely from model training.
Statistical evaluation of the curated dataset revealed strong environmental relationships and marked diurnal dynamics across the monitored cassava field. Following gap reconstruction and outlier removal, ambient temperatures averaged 36.12 degrees Celsius with a standard deviation of 6.94 degrees, relative humidity averaged 63.26 percent, and soil moisture exhibited a mean value of 19.38 percent. Pearson correlation coefficients demonstrated an intense inverse dependency of negative 0.98 between temperature and atmospheric humidity, illustrating how daytime solar heating drove rapid air drying across the farm canopy. Furthermore, soil moisture showed a positive correlation of 0.62 with relative humidity and a moderate negative correlation of negative 0.58 with ambient temperature. In late March, the sensor array recorded an abrupt meteorological event during which daily average temperatures dropped from 36 to 30 degrees Celsius while humidity climbed from 63 to 83 percent and soil water content surged to 34 percent, providing a clear multi-sensor signature of natural precipitation on the rain-fed site.
To convert raw sensor measurements into an informative predictive feature space, the researchers engineered an extensive battery of lagged variables, rolling statistics, and continuous temporal representations. Historical soil moisture measurements were sampled across backward intervals of 1, 5, 15, 30, 60, 180, 360, and 720 minutes to encode immediate and prolonged soil memory effects. Complementary lags were computed for temperature and humidity, while rolling-window mean statistics were calculated across windows spanning 3, 6, 12, 24, 48, and 168 minutes to smooth high-frequency noise. Additional rolling standard deviations over 6, 24, and 48 minutes captured local environmental volatility. To address numerical boundary discontinuities between the final hour of the night and the start of the morning, cyclical sine and cosine transformations were applied to the hour of the day and day of the year, providing continuous cyclical encodings that enabled algorithms to learn diurnal solar cycles without experiencing abrupt artificial mathematical shifts at midnight.
Predictive modeling evaluated four supervised machine learning algorithms alongside two classical statistical benchmarks across four distinct operational forecasting horizons: 1-day, 2-day, 5-day, and 7-day ahead. Benchmark comparisons incorporated a naive persistence model, which assumed that future moisture levels would perfectly match the most recent observed reading, and an autoregressive integrated moving average specification parameterized as ARIMA(2,1,2). The machine learning cohort comprised Ordinary Least Squares linear regression, a Random Forest regressor built with 500 estimators and a maximum depth of 20, an Extreme Gradient Boosting model configured with 500 sequential boosting rounds, a learning rate of 0.01, and a maximum tree depth of 8, and a Multi-Layer Perceptron neural network. The neural network architecture utilized three fully connected hidden layers containing 128, 64, and 32 neurons with rectified linear unit activation, adaptive learning rates, and early stopping regularization capped at 800 training epochs.
Model training and evaluation strictly adhered to temporal holdout validation, partitioning chronologically ordered data so that predictive accuracy was quantified solely against genuine, non-reconstructed sensor readings withheld from the end of the monitoring campaign. Across every evaluated forecasting interval, nonlinear machine learning models demonstrated overwhelming superiority over simple linear regression and time-series benchmarks. For the 1-day forecasting horizon, the Multi-Layer Perceptron delivered the lowest absolute error with a mean absolute error of 3.88 and a root mean squared error of 10.16, while XGBoost attained the highest coefficient of determination at 0.90 alongside an MAE of 4.20. Random Forest produced an R-squared of 0.87, whereas linear regression achieved only 0.45. Benchmark persistence and ARIMA models yielded substantially higher errors, revealing that simple linear extrapolations cannot accommodate the nonlinear hysteresis and fluctuating evaporative forces governing root-zone soil water retention.
Similar performance hierarchies emerged across extended forecast horizons, where ensemble boosting and neural networks reliably tracked moisture changes across multi-day spans. At the 2-day horizon, XGBoost registered the highest accuracy, generating an MAE of 5.00, an RMSE of 10.75, and an R-squared of 0.87, with Multi-Layer Perceptron and Random Forest following at 0.83 and 0.82 respectively, while linear regression fell to 0.40. At the 5-day mark, Random Forest achieved an MAE of 5.29 and an R-squared of 0.85, closely trailed by XGBoost at 0.84 and the neural network at 0.83. In the 7-day holdout evaluation, the Multi-Layer Perceptron recorded an MAE of 2.69 while XGBoost attained an RMSE of 6.91, with both architectures jointly reaching an R-squared of 0.94. The researchers noted that because each horizon was tested on a distinct final holdout window experiencing specific local weather patterns, the higher 7-day score reflects the particular environmental conditions of that test segment rather than an inherent ease in forecasting further into the future.
A critical contribution of the research involved a systematic sensitivity analysis comparing models trained on the leakage-free reconstructed dataset against identical architectures trained on the raw, non-reconstructed records. Across all four machine learning algorithms and all forecasting horizons, pre-training data reconstruction yielded substantial performance enhancements, reducing mean absolute forecasting errors by margins ranging between 22.5 percent and 92.8 percent. The Multi-Layer Perceptron exhibited the most dramatic gains at the 7-day prediction window, where reconstructing the sensor outage allowed the network to learn continuous temporal dependencies that were otherwise completely fractured by the multi-week gap. By establishing continuous time-series structure without leaking post-outage information into training sets, the causal profiling method preserved the essential diurnal rhythms necessary for multi-step gradient descent updates.
Analysis of feature importance derived from the Random Forest model highlighted the primary environmental drivers regulating root-zone soil moisture forecasts. The cyclical cosine transformation of the hour of the day emerged as the single most influential predictor, followed by the 720-minute lagged soil moisture measurement and the cyclical sine transformation of the hour. Antecedent soil moisture statistics, including the 12-hour and 24-hour rolling averages as well as rolling standard deviations, ranked consistently above instantaneous atmospheric metrics. While rolling averages of ambient temperature and relative humidity contributed meaningful predictive value, their raw instantaneous values showed comparatively modest influence. These feature rankings confirm that soil moisture dynamics on the cassava plot were primarily governed by internal moisture history and diurnal atmospheric cycles rather than isolated instantaneous weather readings.
Despite the strong performance reported across the evaluated models, the authors highlighted fundamental experimental constraints that delineate the boundaries of their conclusions. The deployment gathered empirical data from a single multi-parameter sensor node installed at one location within a 0.684-acre field, meaning the findings capture temporal moisture variations but cannot account for spatial soil variability, topography, or canopy differences across larger commercial plots. Furthermore, the dataset was restricted to a single two-month observation window during the Nigerian dry-to-wet transitional season. The research team emphasized that future work must expand to multi-season and multi-location field trials incorporating distributed sensor nodes, secondary reference instruments, walk-forward rolling-origin validation schemes, and sequential deep learning architectures such as Long Short-Term Memory networks to advance climate-resilient precision agriculture.
Subject of Research: Edge computing and machine learning for multi-horizon agricultural soil moisture forecasting
Article Title: Iot and machine learning for multi-horizon soil moisture forecasting using leakage-free reconstructed sensor data in precision agriculture
Article References: Dominic, D. C., Ariaga, T. K., Oboatarheyere, P. O., Njoku, C. E., Audu, G. O., Adebayo, H., Onyejegbu, L. N., & Okafor, N. U. (2026). Iot and machine learning for multi-horizon soil moisture forecasting using leakage-free reconstructed sensor data in precision agriculture. Discover Sensors, 2(1), Article 66. https://doi.org/10.1007/s44397-026-00099-1
Image Credits: AI Generated
DOI: 10.1007/s44397-026-00099-1
Keywords: Precision Agriculture, Soil Moisture Forecasting, Edge Computing, Raspberry Pi 5, Machine Learning, Extreme Gradient Boosting, Multilayer Perceptron, Random Forest Regressor, Time Series Reconstruction, Sensor Outage Imputation, Cassava Cultivation, Capacitive Soil Sensor, Diurnal Profiling, Temporal Causality, Holdout Validation, Agricultural Internet of Things
News Source: Teresa Odom. (November 18, 2026). Machine Learning Models Accurately Forecast Multi-Day Soil Moisture on Cassava Farmland. Scienmag.



