Machine Learning–Based Optimization of Site-Specific NPK Fertilizer Recommendation
Community Article Published
February 24, 2026
Sharing a new open-access paper on site-specific NPK (N, P₂O₅, K₂O) decision support using a national-scale Moroccan cereal dataset (7,180 field observations across 3 seasons / 8 regions).
What’s in the paper
- Built a scalable machine learning and optimization pipeline on 7,180 Moroccan field trials (three seasons, eight regions), benchmarking 47 model variants (linear, kernel, tree-based, ensemble, stacking, and neural architectures) under random and temporal splits with model interpretability, and benchmarking 10 optimization algorithms (deterministic, stochastic, metaheuristic, learning-based, and hybrid) using top-performing machine learning models.
- Under the random regime, the best-performing model achieved a strong yield prediction accuracy of sMAPE ≈ 4.5% (R² ≈ 0.96), capturing strong nonlinear effects driven by geospatial, seasonal, and nutrient-soil interaction features. Under the temporal (out-of-distribution) regime, the best-performing model reached sMAPE ≈ 17.8% (R² ≈ 0.17), where spatial structure and regional shifts were the dominant explanatory factors.
- Metaheuristic optimization (Simulated Annealing, Bayesian Optimization, and Particle Swarm Optimization) generated site-specific NPK fertilizer decision-support recommendations, increasing model-simulated yields by up to 683 kg/ha (≈ 20% over a 3.4 t/ha baseline) while simultaneously improving nutrient-use efficiency under environmental constraints.
Important caveat: Recommendation results are surrogate/model-simulated and intended to prioritize field testing, not as a ready operational prescription engine.
Links
- Paper (DOI): https://doi.org/10.1016/j.atech.2026.101823
- Reproducibility code/workflows: https://github.com/Bioinformatics-UM6P/MLOSSRF
Would love feedback on
- Better ways to handle temporal + spatial shift in agronomic tabular data
- How you’d design field validation for recommendation hypotheses