# Automated Ground Truth Generation for Learning-Based Crack Detection on Concrete Surfaces
## 2 Proposed Method
### Second-Round GT Generation: Refinement Stage  
As shown in Figure 9, the performance of the pre-trained model appeared to be acceptable for conducting crack segmentation, even though the automated labeled data were not comparable to the manually labeled data. The next stage is to obtain more accurate GTs for re-training the model. The entire procedure for achieving this goal is described as follows:  
First, the grayscale image \(I_{\text{g}}\) was enhanced through contrast-limited adaptive histogram equalization (CLAHE) [33], and the enhanced image is denoted as \(\widetilde{I}_{\text{g}}\). CLAHE is  
Figure 8: Crack detection result from Figure 1a, obtained using our proposed model. Figure 7: Trend of training and validation loss. Figure 9: Five additional examples for representing the performance of our pre-trained model. a widely used method for contrast enhancement and has been verified to be effective in several applications [34; 35]. In this method, an image is divided into non-overlapping regions (also known as tiles) of equal size, and the histogram equalization per tile is operated separately. Next, a simple bilinear interpolation was employed to eliminate the inconsistent boundaries between the tiles. In this study, we determined the hyper-parameters for CLAHE, i.e., a clip limit of 0.1 and a tile size of \(8\times 8\) pixels, on the basis of several experimental tests. Second, a fuzzy inference system (FIS) is proposed to determine whether a specified pixel \((x,y)\) is labeled as a crack in the second-round GTs. Let \(p_{1}=\tilde{I}_{g}(x,y)\) and \(p_{2}=\tilde{I}_{\text{pred}}(x,y)\) be two antecedent variables of the proposed FIS, and \(q\) be its consequent variable. Here, \(p_{1}\) represents the intensity of pixel \((x,y)\) in the enhanced grayscale image \(\tilde{I}_{g}\), and \(p_{2}\) is the pixel value of the normalized map \(\tilde{I}_{\text{Pred}}\) at the same position. Both antecedent variables range from 0 to 255, and their fuzzy sets are depicted in Figure 10, in which the trapezoidal and triangular functions are used as the membership functions. For the consequent part, \(q\) is represented by equally spaced triangular membership functions, as plotted in Figure 11. The linguistic terms include _Very Small_ (VS), _Small_ (S), _Medium_ (M), _Large_ (L), and _Very Large_ (VL). The parameters for defining the five membership functions of the two antecedent variables are \(\left\{a_{1}^{k}\ |\ k=1,2,\ldots,5\right\}\) and \(\left\{a_{2}^{k}\ |\ k=1,2,\ldots,5\right\}\). For simplicity, we only attempted to obtain the values of \(a_{1}^{5}\) and \(a_{2}^{5}\), and set \(a_{1}^{1}=a_{2}^{1}=0\); meanwhile, the other parameters were equally spaced between them. Table 3 lists the parameters determined using the trial-and-error analysis method used in this work. Figure 11: Fuzzy sets of consequent variables. Figure 10: Fuzzy sets of antecedent variables. According to the physical characteristics of cracks within an image, the pixels belonging to cracks are often presented in darker colors compared with their neighbors, which belong to the non-crack class. On the basis of the description above and the normalized prediction map \(\bar{\mathbb{I}}_{\text{Pred}}\), we used variables \(p_{1}\) and \(p_{2}\) as two inputs and objectively constructed fuzzy rules using the aforementioned linguistic terms. For example:  
**IF**\(p_{1}\) is _Small_\((\text{S})\)**AND**\(p_{2}\) is _Large_\((\text{L})\), **THEN**\(q\) is _Large_\((\text{L})\). Here, the consequent variable \(q\) indicate the degree to which pixel \((x,y)\) is considered to be the crack class. The entire fuzzy rule base is tabulated in Table 4, in which 25 rules are included. The \(m\)-th fuzzy rule can be formally written in a canonical format as follows:  
**Rule**\(m\): **IF**\(p_{1}\) is \(\hat{A}_{1}^{m}\)**AND**\(p_{2}\) is \(\hat{A}_{2}^{m}\), **THEN**\(q\) is \(\hat{B}^{m}\).