Semantic Segmentation of Aerial Imagery on a Consumer GPU with a From-Scratch Residual U-Net
Abstract
We present swath, an open-source pipeline for semantic segmentation of aerial and satellite imagery that covers the full workflow from raw data to georeferenced predictions. The system trains a residual U-Net from random initialization on the LoveDA benchmark, deliberately avoiding an ImageNet-pretrained encoder so that the architecture generalises to multispectral inputs with an arbitrary number of bands. Training runs on a single RTX 4060 Laptop GPU with 8 GB of VRAM, completing 30 epochs on 2,522 tiles in approximately 2.1 hours. The model reaches a mean intersection-over-union (mIoU) of 0.438 and an overall accuracy of 0.615 on 1,669 validation tiles evaluated at full 1024×1024 resolution through a sliding-window predictor with raised-cosine blending. We document the engineering decisions that make this possible on consumer hardware – mixed-precision training, adaptive accumulator placement, and self-describing checkpoints with safe training resumption – and report a domain gap between rural (mIoU = 0.379) and urban (mIoU = 0.471) scenes that published benchmarks typically obscure by averaging. Ablation experiments quantify the contribution of each memory-saving technique and the effect of class-weighting schemes on rare-class performance. The code, trained weights, and a FastAPI-based inference service are released under the MIT license.
// Source
Authors: Denis O. Drobyshev