## 2 Materials and Methods
### YOLOv2 Detector Performance Evaluation Metrics  
The output of the YOLOv2 detector is a prediction of a bounding box \(Bp\), defined by five components [x, y, width, height, confidence]. Matlab defines the (x, y) coordinates as the left upper corner of the detected box, and (width, height) is its size in pixels. The performance of the transverse crack detector was evaluated using the Average Precision (AP) metrics by estimating the area under the precision-recall relationship curve. Similarly, to determine the number of anchors, the \(IoU\) was applied to assess the detector performance. In this case, \(IoU\), also known as the Jaccard index [30], measures the overlapping area between the predicted bounding box \(B_{p}\) and the ground truth bounding box \(B_{gt}\) divided by the area of union between them [31] according to a formula:  
\[J\left(B_{p},B_{gt}\right)=IoU=\frac{\text{area}(B_{p}\ \cap\ B_{gt})}{\text{area}(B_{p}\ \cup\ B_{gt})}. \tag{8}\]  
The detection is classified as correct or incorrect by comparing the \(IoU\) with a given threshold value, \(t\). If \(IoU\geq t\), then the detection is considered correct; otherwise, the detection is considered incorrect. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Mini Batch Size** & **Epoch** & **Learning Rate** & **Optimizer** \\ \hline  & & & SGDM \\
16 & 60 & 0.001 & Adam \\  & & & RMSProp \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The hyperparameter settings overview of the detection model. Precision (_P_) and Recall (_R_) are computed depending on _IoU_ (threshold value _t_) of the ground truth (green boxes) and predicted bounding boxes (red boxes) with the use of these components (Figure 4):  
* True Positive (_TP_): the transverse crack was correctly detected within the ground truth bounding box (_IoU_ \(\geq\)_t_);
* False Positive (_FP_): the transverse crack was positively detected outside the ground truth bounding box, or the detection was misplaced (_IoU_ \(<\)_t_);
* False Negative (_FN_): the transverse crack was not detected within an image. Precision and Recall are then defined as:  
\[P=\frac{TP}{TP+FP}=\frac{TP}{\text{all detections}} \tag{9}\]  
\[R=\frac{TP}{TP+FN}=\frac{TP}{\text{all ground truths}} \tag{10}\]  
Precision represents the ability of a model to only identify relevant objects (the ratio of true positive predictions to all predicted positives). In contrast, Recall measures the ability of a model to find all relevant cases (the ratio of true positive predictions to all given ground truths). From Precision and Recall can be derived _F1_ Score as their harmonic mean, which is used to measure the overall accuracy:  
\[F1=2\bigg{(}\frac{P\ \times\ R}{P+R}\bigg{)} \tag{11}\]  
The precision-recall curve is the trade-off between Precision and Recall at different confidence scores. A higher area under the precision-recall curve indicates a better detection accuracy of the model. The Average Precision at threshold value \(t\) (_AP@.t_) is formally defined as follows:  
\[AP@.t=\int\limits_{r=0}^{1}p(r)dr \tag{12}\]  
and takes on values between 0 and 1, where the values closer to 1 indicate better detector performance. The Average Precision is usually calculated at _IoU_ = 0.5 and _IoU_ = 0.75 [32], and is reported as _AP@.50_ and _AP@.75_, respectively. The character of the ground truth bounding box _Bgt_ of the transverse crack is such that the width is significantly smaller than its height. The bounding box does not directly reflect the edge of the transverse crack, but there is a gap between the edge of the transverse crack and the side of the bounding box. If  
Figure 4: Examples of: (**a**) Correctly detected transverse crack evaluated as _TP_; (**b**) Detection of a nonexisting object evaluated as _FP_; (**c**) Misplaced detection (depending on threshold value) evaluated as _FP_; (**d**) No detection within an image evaluated as _FN_. Green boxes represent the ground truth and red boxes represent the predicted bounding boxes.