UAV Drone Deep Learning Spillway Crack Detection

Spillways are among the most critical safety components of reservoir dams. They discharge floodwater in a controlled manner, protect the dam body and downstream areas, and support reservoir regulation for water resource utilization. Because spillways are continuously exposed to environmental attack, hydraulic loading, material degradation, and cyclic wetting and drying, surface cracks inevitably develop. If such cracks are not identified and treated in time, they can propagate and deepen under temperature variation, high-velocity flow scouring, and repeated operational loading. The final consequence may be loss of structural integrity or even catastrophic dam failure. Therefore, periodic and accurate crack inspection of spillway surfaces is an essential task for hydraulic engineering safety.

Traditional spillway crack inspection relies mainly on manual visual observation. This approach is inefficient, labor-intensive, subjective, and associated with high safety risk. Large elevation differences and steep inclines make access difficult, and many areas are hidden from the inspector’s view. As a result, manual inspection often suffers from incomplete coverage and inconsistent accuracy. In my work, I address these limitations by integrating a UAV drone inspection framework with an improved deep learning detector. The UAV drone provides flexible aerial access, high-resolution imaging, and repeatable coverage. The deep learning model performs pixel-level crack segmentation, and the detected cracks are further measured and geolocated in a three-dimensional real-scene model.

The overall workflow I propose contains four tightly connected stages. First, a UAV drone equipped with an oblique camera array acquires overlapping images to build a high-precision three-dimensional real-scene model of the spillway. Second, close-range photography flight paths are designed on the basis of that model so that the camera remains perpendicular to each inclined surface and millimeter-resolution imagery can be collected. Third, an improved YOLOv8n model performs pixel-level crack segmentation by incorporating a multi-scale attention module, a bidirectional feature pyramid, and a lightweight convolution design. Fourth, the crack masks are skeletonized and measured, and the resulting crack locations are projected onto the three-dimensional model for visual management. This pipeline is intended to replace manual inspection with a reliable, efficient, and quantitative solution for dam safety monitoring.

1. UAV Drone Image Acquisition Strategy

The first challenge in spillway crack inspection is data acquisition. A spillway commonly has a large height difference and multiple inclined surfaces, including the overflow weir, chute slab, side walls, and stilling basin. A fixed flight altitude or a single nadir-looking camera cannot provide uniform resolution over all these surfaces. I therefore combine oblique photogrammetry with close-range photography using a UAV drone. The oblique survey provides the global spatial reference, while the close-range survey provides the fine surface details needed for crack detection.

In the oblique photogrammetry stage, the UAV drone carries a five-lens camera array and flies along a preplanned route with high image overlap. The initial exterior orientation elements of each image are obtained from a global navigation satellite system and an inertial measurement unit. Dense matching of homologous features and bundle block adjustment are then used to solve the precise position and attitude of every image. Dense point clouds are generated through epipolar geometry constraints and matching search, and an irregular triangulated network is built to represent the spillway geometry. Multi-view texture mapping is finally applied to produce a realistic three-dimensional model. This model is not only a visual base but also the geometric reference for subsequent close-range flight planning.

The accuracy of oblique photogrammetry is usually in the centimeter range, which is insufficient to resolve millimeter-scale cracks. Therefore, I design close-range UAV drone flight paths on the basis of the three-dimensional real-scene model. The spillway surface is divided into nine inspection zones according to its geometric form. For each zone, an equivalent inclined plane is fitted and its inclination angle with respect to the horizontal plane is denoted as $$\alpha_i$$. When a UAV drone photographs a given inclined zone, the camera optical axis is kept perpendicular to that plane. The shooting distance $$h$$ is determined from the camera focal length, pixel size, and sensor dimensions so that the ground sampling distance reaches the sub-millimeter or millimeter level. The field of view then determines the actual surface area covered by a single image.

Let the planned surface path coordinate on the spillway be $$\left(X_{ground}, Y_{ground}, Z_{ground}\right)$$ and the corresponding UAV drone flight coordinate be $$\left(X_{air}, Y_{air}, Z_{air}\right)$$. The coordinate transformation between them is expressed as

$$
\begin{aligned}
X_{air} &= X_{ground} – h \sin \alpha_i \\
Y_{air} &= Y_{ground} \\
Z_{air} &= Z_{ground} + h \cos \alpha_i
\end{aligned}
$$

This relationship allows me to convert a surface coverage path into a safe UAV drone flight path while maintaining the desired shooting distance and camera orientation. By further setting the flight speed and the shooting interval, a complete image acquisition plan is obtained for each inclined zone. The resulting images are characterized by high resolution, high overlap, and full coverage of the spillway surface.

For the engineering case, the UAV drone platform was a multi-rotor aircraft with a real-time kinematic positioning module. A five-lens oblique camera was used for the initial three-dimensional modeling, and a dual long-focus camera with a 40-megapixel sensor was used for close-range photography. The spillway was divided into nine zones, and the close-range campaign acquired 36,610 high-quality and well-exposed images. These images formed the data source for crack detection and measurement.

2. Improved Deep Learning Model for Crack Segmentation

Crack detection based on bounding boxes can only provide an approximate location. A rectangular box does not describe the true geometry of a crack, so it cannot support accurate length and width measurement. For this reason, I adopt a pixel-level semantic segmentation approach. The model performs per-pixel classification and outputs a mask whose spatial dimensions match the input image. This fine-grained representation makes it possible to extract a single-pixel-wide skeleton and an accurate contour, which are necessary for geometric measurement.

The YOLO family is attractive because it combines fast inference with high accuracy. I selected YOLOv8n as the baseline because it provides a segmentation head while remaining lightweight. The input stage uses mosaic augmentation, adaptive anchor calculation, and adaptive gray padding. The backbone extracts multi-scale features, the neck fuses them, and the segmentation head outputs both bounding boxes and pixel-level masks.

Spillway cracks have several challenging characteristics. They appear as linear, irregular, branching, and discontinuous patterns. Their widths vary from macroscopic openings to fine cracks that are difficult to see with the naked eye. The spillway surface also contains color differences, stains, water traces, and biological attachment, all of which create background interference. To improve pixel-level crack segmentation under these conditions, I modified the baseline model in three ways.

First, I introduced an efficient multi-scale attention module into the backbone. The module groups features and performs cross-spatial interaction without reducing the channel dimension. I integrated it into the C2f module to form the C2fEMA block. The motivation is that spillway cracks often have low contrast and weak continuity. Conventional attention mechanisms can be distracted by background noise. The multi-scale attention module captures pixel-level pairwise relationships through parallel subnetworks, which increases sensitivity to crack edges and suppresses false responses from concrete color variation, stains, and water traces. Conceptually, the attention weight can be written as

$$
A = \sigma\left( W_a \cdot \left[ \operatorname{GAP}(F), \operatorname{GMP}(F) \right] \right)
$$

where $$F$$ is the input feature map, $$\operatorname{GAP}$$ and $$\operatorname{GMP}$$ denote global average pooling and global max pooling, $$W_a$$ is a learnable transformation, and $$\sigma$$ is the sigmoid function. The enhanced feature is then

$$
F’ = F \otimes A
$$

with $$\otimes$$ denoting element-wise multiplication. This design strengthens crack edge features without significantly increasing the parameter count.

Second, I replaced the original path aggregation network in the neck with a bidirectional feature pyramid network. The weighted fusion mechanism allows the model to learn the importance of features from different levels during training. This is important for spillway cracks because shallow features are better for wide macroscopic cracks, while deep features are better for fine cracks. A simple addition may cause information from one scale to be overwhelmed by another. The weighted fusion can be expressed as

$$
F_{out} = \sigma\left( w_1 F_1 + w_2 F_2 + w_3 F_3 \right)
$$

where $$F_1$$, $$F_2$$, and $$F_3$$ are features from different levels and $$w_1$$, $$w_2$$, and $$w_3$$ are learnable weights. This adaptive balance improves multi-scale crack segmentation, especially for fine cracks.

Third, I introduced a lightweight convolution method into the neck to reduce computation. The high-resolution images produced by the UAV drone contain a large amount of detail, but they also demand considerable computational resources. The lightweight convolution design reduces the cost of standard convolution while preserving channel interaction. The resulting model is both more accurate and more efficient than the baseline. The overall improved architecture can be summarized in Table 1.

