All ideas

Weed maps, one square metre at a time

We split a low-altitude drone photo into 1 m squares, asked an image model to assess the weeds in each one, and turned the results into a spray map. Scoring the whole photo cost less than a penny.

A drone photo of young winter wheat seen from 10 m, with a weed density map over it. Red and orange bands across the top and right show where volunteer oilseed rape is thickest; green bands lower down show clean wheat. Thin white contour lines separate the bands. A divider can be dragged to show the plain photo instead.
Drag the divider to compare.

Weeds come in patches

Weeds are rarely spread evenly across a field. They tend to be concentrated in particular areas: along headlands, in hollows or where the previous crop shed seed.

But most herbicides are still applied across the whole field because we do not have an accurate map of where the weeds are.

Volunteer oilseed rape is a good example. In wheat following rape, some parts of the field can contain large numbers of volunteers while others contain almost none.

A weed map shows where those patches are. A compatible sprayer can then switch sections of the boom on and off as it crosses the field.

The difficult part is producing the map.

We tried doing that from a drone image. We split the image into one-metre squares and used an image model to assess each square individually.

One photo is split into squares, each square is scored, the scores are turned into a map, and a spray threshold is applied.

The photo

The field is winter wheat drilled after oilseed rape. In mid-October, the wheat was at the one to three leaf stage and volunteer rape was emerging, with some areas much denser than others.

We flew a small consumer drone, a DJI Mini 5 Pro, 10 m above the crop.

At this height, each pixel in a 12-megapixel photo represents about 3.5 mm on the ground. One photo covers roughly 14.4 m by 10.8 m.

That gives enough detail to distinguish individual seedlings.

Looking straight down on young winter wheat in drill rows. The top half and the right-hand side are covered in bright green, round-leaved oilseed rape seedlings; the bottom left is clean wheat with bare soil between the rows.
The photo used in the test, taken from 10 m. Dense rape is visible across the top and down the right-hand side, with cleaner wheat in the bottom left.

Why not just count green pixels?

A simple way to detect weeds in drone images is to count green pixels.

Before the crop emerges, this works reasonably well because most green vegetation is likely to be a weed.

Once the crop is growing, it becomes much less useful. Wheat and weeds are both green.

We applied a simple green-pixel rule to three squares from the image.

The squarePixels counted as green

Clean wheatno weeds

A one-metre square of clean wheat: thin green leaves in rows over brown soil.
The same square with only green pixels shown: most of the wheat leaves light up.73%

A few weedsa handful of rape seedlings

A one-metre square of wheat with a few small round-leaved rape seedlings and more bare soil.
The same square with only green pixels shown: the wheat and the rape light up alike.59%

Dense weedsrape covering the ground

A one-metre square almost covered in round-leaved oilseed rape seedlings, with wheat leaves showing through.
The same square with only green pixels shown: nearly everything lights up.92%
Three squares beside the pixels a simple green-pixel rule counts as green.

The square containing a few weeds actually has less green than the clean square because it contains more bare soil.

Colour alone cannot reliably separate wheat from volunteer rape.

Shape is more useful. Wheat leaves are narrow and grass-like, while young oilseed rape has broader, rounder leaves.

That is the distinction we asked the image model to make.

Step by step

Drone takes the photos Code runs the same way every time AI looks at each square Person decides

  1. 1 · Fly low10 m above the crop
  2. 2 · Splitinto 1 m squares
  3. 3 · Askeight questions per square
  4. 4 · Mapturn the scores into a map
  5. 5 · Choosewhere to spray
  6. 6 · Sendthe map to the sprayer
Six steps from a photo to a spray map.

1 · Fly low

The model we used requires each image to be at least 256 pixels on each side.

That sets a practical limit on flight height.

A one-metre square seen from 10 m: individual rape and wheat leaves are sharp.

10 m284 px

Enough
The same square as it would look from 20 m: leaves are softer but still visible.

20 m142 px

Under 256
The same square from 40 m: blocky, with leaves no longer distinct.

40 m71 px

Under 256
The same square from 60 m: a few large blocks of green and brown.

60 m47 px

Under 256
A one-metre square as seen by the drone from different heights. Below 256 pixels Jev will not accept the image.

At 10 m, a one-metre square is about 284 pixels wide, which is enough for the model.

At a more typical whole-field mapping height of around 60 m, the same square is only 47 pixels wide. That is too small for this model and too coarse to show individual seedlings clearly.

So for one-metre squares, the drone needs to fly at about 10 m.

