Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Locating, classifying and counting individual objects in geospatial imagery

1. Context

In the previous lesson, you used Image Recognition to assign a label to an entire image or image chip. This works well when your question is about the overall scene: What type of land use does this tile represent? or Does this image contain a particular feature?

Many spatial questions require more detail. You may want to know how many trees are in a park, where individual ships are located in a harbor, or which rooftops contain solar panels. One label for the whole image is no longer enough.

Object Detection addresses this problem by predicting a variable number of individual objects. Each prediction normally contains:

Detection therefore adds object-level location to image recognition.

Looking ahead, L07 covers semantic segmentation, which labels every pixel but cannot tell two touching objects of the same class apart. L08 combines both ideas into instance segmentation. Object detection sits conceptually between the two: it localizes individual objects without needing to trace their exact outlines.


2. Motivation

Object detection is particularly useful when your research question concerns discrete and countable features.

Examples include:

For an SDS320 project, the important question is not simply whether object detection is technically possible. You need to decide whether its outputs match your research question.

A rectangular bounding box may be perfectly adequate if you need locations and counts. It may be insufficient if your analysis depends on exact area, shape or boundaries.

Detection also introduces several project decisions that did not occur in the same form during image recognition. You need suitable Training Data with object-level annotations, must consider object size relative to Spatial Resolution, and need evaluation metrics that assess both classification and localization.


3. Learning objectives

By the end of this lesson, you should be able to:


4. Lesson roadmap

Work through the lesson in the following sequence:

  1. When to use detection — decide whether bounding-box predictions actually answer your research question.

  2. Detection concepts — understand boxes, confidence scores, IoU, Non-Maximum Suppression and anchor boxes.

  3. Detector architectures — compare two-stage, single-stage, transformer-based and zero-shot approaches.

  4. Detection data — examine annotation formats and prepare the NWPU-VHR-10 benchmark dataset.

  5. Train a detector — train a multi-class Faster R-CNN model with geoai.

  6. Evaluate detections — interpret precision, recall, AP and mAP at different overlap thresholds.

  7. Inference — apply the trained model, visualise predictions and inspect errors.

  8. Project transfer — decide how, or whether, object detection belongs in your own project.

Pages 1–4 build the conceptual and data foundation. Page 5 is the main hands-on workflow. Pages 6–7 close the loop by evaluating and applying the trained model. Page 8 asks you to transfer all of it to your own project.

The red thread is:

Is detection the right task?
        ↓
How are objects represented?
        ↓
Which detector should I start with?
        ↓
Are my annotations suitable?
        ↓
Can I train a reproducible baseline?
        ↓
How well does it work?
        ↓
What happens on new imagery?
        ↓
Does this workflow fit my project?

5. Project framing

While reading, keep your own project in mind.

Ask yourself:

  1. What exactly is one object?
    Can you define a target consistently enough that two people would annotate approximately the same objects?

  2. Are the objects visible at your image resolution?
    A detector cannot recover reliable object information that is not represented clearly in the input imagery.

  3. Do you need boxes or boundaries?
    If location and count are sufficient, detection may be appropriate. If shape or area matters, instance segmentation may be a better fit.

  4. How would you know whether your detector is good enough?
    Your Evaluation Metric and acceptable error rates should follow from the project question rather than from a benchmark alone.


6. Before class

Before the practical part of the lesson:

Optional background:


7. After this lesson

By the end of the lesson, you should have more than a trained example model.

For your own project, you should be able to state: