Skip to content

KotovNikitaStudent/Segmentation_C-SAR

Repository files navigation

Segmentation C-SAR

About project

This repository provides codes for training and testing algorithms for semantic segmentation of objects on C-band radar images, income from satellite Sentinel-1. The following architectures of convolutional neural networks are presented in the repository:

The following convolutional networks are used as basic networks for segmenters:

  • ResNet-34/ResNet-50
  • Xception

Used as a machine learning framework PyTorch. Agricultural fields are selected as segmentation objects in the images.

During training, the following variations of network training policies were used:

  1. Loss functions
  • Dice
  • BCE
  • Dice + BCE
  • Focal
  1. Optimizers
  • Adam
  • AdamW
  • RMSProp
  • SGD

Installation and running

Installation

NOTE: Installation instructions are provided for Linux.

Install the virtual environment in the project:

pip3 install -r requirements.txt

You can also run the project in Docker container. Pull docker image from repository:

docker pull nikkotov98/kotov_sar:dev

Create a docker container based on the downloaded image:

docker run -it --gpus all -v /local_data_root/:/docker_data_root/ /local_code_root/:/docker_code_root/ --name container_name nikkotov98/kotov_sar:dev

You can also use the official image from Nvidia:

docker pull nvcr.io/nvidia/pytorch:21.06-py3

Running

Start training the corresponding algorithm with the following command (optionally, the output of the terminal is written to the log file):

python3 train_xxx.py &> log_name.log

Start testing the corresponding algorithm on the saved scales with the following command:

python3 test.py

Segmentation of a large satellite image with the chosen architecture and the chosen stored weights is done by the script:

python3 segment_full_image.py

Results

Examples of the operation of the segmentation algorithm are presented (performed using the network DeeplabV3+ with base network ResNet-50).

Test results for networks by Dice and F1 metrics:
  Dice F1
Deeplabv3+/ResNet34 0.665 0.598
Deeplabv3+/ResNet50 0.686 0.621
Deeplabv3+/Xception 0.668 0.605
IncFCN 0.722 0.669
MPResNet 0.666 0.603
U-Net/ResNet34 0.689 0.624
U-Net/ResNet50 0.5 0.603

The weights of the trained networks can be downloaded from the Yandex.Disk.

References

About

Training and testing segmentation algorithms for C-SAR images

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages