Source-linked AI summary

Technical Report on the Turba Fertilizer Machine Learning Stack in Morocco

Abdelghani Belgaid, Zakaria Mahmoud, Fahd Chibani, Oumnia Ennaji, Younes Boudoul, Dounia Rachid

arXiv:2610.05949v1cs.LGcs.SE

TL;DR

Recommendation workflows that are difficult to automate or reproduce limit scientific reuse, motivating a stack that separates access, versioned records, and offline surrogates. The released models closely emulate reference recommendations under the evaluated split, but this is not evidence of crop-response prediction or agronomic validity.

  • Problem

    Interactive access, mutable upstream services, and difficulty independently loading or benchmarking trained approximations constrain reproducible fertilizer research.

    Source: §1 · p. 1
  • Method

    Turba links programmatic recommendation access, versioned analytical snapshots, and crop-specific machine-learning surrogates while preserving provenance distinctions among their outputs.

    Source: §1 · p. 2, §2 · p. 2, §7 · p. 6
  • Results

    The three cereal models achieved overall R2 values above 0.9, with MAE ranging from 0.040 to 0.069 and RMSE from 0.160 to 0.210; maize R2 was 0.987 for Maize (Grain) and 0.994 for Maize (Silage).

    Source: §4 · p. 4
  • Takeaways & Limitations

    The stack provides a reproducible basis for benchmarking and method development while keeping recommendation outputs, scenario labels, and surrogate agreement distinct from field observations and agronomic validation.

    Source: §7 · p. 7

    The deterministic random split tests interpolation rather than spatial or temporal generalization, and the models have no explicit uncertainty calibration.

    Source: §4 · p. 5, §6.1 · p. 6

Abstract

from arXiv · show

Site-specific fertilizer recommendation systems adapt nutrient advice to location, soil properties, crop type, and production targets, but scientific reuse is constrained when recommendation functions remain accessible mainly through interactive interfaces, outputs are not versioned, and trained approximations cannot be independently loaded or benchmarked. This technical report presents the Turba fertilizer machine learning stack, a three-layer open-source implementation for reproducible site-specific fertilizer recommendation in Morocco. \texttt{turba-client} provides programmatic access to publicly accessible site profiles, crop-specific target-yield spaces, and N, P$_2$O$_5$, and K$_2$O recommendation workflows; \texttt{turba-data} distributes analysis-ready snapshots; and \texttt{turba-models} packages crop-specific machine learning surrogates of recommendation outputs. The architecture links upstream retrieval, versioned analytical snapshots, reproducible cross-model benchmarking, and loadable offline surrogates while preserving the distinction between recommendation-system outputs, observed agricultural data, and model-generated predictions. The first dataset was constructed from 44,096 unique ESA WorldCereal locations. Scenario expansion across supported cereal workflows generated 132,017 crop-location recommendation requests under a medium target-yield setting. The resulting 22-variable dataset spans 10 regions, 66 provinces, and 1,149 communes. Nine regression families were evaluated under a fixed deterministic 80/20 protocol, and the current release packages five best-performing crop-specific models. The machine learning task is recommendation-function emulation rather than prediction of observed crop response. The stack provides a reproducible basis for spatial and temporal validation, uncertainty estimation, field-trial comparison, and future integration with additional data.

1 Introduction

Reproducible fertilizer research needs more than computational methods: it also requires reusable data, preserved provenance, executable procedures, and recoverable software environments. Turba addresses these needs around publicly accessible Fertimap workflows while distinguishing recommendation outputs from field evidence.

1 Introduction

  • Moroccan research has applied machine learning and optimization to site-specific fertilizer recommendation and documented spatial and temporal heterogeneity in cereal production.Site-specific nutrient decisions account for soil fertility, crop requirements, production targets, and environmental conditions.Source: §1 · p. 1
  • Interactive recommendation interfaces and mutable upstream services can make automated experiments and identical research artifacts difficult to reproduce.Reproducible computational science also calls for preserved provenance, executable procedures, software versions, and intermediate artifacts.Source: §1 · p. 1
  • Earlier Fertimap soil-property maps were publicly viewable but their underlying raster products were not downloadable for independent reuse.The passage distinguishes public visualization from reusable computational access.Source: §1 · p. 2
  • Turba links programmatic Fertimap access, versioned recommendation datasets, and pretrained machine-learning surrogates as three distinct research resources.The stack is independent of Fertimap and is not presented as evidence of fertilizer efficacy or field-level agronomic optimality.Source: §1 · p. 2

