# Crack Location and Degree Detection Method Based on YOLOX Model
## 3 Dataset Construction
### Establish Image Dataset with Labels  
The dataset used in this paper is collected and produced by the authors. In the laboratory, a 1 \(\times\) 1 \(\times\) 0.05 m C20 concrete slab with reinforcement mesh was made and many different degree cracks were artificially made on the concrete slab. Figure 7a,b shows the complete concrete slab and the damaged concrete slab, respectively. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Brand** & **Model** & **Main Parameters** \\ \hline Vision Datum Mars & MARS4112S-23 UM & \
\begin{tabular}{c} Sensor: 1.1” CMOS \\ Pixel size: 3.45 \(\times\) 3.45 \(\upmu\)m \\ Resolution: 4096 \(\times\) 3000 \\ \end{tabular} \\ \hline Vision Datum Mars & LEM5020 CD-H2 &
\begin{tabular}{c} Focal length: 25 mm \\ M.O.D: 0.15 m \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The main parameters of the industrial camera. Figure 6: The image acquisition system. The concrete crack images are collected by the image acquisition system. The camera is perpendicular to the surface of the structure. The distance between the camera and the concrete slab (the working distance) is 0.35 m and the FOV is 144 mm \(\times\) 197 mm. A total of 150 crack images of resolution 3000 \(\times\) 4096 pixels were acquired. In order to reduce the computational cost of training, 150 images were cropped into small images with a resolution of 500 \(\times\) 500 by automatic segmentation. This research aims at detecting the concrete surface crack of different scales, so 2177 images with defect characteristics were finally selected as the final image dataset. In this dataset, these 2177 images were divided into 3 parts in proportion randomly: 1525 images were selected as the training set, 435 images were selected as the validation set, and 217 images were selected as the test set, and the ratio is 7:2:1. The training set is used to train the network model, the validation set is used to test the model during training, and the test set is used for testing after the network model training is completed. The LabelImg software is used to manually label the dataset images to generate some Pascal VOC format [46] samples. In general, the maximum allowable width of the crack cannot be over 0.3 mm, and the crack width shall not be greater than 0.2 mm in special situations. According to this, the structural surface crack category is marked into 5 types: super wide crack, wide crack, normal crack, thin crack, and spalling. The detailed description of each category is shown in Table 2. Therefore, super wide crack, wide crack and spalling can be the focus of structural health monitoring. The normal crack and thin crack may generate into critical damage, which can also be used as long-term monitoring objects. The crack width is measured by an HC-CK103 crack width gauge (as shown in Figure 8a). The equipment has a self-calibration ability and is easy to operate and reliable. The main parameters are shown in Table 3. Figure 8b presents crack width measurements recorded on a concrete slab. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Crack Type** & **Super Wide Crack** & **Wide Crack** & **Normal Crack** & **Thin Crack** & **Spalling 1** \\ \hline \multirow{2}{*}{
\begin{tabular}{c} Crack \\ characteristics \\ \end{tabular} } & \multirow{2}{*}{Crack width \textgreater{} 0.3 mm} & Crack width & Crack width & \multirow{2}{*}{Crack width \(\leq\)0.1 mm} & \multirow{2}{*}{Block Spalling} \\  & & between 0.2 mm & between 0.1 mm & & \\ \multirow{2}{*}{} & and & 0.3 mm & and 0.2 mm & & \\ \hline \hline \end{tabular}  
* The authors label spalling as peel, that is, the type of peel damage is spalling.  
\end{table} 
Table 2: The structural surface crack category and characteristics. Figure 7: Complete concrete slab and concrete slab with damage. (**a**) The complete concrete slab; (**b**) the damaged concrete slab. The number of labels and box position information marked on 2177 images is 10,388 in total, including 2102 super wide crack, 1993 wide crack, 1856 normal crack, 2321 thin crack, and 2116 spelling.