# Using AI-Based Tools to Quantify the Technical Condition of Bridge Structural Components
## 2 Methods
### The Applied AI Methods
RF creates multiple Decision Trees, each trained on a random subset of data and features. These treesmake individual predictions, and the final result is determined by aggregating their outputs, such as using a majority vote for classification or an average for regression. This ensemble approach mitigates overfitting and enhances the model's generalization by reducing the variability in individual tree predictions. Biological neural networks inspire Artificial Neural Networks (ANNs) and consist of three main components: input layer, hidden layers, and output layer [45]. The input layer processes the incoming data, which are transformed through hidden layers using connections between nodes. The output layer generates the final prediction. Each node in the network performs a weighted summation of its inputs and applies a nonlinear activation function, introducing the nonlinearity required to model complex input-output relationships. During training, the network adjusts the weights of these connections to minimize the difference between predicted and actual outputs, typically using optimization techniques like gradient descent to refine the weights and reduce errors. In conclusion, Artificial Neural Networks (ANNs) are highly effective machine learning models capable of making predictions or performing tasks by fine-tuning the weights of interconnected nodes based on training data. They are extensively utilized across a range of applications and have achieved exceptional results in areas such as predictive modeling, natural language processing, speech recognition, and image recognition. ANNs have played a pivotal role in advancing artificial intelligence and machine learning, demonstrating notable success in numerous fields. The mean square error (MSE) served as the loss function in this study [46]:  
\[\text{MSE}=\frac{1}{n}{\sum_{i=1}^{n}{\left(y_{i}^{\prime}-y_{i}\right)}^{2}}. \tag{1}\]  
where \(y_{i}^{\prime}\) represents the output predicted by the model and \(y_{i}\) denotes the actual target output. The performance of the Artificial Neural Network (ANN) was assessed using the mean absolute error (MAE) as the quality metric:  
\[\text{MAE}=\frac{1}{n}{\sum_{i=1}^{n}{y_{i}^{\prime}-y_{i}}}. \tag{2}\]  
To compare models with each other, the mean absolute percentage error (MAPE) and the coefficient of determination (R\({}^{2}\)) were used. A comparative analysis of the performance of ML models was conducted using MAPE and R\({}^{2}\). The MAPE indicator is determined using [47]. MAPE measures the average percentage error between predicted and actual values and can take values from 0% to 100%. The smaller MAPE indicates higher accuracy. \[\text{MAPE}=\frac{100\%}{n}{\sum_{i=1}^{n}{\left|\frac{y_{i}-y_{i}^{\prime}} {y_{i}}\right|}}. \tag{3}\]  
R\({}^{2}\) is a statistical measure used to evaluate fit, predict future outcomes, or validate hypotheses based on related variables [48]. It ranges from 0 to 1 (but can be negative for poorly fitted models). Values closer to 1 indicate that the model explains a greater proportion of variance in the target variable. \[\text{R}^{2}=1-\frac{\sum(y_{i}-y_{i}^{\prime})^{2}}{\sum(y_{i}-\overline{y_ {i}})^{2}}. \tag{4}\]  
where \(\overline{y_{i}}\) is the mean of the output predicted by the model.