Giter Site home page Giter Site logo

mintusf / land_cover_segmentation Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 129.59 MB

Segmentation for land cover using raw satellite data (Sentinel 2La)

License: Apache License 2.0

Python 28.02% Jupyter Notebook 71.98%
satellite-imagery remote-sensing segmentation land-cover

land_cover_segmentation's Introduction

CI pipeline Flake8 check

Summary

Land cover detection using Sentinel satellite data with instance segmentation.

How to run

Environment setup

  1. If you want to create a local environment (e.g. on AWS), please run env/setup_env.sh
  2. If you want to create a docker container, please run env/setup_docker.sh)

Training

  1. Create your yml config file in config folder, according to parameters in default.py
  2. Run training with python train.py --cfg CONFIG_PATH
  3. Experiment can be tracket in comet_ml. In order to do so, please add your API_KEY in .comet.config image
  4. Weights are saved to weights folder
  5. Logs can be found in logs folder

Testing

  1. In order to test and get class-wise metrics on test set, run evaluate.py --cfg CONFIG_PATH --checkpoint WEIGHTS_PATH

Inference

  1. In order to make inference, run infer.py --cfg CONFIG_PATH --checkpoint WEIGHTS_PATH --sample_list PATH_TO_SAMPLES_TXT --outputs SELECTED_OUTPUTS. Possible outputs are: alphablend (png), raster (mask with geographic coordinates), alphablended_raster (alphablend with geographic coordinates) and raw_raster (input image).
  2. Weigths for 3 bands input (results shown below) are available here

Folders:

  • config: training configs, dataset configs
  • env: scripts to build docker environment
  • logs: training logs
  • models: models implementation
  • tests: code tests
  • tools: visualization tool
  • train_utils: utils for training
  • utils: I/O, visualization, raster utils
  • weights: for weights

Dataset

Reference:

Used datasets:

SEN12MS (LINK)

  • Spatial resolution: 10m
  • Patch size: 256 x 256
  • Classes: 33 (converted to 12)
  • According to the paper, the accuracy of annotation is ~80%, which is also limitation for the training.
  • Channels: 12 bands of Sentinel L2C (Only RBG bands used for training and its results are shown in this document)
  • Dataset for class snow was created by this repository creator using EO Browser

Models

Results

Metrics (test set)

class recall precision f1
shrublands 0.85 0.73 0.79
urban 0.70 0.60 0.65
agricultural 0.90 0.76 0.82
barren 0.43 1.00 0.60
snow 0.91 0.93 0.92
water 0.92 0.97 0.94
dense_forest 0.42 0.77 0.54
open_forest 0.53 0.54 0.54
wetlands 0.66 0.23 0.23
grasslands 0.48 0.38 0.42

Confusion matrix (test set)

Confusion_matrix

Generated masks example

Colors

Test res

Real-life Web App

The model is used in this repository as a backend for land cover classification.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.