## 6 Conclusions  
This study developed an automated system aimed at identifying red wall regions as well as assessing the presence and distribution of moisture. To achieve this, the visible and thermal images of target red walls were captured and preprocessed to ensure uniform image dimensions and enhance key features. Two CNN models were trained in this study, one for detecting red wall boundaries and another for locating moist areas. The major contributions of this study include the following:  
1. A novel image calibration method: To address the misalignment caused by motion interference during image capture, this study proposes a novel image calibration method. After resizing thermal images, a 5 \(\times\) 5 convolution and binarization are applied to both visible and infrared images, followed by iterative overlay analysis to determine the optimal alignment coordinates based on the highest pixel overlap.
2. Automated detection of red wall moisture areas: Due to the current reliance on the manual interpretation of visible and thermal images in heritage restoration, the process remains labor-intensive and time-consuming. To solve this issue, this study proposes an automated red wall moisture detection system that integrates two CNN models. The system requires only 3 s to analyze 100 sets of visible and infrared images, achieving approximately 1200 times greater efficiency compared to manual inspection.
3. A highly accurate system for detecting moisture in red wall structures: Before training the CNN, thermal images are masked to eliminate irrelevant information that could negatively impq1 act model performance. During training, the CNN parameters are also fine-tuned to optimize accuracy. As a result, the proposed method achieves an accuracy of 91.18%, representing a 24.05% improvement over existing approaches.  
Overall, the method developed in this study can be used to detect moisture in the lime-plaster-covered old brick walls of Confucian temples and other cultural heritage buildings. The proposed method reduces the workload of the professionals involved in cultural heritage preservation and restoration as well as efficiently and accurately determines the moisture condition of walls, thus contributing to the control of wall damage at cultural heritage sites.  
Conceptualization, Y.-Y.H.; methodology, Y.-Y.H. and C.-Y.; software, C.-Y.Y.; validation, C.-Y.Y.; formal analysis, Y.-C.C.; investigation, Y.-C.C.; resources, Y.-C.C.; data curation, Y.-C.C.; writing--original draft preparation, Y.-Y.H.; writing--review and editing, Y.-Y.H.; visualization, Y.-Y.H.; supervision, S.-L.C.; project administration, S.-L.C.; funding acquisition, Y.-C.C. All authors have read and agreed to the published version of the manuscript. This work was supported in part by the National Science and Technology Council, Taiwan, under grant numbers of 112-2221-E-033-049-MY3, 113-2622-E-033-001, and 112-2221-E-033-025.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The model and trained models presented in this study are openly available from GitHub at [[https://github.com/m28124023/Red-Wall-Moisture-Detection.git](https://github.com/m28124023/Red-Wall-Moisture-Detection.git)]([https://github.com/m28124023/Red-Wall-Moisture-Detection.git](https://github.com/m28124023/Red-Wall-Moisture-Detection.git)) (accessed on 5 June 2025). However, the dataset used in this study cannot be publicly released due to legal and data privacy restrictions.  
**Acknowledgments:** The authors are grateful to the Bureau of Cultural Heritage of the Ministry of Culture, Taiwan, for supporting the research equipment.  
**Conflicts of Interest:** The authors declare no conflict of interest.