# Automated Ground Truth Generation for Learning-Based Crack Detection on Concrete Surfaces
## 2 Proposed Method
### Second-Round GT Generation: Refinement Stage
Here, \(m=1,2,\ldots,25\), and \(\hat{A}_{1}^{m}\in\{\text{VS},\text{S},\text{M},\text{L},\text{VL}\}\), \(\hat{A}_{1}^{m}\in\{\text{VS},\text{S},\text{M},\text{L},\text{VL}\}\), and \(\hat{B}^{m}\in\{\text{VS},\text{S},\text{M},\text{L},\text{VL}\}\) are selected from the fuzzy sets of \(p_{1}\), \(p_{2}\), and \(q\), respectively. Whereas an input pair \((\vec{p}_{1},\vec{p}_{2})\) is imported into the FIS and fires some of the fuzzy rules, the non-fuzzy output can be obtained using the minimum inference engine and the center-of-gravity defuzzification method [36], as formulated below. \[\vec{q}=\frac{\int_{\text{Q}}qB^{\prime}(q)dq}{\int_{\text{Q}}B^{\prime}(q)dq} \tag{6}\]  
and  
\[B^{\prime}(q)=\max_{m}\{A_{1}^{m}(\vec{p}_{1})\wedge A_{2}^{m}(\vec{p}_{2}) \wedge G^{m}(q)\}, \tag{7}\]  
where \(\wedge\) is the minimum operator, and Q is the universe of discourse. Therefore, the main procedure for generating a refined GT is to employ our proposed FIS to classify each pixel as crack or non-crack, followed by forming a binary map to be used as the GT. This is achieved as follows:  
* Step 1: For a specified pixel \((\vec{x},\vec{y})\), two inputs \(\vec{p}_{1}=\widetilde{I}_{\text{g}}(\vec{x},\vec{y})\) and \(\vec{p}_{2}=\widetilde{I}_{\text{pred}}(\vec{x},\vec{y})\) are imported into the proposed FIS. * Step 2: The non-fuzzy output \(\vec{q}\) is obtained using the fuzzy inference engine. This output is regarded as the degree to which pixel \((\vec{x},\vec{y})\) belongs to the crack or non-crack class. * Step 3: Label the refined (second-round) GT, as expressed by \[I_{2}^{\text{GT}}(\vec{x},\vec{y})= \begin{cases}1,&\text{if }\vec{q}\geq T_{\text{crack}};\\ 0,&\text{otherwise}.\end{cases} \] (8) \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \(p_{2}\) & \(p_{1}\) & **VS** & **S** & **M** & **L** & **VL** \\ \hline VS & M & VS & VS & VS & VS \\ S & M & S & S & VS & VS \\ M & L & M & S & S & VS \\ L & L & L & M & S & VS \\ VL & VL & L & M & M & S \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Fuzzy rule table for determining the degree to which a pixel belongs to the crack class. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{Variable \(p_{1}\)} & \(a_{1}^{1}\) & \(a_{1}^{2}\) & \(a_{1}^{3}\) & \(a_{1}^{4}\) & \(a_{1}^{5}\) \\ \cline{2-6}  & 0 & 40 & 80 & 120 & 160 \\ \hline \multirow{2}{*}{Variable \(p_{2}\)} & \(a_{2}^{1}\) & \(a_{2}^{2}\) & \(a_{2}^{3}\) & \(a_{2}^{4}\) & \(a_{2}^{5}\) \\ \cline{2-6}  & 0 & 50 & 100 & 150 & 200 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Parameters of fuzzy sets of antecedent variables. The steps above are repeated for all pixels in the image, where \(1\leq\widetilde{x}\leq w\) and \(1\leq\widetilde{y}\leq h\). Therefore, a binary map (size of \(w\times h\) pixels) can be obtained, in which the crack and non-crack pixels are denoted by 1 and 0, respectively. This map is regarded as the second-round GT and is further used for re-training the pre-trained crack detection model. To facilitate observation, Figure 12 shows the original image, as well as the first- and second-round GTs in subplots (a), (b), and (c). As shown, the shape of the second-round GT was smoother than that of the first-round GT and resembled labeling by a human. Figure 13 shows another five examples that were randomly selected from the dataset. The upper, middle, and bottom rows represent the original, first-round, and second-round GT labels, respectively.