Two-metre squares could be used from around 20 m. The camera’s 50-megapixel mode would approximately double those heights.

2 · Split into squares

The image is divided into complete one-metre squares.

In this photo there are 14 columns and 10 rows, giving 140 squares in total.

Each square is a separate image, 284 pixels wide.

The drone photo with a white grid of 14 by 10 squares drawn over it.
The 140 one-metre squares. The narrow strip around the edge is excluded because it does not contain complete squares.

3 · Ask Jev

The model we used is Jev, a decision model made by TypeSafe. We accessed it through OpenRouter.

Unlike a chatbot, Jev does not return a written answer. It returns probabilities.

We can ask three types of question:

  • Yes or no: the probability that the answer is yes.
  • Choice: the probability of each possible option.
  • Score: the probability of each level on a scale we define.

That makes the output easy to process automatically.

Every square received the same description of the field: winter wheat in Scotland in mid-October, drilled at 12.5 cm row spacing, at the one to three leaf stage, following oilseed rape.

Each square was then asked the same eight questions.

The dense one-metre square: rape seedlings covering most of the ground.

One square, 1 m × 1 m
Answered in 0.4 seconds
Cost: 0.004p

  1. Choice

    What does most of the square show?

    Crop 91%
  2. Yes / no

    Are the wheat's drill rows visible?

    24%
  3. Score 0–3

    How much of the soil does the wheat cover?

    1.5 thin to established
  4. Yes / no

    Are there broad-leaved plants?

    96%
  5. Score 0–4

    How many broad-leaved plants are there?

    3.05 a dense patch
  6. Yes / no

    Are any of them oilseed rape?

    89%
  7. Yes / no

    Are there other broad-leaved weeds?

    49%
  8. Yes / no

    Are there grass weeds between the rows?

    60%
Jev's answers for one square from a dense patch.

All 140 squares were processed six at a time. The complete set of answers came back in about 15 seconds.

The photo partway through scoring: some squares are tinted green, yellow or orange by their answer, some are outlined in white while waiting, and the rest are untouched.
Partway through processing. Outlined squares are waiting for a result; tinted squares have been scored.

4 · Read the answers

One of the questions was simply whether broad-leaved weeds were present.

This was useful for separating clean from weedy ground, but not for measuring weed density.

On every square scoring 1.5 or more, Jev gave a 91–98% probability that broad-leaved weeds were present. It gave a similar answer whether there were a few seedlings or a dense patch.

The 0–4 density score was much more useful.

The clean wheat square.
  1. 0 None76%
  2. 1 A few18%
  3. 2 Scattered5%
  4. 3 Dense patch1%
  5. 4 Covered0%

0.3 No spray

The square with a few rape seedlings.
  1. 0 None0%
  2. 1 A few49%
  3. 2 Scattered46%
  4. 3 Dense patch5%
  5. 4 Covered0%

1.6 No spray

The dense square.
  1. 0 None0%
  2. 1 A few0%
  3. 2 Scattered8%
  4. 3 Dense patch78%
  5. 4 Covered14%

3.1 Spray

Jev's probability for each density level, with the weighted score calculated from those probabilities.

The scores increase in the expected order from clean ground to dense weeds.

Not every question worked.

Young wheat is itself a grass, so the question about grass weeds returned probabilities between 42% and 73% even on squares without grass weeds.

Jev also struggled to identify drill rows reliably.

Those questions would need to be reworked before they were useful.

5 · Turn the scores into a map

Each square’s score is placed at the centre of that square.

The scores are then interpolated into a continuous surface, with contour lines showing changes in weed density.

The final step is to choose a spray threshold.

For this test we used a score of 2, representing many seedlings scattered across the square.

Anything scoring 2 or above is included in the spray zone. Anything below 2 is left untreated.

  1. The photo with each square tinted by its score, from green for clean to orange for dense.Scoresone per square, 0 to 4
  2. The scores smoothed into bands of colour with contour lines between them.Weed densitysmoothed, contours every 10%
  3. The photo split in two by a curved white line: red above, to be sprayed, and green below, to be left.Spray mapscore 2 or more
Scores per square → smoothed weed-density map → spray map. In this image, 62 of the 140 squares scored 2 or more and the spray zone covers 44% of the ground.

The threshold should remain a management decision.

A higher threshold reduces the area sprayed but leaves more weeds untreated. A lower threshold sprays more of the field.

The map simply gives us the information needed to make that decision.

6 · Send it to the sprayer

Our sprayer can already apply from a prescription map.

GPS position is used to switch sections of the boom on and off as the machine crosses the field.

