## 3 Experiment
### Development Environment and Evaluation Metrics
#### 3.1.2 Evaluation Metrics  
A confusion matrix is a standard format for accuracy evaluation in the field of target detection. In this paper, the confusion matrix was used as the most basic index to evaluate the performance of the above-mentioned models in terms of accuracy. The confusion matrix includes the definitions of four types of indicators, namely TN (predicting negative samples as negative samples), FN (predicting positive samples as negative samples), TP (predicting positive samples as positive samples), and FP (predicting negative samples as positive ones). The definitions of the above four types of confusion matrix indicators will also be applied to the following indicators as basic indicators. Precision, Recall, F1-Score, and PR Curve  
Accuracy is the evaluation index of how many real samples are predicted to be real samples in the bridge damage model assessment, that is, the proportion of real positive examples in the prediction results, which is defined as the following Formula (7). Recall (also known as recall) indicates how many samples of bridge damage are correctly predicted in the sample, that is, the proportion correctly predicted by the model in all positive examples, which is used to evaluate our experimental model on the sample. The detection coverage of the bridge damage target in the middle of the bridge is defined as the following Formula (8). In fact, in the actual experiment, the two indicators of Precision and Recall were a pair of contradictory measures. When Precision is high, Recall is low, and vice versa, to comprehensively consider the Precision and Recall performance of the experimental model in bridge damage target detection. We introduced the F1 score to perform weighted harmonic mean on the above two indicators, which is defined as the following Formula (9). At the same time, in order positively show the performance of each model in this experiment in bridge damage detection, we introduced the PR curve evaluation method. The PR curve takes Recall as the abscissa and Precision as the ordinate to draw the curve. If the PR curve of model A can completely wrap up the PR curve of model B, it can be considered that the bridge damage detection performance of model A is better. If it cannot be judged directly, the comparison can be made according to the area under each model curve. \[\text{Precision}(P)=\frac{TP}{TP+FP} \tag{7}\]  
\[\text{Recall}(R)=\frac{TP}{TP+FN} \tag{8}\]  
\[\text{F1 score}(F1)=2\times\frac{P\times R}{P+R} \tag{9}\]  
Mean Average Precision IoU = 0.5 (mAP@.5)  
Accuracy is a common evaluation index in the evaluation of target detection models. It evaluates the proportion of positive samples and negative samples accurately predicted in the bridge damage samples of this model. In the field of target detection, what is different from the traditional classification is the participation of Intersection over Union (IoU). The confidence level restricts the Accuracy index. To better demonstrate the performance of the model in bridge damage detection, we calculated Accuracy under the condition of IoU = 0.5, that is, under the condition of IoU = 0.5, we calculated the average precision (AP) of the detection results of the three types of bridge damage targets, which is defined as the following Formula (10) and then average the mean, which is defined as follows in Equation (11):  
\[AP=\frac{1}{11}\sum_{\gamma\in\{0,0.1,0.2\cdots\lambda\}}p\text{interp}(r) \tag{10}\]  
\[mAP=\frac{\sum\limits_{i=1}^{3}AP_{i}}{3}(IoU=0.5) \tag{11}\]Frames Per Second (FPS)  
The detection speed is a key factor for bridge damage detection, especially in hazardous and harsh environments. Rapid detection allows our embedded mobile devices to quickly conclude damage detection to prevent potential damage from risk (for example, crushed by the wind and waves in the detection of a bridge across the sea, etc.). FPS is a commonly used definition of speed in the image field, which expresses the number of frames transmitted per second.