Everyday Data Science
Latest
Agentic workflows now power a third of surveyed enterprise automationAfrica's AI startup ecosystem posts record funding yearNew benchmark results reshape the coding-agent leaderboardNigeria launches national AI strategy with major investment planRwanda's sovereign AI cloud enters public betaThe future of AI agents: from tools to teammates
AI in AfricaResearch Brief

I Built the First ML Model for Sierra Leone's Rice Harvest — and It Failed

Crop statistics alone couldn't beat a naive baseline. Free satellite data cut the error by a third — and made the harvest visible months ahead

IDIbrahim Denis FofanahData Scientist & AI Researcher7 min read·Sierra Leone · Food Security · Feed Salone

ChatGPT Image Jul 12, 2026, 11_46_42 PM
Agriculture employs most of Sierra Leone's rural population. The country has a national food-security plan — the Feed Salone Strategy (2023–2030) — that depends on knowing what the harvest will look like.

And until this year, no published machine learning study had ever examined Sierra Leonean crop yields. Not one.

So I asked what seemed like the only honest question: not "can ML forecast rice yields" — rich countries have answered that — but "can it forecast them from the data Sierra Leone actually has?"

The first answer was no. That failure turned out to be the most useful thing in the study.

:::aside
TL;DR — Trained on national crop statistics alone, no model beat naive persistence — the trivial baseline of just carrying forward last year's yield. Adding free satellite climate data reversed it completely: a climate-only XGBoost model cut forecast error by a third (RMSE 284 vs 428 kg/ha). The dominant predictor is May–June rainfall — which means the harvest is partly knowable months before it happens, using data that costs nothing. Paper · Code:::

The question nobody had asked

There is a lot of published work on crop-yield prediction. Almost all of it assumes the kind of data a rich agricultural economy has: field-level sensors, farm surveys, high-resolution yield maps, decades of clean records.

Sierra Leone does not have that. Most countries don't.

So the interesting question isn't the one the literature keeps answering. It's this: with the data a data-constrained country genuinely possesses, is forecasting possible at all — or is it a fantasy we tell donors?

That question has a policy consequence attached. Feed Salone is a real national strategy with real money behind it. If yields can be anticipated, you can pre-position rice imports, target fertiliser, and warn people. If they can't, you're planning blind and should say so.

How I set it up (and why the baseline matters)

Twenty-five years of FAOSTAT production data (2000–2024), nine major crops. Three ensemble algorithms — XGBoost, Gradient Boosting, Random Forest.

The methodology is where most yield-prediction papers quietly fall apart, so I want to be explicit about it:

  • Lagged predictors only. Nothing from the harvest year itself. If your model uses information it couldn't have had at prediction time, you haven't built a forecaster — you've built a very expensive way of reading the answer.
  • Expanding-window walk-forward evaluation across seven held-out years (2018–2024). Train on the past, predict the next year, move forward. The way it would actually be used.
  • Benchmarked against naive persistence — just carry forward last year's yield.

That last one is the honest baseline almost nobody reports. It's trivially simple and it is shockingly hard to beat, because yields are autocorrelated. If your fancy gradient-boosted model can't beat "assume it'll be like last year," it has learned nothing.

The first result: no

No model trained on crop statistics alone outperformed naive persistence.

Not XGBoost. Not Gradient Boosting. Not Random Forest.

That's a null result, and I could have quietly not published it. But it's the finding a policymaker most needs, because it says something concrete: the production statistics Sierra Leone already collects do not contain enough signal to forecast next year's harvest. More modelling won't fix that. It's not a modelling problem. It's a data problem.

:::warning
This is the moment where most projects go wrong. Faced with "the model doesn't beat the baseline," the temptation is to tune harder, add features, try a bigger architecture, and eventually to leak a little future information into the training set until the numbers look good.

That's how you get a paper. It's also how you get a system that fails the first year someone actually depends on it — in a country where the failure means people don't eat.

If you can't beat persistence, say so, and go find better data.:::

The second result: yes — with free satellite data

So I went and found better data. Not expensive data. Free data:

  • CHIRPS — satellite rainfall estimates
  • NASA POWER — temperature

Both are freely available, globally, to anyone. I aggregated them into national growing-season features and re-ran everything.

It reversed the result completely.

ModelRMSE (kg/ha)Naive persistence (baseline)428Climate-only XGBoost284

A third less error. And this wasn't a fragile fluke of one model — the gain held for a simple linear model too, and it survived excluding the anomalous 2018 season. When a result holds across model classes and after you remove your weirdest year, you start to believe it.

The finding that actually matters

Here is the part with real-world consequences:

Early-season rainfall — May and June — is the dominant predictor.

Sierra Leone's rice harvest is substantially foreseeable from rain that falls months before it.

That is not an academic curiosity. It means a warning is possible. It means that by early July, using freely available satellite data and a model that runs on a laptop, you can form a defensible view of whether the harvest is heading for trouble — with enough lead time to import, to distribute, to prepare.

The alternative — the current situation — is finding out at harvest.

Where the model fails, and why that's informative too

I want to be precise about the limits, because a forecast that oversells itself is worse than none.

The model did not anticipate the 2018 yield collapse. It simply missed it.

But why it missed is the interesting part: 2018's collapse was institutional, not climatic. The rain was not the problem. The model, which only knows about weather, could not have seen it — and its blindness is diagnostic. When a climate model fails to explain a bad year, that is itself evidence that the cause was not the climate. Look at the institutions instead.

The mirror image shows up too: 2020–2022 produced record yields despite below-average rainfall — consistent with gains from inputs and policy programs, not weather.

So the honest summary of what this model is: a weather-driven early warning system, not an oracle. It tells you when the sky is the risk. When it's wrong, that's a signal the risk is somewhere else — and that's still useful information.

Why this generalises

Sierra Leone is not a special case. It's a representative one.

Dozens of countries have exactly this profile: agriculture-dependent, thin national statistics, no field sensors, no yield maps — and a food-security strategy that needs forecasts anyway.

The result here says something portable to all of them:

  1. Your existing crop statistics are probably not enough. Test against persistence and find out before you build anything.
  2. The satellite data that fixes it is free, global, and already collecting. CHIRPS and NASA POWER cover your country right now, whether or not anyone uses them.
  3. The model doesn't need to be exotic. Gradient boosting on national growing-season features. It runs on a laptop.

The barrier was never compute or algorithms. It was that nobody had done it.

Key takeaways

  1. No model beat naive persistence using crop statistics alone. Always report that baseline. Most papers don't.
  2. Free satellite climate data (CHIRPS, NASA POWER) cut forecast error by a third — RMSE 284 vs 428 kg/ha.
  3. May–June rainfall is the dominant predictor — the harvest is partly knowable months ahead, which makes early warning genuinely possible.
  4. The model missed 2018 because that collapse was institutional, not climatic. A climate model's failure is evidence about where the cause isn't.
  5. This method transfers to any data-constrained agricultural economy. The data is free and already there.

The paper is open on arXiv and the full code is on GitHub. If you work in agriculture or food policy in a country like mine — take it, run it on your own FAOSTAT series, and tell me what you find. That's the point.

Which country should this be run on next? 👇


Ibrahim Denis Fofanah, Seidenberg School of Computer Science & Information Systems, Pace University, and Rise Africa Foundation for STEM and Innovation, Sierra Leone. Full paper: arXiv

.13959.

Share

Found this useful? Passing it on to someone who builds is the best way to help the publication grow.