Amos Bunde

Home / Projects / Research study

How much does a random split overstate crop-map accuracy?

The same models, the same fields and the same satellite images, scored three ways. Only the choice of which fields to hold out changes. A study of 3,286 smallholder fields in Busia County, western Kenya, run against a plan written before the full experiment.

Independent research Sentinel-2 time series PyTorch PostGIS D3 November 2026

A crop map is used where nobody collected labels. It is usually tested on a random sample of labelled fields, most of which have labelled neighbours a few dozen metres away. I measured how much that flatters the result.

Temporal CNN, seven crop classes. Macro-F1 averages the F1 score over classes, so rare crops count as much as maize. Scores are low in absolute terms: this is a hard task, and the subject here is the gap between the columns.

The answer

The better of two models scores a macro-F1 of 0.29 on a random sample of fields, 0.25 when whole 2 km blocks are held out, and 0.21 when a whole image tile is held out. The random split overstates performance in a new area by 0.08 (95% interval 0.065 to 0.100), more than a quarter of the headline score.

Dots are the mean of five seeds. Bars are 95% intervals from resampling 2 km blocks, which keeps neighbouring errors together. The grey tick is a model that always answers maize.

Overall accuracy hides this. It moves by less than two points across the three designs and sits close to the 44.5% from always answering maize. The loss is in the minority crops: recall on common bean falls from 15% on random fields to under 1% on a held-out tile. Away from its training area, the model falls back on maize and cassava.

Where the errors are

Every labelled field, placed with coordinates I recovered for this study. Switch the test design to see which fields the model gets wrong.

Grey squares are the 2 km blocks that contain labels. Field positions are accurate to a few metres.

What I expected and did not find

I wrote down four hypotheses before the full run. One of them was wrong. I expected scores to keep falling as the gap between training and test fields widened. They barely move.

Solid lines enforce a gap. Dotted lines are the control: the same number of training fields, chosen at random, with no gap. Where the two run together, the smaller training set explains the change and distance does not.

Once training-set size is controlled, a gap of up to 1 km costs nothing measurable for either model. The leak in a random split is very local, and two independent measurements agree. In PostGIS, the median distance from a labelled field to its nearest labelled neighbour is 60 m, and 38.5% of fields grow the same crop as that neighbour against 29.0% expected by chance. And in the imagery itself, likeness between fields fades within a few hundred metres:

Empirical semivariogram of field-mean NDVI on the greenest date, from 400,000 random field pairs. Fields 250 m apart show 79% of the overall variance; by 750 m it is 90%.

Holding out a 2 km block already removes those neighbours, so a further gap adds little. The larger drop from block to tile is a change of place, not of distance.

The four hypotheses

The dataset had no coordinates

The CV4A Kenya Crop Type rasters are published without a coordinate system, which rules out any spatial analysis as shipped. I restored them from two measurements.

The three matches agree to within 2.6 m, under a third of a pixel, and the recovered fields land in Busia County as the documentation says. One command reproduces the check.

How it was done

The numbers

Limits

Data: CV4A Kenya Crop Type Competition, PlantVillage and Radiant Earth Foundation (doi:10.34911/rdnt.dw605x). Charts drawn with D3.