Component Baseline YOLOv8n Improved Model Purpose
Backbone C2f C2fEMA Enhance crack edge sensitivity and suppress background noise
Neck fusion PANet Bi-FPN Adaptive multi-scale feature fusion for cracks of different sizes
Neck convolution Standard convolution GSConv Reduce computational complexity while preserving representation
Output Box and mask Box and mask Pixel-level crack segmentation

The loss function combines classification loss, bounding box regression loss, and segmentation mask loss. For the mask branch, I use a binary cross-entropy term with a dice-like overlap term to handle the severe foreground-background imbalance of crack pixels. Let $$M$$ be the predicted mask and $$G$$ be the ground-truth mask. The mask loss can be written as

$$
L_{mask} = – \frac{1}{N} \sum_{i=1}^{N} \left[ g_i \log m_i + (1-g_i)\log(1-m_i) \right] + \lambda \left( 1 – \frac{2 \sum_i m_i g_i}{\sum_i m_i + \sum_i g_i} \right)
$$

where $$m_i$$ and $$g_i$$ are the predicted and true mask values at pixel $$i$$, $$N$$ is the number of pixels, and $$\lambda$$ balances the two terms. This combination encourages both pixel-wise correctness and shape overlap.

3. Crack Measurement and Localization

After the improved model produces pixel-level crack masks, the next step is to convert two-dimensional image information into physical geometric parameters. The crack skeleton and contour are extracted from the mask. The pixel length $$L_p$$ is obtained by counting the number of skeleton pixels. For the pixel width $$W_p$$, I search along the normal direction of each skeleton point. In practice, I use eight directions: $$0^\circ$$, $$45^\circ$$, $$90^\circ$$, $$135^\circ$$, $$180^\circ$$, $$225^\circ$$, $$270^\circ$$, and $$315^\circ$$. For each direction, the distance from the skeleton point to the crack contour is recorded as $$j_i$$, where $$i=1,2,\ldots,8$$. The pixel width at that skeleton point is then

$$
W_p = \min\left(d_1, d_2, d_3, d_4\right)
$$

where

$$
\begin{aligned}
d_1 &= j_1 + j_5 + 1 \\
d_2 &= \sqrt{2}\left(j_1 + j_5 + 1\right) \\
d_3 &= j_3 + j_7 + 1 \\
d_4 &= \sqrt{2}\left(j_4 + j_8 + 1\right)
\end{aligned}
$$

After the pixel width is computed for every skeleton point, the maximum pixel width $$W_p^{max}$$ can be identified. The average pixel width is obtained from the pixel area $$A_p$$ and pixel length $$L_p$$ as

$$
W_p^{avg} = \frac{A_p}{L_p}
$$

These pixel measurements are then converted to image coordinates. The image coordinate system has its origin at the geometric center of the image, with the $$x$$ axis aligned with the pixel coordinate $$u$$ axis and the $$y$$ axis opposite to the pixel coordinate $$v$$ axis. If the physical size of a single pixel is $$d_x$$ mm in width and $$d_y$$ mm in height, the physical width $$W_t$$ and physical length $$L_t$$ in the image plane are

$$
\begin{aligned}
W_t &= d_x W_p \\
L_t &= d_y L_p
\end{aligned}
$$

To obtain the actual dimensions on the spillway surface, I use the vertical distance $$D$$ from the camera perspective center to the spillway surface along the optical axis and the camera focal length $$f$$. The object-space width $$W_z$$ and length $$L_z$$ are

$$
\begin{aligned}
W_z &= \frac{D}{f} W_t \\
L_z &= \frac{D}{f} L_t
\end{aligned}
$$

These equations assume that the optical axis is perpendicular to the spillway surface and that $$D$$ is known accurately. In real close-range photography, the UAV drone attitude and wind can cause centimeter-level fluctuations in $$D$$. Local surface undulations also violate the strict perpendicular condition and introduce projection distortion. For higher accuracy, a digital surface model can be introduced to perform per-pixel projection correction. In my current implementation, the measurement results are still sufficiently consistent for engineering screening and condition assessment.

