Skip to content

gabrielkasmi/deeppvmapper

Repository files navigation

DeepPVMapper: a deep learning-based algorithm for mapping rooftop PV systems from overhead images

Work carried out by Gabriel Kasmi as part of his PhD (2020–2024): "Enhancing the Reliability of Deep Learning Models to Improve the Observability of French Rooftop Photovoltaic Installations". The PhD manuscript is available here.

Installation

Prerequisites

It is recommended to use hardware that allows for GPU acceleration (Metal, CUDA). All models were implemented and coded to run on a GPU with at least CUDA 10.2 installed. 8 to 12 GB of VRAM is advised to run the model in inference mode. The model was initially deployed on a server equipped with three GPUs, each with 12 GB of VRAM.

Installation and Setup

Clone the repository and create a Python environment from the deeppvmapper.yml file:

git clone https://github.com/gabrielkasmi/deeppvmapper.git
cd deeppvmapper

Then create a Python environment:

conda env create --file deeppvmapper.yml
conda activate deeppvmapper

The config.yml file centralizes all the configuration parameters to run the algorithm. Empty fields should be filled by the user, while pre-filled fields can be left as is, provided the user uses the files and sources described in this README. The repository containing the files necessary to run the model can be accessed here: DOI.

Model Weights Retrieval

Two models are required to run the algorithm: a classification model and a segmentation model. The model weights can be retrieved from the following repository: DOI. The path to the model weights must be specified in the configuration file, under the model_dir field.

Downloading Images and Topological Data

The classification and segmentation models were trained on IGN images. Therefore, it is recommended to use IGN images for mapping PV systems. The images can be retrieved from the IGN Geoportal. Similarly, BD TOPO data can be retrieved from the IGN Geoportal. The paths to the orthophotos and BD TOPO data must be specified in the source_images_dir and source_topo_dir fields. Finally, a file containing the boundaries of French municipalities is included in the repository associated with the source code. Its path must be specified in the source_commune_dir field.

Tutorials

Overview

The following flowchart presents our approach for detecting and characterizing rooftop PV systems.

The algorithm works in two stages: first, tiles from IGN are cut into small patches, and each patch is classified. Patches where a PV panel is detected are then segmented. The segmentation allows for extracting the polygon corresponding to the PV system. This polygon is then converted into a geolocated .geojson file.

From the polygon and third-party data, the characteristics of the PV systems (tilt, orientation, installed power, and surface area) are extracted. Various filters are applied, including a filter to keep only installations of less than 36 kWc and located on rooftops.

The reader can refer to Chapter 2 of the thesis manuscript [1] or [2] for more details on the algorithm's characteristics.

Replicating Experimental Results

For first-time users, it is recommended to follow the instructions in the notebooks/hands-on.ipynb notebook, which allows for configuring the configuration file, retrieving the necessary auxiliary data for inference, and running the model on a sample of the data.

Comparisons with the national registry of installations (RNI)

It is possible to compare the registry generated by the model with the national installation registry using the evaluate.py script. The notebook/visualization.ipynb notebook also allows for visualizing the data generated from the notebooks/hands-on.ipynb notebook.

References

[1] Gabriel Kasmi. Enhancing the Reliability of Deep Learning Models to Improve the Observability of French Rooftop Photovoltaic Installations. Chemical and Process Engineering. Université Paris sciences et lettres, 2024. English. ⟨NNT : 2024UPSLM027⟩. ⟨tel-04909303⟩

[2] Kasmi, G., Dubus, L., Blanc, P., & Saint-Drenan, Y. M. (2022). Towards unsupervised assessment with open-source data of the accuracy of deep learning-based distributed PV mapping. arXiv preprint arXiv:2207.07466.

License and citation

License

This software is provided under GPL-3.0 license.

Citation:

The preferred citation for referring to this work is

@phdthesis{kasmi2024enhancing,
  title={Enhancing the Reliability of Deep Learning Models to Improve the Observability of French Rooftop Photovoltaic Installations},
  author={Kasmi, Gabriel},
  year={2024},
  school={Universit{\'e} Paris sciences et lettres}
}

Like this work ? Do not hesitate to star us !