Submitted:
11 July 2025
Posted:
15 July 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Related Works
3. Study Area

4. Methodology
4.1. Data Collection and Sources

4.2. Image Preprocessing
4.2.1. Noise Reduction
4.2.2. Georeferencing and Resampling
4.2.3. Data Augmentation
4.3. Segmentation Models
4.3.1. Training and Validation
4.3.2. Model Selection
- Mask R-CNN: Mask R-CNN extends Faster R-CNN by adding a branch for predicting segmentation masks on each Region of Interest (RoI), in parallel with the existing branch for classification and bounding box regression. This architecture is particularly advantageous for roof segmentation as it allows the model to simultaneously detect roofs and delineate their boundaries with high precision [23]. The model’s ability to generate high-quality masks at the instance level makes it ideal for tasks where accurate roof delineation is essential, such as in urban planning and solar panel installation.

- MaskFormer: MaskFormer represents a shift towards using transformers for segmentation tasks. Instead of relying on region proposals, MaskFormer treats image segmentation as a mask classification task, where each pixel is assigned to a specific class by leveraging attention mechanisms. This model excels in capturing global context and fine details, making it particularly effective for roof segmentation in dense urban environments where roofs can be obscured or partially visible [22].

4.4. Testing
4.5. Post-Processing and Accuracy Assessment
4.5.1. Segmentation Refinement
4.5.2. Accuracy Assessment
- i.
-
Intersection over Union (IoU):, also known as the Jaccard Index, measures the overlap between the predicted segmentation and the ground truth, normalized by their union. It is a widely used metric in image segmentation tasks as it directly evaluates the accuracy of the segmented regions. A higher IoU indicates better segmentation performance [26].is simply the average across all categories or regions:where is the number of classes or regions, and is the for each individual class or region.Mean IoU: It is the average of the IoU scores across all classes or regions. If there’s only one class or region, Mean IoU would be the same as IoU.
- ii.
-
Precision:Precision measures the proportion of correctly identified roof pixels (true positives) against all pixels that were identified as roof pixels (true positives plus false positives). High precision indicates that the model is effective at minimizing false positives, which is crucial for reducing over-segmentation [27].
- iii.
-
Recall:Recall, also known as sensitivity, evaluates the proportion of correctly identified roof pixels out of all actual roof pixels (true positives plus false negatives). High recall indicates that the model successfully captures most of the roof pixels, reducing under-segmentation [27].
- iv.
-
F1-Score:The F1-score is the harmonic mean of precision and recall, providing a single metric that balances both. It is particularly useful when there is an uneven class distribution or when both false positives and false negatives are important to the task [28].
4.6. Polygonization and Georeferencing of Roof Masks
5. Results
5.1. Quantitative Evaluation
5.1.1. Average Precision (AP)
5.1.2. Average Recall (AR)
5.1.3. Comparative Metrics: Precision, Recall, F1-Score, and Mean IoU
5.1.4. Training and Validation Loss Curves
5.2. Qualitative Results
5.2.1. Mask R-CNN
5.2.2. MaskFormer
5.3. Regularization Network for Roof Refinement
- ▪
- The reconstruction loss ensures that the refined mask closely resembles the initial segmentation.
- ▪
- The regularization loss encourages the mask to align with the intensity patterns of the original image, promoting geometrically plausible structures.
- ▪
- The adversarial loss is applied through a discriminator network, which forces the refined masks to be visually indistinguishable from ideal masks derived from OpenStreetMap data.
5.4. Final Rooftop Map Generation
6. Discussion
7. Conclusions
8. Patents
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- P. Chaweewat, “Solar photovoltaic rooftop detection using satellite imagery and deep learning,” Asia-Pacific Power and Energy Engineering Conference, APPEEC, Dec. 2023. [CrossRef]
- V. Batchu, “Satellite Sunroof: High-res Digital Surface Models and Roof Segmentation for Global Solar Mapping,” Aug. 2024. [CrossRef]
- B. Sariturk, D. Kumbasar, and D. Z. Seker, “Comparative Analysis of Different CNN Models for Building Segmentation from Satellite and UAV Images,” Photogramm Eng Remote Sensing, vol. 89, no. 2, pp. 97–105, Feb. 2023. [CrossRef]
- L. Lin et al., “A Dynamic Identification Algorithm for Large Urban Rooftop Solar Energy,” Chinese Control Conference, CCC, pp. 6363–6368, Jul. 2024. [CrossRef]
- M. B. A. Gibril, R. Al-Ruzouq, J. Bolcek, A. Shanableh, and R. Jena, “Building Extraction from Satellite Images Using Mask R-CNN and Swin Transformer,” 34th International Conference Radioelektronika, RADIOELEKTRONIKA 2024 - Proceedings, pp. 1–5, Apr. 2024. [CrossRef]
- Vaswani et al., “Attention Is All You Need,” p. 1, Jun. 2017, Accessed: Jul. 07, 2025. [Online]. Available: https://arxiv.org/pdf/1706.03762.
- N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, “End-to-End Object Detection with Transformers,” Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 12346 LNCS, pp. 213–229, May 2020. [CrossRef]
- D. Chetia, “Image Segmentation with transformers: An Overview, Challenges and Future,” Jan. 2025. [CrossRef]
- Z. He, Y. Cai, H. He, X. Xian, and B. Barrett, “An Enhanced Trans-Involution Network for Building Footprint Extraction from High Resolution Orthoimagery,” International Geoscience and Remote Sensing Symposium (IGARSS), vol. 75, pp. 10030–10034, Jul. 2024. [CrossRef]
- W. Zhao, C. Persello, X. Lv, A. Stein, and M. Vergauwen, “Vectorizing planar roof structure from very high resolution remote sensing images using transformers,” Int J Digit Earth, vol. 17, no. 1, pp. 1–15, Dec. 2023. [CrossRef]
- Q. Zhang, “Research of Land Surface Segmentation based on Convolutional Netword and Transformer Network,” 2022 IEEE 2nd International Conference on Mobile Networks and Wireless Communications, ICMNWC 2022, pp. 1–8, Dec. 2022. [CrossRef]
- S. Gan, “Research of Land Surface Segmentation based on Convolutional Netword and Transformer Network,” 2022 IEEE 2nd International Conference on Mobile Networks and Wireless Communications, ICMNWC 2022, Dec. 2022. [CrossRef]
- H. Saadaoui, A. Ghennioui, B. Ikken, H. Rhinane, and M. Maanan, “Using GIS and Photogrammetry for Assessing Solar Photovoltaic Potential on Flat Roofs in Urban Area Case of the City of Ben Guerir / Morocco,” ISPRS - International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, vol. 4212, no. 4/W12, pp. 155–166, Feb. 2019. [CrossRef]
- N. Rharbi and M. İNceoğlu, “Moroccan New Green Cities, Towards a Green Urban Transition,” Journal of Islamic Architecture, vol. 7, no. 2, pp. 296–305, Dec. 2022. [CrossRef]
- N. Rharbi and H. G. Demirkol, “Impact of Sustainability Transition in Moroccan Cities Identity: The Case of Benguerir,” Iconarp international journal architecture and planning, vol. 11, no. 1, pp. 88–106, Jun. 2023. [CrossRef]
- R. AZMI, C. S. TEKOUABOU KOUMETIO, E. B. DIOP, and J. Chenal, “Exploring the relationship between urban form and land surface temperature (LST) in a semi-arid region case study of Ben Guerir city - Morocco,” Environmental Challenges, vol. 5, p. 100229, Dec. 2021. [CrossRef]
- D. Rivet and A. Ben Mlih, “La articulación de la Administración Territorial del Protectorado francés en Marruecos,” Revista de Estudios Internacionales Mediterráneos, no. 9, p. 6, Dec. 2010. [CrossRef]
- N. Pal, S. Ramkrishna, H. Patil, N. Choudhary, and R. Soman, “TerraGrid: Harnessing Deep Learning Models for Satellite Image Segmentation,” Int J Comput Appl, vol. 186, no. 49, pp. 14–21, Nov. 2024. [CrossRef]
- Y. Yuan, L. Lin, Q. Xin, Z. G. Zhou, and Q. Liu, “An Empirical Study on Data Augmentation for Pixel-Wise Satellite Image Time Series Classification and Cross-Year Adaptation,” IEEE J Sel Top Appl Earth Obs Remote Sens, vol. 18, pp. 1–18, Jan. 2025. [CrossRef]
- M. A. A. Ghaffar, A. McKinstry, T. Maul, and T. T. Vu, “Data Augmentation Approaches for Satellite Image Super-Resolution,” ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, vol. 4, no. 2/W7, pp. 47–54, Sep. 2019. [CrossRef]
- T. Soujanya, Z. Alsalami, S. Srinath, J. Sengupta, and A. Das, “Rooftop Photovoltaic Panel Segmentation using Improved Mask Region-based Convolutional Neural Network,” 2nd IEEE International Conference on Data Science and Information System, ICDSIS 2024, May 2024. [CrossRef]
- N. Kolibarov, D. Wästberg, V. Naserentin, D. Petrova-Antonova, S. Ilieva, and A. Logg, “Roof Segmentation Towards Digital Twin Generation in LoD2+ Using Deep Learning,” Advances in Control and Optimization of Dynamical Systems, vol. 55, no. 11, pp. 173–178, Jan. 2022. [CrossRef]
- M. Amo-Boateng, N. Ekow Nkwa Sey, A. Ampah Amproche, and M. Kyereh Domfeh, “Instance segmentation scheme for roofs in rural areas based on Mask R-CNN,” The Egyptian Journal of Remote Sensing and Space Science, vol. 25, no. 2, pp. 569–577, Apr. 2022. [CrossRef]
- D. Chen, L. Zhang, J. Li, and R. Liu, “Urban building roof segmentation from airborne lidar point clouds,” Journal of remote sensing, vol. 33, no. 20, pp. 6497–6515, Oct. 2012. [CrossRef]
- Zhao, H. Guo, J. Lu, D. Yu, X. Zhou, and Y. Lin, “A new approach for roof segmentation from airborne LiDAR point clouds,” Remote Sensing Letters, vol. 12, no. 4, pp. 377–386, Mar. 2021. [CrossRef]
- R. Shi, K. N. Ngan, and S. Li, “Jaccard index compensation for object segmentation evaluation,” 2014 IEEE International Conference on Image Processing, ICIP 2014, pp. 4457–4461, Oct. 2014. [CrossRef]
- Müller, I. Soto-Rey, and F. Kramer, “Towards a guideline for evaluation metrics in medical image segmentation,” BMC Res Notes, vol. 15, no. 1, Feb. 2022. [CrossRef]
- O. Giraldo, “Precision, Recall and F1 score,” Nov. 2018. [CrossRef]
- Maggiori, Y. Tarabalka, G. Charpiat, and P. Alliez, “Polygonization of remote sensing classification maps by mesh approximation,” Proceedings - International Conference on Image Processing, ICIP, vol. 2017-September, p. 5, Sep. 2017. [CrossRef]
- N. Girard, D. Smirnov, J. Solomon, and Y. Tarabalka, “Polygonal Building Segmentation by Frame Field Learning,” ArXiv, pp. 1–30, Apr. 2020, Accessed: Jul. 08, 2025. [Online]. Available: https://arxiv.org/pdf/2004.14875.
- M. R. Pettinati, “(PDF) The Role of Digital Generalization in Image Segmentation.” Accessed: Jul. 08, 2025. [Online]. Available: https://www.researchgate.net/publication/220913321_The_Role_of_Digital_Generalization_in_Image_Segmentation.
- S. Zorzi and F. Fraundorfer, “Regularization of Building Boundaries in Satellite Images using Adversarial and Regularized Losses,” pp. 5140–5143, Jul. 2020. [CrossRef]
- R. Castello, S. Roquette, M. Esguerra, A. Guerra, and J. L. Scartezzini, “Deep learning in the built environment: automatic detection of rooftop solar panels using Convolutional Neural Networks,” J Phys Conf Ser, vol. 1343, no. 1, p. 012034, Nov. 2019. [CrossRef]
- Z. Qian et al., “Simultaneous extraction of spatial and attributional building information across large-scale urban landscapes from high-resolution satellite imagery,” Sustain Cities Soc, vol. 106, Apr. 2024. [CrossRef]








Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).