U-Net for satellite imagery and forest analysis
2 min readupdated
This model is a multi-task U-Net AI model (an image segmentation architecture) built on Keras, designed to analyze Sentinel-2 satellite imagery. It outputs two maps: pixel-level vegetation cover and the probability of forest reduction. The model uses 18 input channels, including special NDVI and NBR indices for change detection. It features training on overlapping patches to improve accuracy. This tool is useful for ecological researchers and environmental monitoring specialists.
Key features
- Shared encoder and two independent decoders for parallel map prediction.
- Use of 18 input channels: 12 original Sentinel-2 bands and 6 channels with NDVI and NBR indices.
- Application of overlapping training patches (stride 64) to improve prediction quality.
- Compact Keras-based architecture with a total of about 3.1 million parameters.
What you can do
- Segment satellite images into 5 vegetation and land cover classes.
- Predict forest cover loss probability using multitemporal data from 2021-2023.
- Process full scenes using repository scripts with tile splitting and GeoTIFF saving.
Example
import json, numpy as np, keras
from huggingface_hub import hf_hub_download
repo = 'ShashwatVj/assam-landcover-forest-loss-unet'
model = keras.models.load_model(hf_hub_download(repo, 'best.keras'), compile=False)
threshold = json.load(open(hf_hub_download(repo, 'threshold.json')))['value']
Read more
DetailsTest metrics: Overall Accuracy 0.889, mIoU 0.600, PR-AUC 0.584.
Training: Adam 1e-3, batch size 8, 37.6 minutes on a 12-thread CPU.
Limitations: the model is trained for a specific region and requires fine-tuning for other zones.










Comments