logo
ResearchBunny Logo
Prediction of deoxynivalenol contamination in spring oats in Sweden using explainable artificial intelligence

Agriculture

Prediction of deoxynivalenol contamination in spring oats in Sweden using explainable artificial intelligence

X. Wang, T. Borjesson, et al.

Dive into groundbreaking research by X. Wang, T. Borjesson, J. Wetterlind, and H. J. van der Fels-Klerx, uncovering predictive models for deoxynivalenol (DON) contamination in spring oats in Sweden using advanced machine learning techniques. Discover how weather and agronomic factors influence crop safety and accuracy in predictions, with promising results for June.

00:00
00:00
~3 min • Beginner • English
Introduction
Deoxynivalenol (DON), produced by Fusarium spp., contaminates oats and poses risks to human and animal health. The EU sets maximum legal limits for DON in oats (1750 µg/kg for unprocessed oats) and guidance for feed. In Sweden, DON in oats drew major attention after widespread exceedances in 2011, prompting extensive monitoring and associated costs for stakeholders. Early, regional-scale forecasting of DON contamination could enable targeted crop protection and risk-based monitoring to reduce contamination entering the food chain and lower testing costs. Weather strongly affects fungal life cycles and DON production (temperature, humidity, precipitation), while agronomic and site-specific factors (variety, crop rotation, soil type, elevation, location) also influence infection risk. Prior DON-in-oats models often used weather alone, limiting generalizability across differing agronomic practices; combining agronomic and site-specific variables has been suggested to improve performance. Machine learning (ML) has achieved high accuracy for mycotoxin prediction in maize and wheat, yet explainability and oat-focused models have been limited. This study set out to develop regional ML prediction models for Swedish spring oats, quantify the impacts of weather, agronomical and site-specific features on DON levels, and assess collective effects of management practices to provide actionable advice for DON risk reduction.
Literature Review
Previous work on DON prediction in oats and cereals has emphasized weather effects but noted potential gains from including agronomic and site-specific variables. Statistical models sometimes explained little DON variability in oats when using weather alone, while ML methods (random forests, gradient boosting, Bayesian networks, deep neural networks) improved prediction for maize and wheat, often exceeding 90% accuracy. However, studies on oats are fewer, and explainability—clarifying which inputs drive contamination levels—has been lacking. Research has highlighted the roles of oat variety and previous crop (crop rotation) in DON variability, and the importance of aligning varieties with agro-ecological zones. Prior findings also underscore potential model limitations due to class imbalance (few high-DON cases), affecting performance for high contamination levels. This study addresses gaps by integrating weather with agronomic and site-specific data for oats, employing explainable AI (Tree SHAP) to attribute predictions to features.
Methodology
Study design and prediction targets: Three regional risk-assessment models were developed to predict DON contamination level in Swedish spring oats at 11 × 11 km grid resolution. Models provide predictions at three seasonal cutoffs aligned with stakeholder needs: (i) SS-model (Start of Season: Nov 1–Jun 1) for early farmer decisions (e.g., fungicide use); (ii) MS-model (Mid-Season: Nov 1–Jul 1) for early warning and sampling strategy guidance for crop collectors and food safety inspectors; (iii) FS-model (Full Season: Nov 1–Aug 15) for more reliable sampling planning. Outputs were categorical DON levels per grid-year-variety: low (<500 µg/kg), medium (≥500 and <1000 µg/kg), and high (≥1000 µg/kg), set conservatively below EU maximum limits to support precautionary management. Data sources and linkage: Data covered Nov 1 of the previous year to Aug 15 of the current growing year and were linked by grid (11 × 11 km), year, and oat variety group. - DON contamination data: 2012–2019 monitoring results from oats delivered to Lantmännen elevators (54,350 records). Variety groups included Belinda, Ingeborg, Galant, Guld, Symphony, Fatima, Kerstin, Matilda, Feed oats, and unspecified. Additional inputs: grown for feed vs food, organic status (EKO), and mean DON of the previous year in the same grid (by variety group where n>10 deliveries). DON outputs were defined by mean DON per grid-year-variety. Distribution: 82% low, 9% medium, 8% high; 31% below LOQ (100 µg/kg); 4% above 1750 µg/kg; 0.2% above 8000 µg/kg. - Weather data: 2012–2019 from SMHI at 11 × 11 km: HTEMP (max air temp), LTEMP (min air temp), XTEMP (mean air temp), NED (rainfall), XHUM (mean RH), LHUM (min RH), HHUM (max RH), XVH (wind speed), XVR (wind direction), XM (global radiation). For SS, MS, FS models, weekly means/sums during weeks 18–21 (SS), 18–26 (MS), 18–33 (FS), plus monthly means/sums Nov–Apr were computed per grid. - Agronomical and site-specific data: 2016–2017 field-level data (linked to producer deliveries) aggregated to 11 × 11 km grids. Variables: oat variety; year; mean and range of clay, sand, elevation; percentages of oat, ley, other cereals, and other crops as pre-crop (previous year) and pre-pre crop (two years prior). Pre-crops from the Land Parcel Identification System; elevation from 2 × 2 m DEM (Lantmäteriet); soil texture from digital soil mapping of arable land in Sweden. Modeling datasets: Two datasets were constructed: - Dataset 1 (2012–2019): weather + variety variables. - Dataset 2 (2016–2017): weather + variety + agronomical + site-specific variables (limited to these years due to data availability). Data splitting and validation: - Dataset 1: Years 2012–2019 except 2016 were randomly split 80% train and 20% internal test; five-fold cross-validation used for model training/hyperparameter tuning. Year 2016 served as external validation (leave-one-year-out) due to having a contamination distribution close to the 2012–2019 average. - Dataset 2: 2016–2017 randomly split 80% train and 20% internal test with five-fold cross-validation. No external validation possible as agronomical/site-specific data were only available in 2016–2017. Modeling approach: Random Forest (RF) classifiers were implemented in Python 3.9 using scikit-learn 1.0. RF was chosen for handling missing values, non-linearity, robustness to noise/outliers, reduction of overfitting, and capability with unbalanced and spatial data. Performance metrics included confusion matrices, per-class and total classification accuracy, and generalization ability (external validation). Hyperparameters were tuned via five-fold cross-validation. Explainability: Tree SHAP (SHapley Additive exPlanations) was used to quantify feature contributions to predictions globally and by class (low, medium, high). Feature importance rankings and dependency plots were generated to assess directionality and magnitude of effects (e.g., rainfall in December, temperatures/relative humidity near flowering/harvest, variety effects, elevation and soil texture).
Key Findings
- Overall performance: RF models predicted DON contamination levels with strong accuracy. • Dataset 1 (2012–2019, weather + variety): Internal test total accuracies were SS 0.73, MS 0.72, FS 0.73, consistent with five-fold CV means around 0.72. Results indicated predictions were already informative by June (SS-model timeframe). • External validation (2016, dataset 1): Predicting an unseen year was more difficult than internal validation (details in supplementary), indicating limited generalization across years. • Dataset 2 (2016–2017, weather + variety + agronomical + site-specific): Internal test total accuracies were SS 0.94, MS 0.95, FS 0.96. Using weather-only features reduced accuracies to 0.82, 0.81, and 0.88, respectively, showing added value from agronomical and site-specific data. - Feature importance (Tree SHAP): The most influential predictors were rainfall, relative humidity, and wind speed at different growth stages, plus crop variety and elevation. • A key driver was average rainfall in December (NED_MAVE,12): lower values contributed to low DON risk; higher values increased medium/high risk. • Weather around flowering (late June; weeks 28–33) and near harvest (weeks 31–33) was critical: higher RH and precipitation near flowering associated with higher DON; lower average maximum temperature in early August (week 32) increased medium/high DON likelihood. • Variety effects: GALANT and BELINDA were associated with lower DON levels; KERSTIN was associated with medium/high levels. • Site-specific effects: Greater elevation range within fields (>25 m) positively contributed to high DON levels. High-elevation fields (>60 m) with sandy, low-clay soils were associated with higher DON, potentially reflecting drought stress increasing susceptibility to Fusarium infection. - Class imbalance handling: Despite unbalanced data (few high-DON cases), RF achieved relatively balanced per-class performance compared to prior studies that struggled to predict high contamination levels. - Practical implication: Accurate early-season (by June) predictions enable proactive management and risk-based testing, benefiting farmers, collectors, and authorities.
Discussion
The study demonstrates that explainable machine learning can accurately predict regional DON contamination levels in Swedish spring oats. Weather variables are the primary drivers of model performance, while adding agronomical (variety, crop rotation) and site-specific (soil texture, elevation) features further improves accuracy—marginally for the larger 2012–2019 dataset and substantially for the focused 2016–2017 dataset. The ability of the SS-model to provide good predictions by June supports early interventions (e.g., crop protection, sampling plans). SHAP analyses clarify how specific weather windows (December precipitation; late June to August humidity, wind, temperature), varieties, and terrain/soil characteristics influence risk, providing actionable insights for management decisions and for tailoring monitoring in space and time. However, external validation using a leave-one-year-out approach revealed difficulties in generalizing to years not included in training, likely due to inter-annual variability in weather-pathogen-host dynamics and the unbalanced distribution of high-DON cases. A simplified binary risk formulation (above/below a threshold) may be more robust for operational deployment. The models align with EU risk-based control requirements (Reg. 2017/625) by helping prioritize sampling and testing in medium to high-risk regions and support logistics in the oat supply chain.
Conclusion
This work develops and validates three explainable random forest models (SS, MS, FS) to predict regional DON contamination levels in Swedish spring oats, integrating weather, agronomical, and site-specific data. Models achieved strong accuracies (≈0.72–0.73 on 2012–2019 internal tests; up to 0.96 on 2016–2017 with full feature sets) and provided early-season forecasts. Explainability via SHAP identified key drivers—December rainfall, late-season humidity and temperature, wind, variety, and elevation/soil texture—and clarified their directional effects. These models can serve as regional risk-assessment tools for farmers, collectors, and food safety authorities to enable targeted crop protection, risk-based testing, and optimized logistics. Future research should: (i) expand data collection on management practices (fertilization, irrigation, pest control, fungicide use around flowering, harvest timing) and leverage open data (e.g., satellite imagery) to enhance performance and generalizability; (ii) explore binary risk thresholds for robust year-to-year deployment; and (iii) extend to multi-mycotoxin prediction as data availability increases.
Limitations
Key limitations include: (1) incomplete coverage of biologically relevant management factors (e.g., fertilization, irrigation, pest control, fungicide applications around flowering, harvest conditions), due to data unavailability; (2) focus solely on DON, excluding other mycotoxins; (3) limited generalization across years, with reduced performance in external (leave-one-year-out) validation; and (4) class imbalance in observed data (few high-DON cases), which can challenge accurate prediction of high contamination levels.
Listen, Learn & Level Up
Over 10,000 hours of research content in 25+ fields, available in 12+ languages.
No more digging through PDFs, just hit play and absorb the world's latest research in your language, on your time.
listen to research audio papers with researchbunny