• Services
    LLM
    AI & ML
    Digital Healthcare
    Data Science
    DevOps
  • Products
    Jackalope
    EyeAI
  • Industries
    Healthcare
    Agriculture
    EdTech / LMS
    Retail / E-commerce
    Manufacturing
  • Resources
    Blog
    Case Studies
    Expert Guides
  • Company
    About us
    Careers
  • Contact us
logo
Services
LLMAI & MLDigital HealthcareData ScienceDevOps
Industries
HealthcareAgricultureEdTech / LMSRetail / E-commerceManufacturing
Case StudiesAbout UsBlogCareers
Our contacts
+380(66)54-32-579
sales@sciforce.tech

Get monthly digest of innovations

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Social Media:
Privacy Policy © 2026 Sciforce
5.0
Roof Tops Damage Detection

Roof Tops Damage Detection

Published: January 12, 2024
# InsurTech
# Computer Vision
Our project aims to enable insurance companies to analyze roof damage through photos. Users can upload images of their roofs, and our system will assess the damage, identifying its location, size, shape, and type.

Challenge

Use Case Ready For Generative AI

Find out more with SciForce free checklist

We use advanced drone cameras and 3D imaging, similar to technologies by Spar3D, Pointivo, and Loveland Innovations, for accurate roof evaluations. Our method helps to assess the roof damage by analyzing just two images. We identify key points on the roof, match them across images, and apply techniques like the 8-point algorithm for precise camera angle analysis and 3D detail capture. We apply keypoint triangulation to accurately map different areas of the rooftop, then adjust these measurements to real-world dimensions, ensuring precise and reliable evaluations.

By incorporating extra data like image depth maps, and drone movement and rotation details when available, our system achieves greater accuracy. We aim to streamline and improve roof damage assessment for the insurance industry through a blend of high-tech imaging and detailed analytical methods.

Solution

Deliverables

The web service has been implemented that provides REST API for uploading images and receiving damage annotations in addition to rooftop pic meta.

Technical Description

The service development has been split into the following main stages: damage detection, damage size computation, web app implementation, image quality assessment.

Damage detection

It was decided to use the Mask RCNN neural network algorithm for the detection of damaged regions. This approach has proven to be a great candidate for the task of instance segmentation in various areas. It allows the extraction of fine-grained bounding boxes together with polygons representing region shape. Instance segmentation with precise bounding boxes serves a very different purpose in the warehouse tracking case: detecting and tracking labeled boxes across multi-camera zones in a high-volume distribution center rather than mapping damage boundaries on rooftops.

The method implies that we’re using several neural networks for doing a subset of tasks. Initially, the backbone network extracts features of the image, then so so-called Region-Proposal Network (RPN) gives regions that are more likely to contain regions of interest (ROIs) and after that in the last stage third neural network regresses the bounding box inside this ROI together with binary masks describing shape and label classification.

Damage size computation

To compute the actual damage size it’s required to calculate the shingle dimension that encloses this damage area. So the key part of this stage happened to be the correct detection of shingles’ boundaries. Initially it’d been decided to apply pure image processing algorithms for highlighting gaps between tiles followed by extracting closed contours assumed to be shingles.

However, this approach was rejected soon because of the impossibility of adapting heuristic algorithms for diverse image settings including different scales, perspective angle, lighting, and so on. The next step was deep learning-based edge detection for highlighting gaps between roof tiles. Іince it was not fine-tuned for this project, particularly on various images it failed to correctly determine the edges of shingles. The computer vision generalization article documents exactly this failure mode across industries: the gap between controlled test conditions and real-world deployment is where heuristic approaches consistently break down.

The situation was even more deteriorated by the fact that on some images the gaps (horizontal or vertical) were quite vague or completely indiscernible so the results were poor. So it’s been decided to train our model that would directly map the input image to the binarysmask representing the rooftop layout grid. We’ve tested several approaches including UNet, CASENet, and HED. The last one had been used in the previous step, so we’ve just trained it to serve our specific purpose. It occurred to be the best out of them.

So after extraction of the binary mask representing the rooftop layout grid, it becomes easy to extract contours representing shingles and compute their dimensions and subsequently damage size.

Web app implementation

Flask has been adopted as the prior web framework in the project. It’s lightweight and allows to integration all needed functionalities via extensions.

We have implemented 2 requests in the REST API. The first one allows us to retrieve result damage annotations rendered on top of the passed image. The second one lets you extract that annotation list in JSON format accompanied with rooftop image pic quality assessment information.

Image quality assessment

Image quality is computed regarding 2 criteria: blurriness, and scale. The first calculation is pretty simple. It’s just a computation of image Laplacian’s representation variance. The second criterion is quite tough to determine. The first approach was to extract lines from the edge image and then cluster them by angle to detect clusters of parallel lines. The great number of such dominant clusters would show that we have a low scale and a small - huge respectively. The assumption here is that on the low-scale images, there are lots of additional content that would bring its statistics and on the huge scale we won’t have lines at all or very few since there won’t be distinct tiles.

The current approach is directed toward analyzing the frequency terms of the image. The image undergoes Fourier transformation to extract its frequency representation. The idea is that on the low-scale image, a lot of repeated image patterns can be seen, meaning a rooftop shingle layout with a huge number of repeating parallel lines. On the low-scale image, this number would be much lower.

1_Roof_1_ec1579ad12.jpg

Development Journey

The project is written using Python 3.6 language. The main frameworks are the following:

  • Tensorflow - Machine Learning
  • Flask - Web Framework
  • OpenCV - image processing
  • GUnicorn - web server

Impact

Damage detection

Dataset. The dataset comprises 297 images in the train set and 85 in the test respectively. They’ve been annotated manually using the DataTurks annotation tool.

Input Processing

