---
title: "Label images for machine learning"
description: "Step through an image set, draw labelled boxes around what you find, and track which images you have reviewed."
---

# Label images for machine learning

Labelling turns an image set into training data for an object detection model.
You step through the photos and draw a box around each thing you want the model
to learn to find, such as a caterpillar on a canola pod. When you have labelled
enough images, you [export your labels](https://www.droidmap.com/docs/exporting-image-labels) for your
training tool.

![Opening the labelling page, then zooming in to draw a box around a caterpillar, a hole in a pod and a beneficial insect](https://www.droidmap.com/docs/labelling-images/demo.webp)

## Before you start

You need an **asset set** with JPEG or PNG photos in it. If you don't have one
yet, see [Upload your imagery](https://www.droidmap.com/docs/uploading-imagery).

To draw boxes, you need permission to edit assets in the project. Without it you
can still step through the images and see the boxes, but you can't change them.

## 1. Open the labelling page

Open the project, go to **Asset Sets**, and open the asset set. Then click
**Label for ML** at the right-hand end of the **Imagery** heading.

![An asset set page, with the Label for ML button at the end of the Imagery heading](https://www.droidmap.com/docs/labelling-images/asset-set.webp)

The button isn't shown on the outputs of a mapping job, because those are maps
and models rather than source photos.

The page shows the photo in the middle, your labels on the right and a strip of
every image along the bottom.

![The labelling page for a new set, with no labels yet and the New label box ready to type in](https://www.droidmap.com/docs/labelling-images/empty.webp)

## 2. Add a label

A label is the name of what you are marking, such as *Heliothis* or *Hole*.
Type it in the **New label** box, then click **Add** or press **Enter**. The
label becomes the current one, shown next to **Drawing:** above the box.

Choose your label names carefully, because they become the class names your
model learns. They must match exactly, so *Hole* and *hole* count as two
different labels.

## 3. Draw a box

Drag on the photo from one corner of the object to the opposite corner. A dashed
outline follows your pointer, and the box is saved as soon as you let go. There
is no save button.

![A dashed box being dragged around a caterpillar on a canola plant](https://www.droidmap.com/docs/labelling-images/drawing.webp)

Draw the box as tightly around the object as you can, on every image. Consistent
boxes train a better model.

**For small objects, zoom in first.** Very short drags are ignored, so that a
stray click doesn't create a box, and a tiny object can fall under that limit
when the whole photo is showing.

- **Zoom:** use the mouse wheel. The photo zooms around your pointer.
- **Pan:** hold the middle mouse button and drag, or hold **Space** and drag.

## 4. Label everything on the image

An image can have as many labels as it needs, up to 500 boxes. To change label,
click another chip under **Labels** or press its number key. Each chip shows the
number of boxes with that label across the whole set, followed by its number key.

![A photo zoomed in with a Heliothis box, a Hole box and a Beneficial box, and the Labels and On this image lists beside it](https://www.droidmap.com/docs/labelling-images/all-labels.webp)

If an image has several objects, box **all of them**. A model treats anything
you leave unboxed in a labelled image as background, so a missed caterpillar
teaches it that caterpillars aren't worth finding.

## 5. Fix a box

Click a box to select it, or click its row under **On this image**. Handles
appear around a selected box.

![A selected Heliothis box around a caterpillar, zoomed in, with handles on its corners and edges](https://www.droidmap.com/docs/labelling-images/zoomed.webp)

With a box selected, you can:

- **Move it:** drag the box.
- **Resize it:** drag one of its handles.
- **Change its label:** click another chip or press its number key.
- **Delete it:** press **Delete** or **Backspace**, or click the bin icon on its
  row. This happens straight away, with no confirmation, and can't be undone.

Press **Escape** or click an empty part of the photo to deselect it.

> **Tip:** dragging from inside an existing box moves that box. To draw a new box
> that overlaps it, start dragging from outside it.

## 6. Mark images with nothing in them

If an image has nothing to label, click **No objects here** or press **N**. This
counts the image as reviewed and takes you to the next unreviewed one.

![An image marked as having no objects, with an Undo no objects button in the sidebar](https://www.droidmap.com/docs/labelling-images/no-objects.webp)

These marks matter. Images with nothing in them teach a model what to ignore, and
an unmarked image is left out of your export because nobody has confirmed it is
empty.

Made a mistake? Go back to the image and click **Undo no objects**. If you draw a
box on a marked image, the mark is removed for you.

## 7. Move through the set

- **Next or previous image:** use the arrow buttons at the top, or the **←** and
  **→** keys, or **A** and **D**.
- **Next image still to do:** click **Next unreviewed** or press **U**.
- **Any image:** click it in the strip along the bottom.

An image counts as **reviewed** once it has a box or a *no objects* mark. The
count at the top shows your progress, and a dot on each thumbnail shows its
state: blue if it has boxes, grey if it is marked as having no objects.

![A set partly reviewed, with 10 of 13 reviewed at the top and dots on the reviewed thumbnails](https://www.droidmap.com/docs/labelling-images/resume.webp)

You can leave at any time. Your work is already saved, and the page reopens on
the first image you haven't reviewed.

## Change a label's colour

Click the **coloured dot** on a label's chip, then pick a colour, or click the
eyedropper to choose any colour. This doesn't change your current label or the
box you have selected.

![The colour picker open under the Beneficial label](https://www.droidmap.com/docs/labelling-images/colour-picker.webp)

Colours are only there to make the boxes easier for you to see. They are saved in
your browser for that asset set, so other people and your other devices see the
default colours, and they aren't included in an export.

## Keyboard shortcuts

- **1** to **9:** choose a label, or relabel the selected box
- **←** and **→**, or **A** and **D:** previous and next image
- **U:** next unreviewed image
- **N:** mark as having no objects and move on
- **Delete** or **Backspace:** delete the selected box
- **Escape:** deselect the box
- **Mouse wheel:** zoom
- **Middle-drag** or **Space** and drag: pan

## Where your labels are saved

Labels are saved to DroidMap with the images in the asset set, so they are there
on any device. Everyone with access to the project works on the same labels. If
a colleague is labelling at the same time, reopen the page to see their boxes.

If you delete an image, its boxes are deleted with it.

## Troubleshooting

**A photo appears sideways.** Some cameras, phones especially, store a photo one
way up with a note saying how to rotate it. The labelling page shows the photo as
it is stored, because that is the frame your exported boxes are measured in. Label
it as shown, and see
[what to do in your training tool](https://www.droidmap.com/docs/exporting-image-labels#troubleshooting).

**Dragging on the photo puts the cursor in the New label box.** You haven't got a
label yet. Add one first.

**A label has disappeared.** A label you added but haven't drawn with is
forgotten when you leave the page, and so is one whose boxes have all been
deleted. Add it again, spelled the same way.

**The page says *Your last change could not be saved*.** Check your connection and
reload the page. Then check the image, because the last edit you made may not be
there.

**The page says the set has no JPEG or PNG images to label.** Labelling only works
on those two formats. Other files in the set are ignored.
