UAV aerial image-based apparent defect detection method for embankments using an integrated framework of improved YOLOv8 and SAHI Authors: Dongyang Yuan, Changwei Qiu, Bowen Wei, Jiawei Li Published: 2026 ABSTRACT To address the challenges of detecting apparent structural defects like cracks in large-scale embankment, an unmanned aerial vehicle (UAV) aerial image-based apparent defect detection method is proposed using UAV aerial photography and computer vision technologies. Firstly, Cycle-Consistent Adversarial Networks (CycleGAN) is employed to generate virtual apparent defect images under different lighting conditions using the limited aerial images via data augmentation, and then an image sample dataset of apparent structural defects is established. Subsequently, Convolutional Block Attention Module (CBAM) is utilized to enhance the feature extraction capability of You Only Look Once version 8 (YOLOv8) network, and Scylla-Intersection over Union (SIoU) is employed as the localization loss function to further improve the training efficiency and detection accuracy. Thereby, an improved YOLOv8 network-based intelligent detection model is established for identifying the apparent defects in embankment. Furthermore, Slice-aided Hyper Inference (SAHI) module is inserted into the improved YOLOv8 network to promote the small target detection capacity from long-distance high-resolution UAV images during inference period, and accordingly, an integrated framework of improved YOLOv8 and SAHI is proposed for apparent defect detection of embankment. Engineering example shows that, compared with YOLOv8 network, the improved YOLOv8 network exhibits higher detection accuracy and lower missed detection rate. Meanwhile, the image sample dataset augmented by virtual images is beneficial for improving the training ability, and the utilization of SAHI significantly promotes the inference performance of the intelligent detection model. A high-precision intelligent apparent defect detection approach is provided for safety management and danger inspection of embankment engineering. Introduction Embankment engineering, a critical component in river basin flood control systems, plays a vital role in flood prevention and ecological security1. Due to the inherent construction quality issues, long-term hydraulic erosion and biological disturbances, embankments commonly have severe hidden defects, such as cracks, cavities, and collapse pits2. Under the extreme flooding conditions, piping, collapse and some other engineering dangers occur frequently due to the hidden defects3. For instance, during the flood season in 2023, over 1,507 reservoirs and 2,607 km of embankments were damaged by flood disasters in China, resulting in enormous economic losses. Apparent defects, such as cracks and collapse pits, are the external manifestations of internal structural damage of embankment. How to timely inspect the apparent defects is critical for embankment safety management and engineering reinforcement. Currently, the detection of embankment apparent defects primarily relies on manual inspection methods4. However, for the extensive embankment systems characterized by the vast coverage and enormous quantity, manual inspection method suffers from time-consuming procedures, high missed-detection rates and operational risks. These shortcomings make it difficult to meet the practical demands of emergency response and intelligent management in embankment maintenance5. In recent years, the cost-effective industrial-grade UAVs with strong payload capacity and extended endurance have been massively produced, which provides vital technical support for non-destructive structural damage detection of large-scale infrastructure projects, such as concrete dams, bridges and pavements6–10. And accordingly, a UAV aerial image-based non-contact intelligent detection method has been proposed for structural defects via computer vision technology11–14. In summary, the intelligent detection model utilized for structural defect detection are established by two types of computer vision technologies, that is, single-stage object detection algorithms, such as YOLO networks15, and two-stage object detection algorithms, such as Region-based Convolutional Networks (R-CNN)16 and Faster R-CNN17. Due to the merits of fast inference speed, strong model adaptability and superior robustness, the YOLO networks have been extensively researched and applied. For instance, Zhang et al.18 established a road damage detection model by adding multi-level attention block between the backbone and feature fusion parts of YOLOv3. Su19 proposed a precise detection model for apparent damage on bridges via the YOLOv3 network structure enhanced by the squeeze and excitation networks attention mechanism module and spatial pyramid pooling module. Li et al.20 proposed a real-time lightweight defect detection model for hydraulic tunnels using YOLOv5s enhanced by adaptively spatial feature fusion module. Xia et al.21 established a bridge crack detection model using the YOLOv8 improved by spatial pyramid pooling fast (SPPF)-UniRepLk module and global channel spatial attention mechanism. Kang et al.22 proposed an automated system for underwater dam damage detection using remotely operated vehicles and improved YOLOv8n model. Huang et al.6 proposed an intelligent detection system for multi-class concrete dam damage based on the UAVs and improved YOLOX model. The above studies provide feasible approaches for the non-destructive intelligent testing of engineering structures. In general, existing research mainly focuses on developing robust detection models with high identification accuracy in small target by introducing attention mechanisms or modifying network architectures to improve the feature extraction ability of YOLO models. The application of machine vision technology has significantly enhanced detection efficiency and accuracy of structural damages. However, the related study on embankment defect detection is still lacking. To improve the intelligence level of embankment defect inspection, this study attempts to propose a UAV aerial image-based apparent defect detection method for embankments using deep learning technologies. Firstly, to construct the embankment defect sample dataset with abundant and diverse images, CycleGAN23 is employed to generate virtual image samples using the limited aerial images of apparent defects. Secondly, an improved YOLOv8 network-based intelligent detection model is established by employing CBAM attention mechanism24 to improve feature extraction capability, and the localization loss function is modified with SIoU to further improve the training efficiency and detection accuracy. For convenience, the improved YOLOv8 is abbreviated as CS-YOLOv8. Furthermore, the SAHI module25 is deployed to enhance the inference performance of the defect detection model. Finally, the performance of the proposed method is tested through a engineering case. The results demonstrate that the proposed method achieves satisfactory accuracy in defect identification for embankment structures. A feasible technical support and methodological reference is provided for intelligent embankment defect inspection. The research framework is shown in Fig. 1, and the reminder of this article is organized as follows. After introduction, the basic principle of CycleGAN is introduced in Sect. 2. Section 3 provides a detailed explanation of the CS-YOLOv8 and SAHI module. Section 4 validates the performance of the proposed detection model with practical embankment engineering. The conclusions are outlined in Sect. 5. Fig. 1Research framework. Research framework. CycleGAN image augmentation-based dataset construction of embankment apparent defect images The prerequisite for conducting computer vision-based embankment apparent defect detection model is to obtain a dataset with massive and diverse apparent defect images26,27. However, the acquisition of defect images is time-consuming and labor-intensive, especially for large-scale and long-span infrastructure like embankment. To obtain the images, the apparent structural defects of a typical embankment in Poyang Lake basin are captured using DJI Mavic 3E UAV equipped with a high-resolution visible-light camera. The aerial photography altitude ranges from 10 m to 15 m, and 1,631 defect images are obtained. Due to the short duration of the aerial photography, the sample size is relatively limited, and the image diversity is quite inadequate, which is presumably insufficient to train the computer vision-based intelligent detection model. To address this issue, CycleGAN is utilized to augment the image sample capacity by generating virtual images via learning the image feature from the limited images. And then, an image dataset of embankment apparent defects can be constructed using both aerial and virtual images, which is expected to provide sufficient data for constructing the defect detection model. Conventional deep learning methods for image generation, such as the Pix2Pix model28, require pairs of datasets with strict one-to-one correspondence relationship. However, in practice, it is difficult to obtain such image dataset. In contrast, CycleGAN, a kind of generative adversarial network, can generate virtual images using two sets of unpaired image data with different styles, effectively avoiding the requirements of paired image data29. Therefore, CycleGAN is employed for image augmentation by transferring the strongly-illuminated images to the weakly-illuminated styles. CycleGAN architecture is composed of two sets of generative adversarial networks (GANs) with cycle-consistency loss function, as shown in Fig. 2, where x and y are images in strong illumination (X) and weak illumination (Y) domains, respectively. G and F are the generators that translate images from X domain to Y domain and from Y domain to X-domain, respectively; Dx and Dy are the discriminators that evaluate whether the generated images belong to X domain and Y domain, respectively. The adversarial loss functions of the GAN(G, DY) and GAN(F, DX) are expressed as Eqs. (1) and (2), respectively. And the cycle-consistency loss function is defined as Eq. (3), while the objective function of CycleGAN is formulated as Eq. (4). Fig. 2CycleGAN overall structure diagram. 1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${L_{GAN}}(G,{D_Y},X,Y)={E_{y\sim {p_{{\mathrm{data}}}}(y)}}[\log {D_Y}(y)]+{E_{x\sim {p_{{\mathrm{data}}}}(x)}}[\log (1 - {D_Y}(G(x))]$$\end{document} 2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${L_{GAN}}(F,{D_X},Y,X)={E_{x\sim {p_{{\mathrm{data}}}}(x)}}[\log {D_X}(x)]+{E_{y\sim {p_{{\mathrm{data}}}}(y)}}[\log (1 - {D_X}(F(y))]$$\end{document} 3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${L_{cyc}}(G,F)={E_{x\sim {p_{{\mathrm{data}}}}(x)}}[||F(G(x)) - x|{|_1}]+{E_{y\sim {p_{{\mathrm{data}}}}(y)}}[||G(F(y)) - y|{|_1}]$$\end{document} 4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${G^ * },{F^ * }=\arg \mathop {\hbox{min} }\limits_{{G,F}} \mathop {\hbox{max} }\limits_{{{D_X},{D_Y}}} L(G,F,{D_X},{D_Y})$$\end{document} CycleGAN overall structure diagram. where5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L(G,F,{D_X},{D_Y})={L_{GAN}}(G,{D_Y},X,Y)+{L_{GAN}}(F,{D_X},Y,X)+\lambda {L_{cyc}}(G,F)$$\end{document} It can be seen from Eq. (4) that the model training of CycleGAN involves two optimization processes. Specifically, the purpose of generator is to generate virtual data that is sufficiently similar to real data via minimizing the loss function, while the purpose of discriminator is to force the training of generator by distinguishing the difference between real and generated data via maximizing the loss function. When discriminators cannot distinguish the difference between real and virtual images, CycleGAN can realize the desired performance for image style transfer. In this study, 3,364 virtual apparent defect images are generated by CycleGAN, and a dataset consisting of 4,995 apparent defect images is constructed. Then, the dataset is randomly divided into training and validation sets with the ratio of 8:2 for training the intelligent detection model. And the training samples are all annotated using Make Sense platform. It should be mentioned that all virtual samples are classified into the training set. Integrated framework of CS-YOLOv8 and SAHI for embankment apparent defect detection CS-YOLOv8 network YOLOv8 is a popular single-stage real-time object detection network with the merits of powerful feature extraction capability, and excellent detection efficiency and accuracy30,31. To ensure the real-time detection of embankment apparent defects, YOLOv8n, a kind of YOLOv8 network with faster convergence speed and less model parameter, is adopted as the basic framework to construct the detection model for embankment apparent defects. For convenience, YOLOv8n is abbreviated as YOLOv8 in the rest of this article. The architecture of YOLOv8 network is shown in Fig. 3. However, the single-stage object detection networks like YOLOv8 generally suffer from weak small-target recognition. In the aerial images of embankment apparent defects, the targets are small and the background is complex, which poses a significant challenge for the accurate identification of defects. To address this issue, CBAM is introduced to enhance the feature extraction capability of small-target defects under complex background, and SIoU is adopted as the localization loss function to further improve the training efficiency and detection accuracy. Accordingly, CS-YOLOv8 network is established for embankment apparent defect detection. Fig. 3Architecture of YOLOv8 network. Architecture of YOLOv8 network. Optimization of backbone network based on CBAM The attention mechanism can enhance the network’s attention to the targets and suppress the interference of complex background via assigning higher weights to regions of interest by dynamically adjusting the network weights32. In this study, CBAM is employed to strengthen the YOLOv8 network’s feature extraction capability. CBAM is a lightweighted hybrid attention mechanism with channel-spatial cross-dimensional interaction, and it consists of a Channel Attention Module (CAM) and a Spatial Attention Module (SAM), as illustrated in Fig. 4(a). Firstly, the input feature map F1 is processed by max and average pooling operations along each channel to compress its spatial dimensions in CAM. Then, the weight values of each channel can be computed by processing the pooling results through fully connected layer and Sigmoid activation function. And the channel-attentive feature map F2 can be obtained through multiplying feature map F1 by the weight values, as shown in Fig. 4(b). Secondly, the channel-attentive feature map F2 is processed by max and average pooling operations along the channel dimensions in SAM, and the pooling features are concatenated along channels and processed through a convolutional layer to generate spatial attention weight values. Finally, the spatial-attentive feature map F3 can be obtained through multiplying feature map F1 by spatial attention weight values, as illustrated in Fig. 4(c). Fig. 4CBAM module structure. CBAM module structure. The inserted positions of CBAM module are vital to the model performance. Generally, attention mechanism is inserted after feature extraction module in the backbone33. Since the different size feature maps are output from the second to fourth C2f modules in the backbone of YOLOv8, CBAM will be considered to be inserted after these three C2f modules, as marked in the dashed boxes in Fig. 3. And the optimal inserted positions will be analyzed using the dataset in Sect. 4.2.1. Optimization of localization loss function Localization loss function exerts an important impact on training efficiency and identification accuracy in target detection algorithms. In YOLOv8, Complete Intersection over Union (CIoU) loss function is employed as the localization loss function. It evaluates the predicting accuracy of the target location from the aspects of overlapping area, center point distance and aspect ratio between the ground truth and the predicted bounding boxes. However, The calculation process of the CIoU loss function is unstable since it adopts a parameter v to approximate estimate the aspect ratio. Meanwhile, CIoU loss function is unable to take the directional mismatch between predicted and ground truth bounding boxes into account, and it will cause that the determination of predicted bounding boxes is difficult and further influence the training efficiency and accuracy. In comparison, SIoU loss function can effectively overcome CIoU’s limitation and improve the training speed and inference accuracy by considering the influences of angle cost Λ, distance cost Δ, shape cost Ωand IoU between predicted and ground truth bounding boxes. The diagrams of IOU, CIoU and SIoU are shown in the Fig. 5. Fig. 5Diagram of IOU, CIoU and SIoU. Diagram of IOU, CIoU and SIoU. SIoU loss function can be computed as6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Los{s_{SIoU}} = 1 - IoU + \frac{{\Delta + \Omega }}{2}$$\end{document} The angle cost Λ can be computed as7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Lambda = 1 - 2{\sin ^2}(\arcsin (x) - \frac{\pi }{4})$$\end{document}8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x=\frac{{{c_{h1}}}}{\sigma }=\sin (\alpha )$$\end{document}9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${c_h}=\hbox{max} (b_{{{c_y}}}^{{gt}},{b_{{c_y}}}) - \hbox{min} (b_{{{c_y}}}^{{gt}},{b_{{c_y}}})$$\end{document}10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma =\sqrt {{{(b_{{{c_x}}}^{{gt}} - {b_{{c_x}}})}^2}+{{(b_{{{c_{_{y}}}}}^{{gt}} - {b_{{c_y}}})}^2}}$$\end{document} where (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${b_{{c_x}}}$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${b_{{c_y}}}$$\end{document}) and (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$b_{{{c_x}}}^{{gt}}$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$b_{{{c_y}}}^{{gt}}$$\end{document}) are the horizontal and vertical coordinates of the predicted box and ground truth bounding box centers, respectively; ch1 is the height between the central points of the predicted box and ground truth bounding box. The distance cost Δ can be computed as11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Delta = \sum\limits_{t = w,h} {(1 - {e^{ - \left( {2 - \Lambda } \right){\rho _t}}})}$$\end{document}12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho _w}={(\frac{{b_{{{c_x}}}^{{gt}} - {b_{{c_x}}}}}{{{c_w}}})^2},{\rho _h}={(\frac{{b_{{{c_y}}}^{{gt}} - {b_{{c_y}}}}}{{{c_h}}})^2}$$\end{document} where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${c_w}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${c_h}$$\end{document} are the width and height of the minimum bounding rectangle that simultaneously contains the predicted and ground truth bounding boxes, respectively. The shape cost Ω can be computed as13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Omega = \sum\limits_{t = w,h} {{{(1 - {e^{ - {\omega _t}}})}^\theta }}$$\end{document}14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\omega _w}=\frac{{\left| {w - {w_{gt}}} \right|}}{{\hbox{max} (w,{w_{gt}})}},{\omega _h}=\frac{{\left| {h - {h_{gt}}} \right|}}{{\hbox{max} (h,{h_{gt}})}}$$\end{document} where θ is a coefficient; w and h are the width and height of the predicted bounding box, respectively; wgt and hgt are the width and height of the ground truth bounding box, respectively. And the IoU can be computed as15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$IoU=\frac{{\left| {B \cap {B^{GT}}} \right|}}{{\left| {B \cup {B^{GT}}} \right|}}$$\end{document} where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left| {B \cap {B^{GT}}} \right|$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left| {B \cup {B^{GT}}} \right|$$\end{document} are the intersection and union areas between the predicted and ground truth bounding boxes, respectively. SAHI-optimized model inference Even though the above improvement strategies can effectively improve the detection ability of YOLOv8 network for small target apparent defects in complex background, in practice, the missed detection issue is still difficult to avoid. The main reason is that long-distance aerial photography leads to a significant increase of small target defects in the large-sized apparent images. To further improve the inference performance, SAHI is deployed to the pre-trained CS-YOLOv8 network in the inference process. The implementation process of SAHI is shown in Fig. 6. Firstly, SAHI utilizes sliding window approach to partition a large-sized image into a series of small-sized sub-images. Secondly, the CS-YOLOv8 network is employed to detect the apparent defects in the large-sized image and small-sized sub-images at the same time. Then, non-maximum suppression is adopted to combine the inference results between the large-sized image and small-sized sub-images. Finally, the inference results of apparent defects can be output in the large-sized aerial images. It is worth noting that when utilizing SAHI to partition a large-sized image into sub-images, the target feature is probably cut incompletely, and it would result in missed detection problem. To address this issue, the overlap rate of sub-images is set as 0.5 to ensure the completeness and uniqueness of the prediction box34. Fig. 6SAHI slice reasoning process diagram. SAHI slice reasoning process diagram. Evaluation indices for object detection model In this study, precision (P), recall (R), F1-score (F1), average precision (AP), mean average precision (mAP) are employed to comprehensively assess the identification performance of the proposed defect detection model, and they can be calculated as16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$P=\frac{{TP}}{{TP+FN}}$$\end{document}17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$R=\frac{{TP}}{{TP+FN}}$$\end{document}18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${F_1}=2 \times \frac{{P \times R}}{{P+R}}$$\end{document}19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$AP=\int_{0}^{1} {P\left( R \right)} dR$$\end{document}20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$mAP=\frac{1}{N}\int_{0}^{1} {P\left( R \right)} dR$$\end{document} where true positive (TP) is the number of correctly identified defect samples; false positive (FP) is the number of non-defect samples erroneously classified as defects; false negative (FN) is the number of missed defect samples; AP is the area enclosed by the coordinate axis and the P-R curve; mAP is commonly calculated as mAP@0.5 and mAP@0.5:0.95, which represent the AP values when IoU is taken as 0.5 and when it ranges from 0.5 to 0.95 (with a step size of 0.05). Results and discussion Effectiveness test of image enhancement The main objective of utilizing CycleGAN is to enhance the diversity and sample size of the dataset by generate some virtual images through style transfer. Some aerial and virtual images are shown in Fig. 7. It can be seen from Fig. 7 that the generated virtual images effectively retain the features of structural defects, and the background significantly different from the aerial images, which is inducive for constructing a high-precision detection model. To test the effectiveness of CycleGAN-based image augmentation on performance improvement of intelligent detection model, the defect image datasets composed of 1,631 aerial images and 4,995 augmented images including the aerial and virtual images are utilized to establish YOLOv8-based detection model, respectively. The training epoch is set as 500, and the performance evaluation indices of the established models are listed in Table 1. Fig. Comparison of aerial and virtual images. Comparison of aerial and virtual images. Table 1Performance evaluation indices of different Sample datasets.Sample datasetP/%R/%F1/%mAP@0.5/%mAP@0.5:0.95/%Aerial images (total: 1,631)47.0551.8849.3546.1120.78Augmented images (total: 4,995)60.6062.0961.3361.8834.97 Table 1Performance evaluation indices of different Sample datasets.Sample datasetP/%R/%F1/%mAP@0.5/%mAP@0.5:0.95/%Aerial images (total: 1,631)47.0551.8849.3546.1120.78Augmented images (total: 4,995)60.6062.0961.3361.8834.97 Performance evaluation indices of different Sample datasets. Table 1 shows that, compared with aerial images-based YOLOv8 model, all evaluation indices of the augmented images-based YOLOv8 model are significantly improved. Specifically, P and R increase by 13.55% and 10.21%, respectively, which indicates that the model’s detection accuracy is obviously enhanced, and the missed detection rate is notably reduced. Meanwhile, F1, mAP@0.5, and mAP@0.5:0.95 increase by 11.98%, 15.77% and 12.19%, respectively, which demonstrates that the model has better comprehensive performance. Therefore, CycleGAN-based image augmentation can effectively boost the performance improvement of intelligent detection models. The main reason is that the diversity and sample size of defect images are enhanced when adding the virtual images generated by CycleGAN, which is inducive for improving the precision and robustness of object detection network. Construction of CS-YOLOv8 network As mentioned in Sect. 3.3.1, CBAM module can be inserted after the three C2f modules in backbone to enhance the feature extraction capability of YOLOv8 network. To determine the optimal inserted positions of CBAM, some experiments are conducted by deploying CBAM module after individual, two or three C2f modules. The performance evaluation indices of the improved YOLOv8 network are presented in Table 2, where the bold values indicate the best evaluation indices. Table 2Performance evaluation indices of YOLOv8 after inserting single CBAM attention module.ModelsP/%R/%F1/%mAP@0.5/%mAP@0.5:0.95/%Model parameter/MBYOLOv860.6062.0961.3361.8834.975.99YOLOv8 + CBAM(2)57.7359.5558.6356.7531.716.06YOLOv8 + CBAM(3)52.9757.2255.0154.4629.826.05YOLOv8 + CBAM(4)60.5563.4561.9661.8936.086.07YOLOv8 + CBAM(2)(4)59.1955.8457.4759.6333.366.08YOLOv8 + CBAM(3)(4)64.1551.1156.8957.5233.276.10YOLOv8 + CBAM(2)(3)(4)54.0959.9756.8857.3732.196.14 Table 2Performance evaluation indices of YOLOv8 after inserting single CBAM attention module.ModelsP/%R/%F1/%mAP@0.5/%mAP@0.5:0.95/%Model parameter/MBYOLOv860.6062.0961.3361.8834.975.99YOLOv8 + CBAM(2)57.7359.5558.6356.7531.716.06YOLOv8 + CBAM(3)52.9757.2255.0154.4629.826.05YOLOv8 + CBAM(4)60.5563.4561.9661.8936.086.07YOLOv8 + CBAM(2)(4)59.1955.8457.4759.6333.366.08YOLOv8 + CBAM(3)(4)64.1551.1156.8957.5233.276.10YOLOv8 + CBAM(2)(3)(4)54.0959.9756.8857.3732.196.14 Performance evaluation indices of YOLOv8 after inserting single CBAM attention module. It can be seen from Table 2 that all evaluation indices of the optimized YOLOv8 networks are degraded when CBAM module is solely inserted after the second or the third C2f module, or when CBAM modules are inserted after both the second and the fourth C2f modules or the three C2f modules. Meanwhile, when CBAM modules are inserted after both the third and the forth C2f modules, only the P value is significantly increased, while other indices, such as R, F1, mAP@0.5 and mAP@0.5:0.95 are all obviously decreased. However, when the CBAM module is solely inserted after the fourth C2f module in the backbone, expect for P is slightly decreased, other indices are all increased, which indicates that the feature extraction capability of YOLOv8 network is improved when CBAM module is solely inserted after the fourth C2f module. In addition, the model size will gradually increase as more attention mechanism modules are inserted. Merely inserting one CBAM module can not only guarantee the lightweight nature of the model, but also effectively improve the defect detection performance of the model. Therefore, CBAM module is ultimately determined to insert after the fourth C2f module in the CS-YOLOv8 network in this study. After determining the optimal insertion position of CBAM module, SIoU is then employed as the localization loss function to further improve the training efficiency and detection accuracy. And accordingly, the CS-YOLOv8 network is finally established. To test the effectiveness of the proposed model, some experiments are conducted to test the model performance of YOLOv8 network using different optimization strategies. The convergence processes during 100 to 500 training epochs are shown in Fig. 8. The corresponding training results are presented in Table 3. And the normalized confusion matrix are given as Fig. 9. Fig. 8Training process of models with different improved modules. Training process of models with different improved modules. Table 3Ablation experiment results of improved modules.ModelsP/%R/%F1/%mAP@0.5/%mAP@0.5:0.95/%FPSModel parameter/MBYOLOv860.6062.0961.3361.8834.971095.99YOLOv8 + SIoU70.7155.2162.0162.4235.581055.99YOLOv8 + CBAM(4)60.5563.4561.9661.8936.081086.07CS-YOLOv864.9859.8162.2963.1536.551036.07 Table 3Ablation experiment results of improved modules.ModelsP/%R/%F1/%mAP@0.5/%mAP@0.5:0.95/%FPSModel parameter/MBYOLOv860.6062.0961.3361.8834.971095.99YOLOv8 + SIoU70.7155.2162.0162.4235.581055.99YOLOv8 + CBAM(4)60.5563.4561.9661.8936.081086.07CS-YOLOv864.9859.8162.2963.1536.551036.07 Ablation experiment results of improved modules. Fig. 9Normalized confusion matrix of CS-YOLOv8. Normalized confusion matrix of CS-YOLOv8. Figure 8 indicates that with increasing iterations, mAPs of all networks are basically stable after 350 epochs. Consequently, the training results can be used for performance evaluation. Meanwhile, Table 5 demonstrates that, when SIoU is then employed as the localization loss function, the performance indices expect for R are all increased. For instance, F1, mAP@0.5, and mAP@0.5:0.95 are increased by 0.68%, 0.54%, and 0.61%, respectively. In comparison, although the model parameter of the proposed CS-YOLOv8 network is increased by 1.33% and FPS is decreased by 5.50%, the detection accuracy of the CS-YOLOv8 model is obviously improved. Specifically, compared with YOLOv8 network, P, F1, mAP@0.5, and mAP@0.5:0.95 are increased by 7%, 1.57%, 2.05%, and 4.52%, respectively. Moreover, Fig. 9 shows that almost 60% of pits and 80% of cracks can be successfully identified, which further indicates that the CS-YOLOv8 model has good detection ability on cracks and pits. Therefore, the proposed CS-YOLOv8 network has the best real-time detection performance since the slight loss in model inference efficiency is negligible. Model checking performance analysis of integrated SAHI Although the above CS-YOLOv8 network-based detection model has good comprehensive performance, to further enhance the detection accuracy of small target defects in large-scale aerial images, SAHI module is additionally deployed to the pre-trained CS-YOLOv8 network in the inference process. To visually demonstrate the superiority of the SAHI-integrated model for detecting apparent defects in embankments, some tests are conducted using aerial images in the validation dataset. The images are processed with a resolution of 3840 × 3200 pixels, with the detection outcomes presented in Fig. 10. In each individual detection result, the detected targets are displayed in the upper-left corner. Pink bounding boxes are designated for pits, while navy blue boxes for cracks. Confidence levels are displayed adjacent to the bounding boxes, with higher values indicate greater detection certainty. Fig. 10Defect detection results. Defect detection results. It can be seen from Fig. 10 that, compared with YOLOv8 network, the CS-YOLOv8 network and the integrated framework of CS-YOLOv8 and SAHI have excellent defect detection performance. For instance, in the aerial image taken with an altitude of 10 m, YOLOv8 network can accurately detect only one short crack and one pit, and CS-YOLOv8 network can detect another long crack. However, the model integrated framework of CS-YOLOv8 and SAHI can effectively identify more small target defects under three different aerial photography heights or angles, which indicates that the missed detection rate for small targets can be substantially reduced, and the detection accuracy can be obviously enhanced after integrating the SAHI module. Therefore, the approach that integrates SAHI with the CS-YOLOv8 network achieves superior defect detection performance for accurately identifying apparent defects in practice. However, in practical engineering, the detection performance will be significantly affected by UAV flight altitude, camera perspective and weather conditions. For instance, an excessive flight altitude will cause the defect targets to be too small to accurately detect. To accurately identify structural defects in embankment or dams, the UAV flight height should be reduced as much as possible on the premise of ensuring safety, so as to capture clear apparent images of the engineering structures. Conclusion and discussion Aiming to address the challenges of detecting apparent structural defects in large-scale embankment engineering, this study proposed a UAV aerial images-based detection method by integrating CS-YOLOv8 and SAHI. And the model performance is tested using aerial images of a typical embankment, the defect detection accuracy is promising, and an efficient and intelligent approach is provided for embankment safety inspection. The conclusions and limitations are drawn as follows. (1) Generating virtual images through image augmentation techniques to expand the image sample size can enhance the detection performance of deep learning-based models. In this study, the sample size of apparent defect images is effectively augmented by CycleGAN. And the detection accuracy of YOLOv8 model trained by synthetic images is significantly improved. (2) The feature extraction capability and detection accuracy of YOLOv8 network can be effectively improved by inserting CBAM module at appropriate positions and replacing the location loss function with SIoU. And the utilization of SAHI module can further improve the detection performance of small target defects in the inference process. Although the proposed method achieves a promising detection performance for apparent defects in embankments, it still exhibits certain missed detection issues. These deficiencies primarily arise from two aspects. On the one hand, the slender geometric feature of cracks in long-distance aerial images makes the accurate detection challenging. On the other hand, the limited sample size and insufficient diversity of the training images further affect the generalization ability and recognition performance. Therefore, future works will be conducted to acquire a vast amount of apparent structural defect images and to train a robust high-precision intelligent detection model.