The dataset preprocessing stage includes various the for both train and test sets to make the model more robust. The augmentations involve various image transformations such as rotation, scaling, and image filtration. To not exceed the GPU memory capacity during training the maximum annotations number limit has been imposed which is 8 annotations per image. Images that had more annotations were split to 4 tiles and fed to the model separately. During the training stage images were padded and downscaled to the same size of 800x800 pixels. The more resolution the GPU could not incorporate during the training stage. However, for inference, it’s been decided to keep a greater resolution of 1365 pix to capture more information.

Evaluation

The metric used for evaluation is mean average precision (mAP). It indicates how well the model can localize the objects combined with classification power. This metric is commonly used for object detection and instance segmentation tasks.

Model

As we’ve adopted the Mask RCNN approach, we had to determine which feature extractor to employ as a backbone. In this project, several settings have been tested including InceptionV2, ResNet50, and ResNet101. The last one occurred to outperform the first 2 candidates on mean average precision metric (mAP) so it’s been decided to adopt this model.

2_Roof_94b8264348.jpg

3_Roof_b72d058f7e.jpg

These sets contain the same source images, but 6_5 doesn’t put any weight on specific annotation samples to keep all of the damaged areas of equal importance. It can be seen that the model with the ResNet101 backbone outperforms ResNet50 after the same number of iterations. The final model has been trained for about 91k iterations and achieved a 0.484 mAP score which is quite decent.

4_Roof_1_ad5f7f1f8f.jpg

5_Roof_b04ff2741a.jpg

Grid layout restoration

As we mentioned before for damage size estimation it’s required to compute shingle dimensions first. To do that we must detect shingles as well. The solution was end-to-end mapping of the input image to a binary mask representing the shingles layout.

Dataset: The train set constituted 194 samples and the test set - 21 respectively.

6_Roof_65f9b5a938.jpg

Input processing: Image augmentations involved rotation, translation, scaling, and image filtration. The model has been trained for 88 epochs.

Model: Several models have been tested. We’ve stopped on HED (Holistically-Nested Edge Detection). The model originally designed to perform deep learning edge detection, has been fine-tuned to better serve our purpose.

7_Roof_1_8ee1a22e5d.jpg

8_6da59e318c.jpg

Damage Size computation

Dataset: The Test dataset comprises 178.

Model: The HED model from the previous step is used for this algorithm

Metric: Accuracy is the main metric for assessing size computation. The predicted value was considered correct if it diverged from the ground truth value no more than a specified threshold.

Results 0.74 % accuracy.

The solution proposed in this project doesn’t have analogues. Although we’ve used common well known techniques we’ve adapted them for this nontrivial task. The algorithm can be expanded to serve additional needs of course. For example we could detect other types of damage not including shingle damage but also metallic ones.

RELATED CASE STUDIES

View all Case Studies
AI-Driven Roof Modeling From Drone Imagery for for Insurance Company coverAI-Driven Roof Modeling From Drone Imagery for for Insurance Company

Our client is a U.S.-based startup specializing in automated roof measurement for the insurance industry. Their core business involves providing insurers with precise roof dimensions, structural layouts, and damage assessments based on drone imagery. To improve accuracy and reduce manual effort, they needed a custom software solution that could automatically reconstruct roofs in 3D, extract relevant measurements, and generate clean 2D plans suitable for underwriting and claims.

# PropTech
# AI / ML
# Big Data
# Computer Vision
Enabling Continuous DeploymentEnabling Continuous Deployment with Amazon Elastic Container Service and Infrastructure as Code

The client is a U.S.–based company developing a computer-vision platform for sports medicine. Its goal is to help professional teams and medical staff prevent injuries by analyzing basketball footage, detecting abnormal movements, and flagging potential risks for review. The project required building a DevOps infrastructure that would let the client’s product run reliably in the cloud and evolve without deployment bottlenecks. This meant designing a secure AWS infrastructure with isolated environments for development and production, automating delivery of containerized applications through CI/CD pipelines, and managing all resources as code for consistency and repeatability. By focusing on cloud-native services, scalability, and automation, the platform established an AWS DevOps setup for scalable AI or computer vision platforms that could grow and adapt reliably.

# AI / ML
# Big Data
# Computer Vision
# DevOps
Optimizing Multi-Zone Restaurant Service with Computer Vision for HospitalityOptimizing Multi-Zone Restaurant Service with Computer Vision for Hospitality

The client is a mid-sized restaurant chain with about 1200 locations in over 30 countries. Each restaurant provides full-service dining, where waiters take orders, serve food and manage table turnover. Most locations have two dining areas, which can make it hard for staff to keep track of all tables. The client wanted to improve AI for restaurant management by reducing wait times, speeding up table cleaning, and helping staff respond more quickly. Their goal was to use real-time table monitoring and smart video analytics to support better decision-making and improve the overall customer experience, showing how to track table status and wait times using AI in restaurants.

# Retail / E-commerce
# AI / ML
# Big Data
# Computer Vision
# Data Science
# DevOps
Smart video system for remote horse care and monitoringSmart Stable Monitoring System for Premium Remote Horse Care

The client is a private horse club that provides full-time care and boarding for pedigree horses owned by individuals. The smart farming & animal wellness club handles all daily responsibilities — feeding, cleaning, grooming, exercise, and health checks — as owners rarely visit in person. Some horses are fully owned by clients, while others are co-owned with the club as part of long-term investment agreements. Owners expect high standards of care and regular updates without having to contact staff directly. To meet this need, the club introduced an AI-powered horse care system with 24/7 video access and real-time stall condition tracking (temperature, humidity, etc.), and automatic alerts — helping owners stay informed about their horses at any time.

# AI / ML
# Big Data
# Computer Vision
# DevOps