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.

Delineating individual objects into measurable spatial features

1. Context

In L06 you trained an object detection model that draws a box around each discrete object. In L07 you trained a semantic segmentation model that labels every pixel with a class, but treats all pixels of the same class as one undifferentiated region. This lesson combines both ideas: instance segmentation detects each object individually and traces its precise pixel-level boundary, so two neighboring fields, buildings, or tree crowns each get their own separate mask, even though they share the same class.

This is the last of the three “detect and delineate” lessons in the course. Everything you learned about bounding boxes and confidence scores in L06, and about encoder-decoder masks in L07, comes together directly in Mask R-CNN, the architecture this lesson uses.


2. Motivation

Many geospatial questions genuinely need object-level answers, not just class-level ones. Agricultural analysts need individual field parcels to estimate yield or verify subsidy claims; the European Union’s Common Agricultural Policy, for example, requires accurate per-field information across millions of parcels, at a scale where manual digitization is not realistic. Urban planners need individual building footprints, not just a “built-up” class. Disaster response teams need to count and locate individual damaged structures, not just a “damage” region.

In each case, semantic segmentation alone would under-deliver: it can tell you “this area is field,” but not how many fields, where each one starts and ends, or how its shape has changed since last season. Instance segmentation is what turns a thematic class map into a countable, measurable, trackable set of discrete features, ready to be joined, filtered, and analyzed as records in a GIS. In simple terms, instance segmentation is useful when an object’s boundary and identity both matter.


3. Learning objectives

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


4. Lesson roadmap

  1. When instance segmentation fits — how this task differs from detection and semantic segmentation, and when the extra complexity is worth it.

  2. Instances and object identity — instance IDs, per-object masks, and how instance labels differ from class labels.

  3. Mask R-CNN architecture — backbone, Region Proposal Network, detection head, mask head, and why RoI Align matters.

  4. The FTW dataset — the Fields of the World benchmark, its Sentinel-2 chips, and preparing data for training.

  5. Training Mask R-CNN — the main hands-on workflow: training a field-boundary detector with geoai.

  6. Inference and raw predictions — sliding-window inference and reading the instance, class, and score outputs.

  7. Cleaning and vectorizing — post-processing raw masks into clean, GIS-ready polygons with geometric properties.

  8. Batch processing & project transfer — scaling inference to many images, and applying this lesson to your own project.

Pages 1–2 build the conceptual foundation, page 3 covers the architecture, page 4 prepares the data, page 5 is the main training workflow, and pages 6–7 apply and refine the model’s output. Page 8 scales up and transfers everything to your project.


5. Project framing

While reading this lesson, keep your own project in mind and consider:


6. Before class


7. After this lesson

After working through this lesson, you should have: