# Analytical Method for Bridge Damage Using Deep Learning-Based Image Analysis Technology
## 3 Damage Detection Methods
### Crack Detection Algorithms  
In the defect classification algorithm using U-Net (including BIRD U-Net) and ResNet, the input image was passed through all five networks in order, and if no defects were detected in all networks, the image was considered normal. In this study, the damage types were classified as cracks, delamination, efflorescence/leakage, corrosion, and exposed rebar, which are the five important defects of bridges, as previously mentioned, following the advice of current safety inspection experts. Learning other damage types, such as deterioration and plastic deformation, was difficult due to the lack of data, and finding more important defects for demonstration and commercialization was deemed important. The algorithm classifies the damage type when the input image passes through the network, as shown in Figure 4.  
Table 2 summarizes the experimental environment. Python 3.9.12 was used in the experiments, and the model was implemented using Torch 1.1.0, a Python-based deep learning library. The experiments were run on Windows 11 Home with an Intel i9-12900 KS CPU, 64 GB of RAM, and a Geforce GTX 3090 ti graphics card. Additional libraries used were NumPy (ver. 1.14 or later), Pandas, and Matplotlib. For the hyperparameters used in the experiments, the number of training iterations (epoch) was set to 120. To improve the accuracy of classifying the five damage types, we developed an algorithm that passes through five networks that detect each damage type to finally classify the five damage types rather than detect all of the damage types by passing through one network. Furthermore, we added four points to the existing U-Net to implement the BIRD U-Net algorithm, which is specialized for bridges, as shown in Figure 5. The learning rate determines the update rate of a parameter and ranges between 0 and 1. The default \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline OS & Windows 11 Home \\ Python & 3.9.12 \\ PyTorch & 1.1.0+cu113 \\ Learning Epoch & 120 \\ Learning Rate & 0.001(base) \\ Optimizer & Adam \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Experimental environments. Figure 4: Algorithm process. learning rate for the Adam algorithm is 0.001, which is optimal. In addition, the Adam algorithm has the advantage of changing the optimal learning rate according to the update intensity of each parameter. A study by [PERSON] (2023) [27], similar to this paper, applied the Adam optimizer in PyTorch 1.10.0 to train the network. Initially, the learning rate was set to \(1\times 10^{-4}\) and was dynamically tuned in terms of exponential decay, the epoch was set to 120, and batch_size was set to 8. The observation indicated that when the epoch reached a value of 20, the loss then tended to saturate and terminate to prevent overfitting, so that generalization was increased further. When the epoch reached a value of 100, the loss attained a level of 0.04 and tended toward stabilization. Second, the Adam function was used to optimize the U-Net model. Adam is a gradient descent algorithm with an adaptive learning rate. It can efficiently update the weights of the model, and this allows to achieve good performance marked by fast convergence. Third, bilateral filtering was applied to remove noise from the image and improve sharpness, which considers both spatial and color information to soften the image and help detect cracks and anomalies. Finally, we used different colors for each anomaly detected, such as cracks, delamination, efflorescence, and exposed rebar. Different colors were assigned to each class to visualize the anomaly detection results clearly, making interpreting the results easier. When a defect was detected in each network by the algorithms, it was displayed on the input image, and the ratio of the training to test data for the five damage types was 8 to 2, while the ratio of the validation to training data was 8 to 2. Meanwhile, the ratio of the number of datapoints was training data/validation data/test data = 64:16:20.