Instructions to use F1nnSBK/lunar-dinov3-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use F1nnSBK/lunar-dinov3-lora with PEFT:
from peft import PeftModel from transformers import AutoModel base_model = AutoModel.from_pretrained("facebook/dinov3-vits16-pretrain-lvd1689m") model = PeftModel.from_pretrained(base_model, "F1nnSBK/lunar-dinov3-lora") - Notebooks
- Google Colab
- Kaggle
DIVE V3: Lunar DINOv3 LoRA with Matryoshka Embeddings & Epistemic Uncertainty
DIVE V3 (Deep In-Strip Variable Embeddings) is a foundation model for lunar collapse pit and cave skylight detection from LROC Narrow Angle Camera (NAC) orbital imagery. The model adapts a DINOv3 ViT-S/16 backbone using LoRA and a 4-scale Matryoshka projection head (64d, 128d, 256d, 384d) with deterministic multi-scale epistemic uncertainty.
Technical Specifications
- Backbone: DINOv3 ViT-S/16 (
facebook/dinov3-vits16-pretrain-lvd1689m) - LoRA Adapter: rank 32, alpha 32 on
qkv,proj,fc1,fc2(3.78M trainable parameters) - Input Geometry: 256 ร 256 px at 1.0 m/px, SPICE pushbroom projection with SLDEM2015 topographic relief, rotated to top-down solar illumination
- Matryoshka Projections: 4 concentric normalized heads (64d, 128d, 256d, 384d) trained via MatryoshkaDIVELoss (margin 0.70)
- Dataset Partition: 100 km Haversine geodesic clustering (1,311 train, 336 val in King crater, 283 held-out test across Aristarchus, Marius Hills, Ohm, Highland)
Calibration Thresholds
Calibrated decision thresholds tau_d computed from training split positive prototypes:
| Dimension | Decision Threshold (tau) | Pit Mean (s_pit) | Neg Mean (s_neg) | Separation (ฮ) |
|---|---|---|---|---|
| 64d | 0.3287 | +0.9702 | -0.3129 | +1.2831 |
| 128d | 0.3558 | +0.9816 | -0.2700 | +1.2517 |
| 256d | 0.2908 | +0.9731 | -0.3914 | +1.3645 |
| 384d | 0.2475 | +0.9742 | -0.4793 | +1.4535 |
Benchmark Results
Validation Split (King Crater)
| Dim | Model | Rank-1 (%) | MRR | AUC-ROC | PR-AUC | FPR@95 (%) | F1-Score | Acc (%) | ECE | Sep (ฮ) | s_pit | s_neg |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 64d | Legacy HF | 42.1% | 0.5265 | 0.8917 | 0.5708 | 56.71% | 0.5253 | 86.0% | 0.1662 | +0.2182 | +0.5738 | +0.3557 |
| DIVE V3 | 97.4% | 0.9868 | 0.9994 | 0.9956 | 0.34% | 0.9620 | 99.1% | 0.0135 | +1.2464 | +0.9575 | -0.2889 | |
| 128d | Legacy HF | 28.9% | 0.4246 | 0.8469 | 0.4765 | 64.43% | 0.4161 | 74.1% | 0.2683 | +0.1595 | +0.6539 | +0.4943 |
| DIVE V3 | 100.0% | 1.0000 | 0.9999 | 0.9993 | 0.00% | 0.9620 | 99.1% | 0.0132 | +1.2318 | +0.9580 | -0.2738 | |
| 256d | Legacy HF | 47.4% | 0.6045 | 0.8773 | 0.6233 | 46.98% | 0.4167 | 75.0% | 0.2707 | +0.1745 | +0.6584 | +0.4839 |
| DIVE V3 | 100.0% | 1.0000 | 0.9996 | 0.9973 | 0.34% | 0.9500 | 98.8% | 0.0166 | +1.2901 | +0.9421 | -0.3480 | |
| 384d | Legacy HF | 73.7% | 0.8298 | 0.9855 | 0.9047 | 8.05% | 0.6387 | 87.2% | 0.1496 | +0.6598 | +0.7962 | +0.1364 |
| DIVE V3 | 100.0% | 1.0000 | 0.9995 | 0.9960 | 0.67% | 0.9500 | 98.8% | 0.0128 | +1.3854 | +0.9440 | -0.4414 |
Held-Out Test Split (Aristarchus, Marius Hills, Ohm, Highland)
| Dim | Model | Rank-1 (%) | MRR | AUC-ROC | PR-AUC | FPR@95 (%) | F1-Score | Acc (%) | ECE | Sep (ฮ) | s_pit | s_neg |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 64d | Legacy HF | 39.4% | 0.5610 | 0.6566 | 0.3617 | 94.40% | 0.2623 | 68.2% | 0.2253 | +0.1124 | +0.4695 | +0.3571 |
| DIVE V3 | 97.0% | 0.9798 | 0.9937 | 0.9807 | 0.40% | 0.9697 | 99.3% | 0.0067 | +1.1842 | +0.8987 | -0.2856 | |
| 128d | Legacy HF | 39.4% | 0.5932 | 0.6616 | 0.3105 | 78.80% | 0.2602 | 67.8% | 0.2392 | +0.1076 | +0.5478 | +0.4403 |
| DIVE V3 | 97.0% | 0.9848 | 0.9956 | 0.9842 | 0.00% | 0.9697 | 99.3% | 0.0058 | +1.1710 | +0.9242 | -0.2468 | |
| 256d | Legacy HF | 57.6% | 0.7306 | 0.6937 | 0.4199 | 75.20% | 0.3232 | 76.3% | 0.1947 | +0.1365 | +0.5459 | +0.4095 |
| DIVE V3 | 97.0% | 0.9773 | 0.9880 | 0.9773 | 0.00% | 0.9697 | 99.3% | 0.0075 | +1.2563 | +0.8978 | -0.3585 | |
| 384d | Legacy HF | 93.9% | 0.9621 | 0.9910 | 0.9098 | 3.60% | 0.6000 | 84.5% | 0.1651 | +0.7228 | +0.8220 | +0.0991 |
| DIVE V3 | 97.0% | 0.9848 | 0.9945 | 0.9825 | 0.00% | 0.9697 | 99.3% | 0.0068 | +1.3491 | +0.8989 | -0.4501 |
Per-Region Held-Out Test Breakdown (DIVE V3)
| Target Region | Head | Rank-1 (%) | MRR | AUC-ROC | PR-AUC | Acc (%) | Sep (ฮ) | s_pit | s_neg |
|---|---|---|---|---|---|---|---|---|---|
| Aristarchus (14 pos, 106 neg) | 64d | 92.9% | 0.9524 | 0.9757 | 0.9439 | 98.3% | +1.0962 | +0.8533 | -0.2429 |
| 128d | 92.9% | 0.9643 | 0.9865 | 0.9580 | 98.3% | +1.0901 | +0.8710 | -0.2192 | |
| 256d | 92.9% | 0.9464 | 0.9704 | 0.9458 | 98.3% | +1.1964 | +0.8501 | -0.3463 | |
| 384d | 92.9% | 0.9643 | 0.9838 | 0.9549 | 98.3% | +1.2764 | +0.8505 | -0.4259 | |
| Marius Hills (7 pos, 49 neg) | 64d | 100.0% | 1.0000 | 1.0000 | 1.0000 | 100.0% | +1.2450 | +0.9614 | -0.2836 |
| 128d | 100.0% | 1.0000 | 1.0000 | 1.0000 | 100.0% | +1.2039 | +0.9726 | -0.2313 | |
| 256d | 100.0% | 1.0000 | 1.0000 | 1.0000 | 100.0% | +1.2872 | +0.9496 | -0.3376 | |
| 384d | 100.0% | 1.0000 | 1.0000 | 1.0000 | 100.0% | +1.4085 | +0.9543 | -0.4542 | |
| Highland (10 pos, 80 neg) | 384d | 100.0% | 1.0000 | 1.0000 | 1.0000 | 100.0% | +1.3887 | +0.9103 | -0.4784 |
| Ohm (2 pos, 15 neg) | 384d | 100.0% | 1.0000 | 1.0000 | 1.0000 | 100.0% | +1.4274 | +0.9833 | -0.4441 |
Matryoshka-BALD Epistemic Uncertainty Cohorts
| Cohort | N | Mean s_64 | Mean s_384 | Mean p_mean | H_alea (bits) | I_MBALD (bits) | Mean U_veto | Max U_veto |
|---|---|---|---|---|---|---|---|---|
| Pits (Valid) | 71 | +0.9220 | +0.9230 | 0.9824 | 0.0278 | 0.0007 | 0.0022 | 0.0500 |
| Background (Clean) | 538 | -0.2862 | -0.4589 | 0.0040 | 0.0273 | 0.0013 | 0.0030 | 0.1330 |
| Noon (Washed-Out) | 45 | +0.0706 | -0.0426 | 0.2708 | 0.1488 | 0.0418 | 0.0157 | 0.2356 |
| Boundary (Ambiguous) | 676 | +0.8422 | +0.8010 | 0.9179 | 0.1285 | 0.0191 | 0.0418 | 0.8735 |
Usage Example
import json
import numpy as np
import torch
# Load calibration metadata and positive prototypes
with open("calibration_metadata.json", "r") as f:
calib = json.load(f)
temperature = calib["temperature"]
thresholds = {d: calib["heads"][d]["tau"] for d in ["64d", "128d", "256d", "384d"]}
prototypes = torch.load("prototypes.pt", map_location="cpu", weights_only=True)
def evaluate_tile_uncertainty(projections: dict) -> dict:
"""Evaluate multi-scale probabilities, BALD epistemic uncertainty, and coarse-to-fine veto."""
probs = {}
for d in ["64d", "128d", "256d", "384d"]:
z = projections[d].squeeze().numpy()
z = z / max(float(np.linalg.norm(z)), 1e-12)
mu = prototypes[d].numpy()
s = float(np.dot(z, mu))
tau = thresholds[d]
p = 1.0 / (1.0 + np.exp(-np.clip((s - tau) / temperature, -50.0, 50.0)))
probs[d] = float(p)
p_bar = float(np.mean(list(probs.values())))
p_clamped = np.clip(p_bar, 1e-12, 1.0 - 1e-12)
h_total = float(-p_clamped * np.log2(p_clamped) - (1.0 - p_clamped) * np.log2(1.0 - p_clamped))
h_heads = []
for p in probs.values():
pc = np.clip(p, 1e-12, 1.0 - 1e-12)
h_heads.append(-pc * np.log2(pc) - (1.0 - pc) * np.log2(1.0 - pc))
h_alea = float(np.mean(h_heads))
i_mbald = float(max(0.0, h_total - h_alea))
u_veto = float(abs(probs["64d"] - probs["384d"]))
return {
"is_pit": bool(probs["384d"] >= 0.5),
"p_mean": p_bar,
"probs": probs,
"m_bald_bits": i_mbald,
"u_veto": u_veto,
}
Framework Versions
- PEFT 0.19.1
- Downloads last month
- 2
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for F1nnSBK/lunar-dinov3-lora
Base model
facebook/dinov3-vit7b16-pretrain-lvd1689m Finetuned
facebook/dinov3-vits16-pretrain-lvd1689m
