Next Article in Journal
A Fast Convergence Scheme Using Chebyshev Iteration Based on SOR and Applied to Uplink M-MIMO B5G Systems for Multi-User Detection
Previous Article in Journal
The Vicious Cycle of Obesity and Low Back Pain: A Comprehensive Review
Previous Article in Special Issue
Research on Multi-Step Prediction of Pipeline Corrosion Rate Based on Adaptive MTGNN Spatio-Temporal Correlation Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Gray Brick Wall Surface Damage Detection of Traditional Chinese Buildings in Macau: Damage Quantification and Thermodynamic Analysis Method via YOLOv8 Technology

by
Liang Zheng
,
Jianyi Zheng
,
Yile Chen
*,
Yuchan Zheng
,
Wei Lao
and
Shuaipeng Chen
Heritage Conservation Laboratory, Faculty of Humanities and Arts, Macau University of Science and Technology, Taipa, Macau 999078, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(12), 6665; https://doi.org/10.3390/app15126665
Submission received: 7 May 2025 / Revised: 4 June 2025 / Accepted: 11 June 2025 / Published: 13 June 2025

Abstract

Featured Application

This study aims to build an automatic recognition and quantitative detection system (YOLOv8 model and deployed device) for surface damage of historical gray brick buildings in Macau, a World Heritage Site, to achieve a more efficient, standardized, and sustainable detection mechanism in architectural heritage protection and provide technical support and practical samples for the protection of historical and cultural heritage in Macau and southern coastal cities.

Abstract

The historical Lingnan gray brick buildings in Macau, a World Heritage Site, are facing severe deterioration due to prolonged disrepair, manifesting as cracks, breakages, moss adhesion, and other types of surface damage. These issues threaten not only the structural stability of the buildings but also the conservation of cultural heritage. To address the inefficiencies and low accuracy of traditional manual inspections, this study proposes an automated recognition and quantitative detection method for wall surface damage based on the YOLOv8 deep learning object detection model. A dataset comprising 375 annotated images collected from 162 gray brick historical buildings in Macau was constructed, covering eight damage categories: crack, damage, missing, vandalism, moss, stain, plant, and intact. The model was trained and validated using a stratified sampling approach to maintain a balanced class distribution, and its performance was comprehensively evaluated through metrics such as the mean average precision (mAP), F1 score, and confusion matrices. The results indicate that the best-performing model (Model 3 at the 297th epoch) achieved a mAP of 61.51% and an F1 score up to 0.74 on the test set, with superior detection accuracy and stability. Heatmap analysis demonstrated the model’s ability to accurately focus on damaged regions in close-range images, while damage quantification tests showed high consistency with manual assessments, confirming the model’s practical viability. Furthermore, a portable, integrated device embedding the trained YOLOv8 model was developed and successfully deployed in real-world scenarios, enabling real-time damage detection and reporting. This study highlights the potential of deep learning technology for enhancing the efficiency and reliability of architectural heritage protection and provides a foundation for future research involving larger datasets and more refined classification strategies.

1. Introduction

As a world heritage city, Macau has attracted worldwide attention for its profound historical and cultural background and unique urban landscape [1]. A significant portion of these buildings are traditional Chinese structures built using gray bricks. They not only bear witness to the historical changes in Macau but are also important carriers of Macau’s culture and history. There have been Chinese villages in Macau for a long time, and it was not until the 16th century that the Portuguese were allowed to live and build there [2,3]. Traditional Chinese architecture is deeply influenced by Lingnan culture [4], especially the architectural style of the Pearl River Delta region (such as Guangzhou and Hoeng saan), covering temples, old-style houses, and some commercial buildings. However, with the passage of time and the erosion of natural factors, the blue brick walls of these buildings began to show various damage, such as cracks, microbial invasion, cement covering, falling off, and weathering [5]. These damages not only affect the aesthetics of the building, but more importantly, they threaten its structural stability and may cause serious safety hazards. On the other hand, these traditional Chinese buildings are mostly located in low-lying areas and have undergone many land reclamation movements in the past century. Under the influence of global climate change and Macau’s annual summer typhoons, the building foundations are extremely susceptible to saltwater immersion, which further damages the gray brick structure [6].
In recent years, the local government and society have been promoting the construction of Macau as an “exchange and cooperation base with Chinese culture as the mainstream and multiple cultures coexisting” [7]. If these traditional Chinese buildings with historical value were destroyed and wiped out, it would be even more difficult to talk about cultural construction. Therefore, it is particularly important to develop a technology that can quickly, accurately, and intelligently detect wall damage for the gray brick buildings unique to Macau, a World Heritage Site [8]. This can not only provide strong technical support for the protection of Macau’s architectural heritage but also provide references for similar cultural heritage protection around the world. By detecting and repairing damage in a timely and effective manner, we can not only ensure the long-term safety of these buildings but also leave behind valuable historical and cultural heritage for future generations. To improve the ability to identify damage to historical gray brick buildings in the Macau World Heritage Site and better estimate the subsequent repair costs, this study aims to build an automatic recognition and quantitative detection system for surface damage of historical gray brick buildings in Macau. The system automatically detects eight types of historical brick buildings: crack, damage, missing, vandalism, moss, stain, plant, and intact, to achieve a more efficient, standardized, and sustainable detection mechanism in architectural heritage protection. The researchers explored three core questions: (1) How does the YOLOv8 model help build core technologies that help to identify these eight types of gray brick surface damage? (2) What are the results of the model’s image recognition analysis of gray brick damage types? (3) What is the application of the model?
The rest of this paper is organized as follows: Section 2 is a literature review, analyzing existing research results in machine learning, especially object detection models, in architectural heritage. Section 3 introduces the research field, methods, and processes. Section 4 is the training process and results after we built the model. Section 5 takes the traditional gray brick buildings in Macau as an example and deeply analyzes the results of the application. At the same time, the development of the corresponding recognition device is discussed. Section 6 presents the conclusions. Section 7 briefly introduces the invention patents in the Chinese mainland corresponding to the current relevant research results.

2. Literature Review

2.1. Damages of Traditional Gray Brick Buildings

There are a large number of gray brick buildings in Chinese history. However, over time, gray brick masonry begins to age due to reasons such as crumbling, fungus growth, and loss of tension. Structural deterioration continues to threaten some historical buildings. China’s policies to protect clay resources and the environment have also led to a decrease in the firing of clay bricks. Unfortunately, many craftsmen engaged in traditional brick and tile making must change their careers due to the need to work long hours in harsh environments [9]. This has further led to the gradual demise of China’s traditional gray bricks. Scholars Zhao et al. showed through X-ray diffraction (XRD) and differential scanning calorimetry–thermal gravimetry (DSC–TG) analyses that the firing temperature of brick products in Jiangsu, Zhejiang, and Anhui during the Ming and Qing Dynasties might have been 900–1000 °C. However, due to differences in raw materials, production processes, and firing temperatures, there is no favorable correlation between the durability and compressive strength of antique bricks. The excellent durability may be attributed to its traditional production process, clay with low limestone content, firing temperature, and the number of macropores (>1 μm) [9]. In the past five years, many scholars have discussed the evolution of the degree of structural damage of gray brick masonry with freeze/thaw cycles [10,11,12,13]. The analysis methods involved in these studies mainly include mechanical testing, nuclear magnetic resonance, and scanning electron microscopy tests [10], freeze/thaw damage models based on three indicators of mass, compressive strength, and hardness based on Weibull distribution [11], digital image correlation (DIC) technology [12], and fractal theory [13]. Some scholars have used experiments and advanced numerical methods to characterize the mechanical properties and structural analysis of gray clay bricks (GCB) in traditional Chinese masonry buildings [8]. They have observed that in the gray brick buildings of Rua da Felicidade (福隆新街), the short side walls with smaller openings have higher stiffness and a higher strength-to-weight ratio than the long side facades. They believe that the short side walls are more resistant to lateral loads. In addition, some scholars have conducted research and analysis on the damage mechanism of gray bricks. For example, researchers tested gray bricks with varying levels of damage by placing them through drying and wetting cycles with mixed salt, and they looked at the changes in things like weight, how much water the bricks absorbed, and how deep the erosion was, to predict how much longer the bricks would last [14]. Based on this, some scholars also used the Wiener process model to predict the life of gray bricks [15]. The research on the damage mechanism of gray brick’s freeze/thaw cycle mainly focuses on the ancient town of Longshengzhuang in Ulanqab, Inner Mongolia [16].

2.2. Identification of Damage to Traditional Chinese Buildings

Traditional Chinese architecture mainly uses soil and wood as the main building materials and many tiles, bricks, stones, and other materials. However, due to the differences in geographical location, regional climate, and damage factors, a series of scholars have conducted research on the surface damage of these traditional building materials in subfields [5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]. These studies mainly focus on traditional building materials such as Chinese gray brick, shed-thin tiles, brick and stone surfaces, blue roofing tiles (clay terracotta tiles) from the Jiangnan region, sintered red clay tiles on sloping roofs, wooden structures, Chinese clay tiles, and glazed tiles on the roof, among which Chinese gray brick has received the most attention. In terms of geographical distribution, the historical buildings in world heritage sites such as Beijing, Fujian, Zhejiang, and Macau have received the most attention. In addition to traditional physical monitoring methods, more and more research is focused on technologies in the field of computer vision, such as Region-based Convolutional Neural Networks (R-CNN) and You Only Look Once (YOLO) series real-time object detection models. The main findings of recent studies of this type are summarized in Table 1 below.

2.3. Development of Equipment for Identifying Surface Damage

The construction of non-destructive testing models requires long-term investigation, collection, debugging, and optimization and also requires improvement through continuous testing. At present, cutting-edge research results are no longer limited to the analysis of laboratory workstations but have been further deepened to independently develop mobile identification devices or systems [21,33]. For example, some scholars have used the CPU of a smartphone to process the video captured by the phone’s camera in real time and used the TensorFlow Object Detection API to integrate the trained model into an Android-based smartphone. Finally, they verified the detection performance of the smartphone through two cases: detecting the walls of the Forbidden City and detecting the moat walls [21]. They achieved real-time detection of brickwork damage using smartphones. In addition, some scholars have developed the GreatWatcher system based on MCS technology and deep learning algorithms to monitor damage on the surface of the Great Wall [33]. Table 2 shows the mobile devices developed by scholars for identifying damage on Chinese gray brick surfaces in existing research. It is clear that creating mechanical equipment using computer vision models for non-destructive testing involves some costs, but its portability significantly enhances where and how the model can be used, and it also has potential economic value in the market.
In addition, scholars from Xi’an University of Architecture and Technology proposed an ancient building gray-brick damage detection algorithm that integrates an attention mechanism in response to the research of our team in 2023 [5]. They made improvements through the YOLOv8n algorithm: for example, adding shallow feature map inflow to the feature fusion network to solve the problem of low recognition accuracy of low-level features such as small cracks and damaged textures in damage detection; introducing the Convolutional Block Attention Module (CBAM) in the feature fusion layer to achieve dual attention to channel features and spatial features, thereby improving the algorithm’s ability to fuse features of different dimensions; in the feature extraction network part, the C2f module is improved through Shuffle Attention (SA) to solve the problem of feature information loss caused by deep convolution dimensionality reduction operations, thereby further improving the performance of the model [34]. Their improved model has achieved overall improvements, but they also found that the detection accuracy of the damage type of moss attachment is at an average level, and the improved algorithm has no significant improvement over the original algorithm. The reason may be that the size of the annotation boxes of this type of damage instance varies greatly, and there is a clear gap in the characteristics of the moss’s survival and death states.
In past research by scholars, it has been verified many times that the training set is the basis of model learning, and its quality and quantity directly affect the performance of the model. Therefore, researchers tried to expand the scope of collecting images and increasing the number of labels to create datasets. This will help the research team to further improve the model and deepen this research based on previous studies.

3. Materials and Methods

3.1. Research Process

Based on the YOLOv8 deep learning object detection model, this study constructed a complete research process suitable for wall damage identification of Lingnan gray brick historical buildings in Macau. The process includes data collection, image processing, annotation and organization, model training, performance verification, and final field deployment and application, as shown in the six stages in Figure 1.

3.1.1. Data Collection Stage

In the first round of on-site investigation, the research team found that there are 162 gray brick buildings in Macau, which are divided into six categories: temples, shophouses, residential buildings, others (guild halls, exhibition halls, rest areas, etc.), collapsed and demolished walls or walls that are difficult to collect, and buildings that have been completely demolished, and their preservation conditions vary. These damaged gray brick buildings are mainly concentrated in Freguesia da Sé (大堂區), Freguesia de São Lourenço (風順堂區/聖老楞佐堂區), Taipa Island, Coloane Island, and other areas. According to the preliminary assessment of the remaining gray bricks in the building, they can also be divided into three situations, namely (1) 100% gray bricks remaining: the gray bricks of the entire building are well preserved and can be collected in large quantities; (2) 70% gray bricks remaining: the building is still in existence, and there are a large number of gray bricks on the side facades, which can be collected; and (3) 10–50% gray bricks remaining: the remaining walls or other buildings are incomplete and collapsed and will not be collected for now. Through field investigation and high-resolution photography equipment, priority was given to collecting typical architectural samples with good gray brick preservation (gray brick remaining at least 70%), such as Lin Kai Temple (蓮溪新廟), Pao Kong Temple (包公廟), and Lou Kau Mansion (盧家大屋). Based on the facade structure, orientation, lighting conditions, and damage performance of each building, wall images were taken face-by-face, and environmental variables such as the acquisition time, weather conditions, and camera angles were simultaneously recorded. Based on the degree of gray brick preservation, the research team divided the buildings into three categories: complete preservation, large-scale remnants, and partial incompleteness, to achieve scientific classification and precise sampling. To do this, the team carefully checked the images and removed any that were unclear, covered by cement or moss, tilted, had strong shadows, or were blocked, resulting in 375 good-quality images for further processing and training of the model. We ultimately identified 375 high-quality images for further data processing and modeling training.

3.1.2. Data Processing Stage

The research team systematically optimized and standardized the collected original images to meet the strict requirements of YOLOv8 model training on image quality and structured format. First, the original images were carefully cut to remove distractions in areas that were not the focus, like cars, trash, and wires, keeping only the important gray brick wall sections to make sure the images were clear and relevant. Next, all images were resized to 512 × 512 pixels to meet the YOLOv8 model’s requirements, ensuring that the resolution was consistent and did not affect feature extraction. In terms of image quality improvement, the research team used professional image processing tools such as Photoshop to perform multiple optimization processes on the images, including image denoising, color restoration, brightness adjustment, contrast enhancement, and perspective correction. This type of processing not only enhances the visual performance of microscopic damage, such as brick joints, cracks, and peeling but also increases the focus on key details during model recognition, effectively enhancing the model’s perception ability and positioning accuracy. In addition to improving the representativeness of the training set and the generalization ability of the model, the research team preliminarily screened and classified the damage types of the images while retaining the original diversity of the data and constructed an image subset covering typical damage types. This subset included 51 cracked images, 57 damaged images, 52 missing images, 40 human damage images, 68 moss attachment images, 58 surface stain images, and 49 plant erosion images. A total of 375 high-quality sample images were selected for the final training dataset.

3.1.3. Data Annotation Stage

The research team used the professional object detection and annotation tool LabelImg to perform brick-by-brick fine annotation on 375 standardized, high-quality images to ensure that the YOLOv8 model could learn and accurately identify various typical damage types on gray brick walls. The annotation work not only emphasizes the extraction of semantic information about damage in the image but also considers the true expression of the scale of building materials, reflecting the high-resolution and high-precision application capabilities of artificial intelligence technology in the field of architectural heritage protection. In terms of annotation strategy, the research team set eight annotation categories, namely crack, damage, missing, vandalism, moss, stain, plant, and intact. Each category uses a box to outline the area, and the annotation focuses on the exact part of the gray brick shown in the image to make sure that the results are consistent and can be traced back to the physical structure. In the case of overlapping or compound damage, the team prioritized labeling according to the preset damage severity hierarchy, namely missing > crack > damage > vandalism > plant > moss > stain. This priority sequence ensures that the model focuses on the key damage areas that have a greater impact on the stability of the building structure during training, thereby enhancing the practical application value of the model. In addition, since the goal of this study is not only damage identification but also includes the automatic counting function of the total number of gray bricks and the number of damages, it is required to fully label all gray bricks in the image, regardless of whether they are damaged, to achieve subsequent brick surface unit-level identification and metrological analysis based on the YOLOv8 model. To construct a well-structured dataset, 375 annotated images were divided into training sets and validation sets in proportion, including 303 training sets (train), 34 validation sets (val), 337 training and validation mixed sets (trainval), and 38 test sets (test). The annotated data formats were all converted into the YOLO-adapted XML file format and paired with the corresponding images one by one.

3.1.4. Model Training Stage

The research team conducted deep learning training on the labeled dataset based on the YOLOv8 structure, aiming to achieve high-precision automatic identification of multiple types of damage in gray brick walls. The machine learning environment was set as follows: the operating system was Windows 11 (X64), the CUDA version was 11.5, the deep learning framework was PyTorch (1.13.0), and the graphics card and processor were a GeForce RTX 3070 (16 GB) (Santa Clara, CA, USA) card and an AMD Ryzen 9 5900HX (3.30 GHz) processor (Santa Clara, CA, USA), respectively. The YOLOv8 model uses a modern C2F (cross-stage partial with focus) design, which combines effective feature extraction and a method for merging features at different scales. It can achieve keen perception and precise positioning of fine-grained targets (such as cracks, moss, etc.) while keeping the model lightweight. It is extremely suitable for tasks involving the detection of complex and subtle damage on brick surfaces in traditional buildings. In the specific training strategy, this study set up a two-stage training scheme of gradual unfreezing. The initial stage of training was the Freeze Train stage, which freezes the parameters of the Backbone backbone network and only trains the detection head module, thereby stabilizing the network structure and improving the initial learning efficiency. This stage was from epoch 0 to epoch 50th of training; the batch size was set to 4, the initial learning rate was 0.01, the stochastic gradient descent (SGD) optimizer was used, and the momentum term 0.937 was combined for optimization and updating. Then, we entered the unfreeze training phase, unlocked the backbone weights, and further trained the entire network to optimize the overall detection performance. The training cycle lasted from the 50th epoch to the 300th epoch, and the batch size was adjusted to two to adapt to the video memory resources and ensure training stability. The input image size used in the entire training process was unified to 512 × 512 pixels, and the cosine decay learning rate decay strategy (min lr was set to 0.0001) was used to effectively smooth the training process and prevent oscillation or overfitting. The model saves weight parameters every 5 epochs and sets up eight subprocesses for data loading (num workers = 8) to speed up training. The training dataset contains 351 images, and the validation set contains 40. The initial weight of the model was based on the pre-trained model yolov8_x.pth to ensure that the network had a favorable convergence starting point. During the feature extraction and classification process, YOLOv8 identified the basic textures and structures of the original image using the backbone network and then improved the understanding of the image by combining information at different scales with the Neck module (like FPN and PAN structures). Finally, the three sets of detection heads, Head0, Head1, and Head2, each worked with feature maps of different sizes to accurately identify small targets (like microcracks), medium targets (like damaged areas), and large targets (like big patches of moss). The specific parameters of the model are shown in Table 3.

3.1.5. Model Testing Stage

This study systematically evaluates the performance and verifies the effect of the trained YOLOv8 model and comprehensively analyzes its accuracy, stability, and practicality in tasks for detecting damage to gray bricks. In this stage, not only were standard evaluation indicators for object detection used, but auxiliary analysis methods such as heatmap visualization and damage quantification were also introduced to enhance the interpretability and engineering applicability of building damage detection. In the test phase, 38 independent test set images previously defined were used, and the evaluation indicators included the mean average precision (mAP), F1 score, recall, precision, and log-average miss rate (LAMR). Among them, mAP is the core indicator that measures the detection performance of the model under different categories and IoU thresholds, reflecting its generalization ability in complex damage scenarios. The YOLOv8 model trained in this study achieved high performance in the mAP indicator, indicating that it has excellent recognition in the location and classification of multiple types of detailed damage, such as cracks, missing parts, moss, and stains. The F1 score is used to balance precision and recall and can reflect the comprehensive recognition ability of the model, especially when some categories are unevenly distributed. The improvement in recall indicates that the model has a strong ability to cover all damage, while the accuracy shows that it has high reliability in filtering false positives. The introduction of LAMR measures the model’s ability to capture small targets or minor damage in the low recall stage from a robustness perspective. A low LAMR value shows that the model is good at minimizing missed detections, making it ideal for high-precision situations like restoring cultural relics and conducting daily inspections.
Aside from using numbers to measure things, this study also added two visual tools, heatmap analysis and damage quantity statistics, to make the model results easier to understand and use. In the heatmap part, we created a Grad-CAM mechanism that combines features from multiple layers of convolutional data. In the heatmap module, we constructed a Grad-CAM mechanism based on multi-layer convolutional feature fusion. Through learnable upsampling, feature alignment (DeformConv2d), and dynamic channel fusion modules, a multi-scale semantically enhanced spatial attention map was generated to clearly display the damaged area of the model’s attention and its weight distribution. In the visualization results, the model showed high responsiveness on crack edges, missing areas, and biological attachments, verifying its sensitivity to high-risk damage. Additionally, the cropping and statistics modules implemented after the model was deployed enabled automatic classification and quantitative analysis of the detection results. The model can not only locate the damaged type of gray brick but also count and classify all damaged bricks in the image, providing quantifiable data support for subsequent gray brick maintenance evaluation. This capability is supported by transparent border drawing, multi-class legend display, and classification-saving mechanisms, considering both intuitive image presentation and engineering operability.

3.1.6. Model Application Stage

Finally, the research team deployed the trained YOLOv8 model to a portable smart terminal device (see sub-image 6 in Figure 1). The device integrates a portable high-definition camera, an embedded computing module, and a visual software interface, which can perform real-time detection and analysis of wall images directly on the construction site. The system supports image capture, damage identification, and result export functions, has the convenience of field operation, and is suitable for various practical application scenarios such as cultural relics inspection and maintenance assessment.

3.2. YOLOv8 Model Structure

In this study, to realize the automatic recognition and accurate classification of the damage to the gray brick wall in Macau, this study used the YOLOv8 model as the core detection structure, and based on keeping its original structure unchanged, combined the characteristics of the building surface damage to scientifically configure and fully train its application process. As a representative model with both speed and accuracy in the current object detection field, YOLOv8 has excellent multi-scale perception capabilities and a lightweight network structure and is particularly suitable for the detection of targets with complex textures and tiny cracks, such as gray brick surfaces.
The overall structure of the YOLOv8 model consists of three parts: the backbone network (Backbone), the feature fusion network (Neck), and the detection head (Head) (Figure 2). The backbone network adopts an advanced CSP (cross-stage partial) structure, which enhances the gradient flow and feature extraction capabilities while maintaining the model’s operational efficiency and can effectively capture subtle damage features in gray brick walls, such as cracks and broken corners. The model gathers important details at different levels by using various convolution and downsampling techniques, which correspond to different sizes of the areas it looks at, helping with later detection at multiple scales. As shown in Figure 2, the YOLOv8 structure uses a backbone network based on CSPDarknet53. This part extracts feature maps of different spatial scales through a multi-level feature pyramid (P1 to P5), starting from the input 512 × 512 × 3 color image, and gradually reduces the spatial resolution and increases the number of feature channels. Specifically, P1 (256 × 256 × 80) to P5 (16 × 16 × 640) gradually extract gray brick surface feature information from low to high layers through convolution and downsampling operations. The Neck part, as a feature fusion module, uses the C2f structure, which replaces the CSPLayer in YOLOv5 in YOLOv8. The C2f module contains the input convolution (Conv(c1, 2 × c)) that divides the input channel into two parts and then achieves dense residual fusion through multiple Bottleneck stacking. Finally, the output channel is integrated by convolution (Conv((2 + n) × c, c2)) to improve the perception and expression capabilities of multi-layer features. The C2f layer in Neck outputs feature size annotations such as 64 × 64 × 320, 32 × 32 × 640, and 16 × 16 × 640. Combined with the standard convolution layer (Conv), batch normalization (BN), and SiLU activation function, the context perception of the feature map is effectively enhanced. The up- and downsampling modules (Upsample) and the feature concatenation operation (Concat) further realize the alignment and fusion of features of different scales to improve the robustness of multi-scale features and the overall performance of the model.
In the detection head (Head) part, YOLOv8 adopts a decoupled detection head design to separate the objectness, classification, and bounding box regression tasks in the detection task. Specifically, the localization branch (cv2 module) consists of three layers of convolution (Conv3 × 3→Conv3 × 3→Conv1 × 1) to output the bounding box offset (the channel is 4 × reg_max), while the classification branch (cv3 module) adopts a similar structure, and the final output channel is num_classes, which is used for target classification. In the Head, the two functions are respectively applied to multi-scale feature maps (such as cv20 and cv31); the Sigmoid function is used to process the target probability; and the Softmax function is used to process the classification probability to achieve accurate positioning and multi-class discrimination of the detection results. In terms of loss function setting, YOLOv8 uses CIoU (Complete Intersection over Union) and DFL (Distribution Focal Loss) for bounding box regression loss calculations and uses binary cross-entropy to process classification loss to improve the performance of small target detection and the overall detection effect.
In the feature fusion stage, YOLOv8 uses path aggregation structures (such as a combination of FPN and PAN) to achieve efficient integration of feature maps from different depths. This step enables the model to have stable performance when detecting small targets (such as cracks on the surface of gray bricks or moss point distribution) and large targets (such as the entire brick missing or a large area of pollution). The detection head uses the anchor-free method to output position regression and category classification results. Each layer of prediction branches can handle targets of a specific scale and achieve unified detection capabilities across the full range of sizes. The model’s final output shows the location of the object, the likelihood of its category, and a confidence score, while the non-maximum suppression (NMS) algorithm helps eliminate duplicate predictions to make sure the detection results are accurate and unique.
To better adapt to the needs of building damage detection, we strictly followed the native configuration specifications of YOLOv8, set the image input size to 512 × 512, and used the “x” version model to obtain stronger feature extraction capabilities. At the same time, we used its default three-layer detection head structure (Head0, Head1, and Head2), corresponding to the three-layer feature maps of P3, P4, and P5, covering small, medium, and large spatial scales. In the detection process, the model can find and identify each gray brick in the image and assess its damage, which helps in counting the gray bricks and analyzing the damage on their surfaces. In addition to enhancing the model’s visualization, expression, and engineering practicality, this paper integrates the feature fusion heatmap in the simplified path, which clearly shows the response area focused on by the model in feature maps of different scales. The final output result (Output) has a size of 512 × 512 × 3, where different color channels represent different prediction categories (such as missing, cracked, contaminated, etc.) to intuitively show the positioning and classification effect of YOLOv8 in gray brick damage detection.

4. Results

4.1. Model Training Results

As shown in Figure 3, the YOLOv8 model showed good convergence and stability during the training process of the dataset for damage to Macau’s gray brick walls in this study. The model’s train loss reached 142.51, validation loss was 64.19, and mAP was 0.00 at the first epoch, reflecting that the model was still in the early stages of feature learning at the initial stage. As the training continued, the loss value dropped rapidly, and the validation loss dropped to a minimum of 2.68 at the 64th epoch, indicating that the model’s fit to the validation set was optimal. At the same time, the mean average precision (mAP) reached a peak of 0.71 at the 90th epoch, indicating that the model’s comprehensive performance in multi-class damage identification had reached a stable level. Finally, at the end of the 297th epoch of training, the training loss dropped to a minimum of 1.40, indicating that the model’s error on the training set was tiny and the training process tended to converge.
After completing the training of the YOLOv8 model, this study selected the 64th epoch (Model 1), the 90th epoch (Model 2), and the 297th epoch (Model 3) in the training process as representative models and compared and evaluated their detection performance on the test set to further verify the optimal performance timing and stage stability of the model in the task of identifying damage to gray brick walls (Figure 4). The mean average precision (mAP) of each model was 63.62%, 62.60%, and 61.51%, respectively, and the corresponding log-average miss rate (LAMR) also showed obvious differences in the category dimension.
The model from the 64th epoch had the highest overall mAP at 63.62%, showing it was the best at distinguishing different types of damage features during training. It scored 0.95 in the vandalism category, and its scores in the moss, missing, and damage categories were all above 0.70, which means it adapts well to damage types that have clear differences in texture, shape, and distribution. It obtained an AP value of 0.95 in the vandalism category, and the AP values in the moss, missing, and damage categories all exceeded 0.70, indicating that it has excellent adaptability to damage types, with obvious differences in texture, shape, and distribution characteristics. In contrast, the mAP of the 90th epoch and 297th epoch models slightly decreased to 62.60% and 61.51%, respectively. Even though the drop was small, the AP was much lower in harder categories to identify, like intact and stain, suggesting that the model might be overfitting or losing its ability to generalize features.
According to the LAMR index, Model 1 shows a more balanced missed detection control ability in multiple categories. For example, in the moss and missing categories, its LAMR is 0.51 and 0.50, respectively, which is better than Model 2 (0.57 and 0.56) and Model 3 (0.51 and 0.60), indicating that the model is more robust for damage recognition in small-scale, high-overlapping areas. More significantly, the three models all show extremely low missed detection rates (all 0.00) in the vandalism category, further verifying that this type of damage is the most prominent in the training set and that the model can stably capture its obvious features. However, in the plant and stain categories, regardless of the model at which stage, the LAMR is always high (up to 0.90). This shows that this type of surface attachment or color spot interference feature is still a recognition weakness of the current model. We speculate that due to the high degree of confusion between its texture and background or the subjective differences in the annotation boundaries, further optimization is still needed in terms of data balance and fine-grained annotation strategies.
As shown in Figure 5 and Table 4, the 64th epoch model achieved relatively balanced results in multiple key indicators, especially in the vandalism category. All models showed stable and extremely high recognition capabilities (AP = 0.95 or 1.00, LAMR = 0.00, F1 = 0.75 or 1.00). This evidence shows that the characteristics of this type of damage are obvious, and the model can accurately capture them. However, in the remaining categories, the performance of the 64th epoch model is more robust, especially in the detection of highly complex surface damage, such as missing (AP = 0.72, recall = 0.78) and moss (AP = 0.76, recall = 0.84). This result shows that the model at this stage can effectively learn target features with strong texture and fuzzy boundaries. At the same time, the F1 value of structural damage, such as damage and cracks, is also close to or exceeds 0.6, proving the stability of the model in extracting spatial continuity features. Although the performance of plant, stain, and intact classes is still relatively low, especially the recall and F1 values are obviously insufficient (e.g., recall of plant = 0.38), these interfering features have strong visual uncertainty in the original image, which is a common difficulty in current building damage detection.
In comparison, even though the overall mAP of the 90th epoch model went down slightly to 62.60%, the model did well at recognizing cracks (AP = 0.74), showing it is better at noticing fine details. However, the model’s precision and recall for the intact category are very low (precision = 0.35, recall = 0.33), and the F1 value is just 0.34. However, the precision and recall of the model in the intact category are extremely low (precision = 0.35, recall = 0.33), and the F1 value is only 0.34. This indicates that the model’s ability to discriminate undamaged areas has declined, which may be due to the excessive reinforcement of the learning of the damage category in the later stage of training, resulting in insufficient generalization ability of the non-damaged category. In addition, although the F1 values of the plant and stain categories have increased slightly, the LAMR remains high (both 0.83), indicating that the problem of missed detection has not been fundamentally improved.
At the 297th epoch model stage, although the overall mAP further dropped to 61.51%, some categories showed more mature detection capabilities, especially in the moss and missing categories, with recall reaching 0.89 and 0.85, respectively, and F1 reaching 0.74 and 0.73. This result shows that the model’s detection coverage of common damaged targets has been significantly improved at the end of training, and the missed detection rate has been controlled (LAMR = 0.51 and 0.60). At the same time, the recall of the crack category rose to 0.71, and the precision also reached 0.66, indicating that the model, at this stage, has achieved a coordinated improvement in detection accuracy and recall rate for crack-type targets. However, like the previous stage, the performance of the three categories of intact, plant, and stain is still lagging behind, especially the recall of intact is only 0.27, indicating that the model still finds it difficult to extract effective features from non-damaged textures, and the problems of misjudgment and missed judgment have not been eradicated.
Looking more closely at how well the three-stage model identifies different types of gray brick damage, using the confusion matrix helps us to better understand how well the YOLOv8 model can tell the difference between various labels and where it tends to make mistakes in real situations (Figure 6, Figure 7 and Figure 8). Model 1 had a high accuracy rate of 0.79 for identifying missing bricks, showing it can reliably spot missing damage; it scored 0.57 for cracks, 0.68 for damage, and 0.89 for moss. Model 1 achieved a high recognition accuracy rate (0.79) in the missing category, showing a stable ability to distinguish brick-missing damage, while crack, damage, and moss reached 0.57, 0.68, and 0.89, respectively. In particular, the recognition of the moss category was the most stable, with almost no confusion. In the plant, stain, and intact categories, the accuracy rate was much lower, especially for stain and intact, which were only 0.52 and 0.44, respectively, and many were wrongly identified as damage, background, or each other. This shows that the model struggles to see the small differences between surface stains, natural attachments, and the brick surface itself. It is important to note that the vandalism category does well in all models (with an accuracy close to 1.00) because it has clear texture edges, noticeable local changes, fewer differences in training samples, and is easier for the model to learn. It should be pointed out that although the vandalism category performs well in all models (with an accuracy close to 1.00), this improvement is mainly due to its clear texture edges, obvious local structural mutations, small differences in training samples, and ease of being efficiently learned by the model.
The confusion matrix of Model 2 shows that the model’s crack recognition ability is further enhanced (the accuracy rate rises to 0.71), and the performance of damage and missing classes is also relatively stable (both 0.71 and 0.79), indicating that the model maintains excellent stability for structural damage. At the same time, the recognition effect of the plant class has been significantly improved, reaching 0.77, indicating that the model has learned more boundary features of vegetation interference in the middle and late stages. However, the accuracy of the vandalism category dropped from 1.00 to 0.75, and some were misjudged as missing, which may be due to the strong similarity between local damage and the overall absence of bricks in the edge features of the image. In addition, there is still serious confusion between stain and intact. For example, 0.28% of the “stain” class is misjudged as background, indicating that the model is still not robust to fine-grained color differences and weak texture targets.
The confusion matrix of Model 3 presents a clearer and more stable trend. Its recognition of the missing category is further improved to 0.86, becoming one of the categories with the highest recognition accuracy in this study. At the same time, crack and moss also maintained a high level, 0.79 and 0.89, respectively. However, it is worth noting that although the overall accuracy of the damage category is 0.71, its confusion rate is relatively high, especially the proportion of being misidentified as intact and background is 0.61 and 0.48, respectively, indicating that the model’s recognition ability for edge wear and mild surface erosion still has bottlenecks. Also, the model’s ability to recognize plant categories dropped to 0.62, the same as Model 1. There is still a clear confusion between stains and intact items, with 0.28% of stains being seen as background and many intact items being wrongly identified as damage or stains, showing that the model is not yet strong enough to recognize non-structural and low-contrast features.
Combining the evolution trends of the three confusion matrices, we can observe that the YOLOv8 model maintains excellent recognition stability in categories with prominent features such as vandalism, missing, and moss. However, in categories such as stain, plant, and intact, which are like the background texture and have blurred visual boundaries, there are always different degrees of confusion. Although the overall accuracy of Model 2 is slightly lower than that of Model 1, it performs better in plant recognition and misjudgment control, while Model 3 has enhanced the final recognition ability of missing and crack categories, but there is also an accumulation of misjudgments between structural damage and background information.

4.2. Model Testing

According to the results of the thermal map, the performances of Model 1, Model 2, and Model 3 in the actual image test can be confirmed. Model 3 shows a stronger, denser, and more focused response on the real gray brick damage area in most cases, and its overall performance is better than Model 1 and Model 2, especially in images with complex visual features and uneven damage distribution (Figure 9). From typical samples such as image numbers 1, 4, 5, 6, and 8, Model 3 shows a larger area and higher response intensity (the red area is denser) in the thermal map, accurately covering various types of gray brick damage such as cracks, breakage, peeling, weathering, and plant erosion. For example, in image 1 of Figure 9, Model 3 clearly captures the continuity of the brick joints and the fractured areas of the brick surface, while the responses of Model 1 and Model 2 are weak and discontinuous. In image no. 6 of Figure 9, multiple depressions and holes on the brick surface also obtain concentrated and consistent high responses in the thermal map of Model 3. However, it should be pointed out that the high-response areas marked by the three groups of models do not always accurately correspond to the specific locations of actual damage. This is mainly because the facade of a single brick was used as the frame selection unit during the marking stage in this study rather than accurate marking based on damage details. This strategy has affected the complete correspondence between the thermal map and the damaged location to a certain extent.
After using heatmap visualization to test the new dataset (Figure 10), we found that the three models performed well on images they had not seen before, showing they can recognize damage consistently. Compared with the previous test based on the training set, this round of experiments used gray brick image samples that the model had never seen, including various brick-type arrangements, weathering degrees, and differences in gray joint treatment. This setting is closer to the actual application scenario and can fully verify the performance of the model in a real environment. Overall, Model 3 still shows the best recognition response and regional focusing capabilities and has stronger cross-image generalization capabilities and damage perception robustness.
Specifically, in image no. 3 of Figure 10, Model 3 accurately responds to the area with more serious cracks on the brick surface, and the heatmap of Model 3 forms a concentrated and continuous red high-response area there. Models 1 and 2 show slight response diffusion or blurred boundaries, indicating that their ability to locate damage is relatively weak when facing unlabeled images. Additionally, image no. 5 of Figure 10, despite showing relatively light damage overall and having mostly intact bricks, still contains numerous details such as slight weathering, pollution spots, and microcracks. Model 3 shows a stronger ability to capture details. The response hotspots are not only large in number and evenly distributed but also show excellent damage sensitivity. It is particularly noteworthy that in images no. 5 to no. 7 of Figure 10 with more background interference (such as light-colored brick joints, uneven lighting, etc.), the response boundaries of the three models are blurred, and the noise response increases (blue at the edge of the image), and Model 2 has a lack of effective activation in local areas (image no. 2 of Figure 10), indicating that it still has certain limitations in feature extraction and structural cognition.
In summary, Model 3 has a relatively stronger generalization ability for different types of damage. Its heatmap shows a higher overall activity in most images, and the red area is richer. This shows that it is more sensitive to gray brick damage and has better recognition density and response stability, reflecting that the model has successfully developed a more mature mechanism for extracting damage features in the later stage of training. This “high response + wide coverage” heatmap feature not only shows that Model 3 can effectively identify the dominant damage area but also has a strong ability to capture microscopic damage, showing that it has stronger adaptability and application potential when facing the complex, changeable, and highly heterogeneous surface weathering phenomenon of the walls of Macau’s historical buildings.
In the damage quantification test of the training set samples, by comparing images no. 1 to no. 8 in Figure 11 one by one, we can observe the performance differences of each model in terms of the damage-type distinction and brick-level selection accuracy in more detail. In image no. 1, only Model 2 successfully identified the crack label of a brick in the upper right corner, while Models 1 and 3 failed to identify the crack, indicating that Model 2 is more sensitive in extracting local detail features. In image no. 2, Model 3 showed the best overall recognition effect, not only accurately identifying cracks and stains but also accurately framing the damaged area in the lower part of the brick surface. Since the study’s guidelines say that damage is more serious than stains, Model 3’s ability to focus on identifying damage labels makes its performance more accurate and logical. Image no. 3 further verifies the robustness of Model 3. The obvious surface peeling and weathering marks in the upper half are accurately marked as “damage” rather than mistakenly marked as “stain”. In contrast, Models 1 and 2 are confused about their judgment regarding this area. In image no. 4, both Model 1 and Model 2 misclassified the damaged area as moss, obviously failing to correctly extract the texture features of material erosion. Although Model 3 made more accurate judgments overall, it still misclassified a missing area as damage. This is because the bricks in this area are not entirely absent; instead, the surface has peeled off more, which causes confusion regarding the label boundary. In image no. 5, Model 3 accurately identified most areas but misclassified one “damage” area as vandalism. This may be because the surface morphology of the brick is relatively abnormal, and the texture mutation is misjudged by the model as a sign of human intervention. In image no. 6, Model 3 shows a clear advantage and accurately judges the damaged properties of the second row of bricks, while Models 1 and 2 misclassify the area as missing, obviously confusing the bricks with an intact structure but a peeling surface with the empty bricks that are completely peeled off. In addition, Model 3 also performs well in other label recognition in this image, and the overall output result is stable and clear. In image no. 7, Model 3 accurately frames all cracked bricks, while Model 1 and Model 2 have some missed detections and false detections, which shows that Model 3 has a stronger perception and selection consistency on crack samples. Image no. 8 is a more challenging sample. All three models incorrectly label some types of damage caused by nature, like breakage or moss, as vandalism. This shows that the way we label these damages is often confusing and needs to be improved as we gather more data and adjust the model settings.
In the new test images, we further verified the generalization performance of the model under non-training set conditions (Figure 12). Overall, we noticed that Model 1, Model 2, and Model 3 all missed some detections and made some false detections, especially with the blue brick surfaces seen from far away, like in image no. 1 to image no. 6. This shows that the model struggles to identify brick damage when viewed from a distance and the details are unclear. However, when we looked at image no. 7 of Figure 12, which was taken up close, the missed detections were much lower, and the accuracy of recognition was much better. However, under the close-up shooting condition of image no. 7 of Figure 12, the missed detection rate is significantly reduced, and the recognition accuracy is significantly improved. In particular, Model 3 shows better adaptability and accuracy. It can not only clearly select the damaged area but also accurately identify high-detail damage, such as cracks, showing strong scale robustness. This result shows that under conditions of high resolution of the acquired image and clear brick surface features, the damage features learned in the model training can be fully activated, and the detection effect is more ideal. In addition, the three models generally confuse damage with stain in this batch of test images, especially in images 2, 3, and 5 of Figure 12, indicating that there is strong uncertainty in the boundaries between such labels. According to field investigations and manual labeling experience, this type of confusion is mostly caused by the use of cement mortar or lime for local repairs during the maintenance of Macau’s gray bricks. The repaired area has both the structural properties of material replacement and the characterization characteristics of significant color difference and material discontinuity. Therefore, it has the dual semantics of “damage” and “stains” visually. Even manual identification is difficult to label consistently, resulting in recognition conflicts in model training and testing.
In comprehensive comparison, Model 3 still shows more stable performance, especially in image no. 7 of Figure 12, which accurately captures all cracks and broken bricks, reflecting its discrimination ability in high feature density images. In long-distance images (such as images 1, 4, and 8 of Figure 12), the three models all show high uncertainty and deviation, further confirming that the model in this study is more suitable for close-range or medium-short-range detection scenarios. Practical applications should avoid directly deploying this model in high-viewing environments like long-distance monitoring or large-scale drone scanning. It is recommended to combine the close-range image acquisition strategy to give full play to the advantages and reliability of the model for brick damage detection.

4.3. Comparison with YOLOv12

In addition to the original YOLOv8 model, this study also trained and evaluated the latest YOLOv12 model to analyze the performance differences and applicability of the two on this dataset. The parameter settings used in the training of the YOLOv12 model are consistent with those of YOLOv8. The core includes the input image size of 512 × 512, the batch size of 2, the optimizer using SGD, the learning rate strategy of cosine decay, and the training epoch set to 300 [35,36]. During training, the early stopping feature in YOLOv12 was activated because the validation set’s performance did not improve after several rounds, so training automatically stopped at the 199th epoch (more details can be found in the YOLOv12_results.csv file in Appendix A). In addition, other key settings such as data augmentation strategies (mixup, copy-paste, randaugment), freeze/thaw phase division, and the training and validation division ratio are also consistent (see the args.yaml file in the Supplementary Material for details).
Figure 13 displays the comparison results. From the training results, the YOLOv8 model reached its peak performance at the 90th epoch, with a mAP@0.5 of 0.7128, while the YOLOv12 model reached a maximum mAP@0.5 value of 0.6825 at the 95th epoch, which is slightly lower than YOLOv8 overall. The two models are relatively close in the trend of the mAP curve, and YOLOv8 has higher detection accuracy and convergence stability in some stages. This result shows that although YOLOv12, as an updated version, has certain feature expression advantages in theoretical structure, in the gray brick damage detection task scenario targeted by this study, YOLOv8 still shows stronger adaptability and robustness; this is especially in the small sample training set, where it can better maintain detection accuracy.

5. Discussion

5.1. Model Application

After completing the systematic evaluation and comparative analysis of the model performance, the research team finally selected Model 3 as the deployment model. This model showed better performance in multiple test dimensions, especially in terms of the intensity of heatmap responses, spatial focusing ability, and stability of damage identification, which were better than Model 1 and Model 2. Figure 14 shows the recognition effect of Model 3 on typical damage types, including seven categories: stain, plant, moss, missing, damage, crack, and vandalism. Through the triple comparison of images, heatmaps, and box selection results, the model’s recognition ability for different types of damage can be more intuitively observed.
From the results, Model 3 has a high accuracy in identifying stains, plants, damage, cracks, and human damage. These categories often have obvious texture changes, morphological features, or edge breaks, such as stains with dark and mottled colors, damage with material peeling, cracks with linear structures, and human damage with tool penetration. These are easy to form feature focus in convolutional neural networks, so the model can stably identify them. In addition, the model performs well in identifying “plant” damage and can effectively distinguish the biological erosion features attached to the brick surface. However, the model still has some confusion when distinguishing between “moss” and “plant”, two categories with similar semantics. The heatmap and annotation results reveal that the model mistakenly identifies some moss areas as plants. This misdetection is mainly due to the high similarity between the two in image performance, especially when the shadow is heavy or the moss is attached in large pieces; it is effortless to confuse it with the wall-attached vines of the plant class. In addition, there are certain errors in the identification of missing damage, and the model often identifies it as damage. This confusion may be related to the “complete bricks as the labeling unit” in the label set, which causes the model to tend to make judgments based on local morphology rather than structural integrity, thus confusing the boundary between severe surface erosion and missing bricks.
In general, Model 3 has a good ability to identify damage to gray bricks, especially in damage types with clear feature expressions that show high classification accuracy. Although there are still misjudgments in individual categories with similar semantics, these results are basically consistent with the real complexity of current brick surface weathering. In future research, we can further optimize the definition system of damage categories, introduce more fine-grained image features, and enhance semantic segmentation capabilities to continuously improve the adaptability and stability of the model in tasks for identifying damage in diverse historical buildings.

5.2. Development of Intelligent Identification Devices

To apply the model for identifying gray brick damage in actual scenarios, this research team designed and developed an integrated intelligent detection device, as shown in Figure 15. The device consists of a portable box that serves as the basic unit and integrates essential components, including a high-resolution display, a camera with pan/tilt functionality, a keyboard and mouse input system, and a compartment for storing the charging cable. It has good structural compactness and functional integrity. The box is made of sturdy, shockproof materials and has a precision-structured nested module to fix various electronic components, effectively ensuring stability and durability during transportation and outdoor use. The overall size of the device is about 55 cm × 35 cm × 25 cm, and the weight is controlled within 8 kg. It is equipped with a retractable pull rod and roller casters, which make it easy to drag like a suitcase, significantly improving the convenience and maneuverability of field operations.
During the specific research and development process, the team deployed the optimal model (Model 3), trained based on the YOLOv8 structure on an industrial-grade notebook system with independent image recognition and reasoning capabilities, and integrated it into the device. The camera module supports a maximum resolution of 4K and multi-angle adjustment, which can meet the acquisition requirements of different heights and different brick wall surface conditions. With the built-in light adaptation algorithm, it can also work stably under different lighting conditions. Users can quickly operate the detection process through touch or keyboard. The system supports core functions such as real-time image upload and analysis, heatmap display, damage-type annotation, and damage quantity statistics. It also supports saving results for subsequent data analysis or maintenance record archiving.
The device has many advantages, as follows: (1) As a device customized for the maintenance needs of professional historical buildings, it is highly scalable. Based on its ability to identify current blue brick damage, it can also add features like 3D reconstruction, scoring of damage levels, and comparing historical images to handle a wider range of project needs. (2) Its portable design makes it particularly suitable for long-term outdoor inspection tasks, without being restricted by site and power supply, and is particularly suitable for field inspections in narrow spaces and complex facade environments in old city streets and alleys. (3) The selection of equipment hardware considers both performance and cost. Large-scale production will greatly reduce its overall cost, thereby laying the foundation for the popularization and promotion of technology. (4) The deployment and use of the equipment provide a realistic path for the routine physical examination mechanism of gray brick materials in historical buildings. It is expected to become an important tool for daily inspections, pre-restoration surveys, and cultural relic disease monitoring in Macau and other southern world heritage areas, providing scientific support for heritage protection decisions.

5.3. Limitations

Overall, we focused on the application of exploration and engineering practice verification of a surface damage identification task of gray brick walls of traditional buildings in Macau based on the existing YOLOv8 model. Although this study has achieved certain interim results, there are still some shortcomings. First, in the setting of the label system, some damage categories (such as stains and damage, moss, and plants) have strong similarities in image representation, and the model is prone to confusion in actual recognition, especially in the color spot area produced after cement repair. Even manual recognition has subjective bias. Secondly, since the whole brick is used as the unit for labeling instead of the actual damaged area as the frame selection benchmark, there is a certain deviation between the thermal map response and the actual damage location. In addition, the model’s recognition ability for the intact brick (intact) category is generally weak, probably because it lacks prominent visual features and fails to form effective classification features during training. Finally, the model’s detection performance for long-distance images is poor, and it is not suitable for high-altitude shooting or drone collection scenarios. Compared with the innovative research on basic algorithms, the innovation of this paper is mainly reflected in the implementation of engineering applications, optimization of detection processes, and the establishment of a multi-dimensional evaluation system. This application research oriented to engineering needs is inevitably subject to the following limitations: (1) Due to the special requirements of the real-time and adaptability of algorithms in the field of architectural heritage protection, YOLOv8, which currently takes into account both accuracy and speed, was used as the core detection framework, and no horizontal multi-model comparison and theoretical breakthrough were carried out. (2) In the case of limited sample size and incomplete definition of multi-type labels, the current research was more focused on optimizing the application effect and engineering the feasibility of existing technologies in specific scenarios rather than proposing a new theoretical model or algorithm structure. (3) The diversity and complexity of the fields of architectural engineering and cultural heritage protection also limit the depth of algorithm innovation. We will further expand the sample, refine the label system, and explore more innovative solutions in combination with advanced detection algorithms.
In addition, this study found that the model had some confusion when identifying certain similar categories (such as “stain” and “damage”, “moss”, and “plant”). This problem was reflected in the confusion matrix and heatmap results. The main reasons for this confusion are the blurred boundaries of label definitions, the visual similarities of image features, and the inconsistency of local annotations. Although this study has tried its best to ensure the quality of annotations and the balance of categories under the existing category system, it also fully recognizes the impact of category definition strategies on model performance. To this end, future research will try to introduce a hierarchical classification system as follows: (1) Group the damage types into large categories (such as distinguishing between structural damage and non-structural attachment) and then perform more fine-grained classification and recognition within each large category to reduce the confusion rate between similar categories. (2) This study will explore merging easily confused categories (such as “stain” and “damage”) or adopting a semantic refinement annotation strategy to improve the model’s ability to distinguish different types of damage and generalization performance. (3) By optimizing the classification system and improving the labeling strategy, it is expected that the robustness and accuracy of the model in practical applications will be further enhanced, providing more efficient and reliable technical support for the protection of Macau’s traditional architectural heritage. At last, at the model structure and deployment levels, we will try more advanced lightweight Transformer or attention fusion models to improve remote recognition capabilities [37,38,39,40]. Moreover, we will explore the integrated application of functions such as three-dimensional reconstruction and time series monitoring to create an intelligent platform that is suitable for historical building inspections, disease trend analysis, and digital archive construction, providing technical support and practical samples for the protection of historical and cultural heritage in Macau and southern coastal cities.
In addition, as for the number of samples, there are also certain limitations. At present, it is difficult to continue to obtain new images in the short term because the local historical building survey task in Macau has been completed in stages. However, the researchers have created a plan to expand their work to include other areas known for Lingnan traditional architecture in the Guangdong–Hong Kong–Macau Greater Bay Area, like traditional houses and traditional villages in Guangzhou, Foshan, and Zhaoqing [4,41,42,43,44,45,46,47,48,49], in order to build a larger and more varied dataset that will improve the model’s usefulness and ability for application to different situations.

6. Conclusions

This study aims to build an automatic recognition and quantitative detection system for surface damage on historical gray brick buildings in Macau so as to achieve a more efficient, standardized, and sustainable detection mechanism for architectural heritage protection. Based on the YOLOv8 deep learning target detection framework, the study finally selected the best-performing Model 3 (297th epoch) as the deployment model after systematic data collection, image processing, fine annotation, and multiple rounds of model training. The image data source includes 162 gray brick historical buildings in Macau, with a total of 375 annotated training images, covering eight categories of labels, including “crack, damage, missing, vandalism, moss, stain, plant, and intact”. Multi-dimensional performance evaluations were carried out through training sets, test sets, and external new samples and included the mAP, F1 score, recall, precision, LAMR, confusion matrix, heatmap response, and quantitative statistics, laying a solid foundation for subsequent deployment.
In terms of performance evaluation, Model 3 shows a stronger generalization ability and spatial response stability. It is significantly better than Model 1 and Model 2 in some categories (such as a moss recall = 0.89, missing recall = 0.85, and crack F1 = 0.69), especially in complex backgrounds, where the thermal map response range is wider and the intensity is higher. In the quantitative detection test, Model 3 not only has excellent frame selection consistency for damage and cracking but also maintains recognition accuracy under different lighting, material repair, and natural weathering conditions. In the detection of the new dataset, Model 3 accurately identifies key damage types, such as cracks and damage in close-range samples, showing excellent perception of high-density image details. Additionally, by using portable detection terminals, Model 3 was built into a portable device that can take 4K images, create thermal maps, label quantities, and export data. The hardware design also fully considers the needs of field inspections, ensuring stability, portability, and scalability while also having the potential for large-scale production and application.

7. Patents

The technology related to this project has been applied for an invention patent of the People’s Republic of China, entitled “A method for identifying damage types on exterior walls of gray brick buildings” (一種青磚建築外牆面損傷類型的識別方法). The applicant is the Macau University of Science and Technology, and the inventors are Yile Chen, Jianyi Zheng, Liang Zheng, Xiaohong Yang, and Jingzhao Feng. This invention patent entered the invention disclosure and substantive examination stage in March 2024, and the invention publication number is CN117636047A. This is available online at https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=SCPD&dbname=SCPD202401&filename=CN117636047A&uniplatform=OVERSEA&v=9LIxGtMpDocFzn4IaYYP8cwUWVoxnkSAT5kQbqt4YFDEZY1pbiV8bSSRxSETY4aY (accessed on 24 April 2025).

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/app15126665/s1.

Author Contributions

Conceptualization, L.Z., J.Z. and Y.C.; methodology, L.Z. and Y.C.; software, L.Z. and Y.C.; validation, L.Z. and Y.C.; formal analysis, L.Z. and Y.C.; investigation, L.Z., J.Z., Y.Z., W.L., S.C. and Y.C.; resources, L.Z., J.Z. and Y.C.; data curation, L.Z., Y.Z., W.L., S.C. and Y.C.; writing—original draft preparation, L.Z. and Y.C.; writing—review and editing, L.Z., J.Z., Y.Z., W.L., S.C. and Y.C.; visualization, L.Z.; supervision, J.Z.; project administration, J.Z.; funding acquisition, J.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Macau Science and Technology Development Fund (FDCT)’s Funding for Innovation and Technology Promotion (0080/2023/ITP2): Research and development of intelligent detection technology and equipment for damage of gray brick walls of traditional Chinese buildings in Macau.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The datasets used and analyzed during the current study are available from Jianyi Zheng (jyzheng@must.edu.mo) upon reasonable request.

Acknowledgments

We are very grateful to the students who assisted in the collection of images of gray brick walls of traditional Chinese buildings: Haodong Zheng, Honglin Lin, Jieying Deng, Shaowu Tang, Cong Hu, and Danrui Li.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. YOLOv12 Results

Table A1. The following table shows the relevant results of 199 epochs of YOLOv12 training.
Table A1. The following table shows the relevant results of 199 epochs of YOLOv12 training.
EpochTimeTrain/Box_LossTrain/Cls_LossTrain/Dfl_LossMetrics/Precision (B)Metrics/Recall (B)Metrics/mAP50 (B)Metrics/mAP50-95 (B)Val/Box_LossVal/Cls_LossVal/dfl_Losslr/pg0lr/pg1lr/pg2
121.13311.132282.584491.427630.369530.406370.176340.129420.782491.679111.137010.0033110.0033110.003311
241.52740.916261.680371.247030.3720.395250.270860.203270.797081.686551.105590.0066440.0066440.006644
360.95780.921761.736941.226110.375030.401580.284260.193140.979982.269341.225320.0099770.0099770.009977
480.93161.153631.823591.322350.357550.467690.317250.224910.986212.198561.227410.0099980.0099980.009998
5101.0920.986771.724311.250790.30220.617850.386080.281440.889911.579921.138080.0099960.0099960.009996
6121.2191.014991.539321.233550.495480.441330.407020.306930.871611.428471.119230.0099930.0099930.009993
7141.1930.984051.463141.200540.678310.424340.426560.319250.82551.30171.083360.009990.009990.00999
8161.0130.915481.472481.190680.416330.475580.383470.28370.878321.662841.129150.0099870.0099870.009987
9180.6210.940871.378441.174290.428040.517470.408470.295440.897431.385461.133340.0099820.0099820.009982
10200.6260.902221.338541.173320.387650.555940.501960.373040.841531.311471.151130.0099780.0099780.009978
11220.6710.920041.309381.202960.528560.513340.465290.356580.817241.246581.124010.0099730.0099730.009973
12240.6270.879541.348461.172020.525620.521110.49110.337561.014361.262761.202330.0099670.0099670.009967
13260.6960.937241.311931.210840.512140.569760.466420.347080.868121.310141.134790.0099610.0099610.009961
14280.6240.878191.29081.176150.50250.488330.453180.340260.820411.259861.135420.0099540.0099540.009954
15300.4630.853911.3091.149530.365740.604250.508910.388490.761081.153161.093570.0099460.0099460.009946
16320.3050.891371.264651.173920.526890.515040.469070.352170.839971.244411.127060.0099380.0099380.009938
17339.9440.905271.242431.176160.461730.610750.464130.351330.812911.320761.100190.009930.009930.00993
18359.7750.850231.244451.146180.657470.427320.402180.298840.868811.41011.125020.0099210.0099210.009921
19379.5640.885451.175681.1590.50420.477230.424220.303590.893871.475081.205140.0099110.0099110.009911
20399.3480.848051.184031.159090.451320.583010.521630.395040.783281.194471.110860.0099010.0099010.009901
21419.620.841561.174061.16350.370880.709940.513030.397060.79281.257171.105970.0098910.0098910.009891
22439.9550.827031.15451.117970.526770.521760.492820.38560.762551.264541.091510.009880.009880.00988
23459.9660.828651.162141.156090.570730.657740.595460.467940.766251.154041.10070.0098680.0098680.009868
24479.9160.832491.161421.144540.567850.640920.559680.42750.799621.1271.124130.0098560.0098560.009856
25499.7330.841231.111661.141550.514950.65680.564930.446220.737091.1541.078330.0098430.0098430.009843
26519.8370.807741.126151.124790.542130.648860.577220.438930.749891.076841.094740.009830.009830.00983
27540.1760.817181.138921.140450.465190.596010.540460.412370.764811.099641.09390.0098160.0098160.009816
28560.0850.799151.087261.115340.548720.582490.5850.461030.770761.097351.103120.0098010.0098010.009801
29579.8790.779241.063471.118380.681680.479040.577930.452250.746871.103151.065750.0097870.0097870.009787
30600.0490.827951.127361.143020.475840.633210.525240.409480.770171.202971.110910.0097710.0097710.009771
31619.9350.804111.1131.126590.629590.558280.592720.460110.74491.149731.099680.0097550.0097550.009755
32639.9620.829351.083051.129910.574080.59430.593990.452330.807761.105991.10990.0097390.0097390.009739
33659.7480.806011.079991.128750.631770.723160.666460.51980.730861.009411.068920.0097220.0097220.009722
34679.7990.800361.075131.116830.550280.698940.63940.500180.727791.023921.062230.0097040.0097040.009704
35699.7180.787041.045741.10520.504150.653490.586030.461820.757871.423541.078410.0096860.0096860.009686
36719.6930.780581.048331.108520.653140.568040.535840.411040.768871.208931.090990.0096680.0096680.009668
3717.47140.787731.116361.115750.565030.709310.670640.520480.723080.991731.06320.0096490.0096490.009649
3835.55550.787441.05331.113380.594760.634460.583710.451730.743191.143711.082850.0096290.0096290.009629
3953.41510.807841.014441.117740.619180.663920.68630.546150.746520.973231.076620.0096090.0096090.009609
4071.3680.777791.035061.121830.553390.589610.584040.457640.746621.063611.088310.0095890.0095890.009589
4189.19610.778051.018751.102570.597680.608730.595340.464030.788561.11221.107970.0095680.0095680.009568
42106.9260.761171.044161.097870.644570.649980.665660.523230.734271.002121.072470.0095460.0095460.009546
43124.6860.772561.01771.094470.690440.539630.620670.481540.738061.075511.109720.0095240.0095240.009524
44142.4230.749291.004061.100920.632520.657360.666520.533750.715561.077641.082830.0095020.0095020.009502
45160.1790.768410.976661.087780.559050.679050.657160.505890.756761.039441.096220.0094790.0094790.009479
46177.8860.758360.963461.098940.597870.577570.620810.483570.74151.067221.106710.0094550.0094550.009455
47195.9510.749220.958241.093380.644310.64440.656540.518380.760061.02621.108530.0094310.0094310.009431
48214.0670.76011.005851.103190.609180.599390.622110.491440.733571.087711.09210.0094070.0094070.009407
49232.0540.751710.999371.11410.631220.640780.622690.496290.723481.098071.084910.0093820.0093820.009382
50249.8550.762530.968631.102410.542520.651070.613560.487320.745611.114941.091590.0093560.0093560.009356
51267.6420.727570.963281.07330.553070.645430.615280.489220.732991.051961.081020.009330.009330.00933
52285.4430.734330.95171.079670.562820.644920.597690.469440.75081.072511.098470.0093040.0093040.009304
53303.7110.746390.956981.091650.606970.577790.605240.493230.723421.1391.081050.0092770.0092770.009277
54321.8660.726230.933431.075670.543370.646330.576380.453960.766251.159321.117860.009250.009250.00925
55340.0650.743080.924811.083850.580930.547920.590120.461290.780131.228261.123370.0092220.0092220.009222
56357.8870.733570.942181.087380.514150.67530.646870.517180.722521.070461.082590.0091930.0091930.009193
57376.2660.734490.92061.096220.612660.565840.591760.472230.7341.140451.096260.0091650.0091650.009165
58394.5580.718210.895961.059480.571380.625850.652530.515280.718261.080641.075330.0091350.0091350.009135
59412.5360.720940.882861.087820.62490.611420.635590.518890.703911.069181.081870.0091060.0091060.009106
60430.4280.716620.906521.078940.638990.652180.649570.521060.745981.132661.088070.0090760.0090760.009076
61448.6210.716710.873111.077640.522020.701890.65420.530020.700431.021021.070450.0090450.0090450.009045
62466.8610.708230.897881.063670.692030.550590.640940.524230.694681.22421.061860.0090140.0090140.009014
63485.1430.719260.901911.081680.479970.659760.59720.475860.735921.126781.072260.0089830.0089830.008983
64503.230.693030.849271.04910.522460.611820.533310.426810.761381.214561.107390.0089510.0089510.008951
65521.2010.682640.848341.066050.557550.661220.62020.487480.734861.031641.08480.0089190.0089190.008919
66539.4740.722990.887761.083440.57560.6660.636680.515220.721211.040661.063770.0088860.0088860.008886
67557.8920.686790.89031.058590.629360.639040.623990.493390.739711.052221.098910.0088530.0088530.008853
68575.9770.70.842781.056560.564250.657980.612660.489860.730541.028711.097350.0088190.0088190.008819
69594.2790.689840.829251.059970.573210.676930.628790.507460.706161.042511.064980.0087850.0087850.008785
70612.6470.699620.841491.060860.590130.643670.638690.514630.696931.052171.065650.0087510.0087510.008751
71630.7860.689850.81251.053880.609070.666720.670590.540760.707041.042341.072470.0087160.0087160.008716
72648.8540.688490.82281.055090.68410.659510.664360.526990.700451.000251.055490.0086810.0086810.008681
73667.0580.7040.897821.075370.574740.694190.655090.536440.693671.054041.049710.0086450.0086450.008645
74685.1260.678080.808891.05910.581170.673340.624320.513870.700511.060671.074540.0086090.0086090.008609
75703.2780.694660.843111.052030.639630.564050.631680.509930.691321.04691.063370.0085730.0085730.008573
76721.0920.695850.825111.061460.428740.690850.579870.461080.721111.139621.087450.0085360.0085360.008536
77739.1610.669440.823141.06150.591090.690090.650920.537040.716331.040031.080280.0084980.0084980.008498
78757.7960.686980.822751.070120.577970.685930.620080.507640.734821.12761.080030.0084610.0084610.008461
79776.3710.704880.860871.063330.619610.623330.647160.530210.721081.06041.090870.0084230.0084230.008423
80794.5630.677370.823341.050910.64750.63110.684770.556870.71920.968441.072690.0083850.0083850.008385
81813.3150.673980.827991.040370.5690.652250.635040.517470.704811.043091.085890.0083460.0083460.008346
82831.8560.677410.799341.046970.55120.676060.625340.506250.727731.032451.087930.0083070.0083070.008307
83850.4160.678960.755521.034730.616150.689740.672680.546260.700210.986281.065220.0082670.0082670.008267
84868.5350.658360.77561.034260.577310.644290.63010.513960.718941.173261.093570.0082270.0082270.008227
85886.7880.678560.764221.052280.601840.675980.643550.530520.703331.085751.088640.0081870.0081870.008187
86904.7020.662340.777541.03950.635160.59720.648020.531550.704871.055441.080820.0081470.0081470.008147
87922.6790.688050.780141.051330.6750.592820.632650.512890.725571.11751.086470.0081060.0081060.008106
88940.7890.661910.7651.035820.605750.66690.662920.535580.70891.071181.090030.0080650.0080650.008065
89959.0230.668070.786921.048830.586710.747790.668570.541450.715741.022311.075470.0080230.0080230.008023
90977.0130.653080.788251.043850.591570.621720.636570.520060.721451.041451.080760.0079810.0079810.007981
91994.8710.658790.757361.032820.666620.614580.637830.521410.734151.013071.098530.0079390.0079390.007939
921013.070.651590.802271.035420.611130.634620.653920.540970.721911.022841.095540.0078970.0078970.007897
931031.080.658420.787141.030590.596450.668780.675630.560750.703361.021351.073420.0078540.0078540.007854
941049.830.645450.759491.037030.635250.664230.673990.546950.712590.999721.084380.0078110.0078110.007811
951068.480.660050.729061.041770.60440.611740.665780.540850.694711.037471.05840.0077670.0077670.007767
961086.490.645590.725651.026980.667020.609210.682540.560310.699730.978731.070440.0077230.0077230.007723
971104.70.642420.699991.024910.658320.72940.707230.576280.705890.938151.076270.0076790.0076790.007679
981123.540.649980.74691.039510.597990.587910.632160.508030.739321.040591.114280.0076350.0076350.007635
991142.540.640380.750961.030130.730120.603870.691460.583510.703250.96581.085770.007590.007590.00759
1001160.880.651370.748361.051610.652960.611680.667720.553060.710591.01111.091060.0075450.0075450.007545
1011178.930.651960.749491.043540.652490.686240.669720.547790.725270.979821.116350.00750.00750.0075
1021197.180.625890.714811.030420.643710.713860.69260.56410.709670.967151.099280.0074550.0074550.007455
1031215.230.631390.694081.040260.604610.664770.672650.546520.726691.042841.112230.0074090.0074090.007409
1041233.30.622630.700311.02190.646680.641980.666350.536450.701021.022671.081450.0073630.0073630.007363
1051251.590.630470.707021.029010.652950.661960.654380.529070.711371.065191.083250.0073170.0073170.007317
1061269.810.637810.699151.028160.641360.652690.644240.518040.716281.08671.086020.007270.007270.00727
1071288.140.622560.712241.026840.61390.637120.63620.513750.728261.2311.111940.0072230.0072230.007223
1081306.090.635780.693731.029710.614850.633130.650990.523270.721161.077191.106810.0071760.0071760.007176
1091324.040.624930.682371.030740.590980.654410.642670.52220.734931.032451.119490.0071290.0071290.007129
1101341.70.633880.662921.01640.645920.642230.63980.524510.707031.087521.099760.0070820.0070820.007082
1111359.140.617080.66031.023210.550370.693740.602220.497850.693551.14941.083040.0070340.0070340.007034
1121377.230.621120.682271.036710.636050.668890.629760.519520.690211.115391.086850.0069860.0069860.006986
1131395.190.620370.689491.033530.669860.596620.662750.551580.685781.04641.080160.0069380.0069380.006938
1141412.990.621380.681951.028310.681450.546340.643240.525550.706251.04021.102130.006890.006890.00689
1151430.890.603790.666361.012340.616930.692450.659890.544040.692681.094481.089310.0068410.0068410.006841
1161448.660.61240.653181.015940.565040.670960.615430.500370.712921.119541.114050.0067920.0067920.006792
1171466.60.601570.662071.01620.704070.612030.66180.550230.684961.034471.07580.0067430.0067430.006743
1181484.060.604730.663561.010140.633920.634330.646680.538820.695451.066341.0730.0066940.0066940.006694
1191501.220.605790.628861.00770.656420.60450.640380.531510.697631.027511.074970.0066450.0066450.006645
1201518.480.611080.637061.012920.655230.58660.624070.51520.72221.124181.100470.0065950.0065950.006595
1211536.10.602710.663981.014020.635880.631810.640680.530890.711740.99231.096980.0065450.0065450.006545
1221553.930.605450.637761.010660.579910.683180.628350.513530.71821.058481.093170.0064960.0064960.006496
1231571.690.599090.629981.011280.63310.637190.652120.547170.681571.027191.067140.0064460.0064460.006446
1241589.580.615710.674091.028050.681650.625450.653390.541850.711641.042441.102440.0063950.0063950.006395
1251607.630.588530.630181.018740.596910.616660.635840.51740.721261.069941.093380.0063450.0063450.006345
1261625.480.601190.649191.014320.667140.630790.640960.514610.711841.059051.104620.0062940.0062940.006294
1271643.450.591050.629761.001820.666310.63060.632470.522390.712811.113791.097620.0062440.0062440.006244
1281661.370.591130.639841.016660.623290.638180.60810.500090.720711.111791.114010.0061930.0061930.006193
1291679.10.590050.615731.002040.546070.67610.608940.498430.723011.108251.107040.0061420.0061420.006142
1301697.070.593030.608221.00880.628820.627830.638470.522570.729771.040731.118550.0060910.0060910.006091
1311715.040.591660.616131.009550.654650.630610.650240.532260.710511.041261.098830.006040.006040.00604
1321733.170.587180.618211.007530.690430.573090.659490.534030.715921.030731.103410.0059890.0059890.005989
1331751.160.581470.592130.994150.637290.602590.650570.530380.711291.066791.095330.0059370.0059370.005937
1341769.030.576490.605361.001570.67550.590020.638110.530010.693431.119461.083340.0058860.0058860.005886
1351786.880.581730.566270.989450.650870.640970.667320.549850.704411.074021.090850.0058340.0058340.005834
1361804.770.556240.569090.984060.625220.610190.607050.497310.712571.123381.097460.0057830.0057830.005783
1371822.310.567490.581290.992230.615740.671310.644060.520560.720341.121581.103060.0057310.0057310.005731
1381839.790.578320.577990.994170.626150.697780.659030.539830.708371.032041.099030.0056790.0056790.005679
1391857.560.576740.591611.00920.660830.667060.660210.541990.712291.084571.114060.0056270.0056270.005627
1401875.50.569680.601141.001430.65230.618690.64980.52650.711981.035981.100470.0055750.0055750.005575
1411893.670.567180.583680.991560.626660.618350.628150.518080.705881.074991.093850.0055230.0055230.005523
1421911.840.563210.600210.991080.650180.631660.643440.535380.690161.058911.074530.0054710.0054710.005471
1431929.770.564430.582081.001510.665030.597240.671680.558670.686781.024751.071390.0054190.0054190.005419
1441947.540.571930.568060.992950.661390.608640.643420.530430.701281.070681.08820.0053670.0053670.005367
1451965.440.564160.562570.990780.632120.581020.626860.51250.723691.115141.115790.0053140.0053140.005314
1461983.450.551380.567080.983310.657240.620710.646330.525490.699151.086741.092610.0052620.0052620.005262
1472001.470.559050.586570.990460.585990.630810.632840.517270.710481.130041.108850.005210.005210.00521
1482019.520.563310.560080.990270.605480.697440.666330.541370.706771.070561.102290.0051580.0051580.005158
1492037.390.549940.556940.99720.64190.681420.661810.540890.708551.050861.103190.0051050.0051050.005105
1502055.410.552510.563050.983410.583830.678660.659620.545350.703171.081281.092930.0050530.0050530.005053
1512073.450.546340.555540.989040.654250.629440.651460.542040.708761.07221.102250.0050010.0050010.005001
1522091.540.547580.525210.973660.585670.655710.622160.513210.718241.11471.106810.0049480.0049480.004948
1532109.550.539580.544480.982760.62080.599360.609690.499910.700661.128511.091240.0048960.0048960.004896
1542127.50.537260.521610.974990.608270.648080.640510.533180.702431.100181.09520.0048430.0048430.004843
1552145.270.540180.517720.970690.635560.581140.620510.500850.702041.145841.098740.0047910.0047910.004791
1562163.260.53830.521120.972580.609510.598030.603240.492230.703991.198021.110990.0047390.0047390.004739
1572180.950.534040.537690.977480.590140.577430.572240.473860.709751.237211.125020.0046870.0046870.004687
1582198.510.541120.548520.981220.622010.575320.611110.506710.700321.152131.110630.0046340.0046340.004634
1592216.310.528290.540740.979320.652230.586330.628310.513080.71211.092691.110450.0045820.0045820.004582
16022340.529330.515830.972880.578540.633680.599550.49340.721841.142531.108630.004530.004530.00453
1612251.850.532170.52650.974570.632890.676930.624860.519220.724961.123311.11150.0044780.0044780.004478
1622269.810.519730.512760.975150.59340.689850.6140.509580.701551.100941.098320.0044260.0044260.004426
1632287.650.535750.525460.978930.577540.640640.612550.508990.716391.140521.114750.0043740.0043740.004374
1642305.470.52290.512190.978510.639040.591160.639010.530280.703381.090511.110740.0043220.0043220.004322
1652323.220.531510.526640.974370.622550.579960.595780.492170.699831.140571.110650.004270.004270.00427
1662340.90.521640.5020.976960.649880.594780.615740.506920.69981.102751.107650.0042180.0042180.004218
1672358.820.532170.504430.976110.704160.590750.642360.528060.710261.088421.119960.0041670.0041670.004167
1682376.630.511810.486390.965060.607980.636480.630380.517780.700731.113971.111040.0041150.0041150.004115
1692394.280.517930.487670.967530.730950.600880.664720.554040.69871.055971.109130.0040640.0040640.004064
1702412.010.514430.495440.964990.678910.586980.649680.538740.705191.108011.101430.0040120.0040120.004012
1712429.670.505640.483360.970030.638290.640940.637840.539810.688251.121511.104310.0039610.0039610.003961
1722447.620.502250.473420.958320.655780.612730.636280.531040.695881.106421.105960.003910.003910.00391
1732465.460.514060.488250.969880.664090.604120.629290.519160.704641.099811.108610.0038590.0038590.003859
1742483.110.514430.486120.964890.682940.586480.643730.532850.702811.108271.096320.0038080.0038080.003808
1752500.860.499050.478070.954990.607910.657670.654560.548590.690681.059131.083390.0037570.0037570.003757
1762518.680.518270.495070.976710.618390.691810.657470.546650.706751.058341.098610.0037070.0037070.003707
1772536.650.500550.474350.968140.598140.69060.67250.556050.701151.065881.099480.0036560.0036560.003656
1782554.490.511130.500810.969650.685310.633970.673650.560760.688661.0531.090760.0036060.0036060.003606
1792572.340.498910.485440.959230.696070.624670.666810.557250.69131.047921.098530.0035550.0035550.003555
1802590.150.495390.480030.956940.695990.629210.662850.550540.711571.069031.110030.0035050.0035050.003505
1812607.950.500370.46820.956530.645310.605870.607930.505890.710571.100121.117890.0034560.0034560.003456
1822625.890.507640.499990.965420.602280.655820.630350.521290.718581.105531.124540.0034060.0034060.003406
1832643.790.489560.45790.947890.64080.600630.638930.52580.705931.111851.107210.0033560.0033560.003356
1842661.370.482830.448370.947120.645560.643120.634640.529980.709311.111011.120330.0033070.0033070.003307
1852679.190.484070.446250.964450.682240.615870.636620.523960.709371.097881.107270.0032580.0032580.003258
1862697.030.485390.459040.963360.707750.621560.638120.529910.715771.142851.109380.0032090.0032090.003209
1872715.180.481480.45120.949090.708390.623990.658050.548530.708171.13311.113090.003160.003160.00316
1882732.760.50250.477310.965980.650730.637440.649260.535790.718591.132671.118760.0031110.0031110.003111
1892750.570.479850.457570.952940.636220.614560.602130.493020.713191.147441.125310.0030630.0030630.003063
1902768.070.498490.464470.957280.630080.647940.611440.503750.697351.13551.113190.0030150.0030150.003015
1912785.760.470130.440360.951860.606520.634620.612580.506860.698541.130571.113070.0029670.0029670.002967
1922803.480.476060.447460.94610.664040.625080.631250.520510.706481.1371.118750.0029190.0029190.002919
1932820.920.476050.436880.948590.649170.604460.623620.511910.714561.177691.12270.0028720.0028720.002872
1942838.390.481570.450840.956430.557240.666950.590620.482760.727511.174591.139110.0028250.0028250.002825
1952855.920.475870.444740.941540.599740.63630.586460.485020.721731.176311.134970.0027780.0027780.002778
1962873.320.470120.420210.943610.600910.61580.607150.506260.71751.147121.140630.0027310.0027310.002731
1972891.070.461750.426220.950270.68330.545970.608070.503970.728061.158881.136620.0026840.0026840.002684
1982908.690.472060.434420.9430.577270.59470.591530.491130.717481.204011.125210.0026380.0026380.002638
1992926.50.459430.4080.943790.655980.601470.609670.506080.721861.122621.127170.0025920.0025920.002592
Source: The authors’ calculations are based on the training results.

