Business and operations

Machine learning for crop yield prediction

Crop yield prediction uses machine learning to forecast harvests from in-season weather, satellite vegetation indices and soil or field records. Models estimate yield per county, region or field weeks before harvest, supporting planning, insurance and food-security monitoring.

How machine learning is used for crop yield prediction

Regional forecasts from weather, soil and satellite data

Models predict yield per region weeks before harvest from growing-season weather, soil properties and satellite vegetation indices. Regional forecasts can be added up to national figures and show differences that national numbers hide. Gradient-boosted trees and regularised regression are common baselines.

Real exampleMachine learning for regional crop yield forecasting in Europe (Wageningen)Wageningen researchers designed a generic machine learning workflow for regional yield forecasts and evaluated it on 35 case studies across nine countries that are major producers of six crops.

Learning directly from satellite imagery

Rather than hand-picked vegetation indices, deep learning models learn features from time series of multispectral satellite images. This helps where ground data are scarce, because imagery is available everywhere.

Real exampleDeep Gaussian Process for crop yield prediction (Stanford)Researchers at Stanford combined convolutional or LSTM networks with a Gaussian process on remote sensing data and evaluated the method on county-level soybean yield prediction in the U.S.

Comparing methods on shared benchmarks

Yield studies often use different regions, years and predictors, which makes results hard to compare. Shared benchmarks with harmonised data let researchers test models on the same unseen seasons and countries.

Real exampleCY-BenchCY-Bench, developed within the AgML Machine Learning team, combines sub-national maize and wheat yield statistics with weather, soil and remote sensing predictors across more than 25 countries.

Mapping where crops are grown

Yield estimates need to know which fields grow which crop. Classifiers trained on labelled points and satellite time series produce crop and cropland maps that are then used to aggregate predictors and yields.

Real exampleCropHarvest (NASA Harvest)CropHarvest is an open remote sensing dataset with benchmarks that aggregates 21 datasets into labelled points paired with Sentinel-1, Sentinel-2, elevation and climate data.

Can you learn machine learning for crop yield prediction?

Yes. Agronomists and agricultural economists bring knowledge of crops, seasons and statistics; data scientists can learn the agronomy. Start with Python and regression on tabular yield and weather data, then add raster and satellite processing, then deep learning for imagery.

  1. Python and pandasJoin yield statistics with weather and soil tables by region and year, and build growing-season features.Learn it in Data Tools
  2. Statistics and regressionTrends, correlation and regression explain how much of yield variation weather actually accounts for.Learn it in Statistics
  3. Machine learning with honest validationTrain tree ensembles and regularised regression, and test on whole years the model has not seen, compared with a recent-average baseline.Learn it in Machine Learning
  4. Satellite data and deep learningLearn raster tools such as Rasterio and xarray, then convolutional and sequence models for image time series.Learn it in Deep Learning

Moving into machine learning for crop yield prediction

If you already work in the field

Agronomists and crop scientists already understand growth stages, weather stress and how yield statistics are collected. Add Python, regression with year-based validation and basic raster processing. A realistic first move is a county or district yield model from public statistics and weather data, compared with a five-year average.

If you come from data science or ML

If you come from ML, learn crop calendars, the main drivers of yield and how official statistics are reported and revised. Read operational bulletins from agencies such as USDA or the EU's crop monitoring services, and work with an agronomist on which features make physical sense.

Roles that do this workAgricultural data scientistRemote sensing scientistCrop modellerAgronomistGeospatial analyst

Tools you will use

ToolWhat you use it for
Google Earth EngineExtract vegetation indices and weather summaries for fields or counties from public satellite archives.
RasterioRead, clip and reproject satellite and climate rasters in Python.
xarrayHandle multi-dimensional weather and remote-sensing time series by date and location.
GeoPandasJoin yields to county or field boundaries and aggregate pixels by region.
scikit-learnFit and compare regression models with grouped cross-validation by year and region.

Public data to practise on

  • USDA NASS Quick Stats: Official US crop statistics; download county-level yields per crop and year as the prediction target.
  • NASA POWER: Daily weather and solar data for any location; build growing-season temperature and rainfall features.
  • FAOSTAT: Country-level crop production and yield statistics; model and compare national yield trends.

Your first project

Download county corn yields from USDA NASS Quick Stats with NASA POWER growing-season weather, predict yield with a random forest, and compare it with each county's five-year average using RMSE on a held-out year.

Common questions

Which machine learning models work best for crop yield prediction?

Random forests and gradient-boosted trees are strong, widely used baselines on tabular weather and soil features. Deep learning models such as CNNs and LSTMs are used with satellite image time series. The validation design matters more than the model choice.

What data is used to predict crop yields?

Historical yield statistics, growing-season weather, soil properties, satellite vegetation indices and crop masks showing where each crop grows. Management data such as sowing dates and fertiliser use help at field level when available.

How early in the season can yield be predicted?

Forecasts can be made at several points in the season, and they generally improve as more of the season's weather and imagery is observed. Report accuracy for each forecast date separately rather than one overall figure.

Why test on unseen years?

Weather is shared across neighbouring fields and regions within a year, so random splits let the model see the test year's conditions. Holding out whole years shows how it would perform in a new season.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.