Skip to content

About

Benchmark harness/toolkit for evaluating Geospatial Foundation Models (GFM). Independently developed with long-term updates and maintenance.

Resources

Contributing

Security policy

Stars

52 stars

Watchers

2 watching

Forks

Repository files navigation

geo-eval-harness

CI codecov PyPI version Python 3.12+ License: MIT

Evaluate geospatial image models with classification and segmentation tasks. Configure runs with CLI flags or validated YAML.

  • Image classification uses frozen embeddings with KNN-5 or logistic regression.
  • Segmentation supports frozen backbones, LoRA, and full fine-tuning with linear, convolutional, FPN, DPT, UPerNet, and U-Net heads.
  • Runs append results to CSV files. --resume skips completed evaluations with matching configurations.
  • Custom models implement BenchModel._forward_patch_features. See the custom model guide and contribution guide.

Installation

pip install geo-eval-harness

For development:

git clone https://github.com/torchgeo/geo-eval-harness
cd geo-eval-harness
uv sync --extra dev

Requires Python 3.12+ and runs on Linux, macOS, and Windows.

The Python package is geo_eval_harness; use import geo_eval_harness and python -m geo_eval_harness. TerraTorch models require the separate source installation.

Download a dataset

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

geo-eval-harness download geobench_v1

To download only the datasets needed for a run:

geo-eval-harness download geobench_v1 --datasets m-eurosat

V1 uses the JSON-metadata mirror under data/classification_v1.0_wds/, with a pinned revision and archive SHA-256 verification.

Download GeoBench V2 or an individual dataset by its catalog name:

geo-eval-harness download geobench_v2
geo-eval-harness download eurosat
geo-eval-harness download openearthmap-sar

Hugging Face archive downloads use pinned commits and SHA-256 manifests in src/geo_eval_harness/checksums/. See the dataset guide for download sources, splits, bands, and licenses.

Run a basic experiment

# Inspect available presets and datasets without loading ML dependencies
geo-eval-harness models
geo-eval-harness datasets

# A single dataset with a pretrained ImageNet ResNet-50
geo-eval-harness run --model timm/resnet50 --dataset m-eurosat

By default, run prefers the current CUDA device, then MPS, then CPU. Use --device cpu to select CPU explicitly.

geo-eval-harness run --model rcf --dataset m-eurosat --device cpu

Results are appended to results/models/<model name>.csv. The repository includes reference results; installing the package does not download them. Use --output results/my_run.csv or output.file in YAML to select a separate file. Re-run with --resume to skip completed rows whose configuration matches. Each evaluation is saved as it finishes.

# Linear-only probing, with explicit flags overriding the YAML
geo-eval-harness run --config docs/examples/image-run.yaml --methods linear --device cpu

# Validate selections without loading a model or dataset
geo-eval-harness run --model rcf --dataset m-eurosat --dry-run

The docs/examples/ paths refer to a repository checkout. For an installed package, save a linked example locally and pass its path to --config. See image-run.yaml for an image configuration and run --config-help for the JSON schema. Omitted settings inherit model and dataset defaults; explicit YAML values override them, and supplied flags override YAML. This includes explicit false, null, and [].

geo-eval-harness, python -m geo_eval_harness, and python -m geo_eval_harness.cli expose the same commands.

Measure encoder cost

The standalone profile command measures one fixed real dataset batch and writes JSON to stdout by default. The flops command uses synthetic inputs, does not load dataset samples, and appends compute measurements to a CSV:

geo-eval-harness profile --model rcf --dataset m-eurosat --device cpu \
  --batch-size 8 --warmup 1 --measurements 5 > profile.json

geo-eval-harness flops --model rcf --device cpu --band-configs rgb \
  --seg-heads --output results/my_compute_cost.csv

run, flops, and profile share --output-dir for a common output root and --output for an exact file path that takes precedence. Image runs retain their models/, profiles/, and intrinsic_dim/ subdirectories. Standalone profiling writes profile.json beneath an explicit output root.

Both accept --config and --dry-run. See docs/examples/profile.yaml, docs/examples/flops.yaml, and the configuration reference. Optional profile and intrinsic_dim passes within an image run retain their separate per-model CSVs unless output.file explicitly combines them.

Handcrafted classification baseline

The handcrafted model adds deterministic spectral and spatial measurements to the ImageStats baseline. The handcrafted_level1, handcrafted_level2, and handcrafted_level3 presets select cumulative feature sets; handcrafted defaults to level 2. Feature width depends on the input bands and available spectral indices.

Download the classification datasets and run the level sweep from this checkout:

python -m geo_eval_harness download geobench_v1
python -m geo_eval_harness download geobench_v2 --datasets benv2,treesatai,so2sat,forestnet
python -m geo_eval_harness download eurosat
python -m geo_eval_harness download resisc45
python -m geo_eval_harness download aid
python experiments/run_handcrafted.py

The sweep includes ImageStats as level 0 and every classification protocol in the current dataset catalog, including AID, multilabel datasets and EuroSAT's spatial split. It uses all bands with identity input normalization, with 224-pixel resizing, KNN-5, validation-selected C, train-plus-validation final refit, and 200 bootstrap draws.

The sweep writes to results/models/handcrafted_level*.csv and a local imagestats_handcrafted_control.csv control file (the committed reference results in results/models/ keep handcrafted_level{1,2,3}.csv alongside imagestats.csv). Feature lists and completion status are saved under outputs/handcrafted/. Resume skips matching completed rows; a missing linear or KNN result is reported as a failure. Summaries, including --report-only, select rows matching the requested configuration and devices. Use --output-dir results/handcrafted-current to keep a sweep separate.

Use --levels 1 2, --datasets eurosat resisc45, or --dry-run for a smaller run. The extractor also works through the normal CLI:

python -m geo_eval_harness run --model handcrafted_level2 \
  --dataset eurosat --bands all --normalization none

All four presets default to all bands and identity normalization. Custom YAML can set model: {name: handcrafted, kwargs: {level: 3}}; preprocessing belongs under input, not constructor kwargs.

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.
  • Cleanlab analysis — standalone dataset auditing, probability extraction, and review galleries, with separate dependencies.

Citation

If you use geo-eval-harness in your research, please cite our paper:

@misc{lehmann2026geoevalharnessevaluationharnessgeospatial,
      title={geo-eval-harness: An Evaluation Harness for Geospatial Foundation Models},
      author={Nils Lehmann and Caleb Robinson and Isaac Corley and Jennifer Marcus and Inbal Becker-Reshef and Juan M. Lavista Ferres and Hannah Kerner},
      year={2026},
      eprint={2611.33990},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2611.33990},
}

To cite the software itself:

@misc{geoevalharness,
  title  = {geo-eval-harness: A lightweight benchmarking framework for geospatial foundation models},
  author = {geo-eval-harness Contributors},
  year   = {2026},
  note   = {Software},
  url    = {https://github.com/torchgeo/geo-eval-harness}
}

License

MIT.

About

Benchmark harness/toolkit for evaluating Geospatial Foundation Models (GFM). Independently developed with long-term updates and maintenance.

Resources

Contributing

Security policy

Stars

52 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages