Skip to content

Repository files navigation

Sparse Point Supervision for Remote Sensing Segmentation

Sparse point supervision for semantic segmentation on the LoveDA dataset using DeepLabV3+, a custom PartialCrossEntropyLoss, and controlled experiments on annotation density and sampling strategy.

This repository started as a technical assessment and was polished into a portfolio project that demonstrates weakly supervised segmentation, custom loss design, and experiment-driven analysis in PyTorch.

Scope note: The reported metrics are from the documented final experiments in this repository. They are a reproducible project snapshot, not a claim of production model readiness or a substitute for broader benchmark evaluation.

Quick Links

Why This Project

Semantic segmentation usually assumes dense pixel-wise labels. In remote sensing, that assumption is expensive. Full masks take time to annotate, especially for large aerial images with multiple land-cover classes.

This project explores a more practical setup: training a segmentation model when only a very small fraction of pixels are labeled as points.

The central question is simple:

Can sparse point annotations still train a useful remote sensing segmentation model?

What I Built

  • A sparse-label generation pipeline that converts dense masks into point-supervised targets.
  • A custom PartialCrossEntropyLoss that computes loss only on labeled pixels and ignores unlabeled regions.
  • A DeepLabV3+ segmentation baseline with an ImageNet-pretrained ResNet-50 encoder.
  • An annotation-density experiment across 0.1%, 0.5%, 1.0%, and full supervision.
  • A sampling-strategy comparison between random and balanced point sampling at 0.1%.
  • Reproducible plots and a written technical report from the final run.

Project Snapshot

Item Value
Dataset LoveDA
Framework PyTorch + segmentation_models_pytorch
Model DeepLabV3+
Encoder ResNet-50 with ImageNet pretrained weights
Optimizer AdamW
Learning rate 1e-4
Batch size 2
Epochs per experiment 2
Full dataset pairs found 4,191
Train / validation split 3,352 / 839
Final experiment subset 1,000 / 200

Approach

Instead of supervising every pixel, the project keeps only a small percentage of labeled pixels and marks the rest with an ignore index. The model is then trained only on those labeled points.

Two sparse-label strategies were tested:

  • Random sampling: choose labeled pixels uniformly from valid mask locations.
  • Balanced sampling: force at least one point from each class present in the image before filling the remaining point budget.

This setup makes it possible to study whether sparse supervision can approximate full-mask training closely enough to be useful.

Results At A Glance

Annotation Density

Setting Train Loss Val Pixel Accuracy Val mIoU
Random points (0.1%) 1.0216 0.6157 0.3160
Random points (0.5%) 1.0144 0.7025 0.4021
Random points (1.0%) 1.0180 0.6597 0.3510
Full supervision (100%) 1.0125 0.6871 0.3545

Sampling Strategy at 0.1%

Setting Train Loss Val Pixel Accuracy Val mIoU
Random sampling (0.1%) 1.0283 0.7088 0.3980
Balanced sampling (0.1%) 1.0175 0.6616 0.3488

Visual Results

1. Annotation Density Experiment

0.5% random point supervision produced the strongest result in the density study, reaching the best validation mIoU in the final run.

Annotation density results

2. Sampling Strategy Comparison

Balanced sampling was tested as a class-coverage strategy, but in the final run it did not outperform random sampling at 0.1% supervision.

Sampling comparison results

3. Overall mIoU Ranking

This view compares all final runs together and makes the relative ranking easier to scan quickly.

Overall experiment ranking

Key Takeaways

  • Sparse point supervision can train a usable remote sensing segmentation model.
  • A custom partial cross-entropy loss is enough to make sparse point training work cleanly in a standard segmentation pipeline.
  • In this final run, 0.5% random point labels gave the strongest density-study result.
  • Balanced sampling did not improve over random sampling in the final 0.1% comparison.
  • The project is a solid proof of concept, but not yet a fully optimized benchmark.

Repository Structure

Running the Project

Google Colab

  1. Open meriti_assessment.ipynb in Colab.
  2. Run the dependency-install cell at the top of the notebook.
  3. Mount Google Drive if you want outputs saved.
  4. Let the notebook download the LoveDA dataset through kagglehub.
  5. Run the experiment cells near the end of the notebook.

Local Setup

pip install -r requirements.txt

Then open the notebook in Jupyter and run it normally.

Regenerate the README Graphs

python scripts/generate_graphs.py

Limitations

  • The final results come from a subset of the full split, not the full dataset.
  • Each experiment was trained for only 2 epochs.
  • Results were taken from single runs rather than averaged across multiple seeds.
  • The project does not yet include semi-supervised learning, pseudo-labeling, ensembling, or longer training schedules.

These limitations matter, so the current results should be read as a strong prototype and portfolio project rather than a final benchmark claim.

Next Steps

  • train for longer and compare multiple random seeds
  • evaluate on a larger subset or the full split
  • save intermediate predictions and qualitative segmentation outputs
  • add experiment tracking and cleaner training utilities outside the notebook
  • explore semi-supervised extensions such as pseudo-labeling

Notes

  • The LoveDA dataset is not included in this repository.
  • Model checkpoints are not included.
  • The repository is designed to be easy to read, rerun, and discuss as a self-contained individual project.

About

PyTorch research project exploring sparse point supervision for LoveDA remote-sensing segmentation with DeepLabV3+ and custom partial cross-entropy.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages