{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,11]],"date-time":"2026-09-11T10:10:26Z","timestamp":1789121426731,"version":"build-2803163510"},"reference-count":49,"publisher":"MDPI AG","issue":"9","license":[{"start":{"date-parts":[[2026,9,11]],"date-time":"2026-09-11T00:00:00Z","timestamp":1789084800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["J. Imaging"],"abstract":"<jats:p>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.<\/jats:p>","DOI":"10.3390\/jimaging12090435","type":"journal-article","created":{"date-parts":[[2026,9,11]],"date-time":"2026-09-11T08:17:42Z","timestamp":1789114662000},"page":"435","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["MonuSegFormer: A Hybrid Swin-Transformer Architecture for Semantic Segmentation of Moroccan Cultural Heritage Monuments"],"prefix":"10.3390","volume":"12","author":[{"ORCID":"https:\/\/orcid.org\/0009-0009-5822-8642","authenticated-orcid":false,"given":"Ouail","family":"Choukhairi","sequence":"first","affiliation":[{"name":"Laboratory of Computer Science Research (LaRI), Department of Computer Science, Ibn Tofail University, K\u00e9nitra 14000, Morocco"}],"role":[{"vocabulary":"crossref","role":"author"},{"role":"supervision","vocabulary":"credit"},{"role":"validation","vocabulary":"credit"},{"role":"visualization","vocabulary":"credit"},{"role":"investigation","vocabulary":"credit"},{"role":"conceptualization","vocabulary":"credit"},{"role":"methodology","vocabulary":"credit"},{"role":"software","vocabulary":"credit"},{"role":"writing-review-editing","vocabulary":"credit"},{"role":"resources","vocabulary":"credit"},{"role":"data-curation","vocabulary":"credit"},{"role":"writing-original-draft","vocabulary":"credit"},{"role":"formal-analysis","vocabulary":"credit"}]},{"ORCID":"https:\/\/orcid.org\/0009-0000-8971-009X","authenticated-orcid":false,"given":"Mouad","family":"Choukhairi","sequence":"additional","affiliation":[{"name":"Laboratory of Computer Science Research (LaRI), Department of Computer Science, Ibn Tofail University, K\u00e9nitra 14000, Morocco"}],"role":[{"vocabulary":"crossref","role":"author"},{"role":"visualization","vocabulary":"credit"},{"role":"supervision","vocabulary":"credit"},{"role":"validation","vocabulary":"credit"},{"role":"investigation","vocabulary":"credit"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4933-6640","authenticated-orcid":false,"given":"Ali","family":"Choukri","sequence":"additional","affiliation":[{"name":"Laboratory of Computer Science Research (LaRI), Department of Computer Science, Ibn Tofail University, K\u00e9nitra 14000, Morocco"}],"role":[{"vocabulary":"crossref","role":"author"},{"role":"visualization","vocabulary":"credit"},{"role":"supervision","vocabulary":"credit"},{"role":"investigation","vocabulary":"credit"},{"role":"validation","vocabulary":"credit"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5647-303X","authenticated-orcid":false,"given":"Youssef","family":"Fakhri","sequence":"additional","affiliation":[{"name":"Laboratory of Computer Science Research (LaRI), Department of Computer Science, Ibn Tofail University, K\u00e9nitra 14000, Morocco"}],"role":[{"vocabulary":"crossref","role":"author"},{"role":"visualization","vocabulary":"credit"},{"role":"supervision","vocabulary":"credit"}]}],"member":"1968","published-online":{"date-parts":[[2026,9,11]]},"reference":[{"key":"ref_1","first-page":"248","article-title":"Deep learning for fresco analysis: Pigment recognition and damage detection","volume":"55","author":"Rivet","year":"2022","journal-title":"J. Cult. Herit."},{"key":"ref_2","doi-asserted-by":"crossref","unstructured":"Yao, Y., Luo, Z., Li, S., Zhang, J., Ren, Y., Zhou, L., Fang, T., and Quan, L. (2020, January 13\u201319). BlendedMVS: A large-scale dataset for generalized multi-view stereo networks. Proceedings of the IEEE CVPR, Virtual.","DOI":"10.1109\/CVPR42600.2020.00186"},{"key":"ref_3","unstructured":"Choukhairi, O. (2026, June 07). Moroccan Monuments Dataset (MMD). IEEE DataPort, Available online: https:\/\/ieee-dataport.org\/documents\/moroccan-monuments-dataset."},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"He, K., Zhang, X., Ren, S., and Sun, J. (2016, January 27\u201330). Deep residual learning for image recognition. Proceedings of the IEEE CVPR, Las Vegas, NV, USA.","DOI":"10.1109\/CVPR.2016.90"},{"key":"ref_5","doi-asserted-by":"crossref","unstructured":"Chen, L.-C., Zhu, Y., Papandreou, G., Schroff, F., and Adam, H. (2018, January 8\u201314). Encoder-decoder with atrous separable convolution for semantic image segmentation. Proceedings of the ECCV, Munich, Germany.","DOI":"10.1007\/978-3-030-01234-2_49"},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Zhao, H., Shi, J., Qi, X., Wang, X., and Jia, J. (2017, January 21\u201326). Pyramid scene parsing network. Proceedings of the IEEE CVPR, Honolulu, HI, USA.","DOI":"10.1109\/CVPR.2017.660"},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Milletari, F., Navab, N., and Ahmadi, S.-A. (2016, January 25\u201328). V-Net: Fully convolutional neural networks for volumetric medical image segmentation. Proceedings of the 3DV, Stanford, CA, USA.","DOI":"10.1109\/3DV.2016.79"},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"318","DOI":"10.1109\/TPAMI.2018.2858826","article-title":"Focal loss for dense object detection","volume":"42","author":"Lin","year":"2020","journal-title":"IEEE Trans. Pattern Anal. Mach. Intell."},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. (2009, January 20\u201325). ImageNet: A large-scale hierarchical image database. Proceedings of the IEEE CVPR, Miami, FL, USA.","DOI":"10.1109\/CVPR.2009.5206848"},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Woo, S., Park, J., Lee, J.-Y., and Kweon, I.S. (2018, January 8\u201314). CBAM: Convolutional block attention module. Proceedings of the ECCV, Munich, Germany.","DOI":"10.1007\/978-3-030-01234-2_1"},{"key":"ref_11","unstructured":"Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., and Polosukhin, I. (2017, January 4\u20139). Attention is all you need. Proceedings of the NeurIPS, Long Beach, CA, USA."},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. (2021, January 11\u201317). Swin Transformer: Hierarchical vision transformer using shifted windows. Proceedings of the IEEE ICCV, Virtual.","DOI":"10.1109\/ICCV48922.2021.00986"},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., and Schiele, B. (2016, January 27\u201330). The Cityscapes dataset for semantic urban scene understanding. Proceedings of the IEEE CVPR, Las Vegas, NV, USA.","DOI":"10.1109\/CVPR.2016.350"},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Zhou, B., Zhao, H., Puig, X., Fidler, S., Barriuso, A., and Torralba, A. (2017, January 21\u201326). Scene parsing through ADE20K dataset. Proceedings of the IEEE CVPR, Honolulu, HI, USA.","DOI":"10.1109\/CVPR.2017.544"},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Long, J., Shelhamer, E., and Darrell, T. (2015, January 7\u201312). Fully convolutional networks for semantic segmentation. Proceedings of the IEEE CVPR, Boston, MA, USA.","DOI":"10.1109\/CVPR.2015.7298965"},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Ronneberger, O., Fischer, P., and Brox, T. (2015, January 5\u20139). U-Net: Convolutional networks for biomedical image segmentation. Proceedings of the MICCAI, Munich, Germany.","DOI":"10.1007\/978-3-319-24574-4_28"},{"key":"ref_17","unstructured":"Chen, L.-C., Papandreou, G., Schroff, F., and Adam, H. (2017). Rethinking atrous convolution for semantic image segmentation. arXiv."},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"3349","DOI":"10.1109\/TPAMI.2020.2983686","article-title":"Deep high-resolution representation learning for visual recognition","volume":"43","author":"Wang","year":"2021","journal-title":"IEEE Trans. Pattern Anal. Mach. Intell."},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"1137","DOI":"10.1109\/TPAMI.2016.2577031","article-title":"Faster R-CNN: Towards real-time object detection with region proposal networks","volume":"39","author":"Ren","year":"2017","journal-title":"IEEE Trans. Pattern Anal. Mach. Intell."},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Liu, Z., Mao, H., Wu, C.-Y., Feichtenhofer, C., Darrell, T., and Xie, S. (2022, January 18\u201324). A ConvNet for the 2020s. Proceedings of the IEEE CVPR, New Orleans, LA, USA.","DOI":"10.1109\/CVPR52688.2022.01167"},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Wang, W., Dai, J., Chen, Z., Huang, Z., Li, Z., Zhu, X., Hu, X., Lu, T., Lu, L., and Li, H. (2023, January 17\u201324). InternImage: Exploring large-scale vision foundation models with deformable convolutions. Proceedings of the IEEE CVPR, Vancouver, BC, Canada.","DOI":"10.1109\/CVPR52729.2023.01385"},{"key":"ref_22","unstructured":"Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., and Gelly, S. (2021, January 3\u20137). An image is worth 16\u00d716 words: Transformers for image recognition at scale. Proceedings of the ICLR, Virtual."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Zheng, S., Lu, J., Zhao, H., Zhu, X., Luo, Z., Wang, Y., Fu, Y., Feng, J., Xiang, T., and Torr, P.H.S. (2021, January 19\u201325). Rethinking semantic segmentation from a sequence-to-sequence perspective with Transformers. Proceedings of the IEEE CVPR, Virtual.","DOI":"10.1109\/CVPR46437.2021.00681"},{"key":"ref_24","unstructured":"Bao, H., Dong, L., Piao, S., and Wei, F. (2022, January 25\u201329). BEiT: BERT pre-training of image Transformers. Proceedings of the ICLR, Virtual."},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Liu, Z., Hu, H., Lin, Y., Yao, Z., Xie, Z., Wei, Y., Ning, J., Cao, Y., Zhang, Z., and Dong, L. (2022, January 18\u201324). Swin Transformer V2: Scaling up capacity and resolution. Proceedings of the IEEE CVPR, New Orleans, LA, USA.","DOI":"10.1109\/CVPR52688.2022.01170"},{"key":"ref_26","unstructured":"Xie, E., Wang, W., Yu, Z., Anandkumar, A., Alvarez, J.M., and Luo, P. (2021, January 6\u201314). SegFormer: Simple and efficient design for semantic segmentation with Transformers. Proceedings of the NeurIPS, Virtual."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Strudel, R., Garcia, R., Laptev, I., and Schmid, C. (2021, January 11\u201317). Segmenter: Transformer for semantic segmentation. Proceedings of the IEEE ICCV, Virtual.","DOI":"10.1109\/ICCV48922.2021.00717"},{"key":"ref_28","unstructured":"Cheng, B., Schwing, A., and Kirillov, A. (2021, January 6\u201314). Per-pixel classification is not all you need for semantic segmentation. Proceedings of the NeurIPS, Virtual."},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Cheng, B., Misra, I., Schwing, A.G., Kirillov, A., and Girdhar, R. (2022, January 18\u201324). Masked-attention mask transformer for universal image segmentation. Proceedings of the IEEE CVPR, New Orleans, LA, USA.","DOI":"10.1109\/CVPR52688.2022.00135"},{"key":"ref_30","unstructured":"Chen, Z., Duan, Y., Wang, W., He, J., Lu, T., Dai, J., and Qiao, Y. (2023, January 1\u20135). Vision Transformer adapter for dense predictions. Proceedings of the ICLR, Kigali, Rwanda."},{"key":"ref_31","unstructured":"Oquab, M., Darcet, T., Moutakanni, T., Vo, H.V., Szafraniec, M., Khalidov, V., Fernandez, P., Haziza, D., Massa, F., and El-Nouby, A. (2024). DINOv2: Learning robust visual features without supervision. Trans. Mach. Learn. Res."},{"key":"ref_32","unstructured":"Wang, X., Girshick, R., Gupta, A., and He, K. (2018, January 18\u201323). Non-local neural networks. Proceedings of the IEEE CVPR, Salt Lake City, UT, USA."},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Kirillov, A., Mintun, E., Ravi, N., Mao, H., Rolland, C., Gustafson, L., Xiao, T., Whitehead, S., Berg, A.C., and Lo, W.-Y. (2023, January 2\u20133). Segment anything. Proceedings of the IEEE ICCV, Paris, France.","DOI":"10.1109\/ICCV51070.2023.00371"},{"key":"ref_34","unstructured":"Ravi, N., Gabeur, V., Hu, Y.-T., Hu, R., Ryali, C., Ma, T., Khabsa, M., Roller, S., El-Nouby, A., and Aslan, I. (2024). SAM 2: Segment anything in images and videos. arXiv."},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Berretti, S., and Su, G.M. (2022). GradXcepUNet: Explainable AI based medical image segmentation. Smart Multimedia, Springer.","DOI":"10.1007\/978-3-031-22061-6"},{"key":"ref_36","unstructured":"Zhu, Y., Li, J., Wang, X., and Chen, L. (2023, January 8\u201311). Weakly supervised semantic segmentation for historical wall painting deterioration. Proceedings of the IEEE ICIP, Kuala Lumpur, Malaysia."},{"key":"ref_37","first-page":"906","article-title":"Deep learning for stone surface segmentation in historical building fa\u00e7ades","volume":"14","author":"Valero","year":"2022","journal-title":"Remote Sens."},{"key":"ref_38","first-page":"93","article-title":"Point cloud semantic segmentation for heritage buildings using graph neural networks","volume":"196","author":"Qiu","year":"2023","journal-title":"ISPRS J. Photogramm. Remote Sens."},{"key":"ref_39","first-page":"78142","article-title":"Hierarchical mask Transformer for heritage building fa\u00e7ade segmentation","volume":"11","author":"Ye","year":"2023","journal-title":"IEEE Access"},{"key":"ref_40","doi-asserted-by":"crossref","unstructured":"Tyle\u010dek, L., and \u0160\u00e1ra, R. (2013, January 3\u20136). Spatial pattern templates for recognition of objects with regular structure. Proceedings of the GCPR, Saarbr\u00fccken, Germany.","DOI":"10.1007\/978-3-642-40602-7_39"},{"key":"ref_41","doi-asserted-by":"crossref","unstructured":"Lin, T.-Y., Doll\u00e1r, P., Girshick, R., He, K., Hariharan, B., and Belongie, S. (2017, January 21\u201326). Feature pyramid networks for object detection. Proceedings of the IEEE CVPR, Honolulu, HI, USA.","DOI":"10.1109\/CVPR.2017.106"},{"key":"ref_42","doi-asserted-by":"crossref","unstructured":"Ranftl, R., Bochkovskiy, A., and Koltun, V. (2021, January 11\u201317). Vision Transformers for dense prediction. Proceedings of the IEEE ICCV, Virtual.","DOI":"10.1109\/ICCV48922.2021.01196"},{"key":"ref_43","unstructured":"Hu, E.J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., and Chen, W. (2022, January 25\u201329). LoRA: Low-rank adaptation of large language models. Proceedings of the ICLR, Virtual."},{"key":"ref_44","doi-asserted-by":"crossref","unstructured":"Cao, H., Wang, Y., Chen, J., Jiang, D., Zhang, X., Tian, Q., and Wang, M. (2022, January 23\u201327). Swin-Unet: Unet-like pure Transformer for medical image segmentation. Proceedings of the ECCV Workshops, Tel Aviv, Israel.","DOI":"10.1007\/978-3-031-25066-8_9"},{"key":"ref_45","unstructured":"NVIDIA Corporation (2026). NVIDIA A100 Tensor Core GPU, NVIDIA Corporation. Available online: https:\/\/www.nvidia.com\/en-us\/data-center\/a100\/."},{"key":"ref_46","unstructured":"Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., and Antiga, L. (2019, January 8\u201314). PyTorch: An imperative style, high-performance deep learning library. Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Vancouver, BC, Canada."},{"key":"ref_47","unstructured":"Loshchilov, I., and Hutter, F. (2019, January 6\u20139). Decoupled weight decay regularization. Proceedings of the ICLR, New Orleans, LA, USA."},{"key":"ref_48","doi-asserted-by":"crossref","unstructured":"Buslaev, A., Iglovikov, V.I., Khvedchenya, E., Parinov, A., Druzhinin, M., and Kalinin, A.A. (2020). Albumentations: Fast and flexible image augmentations. Information, 11.","DOI":"10.3390\/info11020125"},{"key":"ref_49","doi-asserted-by":"crossref","unstructured":"Wu, X., Jiang, L., Wang, P.-S., Liu, Z., Liu, X., Qiao, Y., Ouyang, W., He, T., and Zhao, H. (2024, January 17\u201321). Point Transformer V3: Simpler, faster, stronger. Proceedings of the IEEE\/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA.","DOI":"10.1109\/CVPR52733.2024.00463"}],"container-title":["Journal of Imaging"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2313-433X\/12\/9\/435\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,9,11]],"date-time":"2026-09-11T09:08:01Z","timestamp":1789117681000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2313-433X\/12\/9\/435"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,9,11]]},"references-count":49,"journal-issue":{"issue":"9","published-online":{"date-parts":[[2026,9]]}},"alternative-id":["jimaging12090435"],"URL":"https:\/\/doi.org\/10.3390\/jimaging12090435","relation":{},"ISSN":["2313-433X"],"issn-type":[{"value":"2313-433X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,9,11]]}}}