The repository contains the code for Machine Learning course 2020 (CS-433) project 2 at EPFL in partnership with LESO-PB lab. More information about this project can be found in the folder documents
.
The project is accomplished by team OverfitTeam
with members:
- Riccardo Cadei: @riccardocadei
- Raphael Attias: @raphaelattias
- Shasha Jiang: @dust629
The project has been developed and test with python3.6
.
The required library are numpy, Pytorch, sklearn, openCV
The library for visualization is matplotlib
.
The project target is to segment in aerial images of Switzerland(Geneva) the area available for the installation of rooftop photovoltaics (PV) panels, namely the area we have on roofs after excluding chimneys, windows, existing PV installations and other so-called ‘superstructures’. The task is a pixel-wise binary-semantic segmentation problem. And we are interested in the class where pixels can be classified as ‘suitable area’ for PV installations.
- The input aerial images are RGB aerial images in PNG form and each image has size 250×250×3 with pixelsize 0.25×0.25 m^2.
- We used the provided labelling tool to manually label all the data The labelled images are a binary mask with 1 for pixel in PV area, and 0 otherwise.
- The original input images are transformed with saturation and classic normalization before training.
- A real-time data argumentation is applied only on the training set by randomly flipping images horizontally or vertically or rotating in ninety degrees.
- The output of our model is again a binary image, where the pixel is one, if its probability of being in the PV area is bigger than a fixed threshold.
- Train/Validation/Test Ratio : 80/10/10 %
- We used a Conventional Neural Network(CNN) model based on U-net and an adaptive learning algorithm to train it. Iou and Acurrancy are computed to evaluate the performances.
- We trained our model firstly on the whole dataset, then we focused only on a specific class of images, residential area
We are able to automatically detect in test images the available rooftop area at pixel level with performances comparable the state-of-the-art. In particular, focusing only on the residential area images we got on the test set an accuracy of about 0.97 and an Intersection over Union index of 0.77 using only 244 images for training. Below an example of a prediction on the test set.
├── labelling_tool
│ ├── crop.py
│ ├── data-verification.ipynb
│ ├── label_images_from_txt.py
│ ├── label_images.py
│ ├── move.py
│ ├── README.md
│ └── scan_images.py
├── loss
│ ├── 1.png
│ ├── 2.png
│ ├── loss.ipynb
│ ├── loss.py
│ └── __pycache__
│ └── loss.cpython-38.pyc
├── main.ipynb
├── model
│ ├── model.ipynb
│ ├── __pycache__
│ │ └── unet.cpython-38.pyc
│ └── unet.py
├── plots
│ ├── all
│ │ ├── batch5loss4
│ │ │ ├── history_train_ioubatch5loss4_1000.npy
│ │ │ ...
│ │ │ └── loss400_batch5loss4.png
│ │ └── batch5loss9
│ │ ├── history_train_ioubatch5loss9_1000.npy
│ │ ...
│ │ └── loss1000_batch5loss9.png
│ ├── other
│ │ ├── b5w4_iou.pdf
│ │ ├── b5w4_loss.pdf
│ │ ├── history_train_iou09122020.npy
│ │ ...
│ │ ├── loss_batch5loss4.pdf
│ │ └── loss_batch5loss5.pdf
│ ├── plots.py
│ └── residencial
│ ├── history_train_ioubatch5loss6_1000.npy
│ ...
│ ├── loss1000_batch5loss6.png
│ └── loss_batch5loss6.png
├── process_data
│ ├── data_loader.py
│ ├── import_test.py
│ ├── normalize.py
│ └── __pycache__
│ ├── data_loader.cpython-38.pyc
│ ├── data_noara_loader.cpython-38.pyc
│ └── data_nopv_loader.cpython-38.pyc
├── README.md
├── reference
│ └── Literature
│ ├── Adam a method \for stochastic optimization.pdf
│ ├── Deep learning \in the built environment automatic detection of rooftop solar panels
│ using Convolutional Neural Networks.pdf
│ ├── Dropout vs. batch normalization an empirical study.pdf
│ ├── Satellite Image Segmentation \for Building Detection using U-Net.pdf
│ ├── Semantic Segmentation of Satellite Images using Deep Learning.pdf
│ └── U-Net, Convolutional Networks \for Biomedical Image Segmentation.pdf
├── run.py
└── train
├── pred_residencial_3.png
└── train.py
documents/report.pdf
: a 4-pages report of this project
Both are available here