Skip to main content

Lightweight benchmarking framework for geospatial models

Project description

torchgeo-bench

CI PyPI version Python 3.12+ License: MIT

A lightweight benchmarking framework for evaluating frozen geospatial foundation models on the GeoBench V1 and V2 suites. Plug in any backbone, get KNN-5 / linear-probe accuracy on classification datasets and mIoU on segmentation datasets, with bootstrapped 95% confidence intervals — all configured through Hydra.

  • Frozen-backbone evaluation — KNN-5, L-BFGS logistic regression, and linear / conv / FPN / DPT segmentation probes.
  • GeoBench V1 + V2 built in — classification and segmentation, RGB or full multispectral / multi-modal stacks.
  • Hydra-driven — sweep models, datasets, partitions, image sizes, and bands without code changes.
  • Resumableresume=true skips already-computed (dataset, method, model, …) rows. Atomic CSV appends are safe across parallel jobs.
  • Bring your own model — implement BenchModel._forward_patch_features and add a one-file Hydra config.

Installation

pip install torchgeo-bench

For development:

git clone https://github.com/torchgeo/torchgeo-bench
cd torchgeo-bench
uv sync --extra dev

Requires Python 3.12+.

Download a dataset

The runner expects datasets under ./data/. To grab GeoBench V1:

torchgeo-bench download geobench_v1

V2 (classification + segmentation) and torchgeo's EuroSAT downloader work the same way (torchgeo-bench download geobench_v2, torchgeo-bench download eurosat). See the documentation for all options.

Run a basic experiment

# Default: random convolutional features (RCF) on every available dataset
torchgeo-bench run

# A single dataset with a pretrained ImageNet ResNet-50
torchgeo-bench run model=timm/resnet50 dataset.names=[m-eurosat]

Results are appended to results/all_results.csv. Re-run with resume=true to skip already-completed rows.

Learn more

  • Documentation — full configuration reference, available models, dataset tables, multi-band experiments, evaluation methodology, output schema, dev / release workflow, and troubleshooting.
  • AGENTS.md — contributor guide and house style.

Citation

If you use this framework, please cite the underlying GeoBench papers (and, once available, the torchgeo-bench paper itself):

@misc{torchgeobench,
  title  = {torchgeo-bench: A lightweight benchmarking framework for geospatial foundation models},
  author = {torchgeo-bench Contributors},
  year   = {TBD},
  note   = {Software},
  url    = {https://github.com/torchgeo/torchgeo-bench}
}

@misc{lacoste2023geobench,
  title         = {GEO-Bench: Toward Foundation Models for Earth Monitoring},
  author        = {Alexandre Lacoste and Nils Lehmann and Pau Rodriguez and Evan David Sherwin and
                   Hannah Kerner and Bj{\"o}rn L{\"u}tjens and Jeremy Andrew Irvin and David Dao and
                   Hamed Alemohammad and Alexandre Drouin and Mehmet Gunturkun and Gabriel Huang and
                   David Vazquez and Dava Newman and Yoshua Bengio and Stefano Ermon and Xiao Xiang Zhu},
  year          = {2023},
  eprint        = {2306.03831},
  archivePrefix = {arXiv},
  primaryClass  = {cs.LG},
  url           = {https://arxiv.org/abs/2306.03831},
  doi           = {10.48550/arXiv.2306.03831}
}

@misc{simumba2025geobench2,
  title         = {{GEO-Bench-2}: From Performance to Capability, Rethinking Evaluation in Geospatial AI},
  author        = {Naomi Simumba and Nils Lehmann and Paolo Fraccaro and Hamed Alemohammad and
                   Geeth De Mel and Salman Khan and Manil Maskey and Nicolas Longepe and
                   Xiao Xiang Zhu and Hannah Kerner and Juan Bernabe-Moreno and Alexandre Lacoste},
  year          = {2025},
  eprint        = {2511.15658},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV},
  url           = {https://arxiv.org/abs/2511.15658},
  doi           = {10.48550/arXiv.2511.15658}
}

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchgeo_bench-0.3.0.tar.gz (75.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torchgeo_bench-0.3.0-py3-none-any.whl (128.8 kB view details)

Uploaded Python 3

File details

Details for the file torchgeo_bench-0.3.0.tar.gz.

File metadata

  • Download URL: torchgeo_bench-0.3.0.tar.gz
  • Upload date:
  • Size: 75.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for torchgeo_bench-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fb3172c792301611961fc42ce9f4c6453b1a1f0b90d64a787a38c519033c0948
MD5 34a92b0d2b61f7c727f7b22861b7307f
BLAKE2b-256 0174174a72cf73b3ccbf8ad5e2dc5986cbaf1f27683a8e105a677c1a69dcf09a

See more details on using hashes here.

File details

Details for the file torchgeo_bench-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: torchgeo_bench-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 128.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for torchgeo_bench-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6a3ca73db0118df1e5c27618d7b2325984ae13a8642798d5874900f743fcf93
MD5 00a3863e61f8f409babdb89e5d1e5d55
BLAKE2b-256 915b9cd206b15c9fe1dd03008e161a2a1f03c8d278a8648ffdc219ec495cf70b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page