Explainable AI for field trials
The most common objection to AI applications in agriculture: the models work as a black box and do not generalise to new data. We developed a general, transparent framework that makes machine learning results interpretable analytically and graphically – surfacing patterns that classical statistics does not show.
The situation
A model that correctly predicts a yield effect but cannot explain why is worthless in practice. A product manager cannot base an application recommendation on a number they cannot justify.
The first question in a specialist conversation is never "what is the predictive accuracy" but: which factor has the strongest influence on the product? And that was precisely the question the available tooling of the time did not answer in a form business functions could use.
The data
Field trial data and the models trained on it. The framework is deliberately model-agnostic: it works equally with XGBoost, random forests, linear models and logistic regression.
Approach
Measure feature importance rather than estimate it. To answer the question of the strongest influencing factor, the increase in prediction error when the respective feature is removed is calculated. That produces a ranking grounded in model behaviour rather than in assumption.
Marginal effects through Accumulated Local Effects. ALE describe the relationship between the target variable and an individual feature. That reveals not only that a factor matters but in which direction and from which value it takes effect.
Interaction effects in two heatmaps. The first shows the second-order effect – how the influence of one feature is modified by another. The second shows the total effect of interaction plus individual main effects, and which combination of factor levels leads to good or poor agricultural performance. Placed side by side, they allow strongly interacting regions to be identified and the balance between interaction and main effect to be judged.
Implemented with the R packages iml, lime and DALEX.
Outcome
The result was a complete analytical process for explaining machine learning models, applicable across model classes. The explanations are intuitive and comprehensible without statistical training, and the graphics deliver insight beyond the model's prediction.
The practical effect: the product manager decides on the basis of the factors rather than on a single number – and can carry the findings into business strategy.
Transferability
Model-agnostic interpretation with reported main and interaction effects is required wherever a model's statement has to be defended on scientific terms: assay analysis, toxicity prediction, process optimisation.
Today
The need is the same; its status has shifted entirely. When we built this framework, explainability was a research topic and an argument to use with sceptical specialist functions. Today it is a regulatory requirement: the EU AI Act demands documented traceability for high-risk applications.
Technically, SHAP has established itself as the standard, with TreeSHAP as the efficient variant for tree ensembles and SHAP interaction values covering what we then represented through two heatmaps. ALE remain methodologically correct and, where features are correlated, superior to the older partial dependence displays – that part of the framework has not aged, it has been vindicated. On permutation-based feature importance we now understand more precisely that it is biased under correlation; we therefore work with grouped or conditional variants. And implementation today would happen in Python with shap and InterpretML rather than in R, simply because the tool chain there is denser.
Last updated: 30 July 2026