Skip to content

Semantic segmentation of PV installations from Swiss aerial images.

Notifications You must be signed in to change notification settings

jeanprbt/swiss-solar-panel-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Panel Segmentation from Aerial Images ☀️

CS-433 | Machine Learning @ EPFL

Mehdi Zoghlami, Maxime Ducourau, Jean Perbet

Introduction

This repository contains the code for the second project of the course CS-433 - Machine Learning @ EPFL. This project was run in partnership with the Swiss Data Science Center, and the goal was to develop a machine learning model to detect solar panels from aerial images provided by Swisstopo.

This project experiments with both U-Net and DeepLabv3 architectures, using CNNs for the binary semantic segmentation task of deciding whether a pixel is a solar panel or not on aerial images.

Repository structure

The repository is structured as follows:

├── data/                           
│   ├── images/              # Images
│   ├── labels/              # Ground truth labels
│   ├── roofs/                        
│   │   ├── coordinates/     # Coordinates of all swiss roofs
│   │   ├── images/          # Images w/ filtered out roofs
│   │   └── masks/           # Binary masks of roofs corresponding to images
│   ├── tiles/               # Original tiles             
│   ├── urls/                # Swisstopo URLs  
│   └── weights/             # Pre-trained weights for models
├── notebooks/
│   ├── preprocessing.ipynb  # Notebook for data retrieval & preprocessing
│   └── results.ipynb        # Main notebook w/ results
├── report.pdf               # Associated paper
├── src/
│   ├── models/              # Model-specific classes/functions    
│   ├── dataset.py           # Data loading classes/functions
│   ├── model_functions.py   # Generic model functions
│   ├── plotting.py          # Plotting functions
│   ├── postprocessing.py    # Postprocessing functions
│   └── preprocessing.py     # Preprocessing functions
└── README.md

Run instructions

  1. Install the required dependencies.

    pip install -r requirements.txt
  2. Data should be collected and put in the corresponding directories. There are two ways to do this.

    • Run the preprocessing.ipynb notebook in the notebooks/ directory (~500 data points)
    • Directly download the data from this kaggle dataset (~750 data points)
  3. Decide whether you want to train models on your own or use them pre-trained with the weights we provide. In the latter case, you should download the weights from the same [kaggle dataset] as for the previous step.

  4. Run the main notebook results.ipynb with training & results parts.

About

Semantic segmentation of PV installations from Swiss aerial images.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •