Instructions to use nasa-ibm-ai4science/Crater-Detection-NASA-IBM-Lunar-Foundation-Model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TerraTorch
How to use nasa-ibm-ai4science/Crater-Detection-NASA-IBM-Lunar-Foundation-Model with TerraTorch:
from terratorch.registry import BACKBONE_REGISTRY model = BACKBONE_REGISTRY.build("nasa-ibm-ai4science/Crater-Detection-NASA-IBM-Lunar-Foundation-Model") - PEFT
How to use nasa-ibm-ai4science/Crater-Detection-NASA-IBM-Lunar-Foundation-Model with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
NASA-IBM LFM — Crater Detection
Fine-tuned crater-detection checkpoints for the NASA-IBM Lunar Foundation Model (NASA-IBM LFM).
Two checkpoints, one per scale, both LoRA-adapted from the same pretrained lunar backbone — the adaptation strategy that performed best on crater detection in our experiments:
- WAC (context scale, ~100 m/px) — trained on the Robbins crater catalog benchmark. Best result on the benchmark: mAP 0.2581 ± 0.0017, ahead of every ImageNet-pretrained baseline (best: SwinV2-B, 0.2420 ± 0.0047) and of an architecture-matched random-init control (0.2289 ± 0.0037).
- NAC (meter scale, ~1 m/px) — trained on the NAC hand-labeled benchmark. mAP 0.1543 ± 0.0098, the best NASA-IBM LFM variant on this task and statistically indistinguishable from the top baseline (SwinV2-B, 0.1552 ± 0.0086).
📄 Full method and tables: paper · 💻 Fine-tuning code and configs: GitHub · 🧠 Pretrained backbone: nasa-ibm-lunar-fm
Example predictions. Top: WAC / Robbins crater catalog. Bottom: NAC hand-labeled dataset. Green: ground truth; blue: predictions at confidence ≥ 0.5. The NAC benchmark has denser, less sharply defined labels and part of it is annotated at 5 m/px (visibly blurrier — including the tile shown), which helps explain the lower scores there for all models.
Checkpoints at a glance
| WAC / Robbins | NAC hand-labeled | |
|---|---|---|
| Science theme | Impact processes | Impact processes |
| Task | Single-class bounding-box detection | Single-class bounding-box detection |
| Resolution | ~100 m/px (LROC WAC) | ~1 m/px (LROC NAC) |
| Tile size | 512 × 512 px (51.2 km) | 256 × 256 px (256 m) |
| Split sizes (train/val/test) | 800 / 100 / 100 | 645 / 59 / 62 |
| Backbone | NASA-IBM LFM ViT-B, FlexiViT patch size 8 | NASA-IBM LFM ViT-B, FlexiViT patch size 8 |
| Adaptation | LoRA (r = 16, α = 32) on encoder attention + MLP linears | same |
| Neck / head | Multilayer Simple Feature Pyramid → Faster R-CNN | same |
| Test mAP / AP@50 / AP@75 | 0.2581 / 0.6183 / 0.2263 | 0.1543 / 0.4416 / 0.1072 |
| License | Apache-2.0 | Apache-2.0 |
Repository contents
NAC_config.yaml NAC craters: TerraTorch config for NAC crater task
NAC_ni_lfm_ps9_s44.ckpt NAC craters: LoRA adapter + detection head weights
WAC_congig.yaml WAC, Robbins craters: TerraTorch config (100% training data)
WAC_ni_lfm_ps8_lora_s46.ckpt WAC, Robbins craters: LoRA adapter + detection head weights (100% training data)
The pretrained backbone is not duplicated here — pull it from nasa-ibm-lunar-fm and point the config's backbone checkpoint field at it.
Benchmark datasets
Both benchmarks ship as part of SomBench.
Robbins craters (WAC). The Robbins catalog is a manually annotated global database of over 2 million lunar impact craters, intended as a near-complete census of diameters ≥ 1–2 km, digitized from LROC WAC global mosaics with topographic cross-checks. Rim polygons are converted to per-tile bounding boxes. The benchmark is 1,000 WAC visible tiles drawn from the test split of the pretraining corpus, filtered to solar-incidence angles of 60–80° for favorable illumination.
NAC hand-labeled. Built from LROC NAC imagery (1–5 m/px) spanning six NAC PHO sites — Highlands, King Ejecta, Apollo 15 S-IVB, Apollo 17, Reiner Gamma, and March 17 Impact Crater — selected under relief-enhancing illumination (incidence ~50–80°). Craters were manually labeled inside 4–6 fixed 1024 × 1024 px study areas per site using co-registered 3 m/px DTMs, digitized as circles with OpenCraterTool, then mapped to 256 × 256 patches in COCO format: 766 patches, 97,104 crater annotations. Splits are enforced at both site and study-area level to prevent leakage.
Intended use
Detecting impact craters in LROC imagery at either context scale (WAC mosaics) or meter scale (NAC frames), and as a starting point for further fine-tuning on your own crater labels. Crater catalogs underpin relative-age dating, geologic mapping, and landing-site hazard assessment — these checkpoints are research tools for that pipeline, not certified products for any of it.
Out of scope.
- Not validated for operational decisions such as landing-site certification or hazard clearance. Absolute mAP is modest, particularly at meter scale (0.15), and detections should be treated as candidates for review.
- Illumination-conditioned. Both benchmarks were built under favorable incidence angles (60–80° WAC, ~50–80° NAC). Behavior under near-nadir or extreme-grazing illumination is untested.
- WAC and NAC tiles come from the pretraining test split, so they are unseen by the backbone — but they are drawn from the same corpus and instrument processing. Transfer to other mosaic products or reprocessings is unmeasured.
- Not evaluated on other planetary bodies. As with the backbone, no geodetic reference frame is maintained.
Usage
Both checkpoints run through TerraTorch, configured from YAML. The companion repo adds the SomBench benchmark datamodules, backbone wrappers, support for registering new input modalities into the pretrained backbone, and FlexiViT patch-embedding interpolation.
git clone https://github.com/NASA-IMPACT/NASA-IBM-Lunar-Foundation-Model && cd $_
pip install -e .
# reproduce the WAC / Robbins fine-tune
terratorch fit --config configs/finetune/crater_wac_robbins_lora.yaml
# evaluate a released checkpoint
terratorch test --config configs/finetune/crater_wac_robbins_lora.yaml \
--ckpt_path wac_robbins/checkpoint.ckpt
from huggingface_hub import snapshot_download
local = snapshot_download("nasa-ibm-ai4science/Crater-Detection-NASA-IBM-Lunar-Foundation-Model")
# then set the backbone checkpoint path in the YAML to the downloaded nasa-ibm-lunar-fm backbone
Exact registry names and full hyperparameters are in the GitHub repo.
Evaluation
All backbones are fine-tuned through TerraTorch with the data loaders, splits, augmentations, loss, and evaluation metric held fixed — only encoder weights and initialization differ. Values are mean ± standard deviation over 5 random seeds; bold is the best mean per column, underline the second best. Metrics are test-set bounding-box mAP (COCO convention).
Baselines are ResNet-50, ViT-B MAE, ConvNeXt-B, ConvNeXt-V2-B, SwinV2-B, and DaViT-B initialized from public ImageNet-1k/22k weights, plus two from-scratch controls: a random-init ResNet-50 and an architecturally identical random-init copy of our model, which isolates the contribution of lunar pretraining from that of architecture.
Robbins craters, LROC WAC (context scale)
Reported at two training-data fractions to probe label efficiency.
50% training data
| Model | mAP ↑ | AP@50 ↑ | AP@75 ↑ |
|---|---|---|---|
| ResNet-50 (ImageNet) | 0.1993 ± 0.0007 | 0.4960 ± 0.0036 | 0.1572 ± 0.0038 |
| ResNet-50 (random init) | 0.1873 ± 0.0011 | 0.4663 ± 0.0029 | 0.1472 ± 0.0041 |
| ViT-B MAE (ImageNet) | 0.2167 ± 0.0022 | 0.5656 ± 0.0092 | 0.1670 ± 0.0042 |
| ConvNeXt-B (IN22k) | 0.2266 ± 0.0030 | 0.5684 ± 0.0030 | 0.1840 ± 0.0040 |
| ConvNeXtV2-B (IN22k) | 0.2303 ± 0.0034 | 0.5845 ± 0.0036 | 0.1829 ± 0.0087 |
| SwinV2-B (ImageNet) | 0.2313 ± 0.0027 | 0.5849 ± 0.0072 | 0.1862 ± 0.0041 |
| DaViT-B (ImageNet) | 0.2250 ± 0.0037 | 0.5655 ± 0.0086 | 0.1781 ± 0.0099 |
| NASA-IBM LFM (ps8, random init) | 0.2197 ± 0.0027 | 0.5433 ± 0.0072 | 0.1781 ± 0.0038 |
| NASA-IBM LFM (ps8, full FT) | 0.2541 ± 0.0018 | 0.6100 ± 0.0032 | 0.2213 ± 0.0028 |
| NASA-IBM LFM (ps8, LoRA) | 0.2539 ± 0.0014 | 0.6103 ± 0.0012 | 0.2214 ± 0.0030 |
| NASA-IBM LFM (ps8, frozen) | 0.1617 ± 0.0026 | 0.3962 ± 0.0052 | 0.1081 ± 0.0040 |
100% training data — the released WAC checkpoint
| Model | mAP ↑ | AP@50 ↑ | AP@75 ↑ |
|---|---|---|---|
| ResNet-50 (ImageNet) | 0.2148 ± 0.0018 | 0.5288 ± 0.0055 | 0.1762 ± 0.0038 |
| ResNet-50 (random init) | 0.2077 ± 0.0016 | 0.5131 ± 0.0017 | 0.1698 ± 0.0035 |
| ViT-B MAE (ImageNet) | 0.2259 ± 0.0054 | 0.5834 ± 0.0151 | 0.1785 ± 0.0078 |
| ConvNeXt-B (IN22k) | 0.2308 ± 0.0067 | 0.5830 ± 0.0054 | 0.1890 ± 0.0137 |
| ConvNeXtV2-B (IN22k) | 0.2396 ± 0.0037 | 0.6025 ± 0.0056 | 0.2014 ± 0.0080 |
| SwinV2-B (ImageNet) | 0.2420 ± 0.0047 | 0.6020 ± 0.0061 | 0.2028 ± 0.0086 |
| DaViT-B (ImageNet) | 0.2347 ± 0.0029 | 0.5981 ± 0.0051 | 0.1912 ± 0.0053 |
| NASA-IBM LFM (ps8, random init) | 0.2289 ± 0.0037 | 0.5595 ± 0.0080 | 0.1893 ± 0.0073 |
| NASA-IBM LFM (ps8, full FT) | 0.2537 ± 0.0034 | 0.6156 ± 0.0024 | 0.2174 ± 0.0072 |
| NASA-IBM LFM (ps8, LoRA) | 0.2581 ± 0.0017 | 0.6183 ± 0.0034 | 0.2263 ± 0.0027 |
| NASA-IBM LFM (ps8, frozen) | 0.1871 ± 0.0024 | 0.4583 ± 0.0055 | 0.1317 ± 0.0038 |
NAC hand-labeled craters (meter scale), 100% training data
The released NAC checkpoint.
| Model | mAP ↑ | AP@50 ↑ | AP@75 ↑ |
|---|---|---|---|
| ResNet-50 (ImageNet) | 0.1411 ± 0.0036 | 0.4374 ± 0.0196 | 0.0895 ± 0.0055 |
| ResNet-50 (random init) | 0.1296 ± 0.0034 | 0.4159 ± 0.0171 | 0.0787 ± 0.0057 |
| ViT-B MAE (ImageNet) | 0.1236 ± 0.0119 | 0.3798 ± 0.0460 | 0.0703 ± 0.0109 |
| ConvNeXt-B (IN22k) | 0.1464 ± 0.0060 | 0.4400 ± 0.0249 | 0.0933 ± 0.0039 |
| ConvNeXtV2-B (IN22k) | 0.1345 ± 0.0085 | 0.3949 ± 0.0545 | 0.0783 ± 0.0107 |
| SwinV2-B (ImageNet) | 0.1552 ± 0.0086 | 0.4586 ± 0.0308 | 0.1090 ± 0.0146 |
| DaViT-B (ImageNet) | 0.1501 ± 0.0096 | 0.4620 ± 0.0265 | 0.0983 ± 0.0080 |
| NASA-IBM LFM (ps8, random init) | 0.1274 ± 0.0151 | 0.3632 ± 0.0439 | 0.0818 ± 0.0139 |
| NASA-IBM LFM (ps8, full FT) | 0.1460 ± 0.0264 | 0.4565 ± 0.0732 | 0.0953 ± 0.0318 |
| NASA-IBM LFM (ps8, LoRA) | 0.1543 ± 0.0098 | 0.4416 ± 0.0496 | 0.1072 ± 0.0116 |
| NASA-IBM LFM (ps8, frozen) | 0.1295 ± 0.0038 | 0.4098 ± 0.0121 | 0.0756 ± 0.0040 |
What to read from these tables
- On WAC, lunar pretraining wins clearly. The pretrained variants lead every metric column at both data fractions, and the gap to both the best ImageNet baseline and the random-init control is substantially larger than the seed spread. The ranking is stable across fractions.
- Label efficiency. The pretrained variants trained on 50% of the WAC data already match or exceed SwinV2-B trained on the full set (0.2541 / 0.2539 vs. 0.2420).
- LoRA is the better choice here. It tops every WAC column at 100% data and gives the best NASA-IBM LFM mAP on NAC, while training only a small fraction of the encoder parameters — and with a narrower seed spread than full fine-tuning (e.g. NAC: ± 0.0098 vs. ± 0.0264). This is why both released checkpoints are LoRA.
- On NAC, treat the leaders as comparable. Scores are low across the board and the top models sit inside one another's standard deviation, so LoRA at 0.1543 and SwinV2-B at 0.1552 should not be read as a ranking. Two properties of the benchmark plausibly bound all models: labels are dense and less sharply defined than the Robbins boxes, and part of the data is annotated at 5 m/px and visibly blurrier.
- Freezing the encoder fails on this task. The frozen variant falls below every baseline at both scales, and on NAC performs like random init (0.1295 vs. 0.1274) — some encoder adaptation is needed at meter scale.
Training configuration
Shared across both checkpoints unless noted.
| Framework | TerraTorch, YAML-configured |
| Detection head | Faster R-CNN |
| Neck | Multilayer Simple Feature Pyramid — encoder tokens from layers 2, 5, 8, 11 (of 12, zero-indexed) reshaped to a spatial grid and interpolated into a 4-level FPN |
| Backbone patch size | 8 (FlexiViT interpolation of the 16 × 16 pretrained patch embedding) |
| LoRA | rank 16, α = 32, on encoder attention + MLP linear layers; remaining encoder weights frozen, head trained normally |
| Optimizer | AdamW, cosine schedule, 500 warm-up steps, η_min = 1e-6 |
| LR (pretrained) | 5e-5 backbone and head, layer-wise LR decay 0.65, encoder weight decay 0.05–0.1, head weight decay 1e-3, drop_path 0.1 |
| LR (random-init control) | flat 1e-4 both, layer decay 1.0, no stochastic depth |
| LR (ImageNet baselines) | flat 1e-4 both |
| Anchors | tuned per benchmark to crater size distribution — NAC: 4–96 px across four pyramid levels, aspect ratios [0.7, 1.0, 1.4] (near-circular) |
| RPN / ROI budgets | 512 samples/image RPN, 1024 ROI, 600 detections/image (crater density per tile) |
| Augmentation | D4 group (rotations + flips) applied jointly to images and boxes |
| Schedule | batch size 4, up to 100 epochs, early stopping on validation mAP (patience 15) |
| Selection | best checkpoint by validation mAP |
| Seeds | 5 per configuration |
Optimizer recipes are deliberately not shared across backbone families: our pretrained model uses layer-wise LR decay with a lower encoder LR to avoid pushing pretrained representations away early in training, while ImageNet baselines and from-scratch controls use flat learning rates conventional for their architectures.
Limitations
- Small test sets. 100 WAC tiles and 62 NAC patches. Differences below the reported seed spread are not a ranking — this is the main caveat on the NAC numbers.
- NAC annotation heterogeneity. Sites annotated at 5 m/px are visibly blurrier than higher-resolution sites, and the benchmark mixes both. NAC pointing is uncontrolled in these frames.
- NAC coverage is site-limited by construction — six NAC PHO sites with co-registered 3 m stereo DTMs. Globally distributed, not globally dense.
Citation
@article{fraccaro2026lfm,
title = {Multimodal-Multiresolution Foundation Model for Lunar Remote Sensing},
author = {Fraccaro, Paolo and Nyirjesy, Gabby and Szwarcman, Daniela and Patil, Himanshu
and Gaur, Vishal and Lal, Rohit and Slank, Rachel A. and Dawson, Geoffrey
and Debary, Hiyam and Dionelis, Nikolaos and Barker, Michael K. and Annex, Andrew
and Viswanathan, Vishnu and Morse, Zachary and Schaefer, Ethan I. and Kumar, Ankur
and Watson, Campbell D. and Dawson-Rigas, Rebekah I. and Maskey, Manil
and Roy, Sujit and Ramachandran, Rahul and Bernab\'e-Moreno, Juan},
year = {2026}
}
@misc{sombench2026collection,
author = {Patil, Himanshu and Nyirjesy, Gabby and Slank, Rachel A. and Gaur, Vishal
and Szwarcman, Daniela and Fraccaro, Paolo and Dionelis, Nikolaos and Barker, Michael K.
and Annex, Andrew and Viswanathan, Vishnu and Morse, Zachary and Schaefer, Ethan I.
and Debary, Hiyam and Kumar, Ankur and Lal, Rohit and Dawson, Geoffrey
and Watson, Campbell and Dawson-Rigas, Rebekah I. and Maskey, Manil
and Bernab\'e-Moreno, Juan and Ramachandran, Rahul and Roy, Sujit},
title = {{SomBench}: Benchmark Dataset for Advancing Machine Learning in Lunar Science},
year = {2026},
howpublished = {\url{https://huggingface.co/collections/nasa-ibm-ai4science/lunar-fm-ml-ready-benchmark-dataset-sombench}}
}
@article{Robbins2019New,
title = {A New Global Database of Lunar Impact Craters $>$1--2 km: 1. Crater Locations
and Sizes, Comparisons With Published Databases, and Global Analysis},
author = {Robbins, Stuart J.},
journal = {Journal of Geophysical Research: Planets},
volume = {124},
pages = {871--892},
year = {2019},
doi = {10.1029/2018JE005592}
}
Please also cite TerraMind (Jakubik et al., 2025), TerraTorch (Gomes et al., 2025), FlexiViT (Beyer et al., 2023), and — for the NAC annotations — OpenCraterTool (Heyer et al., 2023).
Acknowledgments
Supported by NASA under Award No. 80MSFC25M0084. Data products courtesy of LROC and LOLA.
Contact: Sujit Roy (sujit.roy@nasa.gov) · Paolo Fraccaro (paolo.fraccaro@ibm.com)
- Downloads last month
- 316