Localization in the three-dimensional real-scene model is another important capability. During close-range image acquisition, the exterior orientation elements of the camera perspective center $$S$$ are recorded as $$\left(X_S, Y_S, Z_S\right)$$ and $$\left(\varphi, \omega, \kappa\right)$$. The principal point $$o$$ has image-space coordinates $$\left(0,0,-f\right)$$. The unit vector of the optical axis in object space is

$$
\mathbf{e} = \left(a,b,c\right) = \left(\sin\varphi \cos\omega, \sin\omega, -\cos\varphi \cos\omega\right)
$$

If the distance from the perspective center to the spillway along the optical axis is $$D$$, the object-space coordinates of the principal point are

$$
\begin{aligned}
X_O &= X_S + aD \\
Y_O &= Y_S + bD \\
Z_O &= Z_S + cD
\end{aligned}
$$

Using this transformation, each detected crack image can be aligned with the three-dimensional real-scene model. All crack records are mapped onto the nine spillway zones, and a crack sketch is generated to form a one-crack-one-record visual management interface. This supports intuitive browsing, tracking of crack development, and dynamic display over time.

4. Experimental Setup and Evaluation Metrics

I evaluated the method on a large reservoir spillway. The dataset was built from UAV drone images collected over nine spillway zones. To ensure diversity and reliability, I randomly selected 30% of the images from each zone, giving a total of 10,983 images for training and testing. The images were annotated with a labeling tool, and the annotations were converted into the format required by the YOLO framework. Five-fold cross validation was used. The dataset was divided into five mutually exclusive subsets, and the distribution of the nine zones was kept consistent across the subsets. In each fold, one subset served as the test set and the remaining four served as the training set. The average of the five test results was used as the final performance indicator.

The training environment used Windows 11 x64, PyTorch 2.0.1, Python 3.9.17, an NVIDIA GeForce RTX 3090 GPU, and an Intel Core i9-13900KF CPU. The model converged after approximately 250 iterations. Based on repeated experiments, the training schedule was set to 300 epochs, the batch size was 16, and stochastic gradient descent was used as the optimizer.

The evaluation metrics are precision, recall, average precision, and giga floating-point operations per second. Precision measures the proportion of true positives among all predicted positives:

$$
P = \frac{TP}{TP + FP}
$$

where $$TP$$ is the number of correctly predicted positive samples and $$FP$$ is the number of incorrectly predicted positive samples. Recall measures the proportion of true positives that are successfully detected:

$$
R = \frac{TP}{TP + FN}
$$

where $$FN$$ is the number of missed positive samples. The precision-recall curve is integrated to obtain average precision:

$$
AP = \int_{0}^{1} p(r) \, dr
$$

GFLOPs represents the number of billion floating-point operations required for one forward pass. It is used here as a measure of computational complexity and deployment potential.

5. Ablation Study

To verify the contribution of each proposed module, I conducted an ablation study with the baseline YOLOv8n and three incremental variants. The results are summarized in Table 2. Adding the C2fEMA module alone increased AP@0.5 by 2.12% and recall by 1.53%. This confirms that the multi-scale attention mechanism improves the segmentation of weak crack edges and suppresses background noise. Adding the Bi-FPN module alone increased AP@0.5 by 1.37% and recall by 0.05%. The weighted feature fusion allows the network to balance shallow and deep features, which is important because wide macroscopic cracks and fine cracks are represented at different levels. Combining C2fEMA and Bi-FPN increased AP@0.5 by 3.21% and recall by 2.47% over the baseline, showing a clear synergy between the two modules. Finally, adding GSConv produced the best overall result. The final model achieved AP@0.5 of 85.72%, AP@0.5:0.95 of 76.43%, precision of 95.7%, recall of 80.53%, and only 8.2 GFLOPs. Compared with the baseline, AP@0.5 improved by 6.46% and AP@0.5:0.95 improved by 9.08%, while GFLOPs decreased from 8.7 to 8.2.

