Cloud Detection — SegFormer (MiT-B4 encoder, RGB)

Repository: Burdenthrive/cloud-detection-segformer-mit-b4
Task: Multiclass semantic segmentation (4 classes) on Sentinel‑2 L1C RGB (3 bands) using SegFormer (segmentation_models_pytorch) with MiT‑B4 encoder.

This model predicts per‑pixel labels among: clear, thick cloud, thin cloud, cloud shadow.


✨ Highlights

  • Input: Sentinel‑2 L1C RGB tiles/patches (float32, shape B×3×512×512, bands B04‑B03‑B02).
  • Backbone: mit_b4 (MiT encoder via segmentation_models_pytorch).
  • Output: Logits B×4×512×512 (apply softmax + argmax).
  • Files: model.py, config.json, and weights.

📦 Files

  • model.py — defines the SegFormer class (wrapper around smp.Segformer).
  • config.json — hyperparameters and class names:
    {
      "task": "image-segmentation",
      "model_name": "segformer-mit-b4",
      "model_kwargs": {
        "encoder_name": "mit_b4",
        "encoder_weights": "imagenet",
        "in_channels": 3,
        "num_classes": 4,
        "freeze_encoder": false
      },
      "classes": ["clear", "thick cloud", "thin cloud", "cloud shadow"],
      "id2label": { "0": "clear", "1": "thick cloud", "2": "thin cloud", "3": "cloud shadow" },
      "label2id": { "clear": 0, "thick cloud": 1, "thin cloud": 2, "cloud shadow": 3 },
      "input_bands": ["B04", "B03", "B02"]
    }
    
Downloads last month
25
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Burdenthrive/cloud-detection-segformer-mit_b4-RGB