AI Pulse by Inblix

U-Net with ResNet-34 extracts buildings from NAIP imagery in 12-epoch GeoAI pipeline

MarkTechPost · Aug 2, 2026 · 2 min read · Read original article →

Curated by the Inblix editorial team


Featured image for article: U-Net with ResNet-34 extracts buildings from NAIP imagery in 12-epoch GeoAI pipeline

The tutorial lays out a complete, GPU-accelerated pipeline for pulling building footprints from high-resolution National Agriculture Imagery Program (NAIP) aerial photos. It’s a practical stack: grab the rasters and vector labels, inspect the spatial metadata, chip the imagery into 512×512 tiles with a 256-pixel stride, and feed those georeferenced chips into a U-Net model with a ResNet-34 encoder pretrained on ImageNet. Training runs for just 12 epochs with a batch size of 8 and a learning rate of 1e-3, using a 20% validation split. The code checks for CUDA availability upfront — if you’re on a T4 GPU in Colab, you’re golden; otherwise, it warns you things will slow to a crawl.

The workflow doesn’t stop at semantic segmentation. Once the model spits out predicted masks, the tutorial runs sliding-window inference across an unseen test scene, then converts those masks into cleaned, regularized building polygons. It calculates IoU and F1 scores to quantify how well the predictions match the ground truth. That’s where most tutorials call it a day. This one keeps going.

Two bonus experiments add real value. First, a zero-shot segmentation run using Grounding DINO and SAM — no fine-tuning, just seeing what the foundation models can do out of the box on NAIP imagery. Second, a comparison against a pretrained Mask R-CNN instance segmentation model, so you can weigh the U-Net approach against a more traditional object detection pipeline. The source data comes from Hugging Face, but the tutorial also points to Microsoft Planetary Computer for NAIP imagery and Overture Maps for building labels, showing how the same pipeline extends to real-world areas. The whole thing is wrapped in defensive try/except blocks so a failed step won’t crash the notebook — a small but telling detail for anyone who’s debugged ML pipelines at 2 a.m.

What’s genuinely useful here is the end-to-end integration. Too many geospatial ML examples stop at model inference and leave you staring at a raster of probabilities. By pushing through to vectorized, regularized polygons with quantitative metrics, this tutorial bridges the gap between academic exercise and something an urban planner or GIS analyst could actually use. The 12-epoch training budget and 512-pixel tile size suggest this is tuned for quick iteration rather than state-of-the-art accuracy, but that’s the right trade-off for a tutorial meant to run on a single GPU in under an hour.

💡 Key Takeaways

  1. The pipeline converts raw NAIP aerial imagery into cleaned building polygons with IoU and F1 scoring, not just segmentation masks.
  2. A U-Net with a pretrained ResNet-34 encoder trains in 12 epochs on 512×512 chips, making it feasible on a single consumer GPU.
  3. Zero-shot experiments with Grounding DINO and SAM provide a direct comparison against the fine-tuned model's performance on the same scene.

Keep reading: See related articles below for more coverage on this topic.

Get smarter about AI

The sharpest AI news, curated daily. Delivered free to your inbox.

← Back to all articles