References

  1. Porter, J. Macau: The Imaginary City; Routledge: London, UK, 2018. [Google Scholar]
  2. Pons, P. Macao; Reaktion Books: London, UK, 2002. [Google Scholar]
  3. Hao, Z. Macau History and Society; Hong Kong University Press: Hong Kong, China, 2011. [Google Scholar]
  4. Zhang, Y.Y.; Wang, P.H. Investigation and analysis of architectural styles in the historical center of Macau. J. Sci. Des. 2021, 5, 1_47–1_56. [Google Scholar] [CrossRef]
  5. Yang, X.; Zheng, L.; Chen, Y.; Feng, J.; Zheng, J. Recognition of Damage Types of Chinese Gray-Brick Ancient Buildings Based on Machine Learning—Taking the Macau World Heritage Buffer Zone as an Example. Atmosphere 2023, 14, 346. [Google Scholar] [CrossRef]
  6. Wang, L.; Huang, G.; Zhou, W.; Chen, W. Historical change and future scenarios of sea level rise in Macau and adjacent waters. Adv. Atmos. Sci. 2016, 33, 462–475. [Google Scholar] [CrossRef]
  7. The Joint Working Committee for Promoting the Construction of Macau Into a “Base for Exchange and Cooperation with Chinese Culture as the Mainstream and Multiple Cultures Coexisting” Holds Its 2024 Annual Meeting. Available online: https://www.gov.mo/zh-hans/news/754876/ (accessed on 24 April 2025).
  8. Wang, X.; Lam, C.C.; Iu, V.P. Characterization of mechanical behaviour of grey clay brick masonry in China. Constr. Build. Mater. 2020, 262, 119964. [Google Scholar] [CrossRef]
  9. Zhao, P.; Zhang, X.; Qin, L.; Zhang, Y.; Zhou, L. Conservation of disappearing traditional manufacturing process for Chinese grey brick: Field survey and laboratory study. Constr. Build. Mater. 2019, 212, 531–540. [Google Scholar] [CrossRef]
  10. Bie, Z. Evolution of structural damage of gray brick masonry under freeze-thaw cycles. J. Shandong Agric. Univ. (Nat. Sci. Ed.) 2020, 51, 668–672. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2020&filename=SCHO202004017&uniplatform=OVERSEA&v=DAIj5z9tiibn9B1_bqbk34S0r7B8tg1JWeqXkVka52H8Ym0h-DzkZYwlrVyAzLSp (accessed on 1 May 2025).
  11. Hao, Y.; He, D.; Wu, R.; He, X. Study on frost damage of gray brick walls of ancient buildings in Longshengzhuang, central Inner Mongolia. Bull. Chin. Ceram. Soc. 2022, 41, 2438–2446+2473. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2022&filename=GSYT202207026&uniplatform=OVERSEA&v=JU6wvNOWoapf8bc5j1jDJfudT3Rml9I6p_ezsvy_VSVeONKPZIoEBy_4Z5GhFbLA (accessed on 1 May 2025). [CrossRef]
  12. Hao, Y.; Gao, J.; Wu, R.; Xuan, J.; He, X. Damage evolution of ancient building gray bricks subjected to freeze-thaw cycles based on DIC. J. Build. Mater. 2024, 27, 764–772. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2024&filename=JZCX202408012&uniplatform=OVERSEA&v=-Qx21h4C_eSB_EKEaxKIw9YP_F2bJpXKpWFP2IbPobu3v90NCAfUE2eCE6dV3HBV (accessed on 1 May 2025).
  13. Wu, A.; Liu, K.; Hao, Y.; Wu, R.; Xuan, J. Research on freeze-thaw damage of gray bricks in ancient buildings based on fractal theory. J. Build. Mater. 2024, 27, 701–710. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2024&filename=JZCX202408005&uniplatform=OVERSEA&v=-Qx21h4C_eQ0FAI1ebydmO46Q0Xka6GU9GRhQC8Ma8ZOTkt8iGzRni1Rpdk2jjLz (accessed on 1 May 2025).
  14. Ma, S.; Li, Z.; Miao, C.; Bao, P.; Kong, L.; Wang, M. Evaluation of anti-salt erosion performance of gray bricks in historical buildings under different damage degrees. J. Henan Univ. (Nat. Sci. Ed.) 2025, 55, 236–245. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2025&filename=HDZR202502010&uniplatform=OVERSEA&v=jFPddmA7qYbSqdfCFrfYyMCzeXY8J0ZGiOirj3D7gzIo8yOJrorSFOJhYUxLMm21 (accessed on 1 May 2025). [CrossRef]
  15. Wu, A.; Guo, Z.; Hao, Y.; Wu, R.; Xuan, J. Study on the corrosion mechanism and remaining life prediction of gray bricks in ancient buildings under saline environment. Eng. Sci. Technol. 2024, 7, 1–12. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CAPJ&dbname=CAPJLAST&filename=SCLH20240702002&uniplatform=OVERSEA&v=hRe408xMqDufouro-SkNduysmTilEPbHDUAVqRyP-tgv3-l0fRDJNVMY8qf76nUh (accessed on 1 May 2025). [CrossRef]
  16. Hao, Y.; Wu, R.; Bao, Y.; A, S.; Wang, L.; Hou, Z.; Feng, W. Deterioration mechanism and remaining life prediction of gray bricks in Longshengzhuang ancient building under complex environment. J. Xi’an Univ. Archit. Technol. (Nat. Sci. Ed.) 2024, 56, 690–700. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2024&filename=XAJZ202405007&uniplatform=OVERSEA&v=vLdJ1R2qZnfK7XPfN32ucoi7-PIKMyXysM-Z9RU9a3S3w0PxCAHlrOwhR9B7LtHM (accessed on 1 May 2025).
  17. Zhang, H.; Zhang, J.; Zhang, L.; Ying, Y.; Wang, N.; Li, D.; Xu, H. Ancient architectural pathology of blue bricks and brick carvings in Northwest China: Example from the White Temple Tower. Case Stud. Constr. Mater. 2024, 20, e03357. [Google Scholar] [CrossRef]
  18. Ma, S.; Chun, Q.; Zhang, C.; Li, D.; Zhai, F. Computer Vision-Based Automatic Damage Identification and Localization of Masonry Architectural Heritage—A Case Study of the Great Wall. Soc. Sci. Res. Netw. 2024. preprint. Available online: https://ssrn.com/abstract=4833323 (accessed on 1 May 2025). [CrossRef]
  19. Zhang, L.; Chen, Y.; Zheng, L.; Yan, B.; Zhang, J.; Xie, A.; Lou, S. Investigating the Surface Damage to Fuzhou’s Ancient Houses (Gu-Cuo) Using a Non-Destructive Testing Method Constructed via Machine Learning. Coatings 2024, 14, 1466. [Google Scholar] [CrossRef]
  20. Li, Q.; Zheng, L.; Chen, Y.; Yan, L.; Li, Y.; Zhao, J. Non-destructive testing research on the surface damage faced by the Shanhaiguan Great Wall based on machine learning. Front. Earth Sci. 2023, 11, 1225585. [Google Scholar] [CrossRef]
  21. Wang, N.; Zhao, X.; Zhao, P.; Zhang, Y.; Zou, Z.; Ou, J. Automatic damage detection of historic masonry buildings based on mobile deep learning. Autom. Constr. 2019, 103, 53–66. [Google Scholar] [CrossRef]
  22. Wang, N.; Zhao, Q.; Li, S.; Zhao, X.; Zhao, P. Damage classification for masonry historic structures using convolutional neural networks based on still images. Comput. Aided Civ. Infrastruct. Eng. 2018, 33, 1073–1089. [Google Scholar] [CrossRef]
  23. Yan, L.; Chen, Y.; Zheng, L.; Zhang, Y. Application of computer vision technology in surface damage detection and analysis of shedthin tiles in China: A case study of the classical gardens of Suzhou. Herit. Sci. 2024, 12, 72. [Google Scholar] [CrossRef]
  24. Zhu, X.; Zhu, Q.; Zhang, Q.; Du, Y. Deep learning-based 3D reconstruction of ancient buildings with surface damage identification and localization. Structures 2025, 73, 108383. [Google Scholar] [CrossRef]
  25. Fu, X.; Angkawisittpan, N. Detecting surface defects of heritage buildings based on deep learning. J. Intell. Syst. 2024, 33, 20230048. [Google Scholar] [CrossRef]
  26. Jiao, J.; Xia, Q.; Shi, F. Nondestructive inspection of a brick–timber structure in a modern architectural heritage building: Lecture hall of the Anyuan Miners’ Club, China. Front. Archit. Res. 2019, 8, 348–358. [Google Scholar] [CrossRef]
  27. Yang, S.; Chen, Y.; Zheng, L.; Chen, J.; Huang, Y.; Huang, Y.; Wang, N.; Hu, Y. Investigating and Identifying the Surface Damage of Traditional Ancient Town Residence Roofs in Western Zhejiang Based on YOLOv8 Technology. Coatings 2025, 15, 205. [Google Scholar] [CrossRef]
  28. Qiu, H.; Zhang, J.; Zhuo, L.; Xiao, Q.; Chen, Z.; Tian, H. Research on intelligent monitoring technology for roof damage of traditional Chinese residential buildings based on improved YOLOv8: Taking ancient villages in southern Fujian as an example. Herit. Sci. 2024, 12, 231. [Google Scholar] [CrossRef]
  29. Fan, J.; Chen, Y.; Zheng, L. Artificial Intelligence for Routine Heritage Monitoring and Sustainable Planning of the Conservation of Historic Districts: A Case Study on Fujian Earthen Houses (Tulou). Buildings 2024, 14, 1915. [Google Scholar] [CrossRef]
  30. Yang, W.; Wang, T.; Meng, H.; Li, W. Study on loose damage monitoring of mortise-tenon joints in traditional wooden structures based on piezoelectric active sensing. Smart Mater. Struct. 2023, 32, 064009. [Google Scholar] [CrossRef]
  31. Zheng, L.; Chen, Y.; Yan, L.; Zhang, Y. Automatic detection and recognition method of Chinese clay tiles based on YOLOv4: A case study in Macau. Int. J. Archit. Herit. 2024, 18, 1551–1570. [Google Scholar] [CrossRef]
  32. Zou, Z.; Zhao, X.; Zhao, P.; Qi, F.; Wang, N. CNN-based statistics and location estimation of missing components in routine inspection of historic buildings. J. Cult. Herit. 2019, 38, 221–230. [Google Scholar] [CrossRef]
  33. Wang, N.; Zhao, X.; Wang, L.; Zou, Z. Novel system for rapid investigation and damage detection in cultural heritage conservation based on deep learning. J. Infrastruct. Syst. 2019, 25, 04019020. [Google Scholar] [CrossRef]
  34. Wang, R.; Lin, H.; Huang, W.; Liu, X. Damage detection method in ancient building grey bricks fused with attention mechanisms. J. Saf. Environ. 2024, 24, 4244–4252. Available online: https://chn.oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2024&filename=AQHJ202411013&uniplatform=OVERSEA&v=_xS5uDqWQr-sMqcCbAc_q0TIoNVIKO_DMB9TO5nngCP8yuSNO1YI55x5jPpqrHRe (accessed on 1 May 2025).
  35. Kurniawan, A.D.S.; Purnama, Y.I.; Wicaksono, A.B.; Mahmudah, H. Comparative Analysis and Optimization of Deep Learning Models for Object Detection Using Grid Search Hyperparameter Tuning. In Proceedings of the 2024 International Electronics Symposium (IES), Denpasar, Indonesia, 6–8 August 2024; IEEE: New York, NY, USA, 2024; pp. 587–592. [Google Scholar] [CrossRef]
  36. Tian, Y.; Ye, Q.; Doermann, D. Yolov12: Attention-centric real-time object detectors. arXiv 2025, arXiv:2502.12524. [Google Scholar]
  37. Nimma, D.; Al-Omari, O.; Pradhan, R.; Ulmas, Z.; Krishna, R.V.; El-Ebiary, T.Y.A.B.; Rao, V.S. Object detection in real-time video surveillance using attention-based transformer-YOLOv8 model. Alex. Eng. J. 2025, 118, 482–495. [Google Scholar] [CrossRef]
  38. Lang, K.; Cui, J.; Yang, M.; Wang, H.; Wang, Z.; Shen, H. A Convolution with Transformer Attention Module Integrating Local and Global Features for Object Detection in Remote Sensing Based on YOLOv8n. Remote Sens. 2024, 16, 906. [Google Scholar] [CrossRef]
  39. Li, M.; Chen, Y.; Zhang, T.; Huang, W. TA-YOLO: A lightweight small object detection model based on multi-dimensional trans-attention module for remote sensing images. Complex Intell. Syst. 2024, 10, 5459–5473. [Google Scholar] [CrossRef]
  40. Li, J.; Zhang, J.; Shao, Y.; Liu, F. SRE-YOLOv8: An Improved UAV Object Detection Model Utilizing Swin Transformer and RE-FPN. Sensors 2024, 24, 3918. [Google Scholar] [CrossRef]
  41. Zhong, F. Creative transformation and innovative development of Lingnan traditional architectural culture-taking the architecture reconstruction design of liwan district in Guangzhou as an example. J. Phys. Conf. Ser. 2020, 1649, 012014. [Google Scholar] [CrossRef]
  42. Song, Y.; Liao, C. Structural Materials, Ventilation Design and Architectural Art of Traditional Buildings in Guangdong, China. Buildings 2022, 12, 900. [Google Scholar] [CrossRef]
  43. Zhong, F. Inheritance and innovative application of Lingnan traditional architectural culture in architectural design. J. Phys. Conf. Ser. 2020, 1649, 012015. [Google Scholar] [CrossRef]
  44. Chen, S. Exploration of Decorative Components of Ancient Houses in Zhanjiang. Art Perform. Lett. 2023, 4, 65–76. [Google Scholar] [CrossRef]
  45. Gao, Y.; Cheng, J. Thermal Environment Analysis of Laneway of Traditional Village in Lingnan. In Proceedings of the 2010 International Conference on E-Product E-Service and E-Entertainment, Henan, China, 7–9 November 2010; IEEE: New York, NY, USA, 2010; pp. 1–4. [Google Scholar] [CrossRef]
  46. Shuyuan, Z.; Junling, Z.; Pohsun, W. Research on the Decorative Patterns of Modern Residential Buildings in Macao from the Perspective of Social Change. Front. Art Res. 2023, 5, 95–100. [Google Scholar] [CrossRef]
  47. Tang, X.X. Three Adaptabilities of the Traditional Vernacular Architecture of the Han Nationality in Lingnan. Appl. Mech. Mater. 2014, 644, 5109–5112. [Google Scholar] [CrossRef]
  48. Tung, K.W. Chikan’s arcade buildings: The hybrid and civil architecture of Lingnan. Archit. Cult. 2018, 6, 329–351. [Google Scholar] [CrossRef]
  49. Zeng, Z.; Li, L.; Pang, Y. Analysis on climate adaptability of traditional villages in Lingnan, China—World Cultural Heritage Site of Majianglong Villages as example. Procedia Eng. 2017, 205, 2011–2018. [Google Scholar] [CrossRef]
