Creating a Very Simple U-Net Model with PyTorch for Semantic Segmentation of Satellite Images

Maurício Cordeiro
Analytics Vidhya
Published in
8 min readApr 5, 2020

--

Cloud segmentation: RGB image (left), ground truth (middle) and our model predictions (right).

Introduction

In my previous story (here), I showed how to create a multi-channel dataset for satellite images from scratch, without using the torchvision module.

Now, we will move on to create a simple deep learning model, for semantic segmentation of satellite images and check how it performs using the 38-Cloud: Cloud Segmentation in Satellite Image, from Kaggle.

To make things easier, this code is available in Kaggle notebook 38-Cloud-Simple_Unet, available here.

The Model

My different model architectures can be used for a pixel-level segmentation of images. The 2019 Guide to Semantic Segmentation is a good guide for many of them, showing the main differences in their concepts. However, when we check the official’s PyTorch model zoo (repository of pre-trained deep learning models), the only models available are:

Besides being very deep and complex models (requires a lot of memory and time to train), they are conceived and pre-trained for the identification of a completely different set of classes (examples: boat, bird, car, cat, etc.) than our main objective…

--

--

Maurício Cordeiro
Analytics Vidhya

Ph.D. Geospatial Data Scientist and water specialist at Brazilian National Water and Sanitation Agency. To get in touch: https://www.linkedin.com/in/cordmaur/