All Projects → gabrieltseng → solar-panel-segmentation

gabrieltseng / solar-panel-segmentation

Licence: MIT license
A U-Net for solar panel identification and segmentation

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to solar-panel-segmentation

Python-for-Remote-Sensing
python codes for remote sensing applications will be uploaded here. I will try to teach everything I learn during my projects in here.
Stars: ✭ 20 (-20%)
Mutual labels:  remote-sensing
whiteboxgui
An interactive GUI for WhiteboxTools in a Jupyter-based environment
Stars: ✭ 94 (+276%)
Mutual labels:  remote-sensing
ee extra
A ninja python package that unifies the Google Earth Engine ecosystem.
Stars: ✭ 42 (+68%)
Mutual labels:  remote-sensing
programming-for-gis-and-rs
Materials for the Intro to Programming for GIS and Remote Sensing Course that I teach at Saint Louis University. They include the updates I made for the spring 2020 and fall 2020 semesters.
Stars: ✭ 61 (+144%)
Mutual labels:  remote-sensing
wildfire-forecasting
Forecasting wildfire danger using deep learning.
Stars: ✭ 39 (+56%)
Mutual labels:  remote-sensing
satproc
🛰️ Python library and CLI tools for processing geospatial imagery for ML
Stars: ✭ 27 (+8%)
Mutual labels:  remote-sensing
deepriver
a deep-learning-based river centerline extraction model
Stars: ✭ 25 (+0%)
Mutual labels:  remote-sensing
ChangeOS
ChangeOS: Building damage assessment via Deep Object-based Semantic Change Detection - (RSE 2021)
Stars: ✭ 33 (+32%)
Mutual labels:  remote-sensing
eodag
Earth Observation Data Access Gateway
Stars: ✭ 183 (+632%)
Mutual labels:  remote-sensing
gsky
Distributed Scalable Geospatial Data Server
Stars: ✭ 23 (-8%)
Mutual labels:  remote-sensing
piradar
Radar using Red Pitaya for RF: using Raspberry Pi 3 for quad-core radar signal processing
Stars: ✭ 59 (+136%)
Mutual labels:  remote-sensing
PyTorch-Segmentation-Zoo
A PyTorch collection of semantic segmentation tools.
Stars: ✭ 33 (+32%)
Mutual labels:  remote-sensing
awesome-spectral-indices
A ready-to-use curated list of Spectral Indices for Remote Sensing applications.
Stars: ✭ 357 (+1328%)
Mutual labels:  remote-sensing
MHCLN
Deep Metric and Hash Code Learning Network for Content Based Retrieval of Remote Sensing Images
Stars: ✭ 30 (+20%)
Mutual labels:  remote-sensing
pylandsat
Search, download, and preprocess Landsat imagery 🛰️
Stars: ✭ 49 (+96%)
Mutual labels:  remote-sensing
lightweight-temporal-attention-pytorch
A PyTorch implementation of the Light Temporal Attention Encoder (L-TAE) for satellite image time series. classification
Stars: ✭ 43 (+72%)
Mutual labels:  remote-sensing
solarshed
A Python library to help monitor solar charge controllers typically used in off the grid applications.
Stars: ✭ 63 (+152%)
Mutual labels:  solar-energy
sarbian
We’ve built a plug’n play Operation System (based on Debian Linux) with all the freely and openly available SAR processing software. No knowledge of installation steps needed, just download and get started with SAR data processing. SARbian is free for use in research, education or operational work.
Stars: ✭ 49 (+96%)
Mutual labels:  remote-sensing
cars
CARS is a dedicated and open source 3D tool to produce Digital Surface Models from satellite imaging by photogrammetry.
Stars: ✭ 147 (+488%)
Mutual labels:  remote-sensing
speckle2void
Speckle2Void: Deep Self-Supervised SAR Despeckling with Blind-Spot Convolutional Neural Networks
Stars: ✭ 31 (+24%)
Mutual labels:  remote-sensing

Solar segmentation Build Status

Finding solar panels using USGS satellite imagery.

1. Introduction

This repository leverages the distributed solar photovoltaic array location and extent dataset for remote sensing object identification to train a segmentation model which identifies the locations of solar panels from satellite imagery.

Training happens in two steps:

  1. Using an Imagenet-pretrained ResNet34 model, a classifier is trained to identify whether or not solar panels are present in a [224, 224] image.
  2. The classifier base is then used as the downsampling base for a U-Net, which segments the images to isolate solar panels.

2. Results

The classifier was trained on 80% of the data, with 10% being used for validation and 10% being used as a holdout test set. On this test set, with a threshold of 0.5 differentiating positive and negative examples, the model achieved a precision of 98.8%, and a recall of 97.7%. This is competitive with DeepSolar (precision of 93.1% - 93.7%, and recall of 88.5% - 90.5%) despite being trained on a smaller, publically available dataset.

AUC ROC results

The segmentation model achieved a Dice coefficient of 0.89:

segmentation results

3. Pipeline

The main entrypoint into the pipeline is run.py. Note that each component reads files from the previous step, and saves all files that later steps will need, into the data folder.

In order to run this pipeline, follow the instructions in the data readme to download the data.

Python Fire is used to generate command line interfaces.

3.1. Make masks

This step goes through all the polygons defined in metadata/polygonVertices_PixelCoordinates.csv, and constructs masks for each image, where 0 indicates background and 1 indicates the presence of a solar panel.

python run.py make_masks

This step takes quite a bit of time to run. Using an AWS t2.2xlarge instance took the following times for each city:

  • Fresno: 14:32:09
  • Modesto: 41:48
  • Oxnard: 1:59:20
  • Stockton: 3:16:08

3.2. Split images

This step breaks the [5000, 5000] images into [224, 224] images. To do this, polygonDataExceptVertices.csv is used to identify the centres of solar panels. This ensures the model will see whole solar panels during the segmentation step.

Negative examples are taken by randomly sampling the image, and ensuring no solar panels are present in the randomly sampled example.

python run.py split_images

This yields the following images (examples with panels above, and without below):

examples with panels

examples without panels

3.3. Train classifier

This step trains and saves the classifier. In addition, the test set results are stored for future analysis.

python run.py train_classifier

3.4. Train segmentation model

This step trains and saved the segmentation model. In addition, the test set results are stored for future analysis. By default, this step expects the classifier to have been run, and will try to use it as a pretrained base.

python run.py train_segmenter

Both models can be trained consecutively, with the classifier automatically being used as the base of the segmentation model, by running

python run.py train_both

4. Setup

Anaconda running python 3.7 is used as the package manager. To get set up with an environment, install Anaconda from the link above, and (from this directory) run

conda env create -f environment.{mac, ubuntu.cpu}.yml

This will create an environment named solar with all the necessary packages to run the code. To activate this environment, run

conda activate solar

This pipeline can be tested by running pytest.

Docker can also be used to run this code. To do this, first build the docker image:

docker build -t solar .

Then, use it to run a container, mounting the data folder to the container:

docker run -it \
--mount type=bind,source=<PATH_TO_DATA>,target=/solar/data \
solar /bin/bash
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].