All videos

ENPNOVA Pixel · ·

TorchGeo Data Pipelines Part 3 - Labels, Splits, and Normalization

This is part 3 of the TorchGeo Data Pipelines series. A model can score well on your test set and still fail the first time it sees a new area.

Notes

This is part 3 of the TorchGeo Data Pipelines series. A model can score well on your test set and still fail the first time it sees a new area. Often the problem isn’t the architecture but the data: the labels, the bands, or the way the data was split. This video covers how to make your data actually worth training on.

It starts with labels: how VectorDataset turns polygons into masks, why zero can mean two different things, how to pre-rasterize labels for speed, and how to check class balance. Next come bands and sensors. You’ll see what pretrained weights expect, the Sentinel-2 processing baseline 04.00 offset that shifts values from 2022 onward, and your options when your bands don’t match the weights. Then splits: why random splits make scores look better than they are, TorchGeo’s five splitting functions, and how to split by region with a buffer. The last section covers normalization: computing statistics on the training split only, applying them on the GPU, and when to use the pretrained weights’ own scaling instead.

Code and API details follow TorchGeo 0.9.

Series

Part 1: How TorchGeo reads your data

Part 2: From files to batches

Part 3: Making data training-ready (this video)

Part 4: Versioning, serving, and inference