Home

Awesome

Self-Supervised Learning for Semantic Segmentation of Pol-SAR Images via SAR-to-Optical Transcoding Using Pytorch

Visual Results

Transcoding Results

Transcoding comparison between three randomly sampled areas and the three type of transcoders implemented

<img src='Docs/manuscript/img/compare.png' align="center" width=1000>

Classification Results (% states for amount of labelled data employed)

Classification results comparison using different pretrained models and different amount of labelled data

<img src='Docs/manuscript/img/map_img.png' align="center" width=1000>

How to use this code

The repo is structured as follows:

. 
├── Data                                        
│   ├── Datasets 
│   ├── Test            ⮕ Here store the patches prepared accordingly to Lib/Dataset/EUSAR/
│   ├── Train           ⮕ For train and test sets
├── Docker              ⮕ Here is store the docker file configuration
├── Docs 
│   ├── arch            ⮕ Here there are some architecture images
│   └── manuscript      ⮕ Here there is the final manuscript
├── Lib                 ⮕ Here there are all the code resources
│   ├── Datasets 
│   │   ├── EUSAR       ⮕ Dataset Pytorch class overload
│   │   ├── processing  ⮕ Dataset preprocessing
│   │   └── runner      ⮕ Some runners to perform dataset processing
│   ├── Nets            ⮕ Here there is the implementation for each network deployed in this framework
│   │   ├── BL          ⮕ Fully supervised framework used as benchmark
│   │   ├── CAT         ⮕ Supervised Conditional Adversarial Transcoder
│   │   ├── Cycle_AT    ⮕ Unsupervised Cycle-Consistent Adversarial Transcoder
│   │   ├── RT          ⮕ Supervised Regressive Transcoder
│   │   ├── SN          ⮕ Segmentation Network to perform semantic segmentation using the features
                          learning during the transcoding phase.
├── eval.py     
├── mainBL.py           ⮕ Main file to train the Baseline
├── mainCAT.py          ⮕ Main file to train the Conditional Adversarial Transcoder
├── mainCycle_AT.py     ⮕ Main file to train the Cycle-Consistent Adversarial Transcoder
├── mainRT.py           ⮕ Main file to train the Regressive Transcoder
├── mainSN.py           ⮕ Main file to train the Segmentation Network
├── readme.md

Getting started

Prepare the Dataset

The data employed in my work was coupled radar and optical images:

All the images employed were 10x10 meters resolution. You can follow the instruction EUSARDataset.py and create a dataset compliant with my EUSARDataset class or recreate your own, In the former you have 100% compatibility, in the latter you could encounter some problems.

Prerequisites

All the training of the networks implemented have been performed on an Nvidia GeForce RTX 2070 SUPER with 8GB of dedicated memory. The code requires at least 8 GB of free GPU and 8 GB of free RAM. In the report you can find approximately the running times.

Prepare the Machine

To prepare the docker you can run this command:

docker create --name [yourPreferredName] --gpus all --shm-size 8G -it -v [folder/Path/To/Project]:[Folder/In/The/Docker] cattale/pytorch:latest

Between square brackets are parameters you can change:

Configure the Test

Now you need to configure the scripts to run the test you want to perform. The parameters are configured as follows when a script is launched:

Run the Code

To run the script follow these instructions.

Acknowledgments

Last but not least this implementation is based on the work of Zhu et al. 2017a.