AI Segmentation
QGIS
Tutorial

AI Segmentation for QGIS: The Complete Guide

A residential neighborhood before and after automatic building detection (after)
A residential neighborhood before and after automatic building detection (before)
ImageryDetected
Drag to compare
A whole residential neighborhood, detected in one pass (Hauts-de-Seine, France, on Google Satellite imagery). Drag the handle to compare.

AI Segmentation turns the imagery you already have open in QGIS into clean vector layers. It works two ways. First, Automatic mode, where you draw a zone, name the object, and get every instance at once (building footprints, parcels, trees, roads, solar panels): it runs in the cloud, no GPU on your machine. Then Manual mode, a semi-automatic model that runs locally on your computer, unlimited: you click one object and the AI outlines it. The image above is a single Automatic run, and this guide walks through it live in QGIS, setting by setting.

Install and activate

In QGIS, open Plugins -> Manage and Install Plugins, search for AI Segmentation, and install. Then sign in from the panel (a browser tab, about 15 seconds) and both modes are ready.

AI Segmentation panel with the Manual/Automatic switch, ready to start
Pick your imagery layer and launch.

Your first detection

Goal: extract every building footprint of the residential neighborhood above. One run, start to finish.

Draw your zone

Click Start Automatic AI Segmentation, then click around the area on the map and close the loop. Crisp, well-contrasted imagery gives the cleanest polygons.

The zone drawn point by point, then closed.

Name the object

Type the object (here building), or pick it in the Library of ready-made objects with previews.

The setup step: object set to building, example card

Show an example (optional)

One word is not always enough. Draw an example hands the AI a sample from your own imagery (same sensor, season, and resolution): outline one object, the AI looks for its look-alikes. Exclude a look-alike does the opposite: outline a false positive to tell the AI "not this". A few examples plus a name is usually the strongest combination, and examples alone work when the object has no good name.

Draw an example, then exclude a look-alike: the reference chips update in the panel.

Set the Detail

The Detail slider splits your zone into a grid of 1024 px tiles, each detected at full resolution and stitched back into one seamless layer, so objects crossing a seam are merged. Finer detail cuts smaller tiles and finds smaller objects; the tile count updates live (here 9 tiles). There is no size limit on the zone.

Live tile grid preview over the zone

Detect

Click Detect objects. The zone is processed tile by tile and results draw live on the map. This run found 951 candidate objects.

Detection in progress, tile 1 of 9

Partial results drawing live during the run

Review

Detection opens a review, not an export. Everything below is instant and needs no re-run: you filter and reshape the detections until the layer looks right. The next section goes through each control.

The review panel: count, display colors, confidence histogram

Export

Click Export polygons. You get a styled GeoPackage layer with a GIS-ready schema: class, score, area_m2, perimeter_m. Here, 335 building footprints.

Exported GeoPackage layer with 335 building footprints

Attribute table with class, score, area_m2 and perimeter_m columns

The review controls, explained

Confidence

Every detection carries a score: how sure the AI is that this polygon really is your object. The run returns everything plausible, and the Confidence slider sets the minimum score to keep: drag toward More objects to reveal weaker detections, toward Only confident to keep only the strongest. The histogram above the slider shows how many objects sit at each level, and the count updates live. The same run, swept live between More objects and Only confident:

Drag the Confidence slider and the layer and count update instantly.

Dense, repetitive objects like these roofs score modestly, so starting low and pruning up usually beats the reverse. Objects you fixed by hand are always kept, whatever the confidence.

Display colors

Four ways to look at the same detections, each answering a different question. Random (one color per object) checks that neighbors are separated. Outline checks boundaries against the imagery. Confidence shows where the AI is sure (yellow) or hesitant (purple), which tells you where to point the confidence slider. Normal is a single clean color. Visual only, the geometry never changes.

The four display modes side by side: Random, Outline, Confidence, Normal
Same detections, four readings: Random to separate neighbors, Outline to check boundaries, Confidence to spot hesitations, Normal to see the layer.

Refine detections

The Refine detections section reshapes every polygon at once, instantly:

Refine detections panel with shape, size and outline controls
Shape, size and outline controls, applied live to the whole layer.
  • Right angles snaps edges to 90 degrees, for man-made shapes like buildings, pools and solar panels.
  • Round corners softens outlines, for natural shapes like trees and bushes.
  • Fill holes closes interior gaps in each polygon.
  • Min / Max size hides detections outside a ground-area range, the fastest way to drop tiny noise blobs.
  • Simplify outline, Clean edges and Expand/Contract fine-tune the outline itself.

