Using Machine Learning for Rooftop Detection and Solar Installations

rooftop detection satellite solar AI
Estimated Reading Time: 4 minutes

Solar energy is a promising and freely available resource for managing the forthcoming energy crisis, without damaging the environment. Unlike conventional fossil fuels, solar is renewable and sustainable. As people around the world look for ways to “go green” and protect the earth, solar panels provide an excellent option. But the utility industry needs smart systems that can help improve the integration of renewables in an effective way. Solar AI, a Singapore based startup incubated as a part of ENGIE Factory, collaborated with Omdena, to pull off a mission to hyper-scale the deployment of distributed solar and the transition towards 100% renewables by modernizing the way rooftop solar is sold. Here’s a look at how we’ve used machine learning for rooftop detection and solar suitability assessment.

The Problem Statement

A standard rooftop solar assessment process can be time consuming and expensive. It can often take between 1 hour to 2 full days to calculate the solar potential of each rooftop. This has resulted in the cost of sales taking up to 30–40% of total project costs in the solar industry. Solar AI aims to drastically reduce the cost of this process by automating solar evaluations with Artificial Intelligence (AI). It also strives to make this information easily available for both building owners as well as solar energy companies. We believe that by using machine learning for rooftop detection we can aid in the swifter adoption of solar in Singapore.

Our Mission: To combine multiple models that can automatically identify rooftops and detect rooftop features using machine learning like obstacles, material, slopes and area from high-resolution satellite imagery.

The Solution

We were first provided with high-resolution Singapore satellite imagery. With these huge and detailed images in hand, we had a list of tasks to perform. The original file size of one image was 2GB. To work with the file we had to first pre-process it by and dividing it into thousands of smaller tiles.

Snapshot of a few tiles created from the huge image

Step 1: The Power of Annotations

Even the most technically advanced algorithms cannot address or solve a problem without the right data. We know that having access to data is quite valuable, but having access to data with a learnable structure is the biggest competitive advantage nowadays. That’s the power of data annotation.

A quirky image with hundreds of rooftops

Our wonderful team of collaborators volunteered to annotate thousands of rooftops in 500+ tiles. We pulled off a smarter method of annotating the buildings, by mapping the OSM data on the raster layer (TIF format tile) in the QGIS software.

The consistent determination of the annotators resulted in a perfectly labeled dataset for Supervised Machine Learning algorithms.

The food for models was ready!

Step 2: Scanning Images of Rooftops with Machine Learning 

The major task was to detect rooftops in a given image using machine learning and computer vision models.

Not just this, we also had to determine their type and structure. These include flat-roof, hip-roof, shed-roof, or any other. This became an instance segmentation problem.

We tried out a number of models such as Mask R-CNN, YOLACT (You Only Look At CoefficienTs), Detectron 2, and more. After training on different batches of annotations as they were delivered, we kept seeing improvement in results. Eventually, the best performing model was selected to go ahead with other tasks.

rooftop detection satellite solar AI

Step 3: Zooming in on Rooftops 

Now that we had the bounding boxes and mask contours of various rooftops, trapped properly in a data frame, we were ready to start the analysis of individual rooftops. After extracting and zooming into masks of each detected roof, we needed the following attributes:

  • Obstacle Detection
  • Area of the roof (excluding obstacles)
  • The material of the roof
  • Detecting faces of Hip/Shed roof
  • The orientation of individual slopes

Step 4: Calculating “Area Available” for Solar Panels

rooftop materials satellite solar AI

For the calculation of a rooftop’s effective area, the area occupied by obstacles has to be subtracted from the whole. So that gives rise to the task of identifying obstacles.

Due to the lack of labeled data for obstacle detection, our genius team shifted their thought process towards an unsupervised approach of edge detection and creating contours. By setting a threshold on contour colors, obstacles were distinguished from plain areas to a great extent.

An effective area was therefore mathematically calculated as the difference between total area and obstacle area in terms of pixels, which was then converted into meters squared.

Step 5: Quality of the roof

Solar panels are installed on your home’s rooftop. Therefore, it’s important to understand how different roof materials may influence this process.

Generally, they range from concrete, metal, roof tiles, eternit to composite shingles.

This task also required a labeled dataset, so I decided to jump in to find a solution where we could skip annotations per se. Using Open Street Maps, we created a small but fruitful dataset labeled with roofs and their materials. A deep learning-based Image Classification model was then created which identifies the material of the roof and gives the probability scores for each class.

Step 6: Solar Panel Direction

Orientation, or the direction your roof faces, may have a large impact on how productive roof-mounted solar panels will be. Your system will generate the most energy when it gets as many hours of light exposure per day as possible. In most places, the ideal power generation angle is 30–40 degrees.

The task of identifying many faces of a hip roof was a challenging one. After multiple attempts with different approaches, the task team managed to create an appreciable mathematical model that could identify the facets as well as the angles they’re inclined on, using some constructive utility functions. The output was the orientation of different roof facets.

Putting it All Together: Solar Deployment using Machine Learning for Rooftop Detection

The outputs of all the tasks were captured systematically in a data frame. Keeping in mind that we computed various attributes based on pixel values, we converted them back to geographic coordinates at the end. This allowed us to project the data on satellite images of a particular CRS (Coordinate Reference System).

After merging everything into an automated pipeline and many rounds of reviews, evaluation, fixing bugs, and testing — our software was ready to be delivered.

This project was a collaboration between Get Solar (formerly Solar AI Technologies) and Omdena, involving more than 30 AI engineers and changemakers across the world to detect rooftops and features via satellite images in order to drive rooftop solar deployment. The original article is also published here: https://omdena.com/blog/machine-learning-rooftops/

This article was first published on 20 October 2020 and last updated on 6 May 2021 to include additional details.

Get an Instant Solar Estimate for your Home Now!

solarai solar simulator estimate

Whether you’re ready to install solar panels on your rooftop, or just wondering how you can benefit from solar, use our instant solar assessment tool to get an estimate of the solar potential of your property and find out how much you can save. At Solar AI, we combine geospatial analysis of satellite imagery with big data and artificial intelligence to provide you with reliable and accurate solar information so that you can make a better solar choice!

Related Posts

You Would Love these

Estimated Reading Time: 6 minutes Meet David and Doyz – he works in financial services and she’s a full-time homemaker and part-time property agent. They have two boys (whose names, like their entire family, all start with ‘D’). Earlier this year

Estimated Reading Time: 6 minutes Solar panels aren’t limited to large commercial projects. It’s also an option for homeowners that’s both sustainable and cost-saving. If you’re considering installing solar on your roof, we know it can be difficult to take the

Estimated Reading Time: 6 minutes If you’re on the path to harnessing the power of the sun for your energy needs, you’ll want to partner with the best in the business. In this article, we unveil the top 10 solar companies

Estimated Reading Time: 7 minutes Solar panel systems in Singapore are gaining traction as the most viable energy source in the renewable energy transition. With our limited land space and sunny, tropical climate, solar is an ideal energy source on rooftops

Estimated Reading Time: 7 minutes P.S Our company does not provide EV charger installation services. However, we do have a list of personal recommendations when it comes to EV Home Charging suppliers, which you can read about here. Electric cars may

Awesome! You're now on our waitlist.

We have added your email address to our waitlist, and will keep you posted on our launch date.

Hungry for the product right now? Drop us a note at info@getsolar.ai

Tell your friends about us!


Thank you for your submission.

We will get back to you with a free solar quote within 48 hours. Here’s to your first step towards a greener Earth.