How alichaaban7/geoai-building-road-extraction works
This repository is a two-approach GeoAI research application for extracting building footprints and road networks from remote-sensing imagery. Its principal workflow prepares labeled raster tiles and train/validation manifests, trains semantic or instance models, selects checkpoints and thresholds/post-processing on validation data, freezes final settings, then runs georeferenced inference and independent GIS evaluation. The Streamlit interface exposes experiment setup, stage execution, and result review. README documents optimization and ArcGIS Learn capabilities not fully represented by sampled source; their exact internal call paths are therefore omitted.
Main entry points: gis_inference.py Georeferenced Inference · train.py Road Training · inference.py Road Inference · app.py Streamlit Interface
Components 26
Research UI
- Streamlit Interface
ui/app.py - Buildings Page
ui/pages/buildings.py - Roads Page
ui/pages/roads.py - Result Reader
ui/utils/result_reader.py
Building Extraction
- Building Data Prep
Buildings/src/models/maskrcnn/data.py - Building Models
Buildings/src/models/factory.py - Mask R-CNN Engine
Buildings/src/models/maskrcnn/trainer.py - SAM-LoRA Training
Buildings/src/models/sam_lora/trainer.py - Building Inference
Buildings/src/inference.py - Instance Inference
Buildings/src/inference_instance.py - Validation Optimization
Buildings/src/optional/optuna_search.py
Road Extraction
- Road Data & Manifests
Roads/src/data/manifests.py - Road Training
Roads/src/train.py - Road Model Factory
Roads/src/models/factory.py - Checkpointing
Roads/src/checkpointing.py - Optuna Search
Roads/src/optional/optuna_search.py - Threshold Search
Roads/src/optional/threshold_search.py - Postprocess Search
Roads/src/postprocessing/search.py - Road Inference
Roads/src/inference.py - Georeferenced Inference
Roads/src/gis_inference.py - Road Mask Processing
Roads/src/postprocessing/road_mask.py
Shared Evaluation
- GIS Evaluation
Roads/src/evaluation/gis_evaluation.py - Metrics
Roads/src/evaluation/metrics.py
Other components
- Researcher
- ArcGIS / Raster Data
- Experiment Results
Connections 29
- Researcher → Streamlit Interface: uses
ui/app.py - Streamlit Interface → Buildings Page: routes
ui/app.py - Streamlit Interface → Roads Page: routes
ui/app.py - Buildings Page → Result Reader: reads results
ui/pages/buildings.py - Roads Page → Result Reader: reads results
ui/pages/roads.py - ArcGIS / Raster Data → Building Data Prep: imagery and labels
- Building Data Prep → Building Models: training data
- Building Models → Mask R-CNN Engine: constructs model
- Mask R-CNN Engine → Building Inference: trained checkpoints
- SAM-LoRA Training → Building Inference: trained checkpoints
- Building Inference → Instance Inference: instance prediction
- Validation Optimization → Building Models: tunes models
- Roads Page → Road Data & Manifests: selects dataset
- Road Data & Manifests → Road Training: manifests
Roads/src/train.py - Road Training → Road Model Factory: builds model
Roads/src/train.py - Road Training → Checkpointing: saves checkpoints
Roads/src/train.py - Optuna Search → Road Training: trains trials
Roads/src/optional/optuna_search.py - Optuna Search → Checkpointing: promotes winner
Roads/src/optional/optuna_search.py - Threshold Search → Road Inference: evaluates predictions
Roads/src/optional/threshold_search.py - Postprocess Search → Road Inference: evaluates predictions
Roads/src/postprocessing/search.py - Postprocess Search → Road Mask Processing: tests settings
Roads/src/postprocessing/search.py - Checkpointing → Road Inference: reconstructs checkpoint
Roads/src/inference.py - Road Inference → Georeferenced Inference: runs raster inference
Roads/src/gis_inference.py - Georeferenced Inference → Road Mask Processing: cleans mask
Roads/src/gis_inference.py - Georeferenced Inference → ArcGIS / Raster Data: writes GIS features
- GIS Evaluation → Metrics: computes scores
- Georeferenced Inference → GIS Evaluation: predictions for evaluation
- GIS Evaluation → Experiment Results: stores evaluation
- Result Reader → Experiment Results: reads summaries
ui/utils/result_reader.py