Abstract
For the detection of structural cracks, engineers need to conduct measurements on-site. However, structural cracks are widely distributed and are not easy to access for measurement. Therefore, photography is commonly used for crack detection. Although the crack is observed in the photos, its location and size need to be clearly defined. Artificial intelligence (AI) and databases are used in graphic processing methods to perform structural crack analysis, in which the Python 3.12 program is used as the main tool. Using the Python program, an AI image analysis program was developed for crack analysis and evaluation. ChatGPT 3.5 was also used for the analysis of crack length and width. Using AI considerably increased credibility in detecting and measuring structural cracks.
1. Introduction
In the structural safety assessment process, the location, length, and width of cracks are measured non-destructively. However, the crack assessment process must be recorded using photography, which often results in differences in assessment results depending on the evaluators. Zhang et al. [] used the image transfer learning method to obtain structural crack analysis results, while Paetsch et al. [] used Hessian-driven Percolation and template matching methods to analyze structural cracks in 3D concrete cracks. Kabir et al. [] used acoustic borehole imagery to determine three-dimensional structural cracks. Ali et al. [] evaluated structural crack images using a convolutional neural network (CNN). Gehri et al. [] analyzed structural cracks in digital photography using vibration reflection wave analysis. However, there is no application of using artificial intelligence (AI) for structural crack analysis. Therefore, an AI image analysis method using ChatGPT and Python was developed in this study to evaluate structural cracks.
2. Python and AI in Detecting Structural Cracks
2.1. Python for Image Analysis
The original building crack image contains a lot of noise and cannot be confirmed by mechanical identification. Therefore, Python software image processing is used to analyze cracks by segmenting them by color. The possible crack areas are marked in different colors to reduce human errors and increase accuracy. The flow chart of the method is shown in Figure 1.
Figure 1.
Structural crack analysis flow chart using Python.
Because the photo is not taken at the front view of the reference plane, image offset occurs, so corrections must be made, as shown in Figure 2. In The horizontal angle of the visual axis is corrected based on the position record during shooting. By using Equations (1)–(3), the length difference in on-site photos caused by the deflection of the viewing angle is corrected.
where are the angle of view and are the horizontal angle of sight axis.
Figure 2.
Diagram of image viewpoint correction.
2.2. Building Crack Length and Width Analysis
The actual size of a crack is estimated by correcting the on-site photos and using computer-aided design (CAD 2022) based on the actual proportion. As shown in Figure 3, the picture length a2 is compared with the CAD correct proportion length a1, and then the photo size is scaled to obtain the diagonal area, and the correct length is analyzed using the CAD measurement function.
Figure 3.
Schematic diagram of photo size scaling using CAD.
2.3. Structure Crack Analysis Using ChatGPT
ChatGPT is used through chatting and graphic input. It provides real-time cloud responses. ChatGPT 3.5 analyzes the size of graphics content in the chat mode. When users provide relative object sizes for comparison after attaching pictures, ChatGPT calculates the sizes precisely.
3. Examples
Wall Crack Analysis
We applied the analysis theory for a wall crack photo is shown in Figure 4 after earthquake. The tiles size is 10 cm ∗ 10 cm so we can define the real crack size by compare tile length in photo.
Figure 4.
Wall crack photo.
The Python image analysis program was applied to estimate the crack area and transfer it to the gray map to define the crack length and width (Figure 5).
Figure 5.
Python crack and gray map of wall crack.
Figure 6 shows the crack location and the crack length and width. Using CAD, the length was calculated as 213.91 cm, while the crack width was 0.5789 cm.
Figure 6.
Wall crack length and width.
ChatGPT was used to analyze the width and length of the photo (Figure 4). The results are shown in Figure 7. The crack length was estimated to be 70 cm, and the crack width was 1 cm.
Figure 7.
Wall crack analysis results using ChatGPT.
4. Conclusions
The crack area was clearly defined through the Python analysis, and misjudgment due to light differences was avoided. The crack analysis results were input into CAD to correct the graphic proportions and analyze the structural crack length and width values. Although ChatGPT enabled preliminary crack assessment, the analysis results showed that the results obtained by ChatGPT were different from the real measurement. Therefore, the analysis results need to be confirmed before structural damage assessment by ChatGPT.
Funding
The author declares no funding was received for this study.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The data supporting the findings of this study are available from the corresponding author upon reasonable request.
Acknowledgments
The author would like to acknowledge the support of Vanung University.
Conflicts of Interest
The author declares no conflicts of interest.
References
- Zhang, K.; Cheng, H.D.; Zhang, B. Unified Approach to Pavement Crack and Sealed Crack Detection Using Preclassification Based on Transfer Learning. J. Comput. Civ. Eng. 2018, 32, 04018001. [Google Scholar] [CrossRef]
- Paetsch, O.; Baum, D.; Ehrig, K.; Meinel, D.; Prohaska, S. Automated 3D crack detection for analyzing damage processes in concrete with computed tomography. In Proceedings of the 4th Conference on Industrial Computed Tomography (iCT), Wels, Austria, 19–21 September 2012. [Google Scholar]
- Kabir, S.; Rivard, P.; He, D.C.; Thivierg, P. Damage assessment for concrete structure using image processing techniques on acoustic borehole imagery. Constr. Build. Mater. 2009, 23, 3166–3174. [Google Scholar] [CrossRef]
- Ali, R.; Chuah, J.H.; Talip, M.S.A.; Mokhtar, N. Structural crack detection using deep convolutional neural networks. Autom. Constr. 2022, 133, 103989. [Google Scholar] [CrossRef]
- Gehri, N.; Jaime Mata-Falcón, J.; Walter Kaufmann, W. Automated crack detection and measurement based on digital image correlation. Constr. Build. Mater. 2020, 256, 119383. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).