Solar Panel Detection from Aerial View or Satellite Images

Shiva Thavani
Analytics Vidhya
Published in
6 min readAug 20, 2020

Detecting Solar Panels using Faster R-CNN ResNet101 and processing images using OpenCV

Why to detect Solar Panels?

As solar photovoltaic (PV) become a major sector of the energy market, there is a growing necessity for granular data regarding distributed rooftop solar PV. Solar power providers and customers, urban planners, grid system operators, and energy policy makers would vastly benefit from an imagery based solar panel detection algorithm that can be used to form granular datasets of installations and their power capacities.The other reason for solar panel detection being that solar panel installers usually don’t share the information about solar panel installations. That’s why a prominent solar panel detection mechanism/algorithm is highly desired. Yet very less work has been done for detection of solar panels from aerial or satellite images.

The information about solar panels in an area can be used by Private Solar Panel Companies some of them are -:

I. Sun Power — Offers Maxeon panel systems for homes and community properties. Storage software monitors and provides backup power. Lease, loan and purchase solar energy options. Easy installation without field wiring. Includes 25-year warranty.

II. Vivint — Solar-Specializes in home solar, battery storage and electric vehicle chargers. Purchase, PPA, loan or lease solar energy options. Installation takes four to eight hours. Includes 25-year panel and 10-year inverter warranties.

III. SunLux Energy — Sells panels, inverters and batteries. Includes monitoring, lifetime support and 25-year warranty on parts, labor and repairs. Offers purchase, finance, lease or prepaid solar energy options. Performs full-service installations.

IV. Sungevity — Offers solar energy options for homes and businesses. Provides multiple storage options and 24/7 monitoring. Purchase, lease and PPA options. Includes 25-year performance warranty and 20-year panel and installation warranty.

APPROACH TO DETECT SOLAR PANELS

To solve this problem, we at Eduwaive Foundation decided to use the power of Artificial Intelligence and Machine Learning. So, to begin with the creation of an algorithm which can detect solar panels from aerial or satellite images we needed a labelled data-set of satellite images.

Step 1: Collection of Data

This is the most important and basic step for developing a machine learning algorithm. We used “Maps Static API” from google cloud platform to get satellite images using the latitude and longitude of some random locations.

QUALITY > QUANTITY

It is of great importance that the data is right for the problem we want to solve. It doesn’t matter if we have terabytes of data if the data isn’t aligned with the problem. We are trying to find data with the features that matter to what we’re trying classify or predict and discard unrelated features. The first step should be proper data collection, and until we achieve this, we will find ourselves constantly coming back to this step.The data set should have all of the useful features stand out. We need to make a model whose job is to detect where the solar panel is on an image, our data set should consist of images which contain solar panels for who we know the exact location on the image.For this we need to label the raw data obtained from google satellite images.

Step 2: Label-ling the satellite images

This was an crucial step for us as label-ling requires lot of manpower and effort as for each individual image we need to generate the labels and their corresponding XML file but thanks to labellerr their auto label-ling tool helped us a lot and boosted the speed of creating a proper labelled data-set for developing a robust algorithm to detect solar panels.We labelled the images in two different categories namely “solar” and “roof”.

Labeled using LABELLERR Research Plan

As we can see how labellerr made whole process of label-ling easy by their auto-label tool and made the data-set more accurate and efficient.As a properly labelled data-set acts as foundation of any Machine Learning model.

Step 3: Training the Machine Learning Model

This step requires a proper environment setup and a lot of computational power also it is the most time-consuming step in the whole process.We used TensorFlow Object Detection model for core processing and we used configurations of “Faster R-CNN ResNet101” this model requires a bit more computational power as compared to others but accuracy of this model compensates for the extra computational power. We divided our data-set into two parts one for training the model and other for evaluating the model on a test data-set. This step took almost 54 hours of processing time and we kept the loss while training the model of order10–2so that our model can predict solar panels more accurately as lower the loss more accurate model is trained. While processing we kept an eye on the model training parameters and statistics at tensor board and monitored the loss in training graph closely. This graph tells the loss rate of the model while training and this is a service provided by TensorFlow to visualize statistics for an accurate and robust model.After this we got our trained machine learning model in from of frozen inference graph (.pb)which we saved it for future use.

Live Statistics on Tensor board

Step 4: Evaluating the Machine Learning Model

Now as the machine learning model was trained and imported in frozen graph interface format. Now we need a python script which is capable of providing predictions on new images using the model trained in previous step.Python script which we formulated takes label.pbtxt, frozen_inference_graph.pb and a test image as input parameters. label.pbtxt contains number of labels on which our model was trained and frozen_inference_graph.pb contains the trained model. In output we get the image with all labels marked.

Step 5: Improving the trained Machine Learning Model

We can further improve accuracy of our model by updating our training data-set with more variations and re-training our ML model so that we can have more accurate and robust model which is capable of detecting the solar panel in all conditions.

SAMPLE PREDICTIONS BY THE SOLAR PANEL DETECTION MODEL -:

Roof — marked by Yellow Bounding Box

Solar Panel — Marked by Green Bounding Box

Solar Panels and Roof detected by the trained model
Solar Panels and Roof detected by the trained model
Solar Panels and Roof detected by the trained model
Solar Panels and Roof detected by the trained model
Roof detected by the trained model as there are no Solar Panels

Now our algorithm is ready to detect the Solar Panels.

I have contributed this trained model to Labellerr Model repository and Labellerr team has integrated this in their tool, so if you don’t want to do all of this hard-work again then just sign up on Labellerr and choose Geo-spatial datatype and then you can just use it from there and integrate it with your project. Hope it helps :)

TOOLS AND TECHNOLOGIES USED

  1. Google Static Maps API — To acquire satellite Images
  2. Labellerr — To easily label the required images and speed up the process.
  3. TensorFlow — To train the model and carry out predictions.
  4. OpenCV — To pre-process the images and make their format suitable to proceed onto training step.
Technology Stack

ABOUT ME -:

I am a coder at heart; from developing challenging large-scale software to small weekend hackathons. For my daily routine am pursuing Computer Science Engineering from Thapar Institue of information and technology TIET. I took Computer Vision for my elective as my interest developed in Facial,Object and Image processing techniques. I Created this project during my Data Science Internship at Eduwaive Foundation, Chandigarh, India.
Connect with me on LinkedIn

--

--