Variant C2fEMA Bi-FPN GSConv AP@0.5 (%) AP@0.5:0.95 (%) Precision (%) Recall (%) GFLOPs
YOLOv8n baseline — — — 79.26 67.35 91.83 73.46 8.7
Optimization 1 ✓ — — 81.38 68.33 93.75 74.99 9.0
Optimization 2 — ✓ — 80.63 70.14 93.33 73.51 8.8
Optimization 3 ✓ ✓ — 82.47 74.37 93.93 75.93 9.5
Optimization 4 ✓ ✓ ✓ 85.72 76.43 95.7 80.53 8.2

The ablation results show that the three modules do not simply add independent gains. The attention module improves edge sensitivity, the bidirectional feature pyramid improves scale balance, and the lightweight convolution reduces computation. Together they produce a model that is more accurate and more efficient than the baseline. This is particularly valuable for UAV drone deployment, because onboard computation is often limited by size, weight, power, and thermal constraints.

6. Comparison with Other Detection Algorithms

I also compared the improved model with representative object detection algorithms, including a two-stage detector, a lightweight single-stage detector, and other YOLO variants. All experiments used the same environment and dataset. The comparison results are presented in Table 3. On AP@0.5, the improved model achieved 85.72%, outperforming Faster R-CNN by 28.49%, YOLOv5s by 9.18%, and YOLOv7-tiny by 9.01%. It also achieved the best precision and recall, reaching 95.7% and 80.53%, respectively. In terms of efficiency, the improved model required only 8.2 GFLOPs, which is far lower than Faster R-CNN and lower than the lightweight YOLO variants. These results indicate that the proposed improvements achieve a better balance among accuracy, reliability, and computational cost.

Algorithm AP@0.5 (%) AP@0.5:0.95 (%) Precision (%) Recall (%) GFLOPs
Faster R-CNN 57.23 53.71 85.1 70.76 272.4
YOLOv7-tiny 76.71 66.83 90.29 73.76 13.2
YOLOv5s 76.54 66.18 89.29 72.26 15.7
YOLOv8n 79.26 67.35 91.83 73.46 8.7
Improved method 85.72 76.43 95.7 80.53 8.2

The comparison confirms that the improved model is not merely a heavier model with more parameters. Instead, it achieves higher accuracy while reducing computational complexity relative to the baseline. This is important for practical UAV drone inspection, where the detector may need to run on an edge device or in a collaborative edge-cloud architecture. A lighter model with higher accuracy reduces transmission burden, shortens response time, and increases the feasibility of real-time or near-real-time inspection.

7. Detection Results and Engineering Application

After cross validation, I selected the best hyperparameters and retrained the final model on the full dataset. The remaining 70% of the UAV drone images were used for automatic crack detection. The model detected cracks with different orientations, including longitudinal, diagonal, and transverse cracks. The detection statistics are shown in Table 4. The model automatically detected 7,381 cracks, including 2,918 longitudinal cracks, 3,014 diagonal cracks, and 1,449 transverse cracks. The average crack length was 3.21 m, and the average crack width was 0.23 mm. Among them, 913 cracks had a width greater than 0.3 mm.

Inspection Type Total Cracks Longitudinal Diagonal Transverse Average Length (m) Average Width (mm)
Model detection 7,381 2,918 3,014 1,449 3.21 0.23
Manual verification 8,657 3,422 3,416 1,819 3.7 0.2

To assess the quality of the automatic results, I also performed manual verification on the same images. Manual inspection found 8,657 cracks, including 3,422 longitudinal cracks, 3,416 diagonal cracks, and 1,819 transverse cracks. The average length was 3.7 m, and the average width was 0.2 mm. Among them, 922 cracks had a width greater than 0.3 mm. The width statistics from the model and manual inspection were close, with a difference of only 0.03 mm. This supports the accuracy of the crack contour extraction. However, the length statistics showed a larger discrepancy of 0.49 m. The main reason is that the model can miss fine, discontinuous, or low-contrast crack segments. It also tends to split a long crack with weak interruptions into several shorter cracks, which lowers the average length. Future work should introduce crack topology connection algorithms to improve the integrity perception of discontinuous cracks.

