🌵 Desert Semantic Segmentation using SegFormer (MiT-B2)
A SegFormer transformer model fine-tuned on the Offroad Segmentation Training Dataset for 10-class semantic segmentation of desert terrain — built for UGV (Unmanned Ground Vehicle) autonomous navigation in off-road environments.
🧠 Model Architecture
🗂 Dataset Classes (10 Categories)
📊 Dataset Statistics
- Image resolution: 960 × 540 (RGB)
- Mask format: uint16 with raw class value encoding
- Total annotated instances: 16,951
🎨 Augmentation Pipeline
11 augmentations specifically chosen for desert and off-road conditions:
⚙️ Training Configuration
📈 Evaluation Results
Evaluated on the validation split (286 images) using COCO-style mean IoU.
Per-Class IoU
Best class: Sky (0.9860) — large uniform regions
Hardest class: Ground Clutter (0.3647) — small, heterogeneous objects
⚙️ Inference
from transformers import SegformerImageProcessor, SegformerForSemanticSegmentation
from PIL import Image
import torch
import torch.nn.functional as F
# Load model
processor = SegformerImageProcessor.from_pretrained("PUSHPENDAR/desert-segformer")
model = SegformerForSemanticSegmentation.from_pretrained("PUSHPENDAR/desert-segformer")
model.eval()
# Load image
image = Image.open("desert_scene.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
# Predict
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits # (1, num_classes, H/4, W/4)
# Upsample to original size
upsampled = F.interpolate(
logits,
size=(image.height, image.width),
mode="bilinear",
align_corners=False
)
pred_mask = upsampled.argmax(dim=1)[0].numpy() # (H, W)
print("Predicted class map shape:", pred_mask.shape)
📦 Repository Files
🚀 Run Locally
git clone https://huggingface.co/PUSHPENDAR/desert-segformer
cd desert-segformer
pip install transformers torch pillow
python app.py
📝 Citation
If you use this model or dataset, please cite:
@misc{desert-segformer-2025,
title = {Desert Semantic Segmentation with SegFormer (MiT-B2)},
author = {Pushpendar Choudhary},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/PUSHPENDAR/desert-segformer}
}
📄 License
Apache 2.0 — see LICENSE for details.