torchgeo: a PyTorch domain library for deep learning with multispectral geospatial and remote sensing data
torchgeo: a PyTorch domain library for deep learning with multispectral geospatial and remote sensing data
What it solves
TorchGeo simplifies the process of applying deep learning to geospatial data. It addresses the challenges of working with remote sensing imagery, which often varies in spectral bands, spatial resolution, and coordinate reference systems (CRS) across different satellites and sensors.
How it works
TorchGeo acts as a PyTorch domain library (similar to torchvision) that provides specialized tools for geospatial data:
- Geospatial Datasets & Samplers: It allows users to combine multiple datasets using intersection (
&) and union (|) operators, automatically handling reprojection into a matching CRS and resolution. It includes samplers (likeRandomPatchSampler) to handle very large images by extracting small patches for training. - Benchmark Datasets: It provides ready-to-use datasets for common tasks like image classification, semantic segmentation, and object detection.
- Pre-trained Weights: It offers models pre-trained on multispectral sensors (e.g., Sentinel-2), moving beyond standard RGB ImageNet weights to better suit remote sensing data.
- Lightning Integration: It provides PyTorch Lightning datamodules and trainers to reduce boilerplate code and ensure reproducibility in experiments.
Who it’s for
- Machine learning experts who want to work with geospatial data without needing deep expertise in remote sensing.
- Remote sensing experts who who want to explore machine learning solutions for their data.
Highlights
- Automatic CRS/Resolution Handling: Automatically ensures matching coordinate reference systems and resolutions when combining datasets.
- Multispectral Support: First library to support pre-trained weights for various multispectral sensors.
- Flexible Dataset Composition: Use set-like operators to merge or intersect image and label datasets.
- C-Line Interface: Supports command-line training via LightningCLI for configuration-based experiments.
Sources
- undefinedtorchgeo/torchgeo