Final project for the Building AI course
This project aims to detect building footprints from satellite and aerial images using Mask R-CNN and image matting techniques, including KNN matting, closed-form matting, and Grabcut. In regions with limited GIS data, this script generates simplified building footprints to support spatial analysis.
In underdeveloped areas, GIS databases are often incomplete or lacking critical spatial data. Urban design projects commonly rely on OpenStreetMap for spatial information, but rural areas frequently lack mapped building footprints. Meanwhile, Google Maps provides aerial imagery. This script detects building footprints from these images and exports shapefiles for urban design applications.
The process follows these steps:
- Dataset preparation
- Convolutional Neural Network processing
- Extracting building bounding boxes and masks
- Local semantic segmentation
- Refining masks for high accuracy
- Applying the Douglas-Peucker algorithm with polygon constraints
- Generating vector-based building footprints
The Ramer–Douglas–Peucker algorithm simplifies a curve composed of line segments, reducing the number of points while preserving the overall shape. Initially developed for cartographic generalization, it offers high accuracy but requires more computational resources.
Dataset: You can download the cropped aerial image tiles and raster labels from WHU Building Dataset.
This script represents an initial phase for extracting building footprints. Future work will focus on integrating Graph Neural Networks (GNNs) in urban planning, enabling more advanced spatial analysis. While this script streamlines certain aspects of design projects, further refinement is needed for real-world applications
Exploring Urban AI and GNN applications for AI-driven urbanism.
