## 4 UAV Data Acquisition and Preprocessing
### UAV Imagery Data Preprocessing
#### 4.2.2 Pavement Cracks Datasets with GSD Information  
Due to the large size of the acquired images or frame images, utilizing them directly as inputs for model training would lead to a sluggish training speed and a significant consumption of processing resources. Therefore, to enhance the parallel batch computing speed, deep learning models have specific requirements for training image datasets. The original images need to be trimmed after frame extraction and fusion, resulting in images with consistent specifications. In this experiment, the extracted frame images from videos were used as the initial images, which were further cropped into 640 px \(\times\) 640 px specification images. The cropping process is shown in Figure 6. Assuming the original image size of a frame was a 3840 px \(\times\) 2160 px road image, 18 640 px \(\times\) 640 px specification images could be cropped. To expand the number of samples for crack categories, data enhancement methods such as augmentation, translation, flipping, and rotation were applied. Additionally, the blurred images were removed to ensure they did not affect the training effect of the model training. The UAV crack original datasets were constructed by manually screening, classifying, and confirming the coverage of the four major crack categories and the no-crack images.  
Road crack labeling plays a crucial role in training and testing deep learning models. The accuracy of labeling directly impacts the quality of model learning. In this experiment, we employed various methods, including manual visual labeling and the Labelimg tool, to decipher, mark, and categorize different types of cracks based on the original UAV crack datasets. The goal was to create an improved training set for crack recognition. Based on the prominence of cracks and their associated damage hazards, road cracks were categorized  
Figure 6: Diagram of trimming process for the large frame image (modified from [10]).  
into four types: longitudinal cracks, transverse cracks, diagonal cracks, and mesh cracks. These categories are illustrated in Table 1.  
Generally, the problem of imbalanced sample distribution in datasets can often lead to overfitting of the model [30]. To address this issue, this experiment fully considered the balance of the sample distribution when creating the labeling datasets. Each type of road pavement crack had a more equal number distribution, as shown in Figure 7. A total of 1388 pavement crack images based on a UAV were collected and labeled, with 304 samples identified as being of the longitudinal crack (_LC_) type, 303 samples identified as being of the transverse crack (_TC_) type, 313 samples identified as being of the obliquely oriented crack (_OC_) type, 368 samples identified as being of the alligator crack (AC) type, and 100 samples being identified as of the no-crack type. To ensure the DL-based model's effectiveness, the datasets were divided into training, validation, and test sets in the ratio of 80%, 10%, and 10%, respectively.  
Notably, existing crack datasets often do not provide ground-truth information, particularly regarding the spatial resolution of UAV imagery. This lack of information directly affects the accuracy of crack identification and measurement in future studies. In this study, the UAV data collection process included the recording of the real-time flight height, an important parameter for each image. Thereby, the Ground Sample Distance (GSD) can be calculated using Formula (2), and also documented in each treated image, which is crucial for the subsequent automated evaluation of pavement damage.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Longitudinal Crack** & **Transverse Crack** & **Oblique Crack** & **Alligator Crack** & **No-Cracks** \\
**(LC)** & **(TC)** & **(OC)** & **(AC)** & **(Other)** \\ \hline \hline \end{tabular}
\end{table}
Table 1: Classification and description of road cracks.  
Figure 7: Samples and distribution of the pavement crack datasets.