Ir para o conteúdo
ModelListadosExterno
Baixar

Deforestation Monitor

Semantic segmentation model for satellite-based land-cover classification and deforestation change detection. Classifies every pixel into one of 7 land-cover classes with a focus on forest boundary delineation.

TipoOtherVersãoRevision 861ffbaCnota

Fonte do modelo

Tipo
Other
Tamanho do arquivo
497 MB
Versão
vRevision 861ffba
Atualizado
16 de set. de 2026
Downloads
0
Fonte
Hugging Face

Descrição da fonte

Deforestation Monitor — U-Net ResNet-50

Semantic segmentation model for satellite-based land-cover classification and deforestation change detection. Classifies every pixel into one of 7 land-cover classes with a focus on forest boundary delineation.

Source code & full pipeline: silentone12725/deforestation-monitor


Model Details

FieldValue
ArchitectureU-Net
EncoderResNet-50 (ImageNet pretrained)
Input512 × 512 × 3 (RGB)
Output512 × 512 × 7 (logits)
Parameters32.5 M
FrameworkPyTorch 2.x + segmentation-models-pytorch
Training GPUNVIDIA A40 48 GB

Land-Cover Classes

IndexClassRGB Colour
0Urban(0, 255, 255)
1Agriculture(255, 255, 0)
2Rangeland(255, 0, 255)
3Forest ← key class(0, 255, 0)
4Water(0, 0, 255)
5Barren(255, 255, 255)
6Unknown (ignored in loss)(0, 0, 0)

Training Data

Three datasets combined via WeightedRandomSampler:

DatasetTrain SamplesWeight
DeepGlobe Land Cover (Kaggle)6021.0
Amazon + Atlantic Forest (Zenodo 4498086)9841.0
LoveDA (Zenodo 5706578, NeurIPS 2021)25220.5
Total4108

Validation and test sets: DeepGlobe only (120 val / 81 test).


Usage

import torch
import segmentation_models_pytorch as smp
from huggingface_hub import hf_hub_download

# Download weights
path = hf_hub_download(
    repo_id="silentone0725/deforestation-monitor",
    filename="best_model.pth",
    local_dir="checkpoints",
    local_dir_use_symlinks=False,
)

# Load model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = smp.Unet(
    encoder_name="resnet50",
    encoder_weights=None,
    in_channels=3,
    classes=7,
    activation=None,
)
ckpt  = torch.load(path, map_location=device)
state = {k.replace("_orig_mod.", ""): v for k, v in ckpt["state_dict"].items()}
model.load_state_dict(state, strict=False)
model = model.to(device).eval()

# Inference (FP16 recommended for RTX 3050 4GB)
model = model.half()
with torch.no_grad():
    logits = model(image_tensor.half().to(device))  # (1, 7, 512, 512)
    mask   = logits.argmax(dim=1)                   # (1, 512, 512)

For the full inference pipeline including preprocessing, change detection, and the FastAPI web UI, see the GitHub repository.


Training Configuration

HyperparameterValue
Loss0.5 × Dice + 0.5 × CrossEntropy (label smooth ε=0.05)
OptimiserAdamW (lr=1e-4, wd=1e-4)
Schedule3-epoch linear warmup → cosine annealing to 1e-6
Epochs50
Batch size16
EMA decay0.9999 (inference uses EMA weights)
Mixed precisionAMP (torch.amp.autocast)

Citation

@misc{deforestation-monitor-2026,
  author  = {Daksh Thakuria},
  title   = {Deforestation Monitor via Satellite Imagery},
  year    = {2026},
  url     = {https://huggingface.co/silentone0725/deforestation-monitor},
  note    = {Deep Learning Lab, AIM3230, Manipal University Jaipur}
}

Fontes

1 fonte
Hugging FacePrimárioVersão 861ffbaa51b01017aab7ac7b19c61289883a677c
huggingface.co/silentone0725/deforestation-monitor/tree/861ffbaa51b01017aab7ac7b19c61289883a677c

Verificado 1 de set.

Artefatos de modelo

1 artefato

best_model.pth

pth · 497 MB · SHA-256 397d34640e66…db38 · Hugging Face

Download file

Trechos de fonte

2 trechos

--- license: mit language: - en tags: - semantic-segmentation - satellite-imagery - remote-sensing - deforestation - land-cover - pytorch - unet - resnet datasets: - deepglobe - loveda pipeline_tag: image-segmentation --- # Deforestation Monitor — U-Net ResNet-50 Semantic segmentation model for satellite-based land-cover classification and deforestation change detection. Classifies every pixel into one of 7 land-cover classes with a focus on forest boundary delineation. **Source code & full pipeline:** [silentone12725/deforestation-monitor](https://github.com/silentone12725/deforestation-monitor) --- ## Model Details | Field | Value | |---|---| | Architecture | U-Net | | Encoder | ResNet-50 (ImageNet pretrained) | | Input | 512 × 512 × 3 (RGB) | | Output | 512 × 512 × 7 (logits) | | Parameters | 32.5 M | | Framework | PyTorch 2.x + segmentation-models-pytorch | | Training GPU | NVIDIA A40 48 GB | --- ## Land-Cover Classes | Index | Class | RGB Colour | |---|---|---| | 0 | Urban | (0, 255, 255) | | 1 | Agriculture | (255, 255, 0) | | 2 | Rangeland | (255, 0, 255) | | 3 | **Forest** ← key class | (0, 255, 0) | | 4 | Water | (0, 0, 255) | | 5 | Barren | (255, 255, 255) | | 6 | Unknown (ignored in loss) | (0, 0, 0) | --- ## Training Data Three datasets combined via `WeightedRandomSampler`: | Dataset | Train Samples | Weight | |---|---|---| | DeepGlobe Land Cover (Kaggle) | 602 | 1.0 | | Amazon + Atlantic Forest (Zenodo 4498086) | 984 | 1.0 | | LoveDA (Zenodo 5706578, NeurIPS 2021) | 2522 | 0.5 | | **Total** | **4108** | | Validation and test sets: DeepGlobe only (120 val / 81 test). --- ## Usage ```python import torch import segmentation_models_pytorch as smp from huggingface_hub import hf_hub_download # Download weights path = hf_hub_download( repo_id="silentone0725/deforestation-monitor", filename="best_model.pth", local_dir="checkpoints", local_dir_use_symlinks=False, ) # Load model device = torch.device("cuda" if torch.cuda.is_available() else "cpu") model = smp.Unet( encoder_name="resnet50", encoder_weights=None, in_channels=3, classes=7, activation=None, ) ckpt = torch.load(path, map_location=device) state = {k.replace("_orig_mod.", ""): v for k, v in ckpt["state_dict"].items()} model.load_state_dict(state, strict=False) model = model.to(device).eval() # Inference (FP16 recommended for RTX 3050 4GB) model = model.half() with...

Source context: 0 downloads · 0 likes · Pipeline image-segmentation · Repo silentone0725/deforestation-monitor