MonuSegFormer: A Hybrid Swin-Transformer Architecture for Semantic Segmentation of Moroccan Cultural Heritage Monuments
Open Access
- 11 September 2026
- journal article
- research article
- Published by MDPI AG in Journal of Imaging
- Vol. 12 (9) , 435
Abstract
Semantic segmentation of architectural elements in cultural heritage sites lies at the intersection of computer vision and digital preservation. Moroccan historical monuments spanning mosques, madrasas, royal gates (babs), and mausoleums across Fez, Rabat, Marrakech, Meknes, and Tetouan present unique challenges, including extreme texture ambiguity between weathered wall surfaces and background, pronounced multi-scale variation from individual window and door openings to full rooftop surfaces spanning tens of metres, and severe class imbalance. We introduce MonuSegFormer, a heritage-specific hybrid architecture coupling a pretrained Swin-B encoder (ImageNet-22K) with a Multi-Scale Atrous Fusion (MSAF) module and a CBAM-augmented progressive decoder. Evaluated on the Moroccan Monuments Dataset (MMD, 2686 annotated RGB images, 5 semantic classes, 5 cities) on the held-out test set (403 images), MonuSegFormer achieves mIoU = 81.7%, outperforming SegFormer-B5 (76.4%), Mask2Former (78.9%), and DeepLabV3+ (71.3%). A composite CE+Dice+Focal loss with class-balanced weights addresses severe class imbalance, yielding the largest gains on the minority classes Door (+5.3 p.p.) and Window (+5.3 p.p.) over the next-best Mask2Former. All qualitative results are produced by real trained-model inference on held-out test images.Keywords
This publication has 30 references indexed in Scilit:
- DINOv2: Learning Robust Visual Features without SupervisionarXiv, 2024
- Swin-Unet: Unet-Like Pure Transformer for Medical Image Segmentation2023
- Smart Multimedia2022
- Deep High-Resolution Representation Learning for Visual RecognitionIEEE Transactions on Pattern Analysis and Machine Intelligence, 2020
- Albumentations: Fast and Flexible Image AugmentationsInformation, 2020
- CBAM: Convolutional Block Attention Module2018
- Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation2018
- Focal Loss for Dense Object DetectionIEEE Transactions on Pattern Analysis and Machine Intelligence, 2018
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal NetworksIEEE Transactions on Pattern Analysis and Machine Intelligence, 2016
- U-Net: Convolutional Networks for Biomedical Image Segmentation2015