Figure 1. Steps in the research process. The Chinese in the picture is the Chinese version interface of the annotation software. (Image source: drawn by the authors; the people in the photo are the authors themselves).
Figure 1. Steps in the research process. The Chinese in the picture is the Chinese version interface of the annotation software. (Image source: drawn by the authors; the people in the photo are the authors themselves).
Applsci 15 06665 g001
Figure 2. YOLOv8 model structure. C2f: CSP-based large residual structure for feature extraction and channel fusion; cv2, cv3: multi-scale detection heads, used for bounding box position regression and classification prediction, respectively; Conv: standard convolutional layer with batch normalization and SiLU activation for feature extraction and downsampling. (Image source: drawn by the authors).
Figure 2. YOLOv8 model structure. C2f: CSP-based large residual structure for feature extraction and channel fusion; cv2, cv3: multi-scale detection heads, used for bounding box position regression and classification prediction, respectively; Conv: standard convolutional layer with batch normalization and SiLU activation for feature extraction and downsampling. (Image source: drawn by the authors).
Applsci 15 06665 g002
Figure 3. Numerical statistics of the model training process. (Image source: drawn by the authors).
Figure 3. Numerical statistics of the model training process. (Image source: drawn by the authors).
Applsci 15 06665 g003
Figure 4. The mAP and LAMR statistical results: Model 1 (64th epoch model), Model 2 (90th epoch model), and Model 3 (297th epoch model). (1) mAP = 63.62%; (2) log-average miss rate. (Image source: drawn by the authors).
Figure 4. The mAP and LAMR statistical results: Model 1 (64th epoch model), Model 2 (90th epoch model), and Model 3 (297th epoch model). (1) mAP = 63.62%; (2) log-average miss rate. (Image source: drawn by the authors).
Applsci 15 06665 g004
Figure 5. Model performance statistics at different training epochs. (Asterisk * in the figure indicates the median.) In the figure, F1 * indicates score threshold = 0.5; recall * indicates score threshold = 0.5; precision * indicates score threshold = 0.5. (Image source: drawn by the authors).
Figure 5. Model performance statistics at different training epochs. (Asterisk * in the figure indicates the median.) In the figure, F1 * indicates score threshold = 0.5; recall * indicates score threshold = 0.5; precision * indicates score threshold = 0.5. (Image source: drawn by the authors).
Applsci 15 06665 g005
Figure 6. Confusion matrix of Model 1 (64th epoch model). (Image source: drawn by the authors).
Figure 6. Confusion matrix of Model 1 (64th epoch model). (Image source: drawn by the authors).
Applsci 15 06665 g006
Figure 7. Confusion matrix of Model 2 (90th epoch model). (Image source: drawn by the authors).
Figure 7. Confusion matrix of Model 2 (90th epoch model). (Image source: drawn by the authors).
Applsci 15 06665 g007
Figure 8. Confusion matrix of Model 3 (297th epoch model). (Image source: drawn by the authors).
Figure 8. Confusion matrix of Model 3 (297th epoch model). (Image source: drawn by the authors).
Applsci 15 06665 g008
Figure 9. Model heatmap test based on the training dataset. (Image source: drawn by the authors).
Figure 9. Model heatmap test based on the training dataset. (Image source: drawn by the authors).
Applsci 15 06665 g009
Figure 10. Model heatmap testing: based on a new dataset. (Image source: drawn by the authors).
Figure 10. Model heatmap testing: based on a new dataset. (Image source: drawn by the authors).
Applsci 15 06665 g010
Figure 11. Model damage quantification ability test based on the training set data. (Image source: drawn by the authors).
Figure 11. Model damage quantification ability test based on the training set data. (Image source: drawn by the authors).
Applsci 15 06665 g011
Figure 12. Model damage quantification ability test based on a new dataset. (Image source: drawn by the authors).
Figure 12. Model damage quantification ability test based on a new dataset. (Image source: drawn by the authors).
Applsci 15 06665 g012
Figure 13. Comparison of mAP values during YOLOv8 and YOLOv12 model training. (Image source: drawn by the authors).
Figure 13. Comparison of mAP values during YOLOv8 and YOLOv12 model training. (Image source: drawn by the authors).
Applsci 15 06665 g013
Figure 14. Comprehensive analysis of model detection capabilities. (Image source: drawn by the authors).
Figure 14. Comprehensive analysis of model detection capabilities. (Image source: drawn by the authors).
Applsci 15 06665 g014
Figure 15. Design and application of gray brick detection and identification device. (1) The structure of the device after opening; (2) The top view of the device; (3) The back design of the device; (4) The pull-rod design after the device is stored; (5) The physical prototype of the device will be exhibited at the 2024 Science and Technology Week and Innovation and Technology Achievement Exhibition in Macau. The Chinese in the picture is the exhibition board description of the 2024 Science and Technology Week and Innovation and Technology Achievement Exhibition. (Image source: drawn by the authors).
Figure 15. Design and application of gray brick detection and identification device. (1) The structure of the device after opening; (2) The top view of the device; (3) The back design of the device; (4) The pull-rod design after the device is stored; (5) The physical prototype of the device will be exhibited at the 2024 Science and Technology Week and Innovation and Technology Achievement Exhibition in Macau. The Chinese in the picture is the exhibition board description of the 2024 Science and Technology Week and Innovation and Technology Achievement Exhibition. (Image source: drawn by the authors).
Applsci 15 06665 g015
Table 1. Technology and progress in research on surface damage of traditional building materials in China.
Table 1. Technology and progress in research on surface damage of traditional building materials in China.
Traditional Building MaterialsYearCase and LocationAnalytical TechniquesSurface Damage Types or Characteristics
Chinese Gray-Brick2024White Temple Tower in Lanzhou CityExperiment on visual degradation characteristics during agingBrick carvings and bricks in four different solutions were analyzed for compressive strength, surface hardness, mass, elastic wave velocity, and color differences [17].
2024Badaling section of the Great WallImproved-YOLOv5n object detection networkFour types are identified: bricks missing, weathering, plant growth, and cracks [18].
2024Fuzhou’s Ancient Houses (Gu-Cuo)YOLOv8 in computer visionIdentify two types of damage: efflorescence and plant growth [19].
2023Macau World Heritage Buffer ZoneYOLOv4 in computer visionIdentifies five types of damage: missing, cracking, plant or microbial erosion, yellowing, and pollution on the exterior walls of ancient gray brick buildings [5].
2023Plain Great Wall of ShanhaiguanIt automatically detects four types of damage (chalking, plants, ubiquinol, and cracking) on the surface [20].
2019Palace Museum Wall in Beijing CityFaster R-CNN based on ResNet101Detects two types of damage (efflorescence and spalling) [21].
2018Forbidden City Wall in Beijing CityA sliding window-based CNN methodIdentifies and locates four categories of damage (intact, crack, efflorescence, and spall) with an accuracy of 94.3% [22].
Shed-thin tile2024The Classical Gardens of SuzhouYOLOv4 in computer visionIdentifies four types of damage: water staining, surface scaling, color aberration, and excessive gaps [23].
Brick and stone surface2025White Pagoda in LanzhouThe improved YOLOv8Identifies four types of damage: alkalinity, erode, spalling, and cracking [24].
2024Gulang Island in Xiamen CityBased on Swin Transformer and YOLOv5Identification of six types: plant penetration, moss, cracking, alkalization, staining, and deterioration [25].
2019Anyuan Railway and Miners’ Club in Anyuan Town, Pingxiang CityVisual inspection and NDT methodsThe physical and mechanical condition of the structural components is evaluated [26].
Gray roofing tile (clay terracotta tiles) from the Jiangnan region2025Longmen Ancient Town in Hangzhou CityYOLOv8 in computer visionIdentifies four types of tiles: green vegetation, dry vegetation, missing tiles, and repaired tiles [27].
Sintered red clay tiles on sloping roofs2024Ancient villages in Quanzhou, Xiamen, and ZhangzhouYOLOv8-seg modelFour large-scale roof damage types, namely collapse, deficiency, plant, and addition, are identified [28].
Wooden structure2024Fujian Earthen Houses (Tulou)YOLOv8 in computer visionIdentifies three types of damage: holes, stains, and cracks [29].
2023Dry column-type Miaoju buildingAn intelligent monitoring system using surface-bonded piezoelectric transducers (including actuators and sensors) with the structureIdentifies damage in different mortise–tenon joints [30]
Chinese Clay Tiles2023Mandarin’s House in MacauYOLOv4 in computer visionIdentifies three types: cracks, stains, and surface wear [31].
Glazed tiles on the roof2019Forbidden City in Beijing CityFaster R-CNNIdentifies the damage to the two components, Goutou and Dishui, and counts the number [32].
Source: The authors calculated the information based on the literature.
Table 2. Visual inspection machine for surface damage identification of traditional building materials.
Table 2. Visual inspection machine for surface damage identification of traditional building materials.
Traditional Building MaterialsYearCase and LocationAnalytical TechniquesEquipment Development Results
Chinese Gray-Brick2019Palace Museum Wall in Beijing CityFaster R-CNN based on ResNet101Two new mobile object detection devices based on IP network cameras and smartphones [21].
2019Great WallMobile Crowd Sensing (MCS) TechnologyThe GreatWatcher system was developed based on MCS technology and deep learning algorithms. The system components include a mobile client (data collection), a web platform (data storage database), and a computing terminal (data analysis and automatic damage detection) [33].
Source: The authors calculated the information based on the literature.
Table 3. Model parameters.
Table 3. Model parameters.
KeysValuesKeysValues
Input shape512, 512Unfreeze batch size2
Init epoch0Freeze trainTrue
Freeze epoch50Init learning rate0.01
Unfreeze epoch300Min learning rate0.0001
Freeze batch size4Optimizer typeSGD (Stochastic Gradient Descent)
momentum0.937Learning rate decay typeCosine annealing
Source: Author’s statistics.
Table 4. Model performance statistics for different epochs.
Table 4. Model performance statistics for different epochs.
EpochClassAverage PrecisionLog-Average Miss RateF1 *Precision *Recall *
64Crack0.670.550.620.660.57
Damage0.710.650.680.70.66
Intact0.410.720.430.60.33
Missing0.720.50.670.570.78
Moss0.760.510.70.590.84
Plant0.490.90.420.450.38
Stain0.370.880.450.430.46
Vandalism0.9500.750.750.75
90Crack0.740.450.580.520.64
Damage0.70.580.690.670.69
Intact0.230.870.340.350.33
Missing0.690.560.650.550.78
Moss0.70.570.680.60.78
Plant0.550.830.620.610.61
Stain0.40.830.510.50.51
Vandalism10111
297Crack0.710.420.690.660.71
Damage0.640.70.670.650.69
Intact0.270.760.330.410.27
Missing0.670.60.730.630.85
Moss0.740.510.740.620.89
Plant0.460.830.550.50.61
Stain0.420.820.520.510.51
Vandalism10111
F1 * indicates score threshold = 0.5; recall * indicates score threshold = 0.5; precision * indicates score threshold = 0.5.
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.

Share and Cite

MDPI and ACS Style

Zheng, L.; Zheng, J.; Chen, Y.; Zheng, Y.; Lao, W.; Chen, S. Gray Brick Wall Surface Damage Detection of Traditional Chinese Buildings in Macau: Damage Quantification and Thermodynamic Analysis Method via YOLOv8 Technology. Appl. Sci. 2025, 15, 6665. https://doi.org/10.3390/app15126665

AMA Style

Zheng L, Zheng J, Chen Y, Zheng Y, Lao W, Chen S. Gray Brick Wall Surface Damage Detection of Traditional Chinese Buildings in Macau: Damage Quantification and Thermodynamic Analysis Method via YOLOv8 Technology. Applied Sciences. 2025; 15(12):6665. https://doi.org/10.3390/app15126665

Chicago/Turabian Style

Zheng, Liang, Jianyi Zheng, Yile Chen, Yuchan Zheng, Wei Lao, and Shuaipeng Chen. 2025. "Gray Brick Wall Surface Damage Detection of Traditional Chinese Buildings in Macau: Damage Quantification and Thermodynamic Analysis Method via YOLOv8 Technology" Applied Sciences 15, no. 12: 6665. https://doi.org/10.3390/app15126665

APA Style

Zheng, L., Zheng, J., Chen, Y., Zheng, Y., Lao, W., & Chen, S. (2025). Gray Brick Wall Surface Damage Detection of Traditional Chinese Buildings in Macau: Damage Quantification and Thermodynamic Analysis Method via YOLOv8 Technology. Applied Sciences, 15(12), 6665. https://doi.org/10.3390/app15126665

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop