## 3 Case Study
### Generate Data and Train the ANN Model  
#### 3.4.1 Single Damages  
Three layers made up the ANN's architecture in this study: an input layer, a hidden layer, and an output layer. The first seven modes' frequencies were used as input data for various damage situations, and the output data comprised damage locations and levels (Figure 15).  
Figure 14: Frequency differences before and after updating.  
Figure 13: MAC values: (**a**) before the model was updated; (**b**) after updating.  
The updated model's modal analysis created input and output data for the ANN. The elements' stiffness was decreased in order to create scenarios of structural damage. With a 1% interval, the elements' stiffness decreased from 0% to 50%. Damage is only truly dangerous and sensitive enough when it occurs on major structural components. Therefore, only the main truss rods were considered in this case. The following equation determined the quantity of input data needed to train the network:  
\[N=n_{e}\times n_{s} \tag{30}\]  
where \(n_{e}\) = total of elements that were considered, and \(n_{s}\) = the number of damage scenarios occurring for a single element. If 84 main elements of the truss are considered, the input data will consist of 4200 samples.  
The ANN was then configured to the settings for training the network after the data generation. The results of the network training process were significantly influenced by the number of neurons in the hidden layer. If the ANN had too few hidden layers, the ANN was too simple and would struggle to deal with the problems to be solved. In contrast, if ANN had too many hidden layers, the network was too complicated. Computer resources consume a lot, which easily leads to overfitting. The loop was used to choose the ideal number of hidden layers within the range of 1 to 50, i.e., the number of hidden layers that will be selected by the loop. Additionally, the impact of noise was evaluated in all situations with a level of 2% for natural frequencies. The Levenberg-Marquardt backpropagation algorithm was used by the ANN to train the network. For damage identification, a data split in the training procedure of 70%-15%-15% was used. There were a maximum of 1000 epochs. In the case of epochs greater than 1000 but still not reaching the best value, it was necessary to implement network optimisation solutions.  
After training, the following figures demonstrate how the ANN model performed:  
All training cases with regression values more than 0.99 are displayed in Figure 16. The training, evaluation, and test datasets are located along the target line (45-degree line). This demonstrates that the real value and predicted value were almost similar. The regression values (R) in linear regression models always range from 0 to 1. The estimated and desired outcomes were the same if R was near to the upper bound (1). Figure 17 shows the histogram of the calculated and intended output errors. There was very little variance between the target and the output. Figure 18 shows the training performance in the datasets. The best validation performance value of 3.0179 was achieved at epoch 190. The epoch number did not exceed 1000, and such network optimisation was not necessary. The graph also shows that the values in the data sets were quite convergent, and no overfitting phenomenon occurred. From the performance graph of R-values, MSE  
Figure 15: Architecture of the ANN used in this study.  
(Tolerance), and the error histogram, the model had clearly been successfully trained, and can thus be applied to the real bridge.  
Figure 16: Regression values of ANN in single damage case: (**a**) Training; (**b**) Validation; (**c**) Test; (**d**) All data.  
Figure 17: Error histogram of ANN in single damage case.