After detection, the crack data were mapped onto the three-dimensional real-scene model built from UAV drone oblique photogrammetry. All detected cracks were assigned to the nine spillway zones, and crack sketches were generated. This created a visual management interface with a one-crack-one-record structure. The interface allows an inspector to browse crack distribution, compare crack records over time, and track the development of specific cracks. This is a practical step toward digital asset management and long-term condition monitoring of hydraulic infrastructure.

8. Discussion of Limitations and Future Work

Although the proposed method achieves strong performance, several limitations remain. First, the recall for very fine cracks is still lower than desired. Missed detections occur mainly for cracks narrower than 0.1 mm and for cracks in shadowed or occluded regions. False positives are mainly caused by textures similar to cracks, such as reinforcement rust marks or water flow traces. Improving the training set with more hard negative samples and more diverse illumination conditions would help reduce these errors.

Second, the accuracy of geometric measurement is affected by the distance from the camera perspective center to the spillway surface. Although the close-range flight is designed to keep this distance as constant as possible, wind and UAV drone attitude variation introduce centimeter-level fluctuations. Local surface undulations also violate the perpendicular projection assumption and cause distortion. A digital surface model could be used to correct the projection on a per-pixel basis. In addition, a more robust pose estimation and surface fitting strategy would improve the reliability of width and length measurements.

Third, the model still faces deployment challenges for real-time UAV drone inspection. Although GFLOPs were reduced to 8.2, onboard computing resources are often limited. Future work should explore lighter network designs, pruning, quantization, and edge-cloud collaborative schemes. A possible architecture is to run a lightweight detector on the UAV drone for preliminary screening and transmit candidate regions to a ground station or cloud server for full pixel-level segmentation and measurement. This would balance latency, bandwidth, and accuracy.

Fourth, crack development is a time-dependent process. The current study focuses on a single inspection campaign. Repeated UAV drone surveys at different times would allow change detection, crack growth rate estimation, and prediction of remaining service life. Combining the three-dimensional real-scene model with a digital twin platform would further improve the ability to simulate flood discharge, structural response, and maintenance planning.

9. Conclusion

I proposed an integrated method that combines UAV drone inspection, oblique and close-range photogrammetry, improved deep learning segmentation, and three-dimensional geolocation for spillway crack detection. The main contributions are as follows.

First, I developed a UAV drone image acquisition strategy for large-elevation and multi-inclination spillways. Oblique photogrammetry builds a three-dimensional real-scene model that provides a spatial reference. Close-range photography flight paths are then designed by fitting inclined planes, keeping the camera perpendicular to each plane, and transforming surface path coordinates into UAV drone flight coordinates. This strategy achieves efficient, high-resolution, and full-coverage image collection.

Second, I improved the YOLOv8n model for pixel-level crack segmentation. The C2fEMA module enhances crack edge sensitivity and suppresses background interference. The Bi-FPN module provides adaptive multi-scale feature fusion for cracks of different sizes. The GSConv module reduces computational complexity while maintaining feature representation. Ablation experiments showed that the final model improved AP@0.5 by 6.46% and AP@0.5:0.95 by 9.08% over the baseline, reaching 95.7% precision and 80.53% recall, while reducing GFLOPs from 8.7 to 8.2.

Third, I implemented crack measurement and localization. The skeleton and contour of each crack mask are used to compute pixel length, maximum width, and average width. These values are converted to image coordinates and then to object-space dimensions using pixel size, camera distance, and focal length. The crack images are further geolocated in the three-dimensional real-scene model through exterior orientation and optical axis direction calculations. This forms a one-crack-one-record visual management interface.

Fourth, I applied the method to a large reservoir spillway. The improved model detected 7,381 cracks with an average length of 3.21 m and an average width of 0.23 mm. Manual verification found 8,657 cracks with an average length of 3.7 m and an average width of 0.2 mm. Width measurements were highly consistent, with a difference of only 0.03 mm. Length measurements showed a larger difference because of missed fine or discontinuous segments. Overall, the method provides a reliable and efficient technical approach for spillway crack inspection and supports intelligent dam safety monitoring.

In future work, I will focus on topology-aware crack connection, digital surface model-based projection correction, lightweight model design for onboard UAV drone deployment, and multi-temporal crack tracking. These developments will further improve the completeness, accuracy, and operational value of UAV drone-based spillway inspection.

Scroll to Top