Model Card — SegFormer-B0 Kathmandu Valley Satellite Segmentation
Model Description
This model is a fine-tuned SegFormer-B0 for semantic segmentation of satellite imagery over Kathmandu Valley, Nepal. It classifies each pixel into one of 7 land-use categories: Background, Residential Area, Road, River, Forest, and Unused Land. The model is intended for urban planning, GIS analysis, and geospatial research applications.
This model can be used out-of-the-box for satellite image segmentation over Kathmandu Valley or similar urban/semi-urban landscapes. It accepts a 512×512 RGB satellite image and outputs a per-pixel land-use classification mask.
This model can be plugged into larger GIS pipelines for:
Automated land-use/land-cover (LULC) mapping
Urban sprawl analysis
River and forest change detection
Input feature generation for spatial planning models
Out-of-Scope Use
Not suitable for segmenting non-satellite imagery (street photos, drone footage with different resolution/angle).
Performance may degrade on satellite imagery from regions with significantly different land cover patterns than Kathmandu Valley.
Not suitable for fine-grained object detection within classes (e.g., identifying individual buildings).
Bias, Risks, and Limitations
Geographic bias: Trained exclusively on Kathmandu Valley tiles; may not generalize to other geographies.
Class imbalance: Despite weighted loss, rare classes (Road, River) may have lower per-class IoU.
Resolution dependency: Expects 512×512 input tiles; other resolutions require resizing and may affect accuracy.
Annotation noise: Manual annotations via CVAT may have some boundary ambiguity between classes.
Recommendations
Validate predictions on your specific region before using results for critical planning decisions. Cross-checking against GIS datasets (e.g., OpenStreetMap) is recommended.
How to Get Started with the Model
Install dependencies:
pip install torch transformers Pillow matplotlib
Then use the inference script in the Direct Use section above.
Training Details
Training Data
A custom dataset was built from satellite imagery of Kathmandu Valley, Nepal, divided into a grid of tiles.
Standard ImageNet normalization via SegformerFeatureExtractor
Data Augmentation
Applied using albumentations:
Horizontal and vertical flips
Random 90-degree rotations
Resize to 512 × 512
Training Hyperparameters
Hyperparameter
Value
Input size
512 × 512
Batch size
16
Optimizer
AdamW
Learning rate
3e-5
Loss function
Weighted Cross-Entropy
Epochs
300 (early stopping, patience=25)
Cross-validation
3-fold
Training regime
bf16 mixed precision
Class Imbalance Handling
Inverse frequency class weights were computed from the training set and applied to the cross-entropy loss, ensuring rare classes (Road, River) contribute proportionally during training.
Evaluation
Metrics
Mean IoU (mIoU): Primary metric — overlap between predicted and ground truth masks averaged across all classes.
Per-class IoU: Segmentation accuracy per land-use category.
Qualitative inspection: Visual comparison of predicted vs. ground truth masks.
Results
Cross-validation results are reported as mean ± standard deviation of mIoU across 3 folds. Training curves (loss, mIoU, gradient norm) are available in the eval_plots/ directory.
The stable gradient norm across training confirms the MiT encoder converged effectively without vanishing gradient issues.
Model Architecture
Backbone: SegFormer-B0 (nvidia/mit-b0)
Encoder: MiT (Mix Transformer) — hierarchical global context without positional encoding
Decoder: Lightweight MLP head — per-pixel class probability predictions
Output: 7-class segmentation mask over a 512×512 spatial grid
Environmental Impact
Hardware Type: CUDA-enabled GPU
Cloud Provider: Not applicable (local training)
Compute Region: Nepal
Carbon Emitted: Not measured
Citation
bibtex
1@misc{praniil2024kathmandu-segmentation,
2 author = {praniil},
3 title = {Kathmandu Valley Satellite Image Segmentation with SegFormer-B0},
4 year = {2024},
5 publisher = {GitHub},
6 howpublished = {\url{https://github.com/praniil/satellite-image-segmentation}},
7}