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- mars
|
| 8 |
+
- dem-prediction
|
| 9 |
+
- u-net
|
| 10 |
+
- multi-task-learning
|
| 11 |
+
datasets:
|
| 12 |
+
- ESA-Datalabs/MCTED
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# MarsDEMNet
|
| 16 |
+
|
| 17 |
+
MarsDEMNet is a comparative deep learning study for single-image Digital Elevation Model (DEM) prediction from Mars CTX satellite imagery. Four architectures are evaluated, a classical Random Forest baseline, a single-output U-Net, a multi-output U-Net with multi-task learning, and an encoder depth ablation — all trained on the MCTED dataset of 80,898 paired CTX orthoimage and DEM patches.
|
| 18 |
+
|
| 19 |
+
## Model Details
|
| 20 |
+
|
| 21 |
+
### Model Description
|
| 22 |
+
|
| 23 |
+
MarsDEMNet addresses a fundamental coverage asymmetry on Mars: while the CTX instrument has photographed ~99.5% of the Martian surface at 5–6 m/pixel, high-resolution stereo DEMs exist for only ~0.5–1% of that coverage. Models trained on MCTED learn to predict dense elevation maps from single optical images, extending effective DEM coverage to nearly the entire planet.
|
| 24 |
+
|
| 25 |
+
- **Model type:** Convolutional encoder-decoder (U-Net)
|
| 26 |
+
- **License:** CC-BY 4.0
|
| 27 |
+
- **Finetuned from:** Trained from scratch — no pretrained weights
|
| 28 |
+
|
| 29 |
+
### Model Sources
|
| 30 |
+
|
| 31 |
+
- **Repository:** https://github.com/harshithkethavath/MarsDEMNet
|
| 32 |
+
- **Dataset:** https://huggingface.co/datasets/ESA-Datalabs/MCTED
|
| 33 |
+
|
| 34 |
+
## Checkpoints
|
| 35 |
+
|
| 36 |
+
Four model checkpoints are provided:
|
| 37 |
+
|
| 38 |
+
| File | Architecture | Val RMSE | Val MAE | Delta-1 |
|
| 39 |
+
|---|---|---|---|---|
|
| 40 |
+
| `marsdеmnet-unet-elevation-4block.pt` | Single-output U-Net, 4-block encoder, 7.8M params | 74.38m | 52.86m | 0.418 |
|
| 41 |
+
| `marsdеmnet-unet-multitask-4block.pt` | Multi-output U-Net, 4-block encoder, 7.8M params | 74.29m | 52.68m | 0.422 |
|
| 42 |
+
| `marsdеmnet-unet-multitask-3block.pt` | Multi-output U-Net, 3-block encoder, 1.9M params | 82.80m | 58.29m | 0.440 |
|
| 43 |
+
| `marsdеmnet-unet-multitask-5block.pt` | Multi-output U-Net, 5-block encoder, 31.4M params | 59.88m | 42.67m | 0.409 |
|
| 44 |
+
|
| 45 |
+
The 5-block multi-output model is the best overall, achieving 19% lower RMSE than the 4-block baseline with no overfitting observed.
|
| 46 |
+
|
| 47 |
+
## How to Get Started
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
import torch
|
| 51 |
+
from scripts.deeplearning.unet import UNet
|
| 52 |
+
|
| 53 |
+
# Single-output (elevation only) — 4-block
|
| 54 |
+
model = UNet(in_channels=1, out_channels=1, num_blocks=4, base_ch=32)
|
| 55 |
+
ckpt = torch.load("marsdеmnet-unet-elevation-4block.pt", map_location="cpu")
|
| 56 |
+
model.load_state_dict(ckpt["model_state"])
|
| 57 |
+
model.eval()
|
| 58 |
+
|
| 59 |
+
# Multi-output (elevation + slope + roughness) — 5-block (best)
|
| 60 |
+
model = UNet(in_channels=1, out_channels=3, num_blocks=5, base_ch=32)
|
| 61 |
+
ckpt = torch.load("marsdеmnet-unet-multitask-5block.pt", map_location="cpu")
|
| 62 |
+
model.load_state_dict(ckpt["model_state"])
|
| 63 |
+
model.eval()
|
| 64 |
+
|
| 65 |
+
# Inference
|
| 66 |
+
with torch.no_grad():
|
| 67 |
+
# optical: (1, 1, 518, 518) normalized CTX patch
|
| 68 |
+
pred = model(optical)
|
| 69 |
+
# Single-output: pred shape (1, 1, 518, 518) — elevation
|
| 70 |
+
# Multi-output: pred shape (1, 3, 518, 518) — [elevation, slope, roughness]
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
Input normalization: clip to 2nd–98th percentile, then z-score per patch. DEM targets are mean-subtracted per patch (relative elevation in meters).
|
| 74 |
+
|
| 75 |
+
## Training Details
|
| 76 |
+
|
| 77 |
+
### Training Data
|
| 78 |
+
|
| 79 |
+
MCTED (Mars CTX Terrain-Elevation Dataset) — 80,898 paired CTX orthoimage and DEM patches derived from 1,122 quality-filtered stereo scenes. Geography-aware train/val split at the scene level to prevent spatial leakage. Train: 65,090 patches. Val: 15,808 patches.
|
| 80 |
+
|
| 81 |
+
### Training Procedure
|
| 82 |
+
|
| 83 |
+
- **Optimizer:** AdamW, lr=1e-4, weight_decay=1e-4
|
| 84 |
+
- **Schedule:** Cosine annealing to 1e-6 over 50 epochs
|
| 85 |
+
- **Early stopping:** Patience 10 on val RMSE
|
| 86 |
+
- **Batch size:** 16
|
| 87 |
+
- **Augmentation:** Random horizontal/vertical flips and 90° rotations applied jointly to image and labels
|
| 88 |
+
- **Loss:** Masked MAE (single-output); weighted sum of masked MAE losses (multi-output, uniform 1:1:1 weights)
|
| 89 |
+
- **Training regime:** fp32
|
| 90 |
+
- **Hardware:** NVIDIA H100 GPU
|
| 91 |
+
|
| 92 |
+
### Preprocessing
|
| 93 |
+
|
| 94 |
+
- CTX patches: percentile clip (2nd–98th) + per-patch z-score normalization
|
| 95 |
+
- DEM patches: per-patch mean subtraction (relative elevation)
|
| 96 |
+
- Validity masking: logical AND of NaN mask and deviation mask; invalid pixels excluded from loss and metrics
|
| 97 |
+
|
| 98 |
+
## Evaluation
|
| 99 |
+
|
| 100 |
+
### Metrics
|
| 101 |
+
|
| 102 |
+
- **MAE** — mean absolute elevation error in meters
|
| 103 |
+
- **RMSE** — primary ranking metric; penalizes large errors
|
| 104 |
+
- **Delta-1** — fraction of valid pixels where max(pred/gt, gt/pred) < 1.25
|
| 105 |
+
|
| 106 |
+
### Results
|
| 107 |
+
|
| 108 |
+
| Model | Params | Val RMSE | Val MAE | Delta-1 |
|
| 109 |
+
|---|---|---|---|---|
|
| 110 |
+
| Random Forest (classical baseline) | — | 58.39m (elev std) | 41.29m | — |
|
| 111 |
+
| Single-output U-Net (4-block) | 7.8M | 74.38m | 52.86m | 0.418 |
|
| 112 |
+
| Multi-output U-Net uniform (4-block) | 7.8M | 74.29m | 52.68m | 0.422 |
|
| 113 |
+
| Multi-output U-Net (3-block ablation) | 1.9M | 82.80m | 58.29m | 0.440 |
|
| 114 |
+
| Multi-output U-Net (5-block ablation) | 31.4M | **59.88m** | **42.67m** | 0.409 |
|
| 115 |
+
|
| 116 |
+
## Bias, Risks, and Limitations
|
| 117 |
+
|
| 118 |
+
- Models are trained on regions of Mars where stereo DEMs exist, which are geographically biased toward scientifically interesting terrain. Performance on flat, featureless plains may be lower.
|
| 119 |
+
- Textureless terrain with no illumination gradient provides no depth cue, a known failure mode.
|
| 120 |
+
- Predictions are relative elevation (mean-subtracted per patch), not absolute MOLA-referenced altitude.
|
| 121 |
+
- Not suitable for safety-critical mission planning without further validation.
|
| 122 |
+
|
| 123 |
+
## Technical Specifications
|
| 124 |
+
|
| 125 |
+
### Model Architecture
|
| 126 |
+
|
| 127 |
+
U-Net encoder-decoder with configurable depth. Each encoder block: Conv2d(3×3) → BatchNorm → ReLU × 2 → MaxPool. Decoder: bilinear upsampling + lateral skip connections. Multi-output variant has three separate 1×1 conv heads for elevation, slope, and roughness.
|
| 128 |
+
|
| 129 |
+
## Citation
|
| 130 |
+
|
| 131 |
+
If you use MarsDEMNet, please cite:
|
| 132 |
+
|
| 133 |
+
```bibtex
|
| 134 |
+
@misc{marsdемnet2026,
|
| 135 |
+
title = {MarsDEMNet: Classical and Deep Learning Approaches for Single-Image Digital Elevation Model Prediction from Mars CTX Imagery},
|
| 136 |
+
author = {Kethavath, Harshith and Yadav, Srija and Katkam, Sathwik},
|
| 137 |
+
year = {2026},
|
| 138 |
+
publisher = {GitHub},
|
| 139 |
+
url = {https://github.com/harshithkethavath/MarsDEMNet}
|
| 140 |
+
}
|
| 141 |
+
```
|