The same trick on anything

Automatic mode is one input away from a completely different job: change the word, get another layer. Farm parcels over 5 km²:

Farm parcels before and after automatic detection (after)
Farm parcels before and after automatic detection (before)
ImageryDetected
Drag to compare
Prompt: farm field. About 250 parcels over 5 km2, one run.

Or the panel arrays of a solar farm:

Solar farm arrays before and after automatic detection (after)
Solar farm arrays before and after automatic detection (before)
ImageryDetected
Drag to compare
Prompt: solar panel. Dozens of arrays, one run.

Trees, cars, greenhouses, pools, solar panels all work the same way; the Library in the panel lists ready-made objects with previews if you'd rather not guess the wording.

Manual mode

Manual mode is a semi-automatic model that runs locally on your own machine, unlimited and offline, after a one-time one-click setup from the panel. The interaction is always the same: you click an object and the AI outlines it in one shot, then left-click adds area and right-click excludes a stray part, so a couple of clicks turn a rough guess into a clean boundary. The same shape controls as Automatic (Simplify outline, Round corners, Right angles, Expand/Contract, Fill holes) apply to the live selection. Save polygon commits it (it turns green), you move to the next object, and Export polygons to a layer writes them all out when you are done.

The Manual panel: a green dot for left-click to add, a red cross for right-click to exclude, the Refine selection controls, and the highlighted Save polygon button
One panel, the whole interaction: left-click to add, right-click to exclude, refine the shape, then Save polygon (highlighted) to commit.

Manual mode earns its place two ways, and the fastest way to meet it is as a repair tool for an Automatic run.

Fix an Automatic result by hand

An Automatic pass gets you most of the way, but a dense scene always leaves a few rough edges: one outline that bleeds into a neighbour, a courtyard the model split in two, a handful of buildings it never caught. Right inside the review, Refine in Manual mode opens those exact detections in Manual so you can correct them point by point, with nothing re-run and no new credits spent.

The Refine in Manual mode button inside the Automatic review panel
Refine in Manual mode, from the review: hand-fix the automatic result instead of re-running it.

Every detection comes across as an editable object. Right-click inside one to re-open it and carve away an over-segmented part; left-click inside it to grow it back. Click empty ground to add a building the pass missed, Delete drops one you do not want, and S keeps the one you are happy with (it turns green). When the layer is right, go Back to review and export the automatic and hand-made polygons together.

Refine in Manual mode reopens the automatic detections as editable objects: left-click grows one, right-click trims it, S keeps it. Then Back to review to export the lot.

Segment from scratch, object by object

You can also skip Automatic entirely and segment element by element, each with its own clean outline. Because the model runs on your machine it is unlimited and costs no credits, which makes it the right tool when you need ten precise objects rather than a thousand, or when you want full control over every boundary. Same imagery rule as Automatic: any visible raster works, from a GeoTIFF to a drone orthophoto to an XYZ/WMS basemap.

Pick Manual and start

In the panel, keep the Manual tab selected, choose your imagery layer, and click Start Manual AI Segmentation. The model loads once, then every click is instant.

Click an object

Click anywhere on the object and the local model outlines it in one shot. Here, a single click on an isolated building.

One left-click, and the AI outlines the whole building

Correct it with a click or two

Left-click adds area the model missed; right-click excludes a part it grabbed by mistake. The outline updates on every click. The green dot is a positive point, the red cross a negative one.

A positive point keeps the building, a negative point excludes the plaza it overshot

Save and move on

Save polygon (or press S) commits the selection: it turns green and joins the layer, and the panel is ready for the next object. The model works best one element at a time.

The saved polygon, now green and part of the layer

Export to a layer

When you have all your objects, Export polygons to a layer writes a styled GeoPackage with a clean schema (label and area_m2), ready for the GIS.

The four hand-drawn buildings exported as a clean GeoPackage layer

Try it on your own map

The best test is a zone you actually work on: install AI Segmentation, run it there, and compare the layer with what you would have digitized by hand. And if anything behaves oddly, the ? Help button in the panel reaches us directly.

Written byLilien Auger
·9 min read
Contact