Giter VIP home page Giter VIP logo

waterseg's Introduction

WaterSeg: Lake Toushka Waterbodies Segmentation from Sentinel-1 SAR imagery

This project aims to perform waterbodies segmentation of Toushka Lakes, a chain of lakes in southern Egypt’s New Valley. The ambitious Toshka Lakes project was designed to provide irrigation for new agricultural developments, and to attract people to the region and away from the dense populations of the Nile Valley itself.

The segmentation task is achieved using Sentinel-1 SAR imagery with the PyTorch framework and the U-Net architecture. The challenge is in differentiating between waterbodies and the surrounding land cover of sands due to the similarity in their intensity values. Traditional machine learning techniques failed to effectively distinguish between these classes. To overcome this challenge, the integration of SAR imagery, polarization information, and terrain features was explored using the U-Net architecture and the PyTorch framework. The training was performed on four different combinations of the dataset. Each combination aimed to evaluate the impact of specific data sources on the segmentation model's performance. The metrics were compared to identify the combination that yields the best results.

Table of Contents

Project Description

The objective of this project is to develop a deep learning model that can accurately segment the water bodies of Toushka Lakes from SAR imagery.SAR data offers valuable information for waterbodies segmentation due to its ability to penetrate cloud cover and capture images regardless of the weather conditions. The segmentation task involves classifying each pixel in SAR satellite imagery as either water or non-water. This information can be valuable for various applications, such as environmental monitoring, water resource management, and urban planning.

The U-Net architecture is chosen for its effectiveness in image segmentation tasks. It was initially developed for biomedical image segmentation but has since been applied to various other domains. It consists of an encoder-decoder structure:

  1. The encoder path, also known as the contracting path, is responsible for capturing contextual information from the input image.

  2. The decoder path, also known as the expansive path, aims to enable precise localization by upsampling the feature maps and recovering the spatial information lost during the encoding process.

Study Area

The lakes are natural depressions in the Sahara Desert that are filled by overflow from Lake Nasser, the enormous 550-kilometer-long (340-mile) reservoir built on the Nile River. Lake Nasser appears in the 2021 image (far right). The rise and fall of Toshka Lakes depend on multi-year fluctuations in the flow of the Nile.

Image Date: November 30, 2021

Dataset

The dataset used in this project consists of Sentinel-1 Synthetic Aperture Radar (SAR) imagery from 2019 to 2021. Unfortunately, no images beyond 2021 were available for this specific location due to the discontinuation of Senitnel-1B, the acquisition platform used in this study area, at the end of 2021. The dataset comprised a total of 90 images, each of which was manually annotated to establish the ground truth labels necessary for training the model to accurately identify water bodies in the SAR imagery. It was divided into 70 images for training and 20 images for validation to assess the model's performance on previously unseen data. It's worth mentioning that the images did not undergo speckle filtering or radiometric terrain correction.

To determine the optimal combination of SAR imagery, polarization information, and terrain features for training, the models were trained on these four different dataset variations:

1. VV Band Dataset

This dataset contains SAR images with only the VV (Vertical-Vertical) polarization band. The VV band provides valuable information about the backscatter intensity, which is essential for distinguishing waterbodies from surrounding land cover.

VV Band- Sentinal-1 SAR

Image Date: December 11, 2021

2. RGB SAR Image Dataset

In this dataset, a composite RGB (Red-Green-Blue) SAR image is created. The VV band is assigned to the red channel, the VH (Vertical-Horizontal) polarization band is assigned to the green channel, and the blue channel is formed by the ratio of VV to VH bands (VV/VH). This composite image provides a visual representation of the SAR data, allowing for better interpretation and analysis.

RGB SAR (red = VV, green = VH, blue = VV/VH)

Image Date: December 11, 2021

3. VV Band + Digital Elevation Model (DEM) Dataset

The third dataset incorporates the VV band SAR images with the Digital Elevation Model (DEM) data. By combining SAR data with terrain information, this dataset takes into account the topographic characteristics of the area, which can influence the appearance and distribution of waterbodies.

4. RGB SAR Image + DEM Dataset:

The fourth dataset combines the RGB SAR image (with VV, VH, and VV/VH bands) with the DEM data. This dataset provides a comprehensive representation by integrating SAR imagery, polarization information, and terrain features.

Results Analysis

The evaluation of the segmentation models over 25 epochs of training reveals that the RGB with DEM model outperforms the other three models in terms of various performance metrics, including model loss value, pixel accuracy, F1 score, and Intersection over Union (IoU). This indicates the effectiveness of incorporating both RGB SAR imagery and Digital Elevation Model (DEM) data for waterbodies segmentation in the lakes of Toushka.

1. Validation Loss Value
2. Validation Pixel accuracy
3. Validation F1_score
4. Validation IoU

Prediction Samples

Original Image

Ground Truth Mask

VV Model Predicted Mask

Metrics of the Best VV Model (after 15 epochs)

RGB Model Predicted Mask

Metrics of the Best RGB Model (after 15 epochs)

VV+DEM Model Predicted Mask

Metrics of the Best VV+DEM Model (after 21 epochs)

RGB+DEM Model Predicted Mask

Metrics of the Best RGB+DEM Model (after 23 epochs)

Installation

  1. Clone the repository:

    git clone https://github.com/MuhammedM294/waterseg.git
  2. Change to the project directory:

    cd waterseg
  3. Setting up an environment to run the project:

      conda create --n <environment-name> 
      conda activate <environment-name>
  4. Install the required dependencies::

    pip install -r requirements.txt

Citing

{
  Author = {Muhammed Abdelaal},
  Title = {Toushka Lakes Water Bodies Semantic Segmentation PyTorch},
  Year = {2023},
  Publisher = {GitHub},
  Journal = {GitHub repository},
  Howpublished = {\url{https://github.com/MuhammedM294/waterseg}}
}

Contributing

Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please open a new issue or submit a pull request.

Acknowledgement

NASA Earth Observatory

License

This project is licensed under the MIT License.

Project based on the cookiecutter data science project template. #cookiecutterdatascience

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.