# Automated Ground Truth Generation for Learning-Based Crack Detection on Concrete Surfaces
## 2 Proposed Method
### Pre-Training Binary Segmentation Model for Crack Detection  
Crack detection is typically achieved through binary semantic segmentation, which classifies every pixel into two classes: crack and non-crack. In this study, we first implemented a pixel-level crack detection method based on the U-Net [24], which relies on an encoder-decoder architecture and uses copy-and-crop operations to propagate the details from the encoder layers to their corresponding layers in the decoder. The crack detection model used in this study was a hybrid of U-Net and VGG16 [18], which uses VGG16 as the encoder portion of the U-Net. Additionally, the U-net encoder can be replaced by different backbones, such as the ResNet [21]. The use of different backbones will be discussed later. Figure 6 shows the architecture of the employed model presented in this subsection, and its detailed composition is presented in Table 1. Because of the limitations of the U-Net, its input size must be a multiple of 32. Hence, an input image measuring \(448\times 448\) pixels with three channels was used, and the output image was a binary map with \(448\times 448\) pixels. The symbol \(\oplus\) denotes the concatenation operation. Additionally, the ReLu function was used as an activation function in every convolution layer, and an up-sampling layer was achieved by performing the well-known bilinear interpolation with a scaling factor of 2. Next, we used the dataset presented in [30] as the target and randomly split all of its 20,000 images into training, validation, and test sets, according to the ratio of 6:1:3. Specifically, 12,044 images were used for training, 2123 for validation, and 5833 for testing, as summarized in Table 2. To consider such a crack detection problem, we adopted the binary cross-entropy loss expressed in (5) as the loss function during training. \[\mathcal{Loss}=-\frac{1}{N}\sum_{i=1}^{N}(z_{i}\log(\mathcal{S}(z_{i}))+(1-z_ {i})\log(1-\mathcal{S}(z_{i}))) \tag{5}\]  
where \(N\) is the number of samples, \(z_{i}\) is the class which is either 0 or 1, and \(\mathcal{S}(\cdot)\) is the sigmoid function. The optimization used in our learning is a stochastic gradient descent with a momentum factor of 0.9, and a learning rate \(\eta=10^{-3}\). In addition, the loss function is modified by adding an L2 regularization term with a weight \(\lambda=10^{-4}\) for preventing overfitting. Figure 7 shows the per-epoch trend of the training and validation loss. It is noteworthy that the minimum total loss occurred at epoch 20, and the validation loss converged; the total loss was 0.07131. Therefore, we selected the trained model after this epoch was completed as the interim best model and applied it to detect cracks in images. The inference output of this model was a probabilistic map \(I_{\text{pred}}\) whose pixel value ranged from 0 to 1 and represented the probability of a pixel belonging to the crack class. To facilitate further discussions, we multiplied the pixel value of the probabilistic map by 255 and then obtained a normalized prediction map \(\widetilde{I}_{\text{pred}}\). Figure 8 shows the normalized prediction result of Figure 1a. Five additional representative examples are shown in  
Figure 6: Simple architecture of the employed U-Net-based model. Figure 9, namely, the upper, middle, and bottom rows, which are the original images; their first-round GTs; and the detection results obtained using our pre-trained model.