2 System Architecture and Computational Provenance

Turba separates upstream recommendation retrieval, versioned analytical records, and learned approximations into provenance-distinct layers. The client, data, and model packages support access, reproducible analysis, and offline prediction, respectively.

2 System Architecture and Computational Provenance

  • The architecture treats an upstream response, a versioned snapshot, and a surrogate prediction as distinct research objects.The client evaluates the externally maintained function, data stores selected evaluations, and models approximate its recommendation outputs.Source: Figure 1 · p. 2, §2 · p. 2

2.1 Data-access layer: turba-client

  • turba-client retrieves site and recommendation information, supports batch requests and input-table normalization, and validates coordinates, crops, target yields, and required columns before execution.Controlled soil-property overrides support sensitivity analysis and comparison with independently measured or curated inputs; future requests remain dependent on the external service.Source: §2.1 · pp. 2–3

2.2 Data layer: turba-data

  • turba-data distributes registered Parquet snapshots separately from the access layer, allowing experiments to use stable analytical records without repeating upstream requests.The first registered dataset is esa_worldcereal_morocco_cereals_medium.Source: §2.2 · p. 3

2.3 Model layer: turba-models

  • turba-models distributes loadable crop-workflow models with registry metadata for estimator, schemas, split policy, and evaluation; its six predictors are geographic and soil variables.The outputs are recommended N, P2O5, and K2O; the models emulate recommendations rather than crop response or independently validated agronomic advice.Source: §2 · p. 2, §2.3 · p. 3

3 Dataset Construction and Coverage

The first dataset expands 44,096 WorldCereal locations into crop-workflow recommendation scenarios while retaining uncertainty about exact crop and irrigation status. Its expanded scenario count is distinct from its unique-site support.

3 Dataset Construction and Coverage

  • WorldCereal classes define compatible recommendation scenarios, not confirmed field-level crop identities or irrigation regimes.The scenario expansion deliberately preserves uncertainty about which crop and irrigation regime occurred at each site.Source: §3 · p. 3
  • 132,017 crop-location scenarios were generated from 44,096 unique WorldCereal locations by enumerating compatible supported workflows.The source subset contains 43,825 Winter Cereals locations and 271 Maize locations.Source: §3 · p. 3
  • The dataset uses a medium target-yield setting and contains 22 variables across 10 regions, 66 provinces, and 1,149 communes.Table 1 summarizes dataset construction and geographic scope.Source: §3 · p. 3, Table 1 · p. 3
  • The nominal spatial support is 44,096 unique coordinates, not 132,017 independent locations, because multiple crop scenarios share coordinates.Statistical support and generalization should be interpreted in terms of unique sites and spatial dependence.Source: §3 · pp. 3–4

4 Machine Learning Benchmark and Evaluation

The benchmark evaluates crop-specific surrogates against recommendation-system outputs using a fixed random split and nine regression families. The released models show high agreement within that evaluation, but the results do not establish agronomic performance or geographic transfer.

4 Machine Learning Benchmark and Evaluation

  • The primary benchmark used a deterministic 80/20 split, with each crop workflow evaluated independently and no coordinate duplicated within that workflow.The same site can appear across workflow-specific datasets, and nearby sites remain spatially dependent.Source: §4 · p. 4
  • Nine regression families were compared using R2, MAE, median absolute error, RMSE, MAPE, and sMAPE, with overall metrics averaging the three nutrient targets without weighting.Estimator configurations were fixed and were not hyperparameter-optimized.Source: §4 · p. 4
  • The scores measure fidelity to recommendation outputs, not crop yield response, nutrient-use efficiency, economic return, environmental loss, or agronomic optimality.The reported high-fidelity emulation applies within the evaluated split, particularly for the much larger winter-cereal datasets.Source: §4 · p. 4
  • Overall R2 exceeded 0.9 for the three cereal models, with MAE 0.040–0.069 and RMSE 0.160–0.210; maize R2 was 0.987 for Grain and 0.994 for Silage (Table 2).Table 2 summarizes packaged surrogates and overall evaluation results; the reported maize MAEs were 0.385 for Grain and 0.478 for Silage.Source: §4 · p. 4, Table 2 · p. 5
  • Percentage errors are difficult to interpret because exact-zero recommendations account for 31.05% of P2O5 targets and 78.83% of K2O targets.MAPE can become extremely large despite high R2 and low absolute error.Source: §4 · p. 5
  • The random split is an interpolation test, so spatial blocking, region-holdout evaluation, and temporal validation are needed before geographic or temporal generalization can be claimed.Each maize workflow has 271 locations, compared with 43,825 for each winter-cereal workflow; the maize results therefore have less statistical support.Source: §4 · p. 5