The weed map can therefore define the areas where the nozzles should be on.

That is the next stage of the project.

So far, we have only tested this on a single photograph. We have not yet mapped a whole field or sprayed from one of these maps.

What it costs

to score all 140 squares in the photo
0.6p
median time to answer one square
0.4 s
per hectare using 1 m squares
42p
per hectare using 2 m squares
15p

Jev is charged in US dollars. These figures use an exchange rate of $1.33 to the pound.

A hectare contains 10,000 one-metre squares, so the per-hectare figure assumes each square is scored once.

For a whole field, the photographs would first need to be stitched into a single map so overlapping areas are not scored more than once.

Flying time is additional, and at a 10 m flight height it is likely to be the larger cost.

Why weed maps are useful

Less chemical, less water and fewer fills

Consider 100 ha of winter wheat being treated for the same weed.

For illustration, assume:

  • herbicide costs £25/ha
  • water volume is 200 L/ha
  • sprayer capacity is 4,000 L
  • weeds requiring treatment cover 30% of the area

These are example figures rather than results from our own farm. The calculator below lets you change them.

Herbicide

Blanket spray£2,500
From the maps£750

Water

Blanket spray20,000 L
From the maps6,000 L

Tank fills

Blanket spray5
From the maps2

The maps save £1,750 of herbicide, 14,000 litres of water and 3 tank fills. Scoring all 100 ha using 1 m squares costs about £42 in model fees, plus flying.

Example figures: change them to model your own. Tank fills are the total water divided by the tank size, rounded up; in practice, part-loads at the end of each field add a few more.

The reduction in chemical is obvious, but water and filling time also matter.

The sprayer still has to travel along the tramlines to reach the weed patches. But using less product means fewer trips back to refill.

During a short spraying window, that can increase the amount of ground covered in a day.

Less unnecessary application

Applying herbicide only where it is needed reduces the total amount used.

That means less product is applied near ditches and watercourses, and larger areas of the field are left untreated.

It also reduces the amount of water that has to be transported to the sprayer.

Targeted spraying fits well with integrated pest management: treat the problem where it exists rather than treating the whole field by default.

Not just weeds

The same method could be used for more than weed mapping.

Jev simply answers the questions it is given. By changing those questions, the same type of drone imagery could potentially be used to assess other crop and field conditions.

One drone flight at the bottom, with six map layers stacked above it: weeds, disease, wet ground, compaction, drought stress and crop establishment.
  1. WeedsBroad-leaved weeds, scored 0–4
  2. DiseaseLeaf spotting and patches
  3. Wet groundStanding water, poor drainage
  4. CompactionHeadlands, gateways, wheelings
  5. Drought stressWilting, early colour change
  6. EstablishmentThin and gappy crop
  7. Drone photosOne low flight
One flight, multiple possible layers. The weed layer is the real map from this photo; the others are examples.
  • Disease pressureAre there spots, stripes or pustules on the leaves? How much leaf area is affected?Would need a lower flight or higher-resolution imagery.
  • DrainageIs there standing water? Is the crop yellow or missing in low areas?Most useful after heavy rain.
  • CompactionIs the crop thinner or shorter along wheelings, headlands or gateways?
  • Drought stressAre leaves rolling or wilting? Is the crop changing colour early?
  • EstablishmentHow evenly has the crop emerged? Where are there gaps in the rows?
  • WeedsHow many broad-leaved weeds are present, and are they oilseed rape?

Each layer could be useful on its own.

Repeated through the season and across several years, they could also create a detailed spatial record of crop performance.

Combined with yield maps, soil tests and other field data, that could help explain why different parts of a field perform differently.

What is still to do

This test used one photograph taken on one afternoon.

Before this becomes a practical field-scale system, several things still need to be done.

  • Map a whole field. Fly the field, stitch the images into one map, divide it into a fixed grid and score each square once.
  • Cover ground faster. At 10 m, one image covers about 150 m². Two-metre squares, 50-megapixel images or a model that accepts smaller inputs could increase working height and reduce the number of photographs needed.
  • Validate the results. The scores look sensible on this image, but that is not enough. We need to manually assess several hundred squares and measure how often Jev agrees.
  • Improve the questions. In particular, the grass-weed and drill-row questions need more work. Different weeds will also need their own descriptions.

Jev’s image input is new, and this is an early test of using it for crop mapping.

But on this photograph it scored all 140 square metres in about 15 seconds for less than a penny.

The model cost is already very small.

The bigger challenge is now collecting enough high-resolution imagery efficiently.