5 Reproducibility and Availability

The report supports software, data, and model reproducibility through versioned packages, snapshots, serialized artifacts, and a documented training workflow. Source code and archived releases are available under stated licensing boundaries.

5 Reproducibility and Availability

  • A registered Parquet snapshot, serialized .joblib artifacts, a model registry, benchmark reports, and the training workflow support reproducibility across data and model layers.A locked environment and seed 42 are recorded, and the training notebook generates the benchmarks, registry, and model artifacts from one run.Source: §5 · p. 5
  • The training workflow can be reproduced from the registered snapshot by installing the version-pinned environment and executing the documented notebook.The notebook records estimator settings and generates target-level benchmarks, an overall leaderboard, and selected-model summaries.Source: §5 · p. 5
  • The three components’ source repositories use the MIT License and archived releases are associated with Zenodo DOI 10.5281/zenodo.20044002.The license applies to Turba software, not upstream services or third-party data sources.Source: §5 · pp. 5–6

6 Limitations and Future Directions

The report identifies limits in upstream-service dependence, scenario-based crop expansion, and the current modeling and evaluation design. It prioritizes stronger validation and outlines longer-term data, modeling, and decision-support extensions.

6.1 Limitations

  • The current modeling layer uses six static spatial and soil variables, a deterministic random split, and no explicit uncertainty calibration.Scenario expansion from broad WorldCereal classes does not confirm field-level crop or irrigation status; snapshots preserve completed experiments but do not make future upstream requests immutable.Source: §6.1 · p. 6

6.2 Near-term validation priorities

  • Near-term validation should use site-grouped spatial blocking, region holdouts, temporal transfer, uncertainty quantification, out-of-distribution detection, and reproducible benchmarks.The report also calls for independent fertilizer-response experiments and prospective field trials measuring yield response, nutrient-use efficiency, profitability, and environmental performance.Source: §6.2 · p. 6

6.3 Longer-term research roadmap

  • The roadmap would expand observations with Moroccan parcel recommendations, crowdsourced field and soil records, and multimodal Earth-observation and environmental data.A planned Turba UI would support interactive mapping, scenario construction, uncertainty visualization, and structured community data collection.Source: §6.3 · p. 6
  • Proposed extensions include soil microbiome information and synthetic-data generation for sparse-data settings, augmentation, controlled experimentation, and robustness analysis.The proposed turba-bio layer would investigate whether microbial diversity and nutrient-cycling potential improve soil-state estimation and fertilizer decisions.Source: §6.3 · p. 6
  • The roadmap envisions a sequential nutrient-management environment and decision analyses spanning value of information, correlated prescription risk, and multi-objective food-system decisions.Coupling turba-gym with WOFOST/PCSE is proposed for reinforcement learning, active experimental design, climate sensitivity analysis, and hybrid process–machine learning simulation; provenance distinctions should be retained across extensions.Source: §6.3 · p. 6

7 Conclusion

The Turba stack separates recommendation responses, versioned analytical snapshots, and offline machine-learning surrogates. Its initial dataset and model release provide a reproducible basis for benchmarking while distinguishing emulation from agronomic validation.

7 Conclusion

  • The three computational objects are recommendation responses, versioned analytical snapshots, and offline machine-learning surrogates.The stack formalizes these layers for site-specific fertilizer recommendation research in Morocco.Source: §7 · pp. 6–7
  • The first dataset contains 132,017 crop-location scenarios derived from 44,096 unique WorldCereal locations, and the release packages five crop-specific surrogates benchmarked across nine regression families.These are recommendation-function emulators, not predictions of observed crop response.Source: §7 · p. 7
  • The stack keeps recommendation outputs, scenario-expanded crop labels, and surrogate agreement distinct from observed field responses, ground-truth crop identities, and agronomic validation.This provenance separation defines validation needs for spatial transfer, temporal generalization, uncertainty-aware inference, crop simulation, and prospective field trials.Source: §7 · p. 7
Loading 2610.05949v1…