Dam body surface personnel and leakage detection method based on YOLO v8 improved model

By improving the YOLOv8 model, the problem of personnel and leakage detection on the surface of the dam body has been solved, and efficient and accurate real-time detection results have been achieved, which are suitable for dam safety inspection.

CN120495936APending Publication Date: 2025-08-15DALIAN UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510588856.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

It is difficult for the prior art to achieve efficient, accurate and real-time detection of personnel and leakage on the surface of the dam body. Especially under high altitude shooting of drones, pedestrians and leakage image pixels account for a small proportion and lack obvious characteristics, which increases the difficulty of identification.

Method used

The improved YOLOv8 model is adopted to collect data on the surface of the dam by drones, mark and process data, build and improve the YOLOv8 network structure, add fine-grained convolution and small object detection layers, optimize model hyperparameters, and improve detection accuracy and efficiency.

Benefits of technology

Real-time and efficient detection of personnel and leakage on the surface of the dam body is achieved, the detection accuracy is improved, the robustness of the network is enhanced, the detection cost and danger are reduced, and the dam body surface is adapted to the complex environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495936A_ABST
    Figure CN120495936A_ABST
Patent Text Reader

Abstract

The invention provides a dam body surface personnel and leakage detection method based on a YOLO v8 improved model, and belongs to the technical field of dam safety detection, and the method comprises the following steps: building a dam body surface personnel and leakage data set which comprises personnel and leakage images at different positions; establishing a YOLOv8 network model, and adjusting and configuring corresponding parameters; the method comprises the following steps: establishing a YOLOv8n improved model, introducing an attention mechanism SPD-Conv into the model, adding a P2 small target detection head, optimizing an SPPF module, and replacing an nn.Upsample module with a DySample module; the YOLO v8s improved model is trained and optimized, and the trained and optimized YOLOv8n improved model is used for detecting personnel and leakage on the surface of the dam body. According to the invention, the detection precision of dam body surface personnel and leakage detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of dam safety detection, and in particular relates to a method for detecting personnel and leakage on the dam surface based on an improved YOLO v8 model. Background Art

[0002] As vital water conservancy infrastructure, dams play a vital role in promoting economic and social development. They perform multiple functions, including water supply, power generation, and flood control. However, a dam failure can result in catastrophic loss of life and property downstream. For earth-rock dams, leakage is the primary potential threat, potentially causing landslides or even dam failure. While manual inspections are currently the primary monitoring method, they are inefficient, have variable quality, and have relatively limited coverage. Similarly, pedestrians mistakenly entering the reservoir area is a significant problem. Therefore, developing an intelligent inspection system that can effectively identify pedestrians within the dam and detect leakage in earth-rock dams has important engineering practical value.

[0003] Dam leaks are often hazardous and difficult to detect, easily causing damage. Pedestrians entering the reservoir area could fall into the water, potentially harming the dam's health. Advanced detection methods based on cameras, drones, and computer vision have been developed to detect surface defects in dams above water, improving detection efficiency. However, a comprehensive approach to detecting personnel and leaks on the dam surface is lacking. Zhou Renlian et al. used drone-mounted infrared-visible dual-light imaging to effectively identify piping and leaks. Wang Linlin et al. employed drone image stitching to detect dam surface structural damage. Wu Yulong et al. used a modified YOLOv5s algorithm to improve the ability to identify leak areas in dam infrared images, achieving an effective trade-off between speed and accuracy. Huang Ben et al. proposed a real-time method for detecting apparent cracks in concrete dams. This method, which improves the YOLOX object detection neural network, meets the requirements for efficient, accurate, and real-time detection of concrete dam cracks. Wang et al. combined drone imagery with convolutional neural networks (CNNs) to automatically identify dam leaks using thermal imaging. Mou et al. proposed a YOLO-FR model for infrared dark small target detection based on feature recombination sampling using YOLOv5, improving the model's infrared dark small target detection capabilities. However, for reservoirs, drones often need to avoid obstacles and must fly at a certain altitude. Images of people and leaks on the dam surface have a relatively small pixel count and relatively subtle features, making identification more difficult. Therefore, image detection and recognition of people and leaks on dam surfaces is a challenging problem. Currently, a systematic, efficient, and accurate method for detecting people and leaks on dam surfaces has not yet been developed. Summary of the Invention

[0004] In view of this, the purpose of this invention is to propose a detection method for personnel and leakage on the dam surface based on the improved YOLO v8 model, which is used to detect leakage and pedestrians and ensure efficient, accurate and real-time detection effects.

[0005] The technical solution of the present invention:

[0006] A method for detecting personnel and leakage on the dam surface based on an improved YOLO v8 model includes the following steps:

[0007] S1: Collecting Data

[0008] The team operated a drone 10-20 meters upstream of the dam surface to collect infrared data from various angles, capturing pedestrians and leakage on the dam surface. The drone videos were processed, and images captured using infrared and visible light cameras were used to identify people and leakage on the dam surface. The underwater videos were also processed. This ultimately yielded an image dataset for training an improved YOLOv8, including leakage and pedestrians.

[0009] S2: Data Processing

[0010] The annotation of pedestrian and seepage features meets the following standards: infrared seepage images and pedestrian images taken from high altitudes often have slender features, which account for a relatively small proportion of pixels in the image, so a certain proportion should be selected. When annotating, ensure that all features of the target are included in the annotation box, and the annotation box should fit the edge of the target and contain as few background features as possible.

[0011] The LabelImg software was used to manually annotate the images of people and leakage on the dam surface in the image dataset of the improved YOLOv8 model. The target category and coordinate information, including the center point coordinates, length, width, and category of the annotated box, were represented by rectangular boxes. The box corresponded one-to-one with the images of people and leakage on the dam surface and was saved in an .xml file.

[0012] The dam underwater defect target detection dataset is a VOC format dataset, which contains .xml files with one-to-one correspondence between people and leakage on the dam surface. The .xml files are converted into .txt files; the dam surface personnel and leakage target detection dataset is randomly divided into training set, test set and validation set in a ratio of 7:2:1, which are used for training the improved YOLOv8 model, validation during training and final performance test, respectively, to obtain the final dam surface pedestrian and leakage target detection dataset.

[0013] S3: Network structure improvement

[0014] (1) Model construction

[0015] A YOLOv8 model was constructed, which mainly consists of a backbone network, a neck network, and a detection head. First, images of people and leakage on the dam surface were input into the backbone network. After the features extracted by the backbone network, the extracted features were input into the neck network. Finally, the defect categories were identified and marked in the detection head. Considering the detection efficiency, detection accuracy, and model parameter size, the depth, width, and maximum number of channels (max_channels) of the YOLOv8 model were set to 0.33, 0.5, and 1024, respectively. That is, the YOLOv8s model was set as the basic model for the underwater defect detection method of dams.

[0016] (2) Model improvement

[0017] Aiming at the problem that the images of people and leakage on the dam surface are blurred and the features are not obvious, resulting in poor model detection performance, the YOLOv8 network structure is improved to enhance its ability to detect people and leakage on the dam surface.

[0018] The improvements to the YOLOv8 model are as follows:

[0019] Leaks on the dam surface have irregular shapes, a small pixel ratio in the target image, and blurred features, making detection more difficult. The basic model's detection performance is insufficient to meet the requirements for detecting people and leaks on the dam surface. To improve detection accuracy and efficiency, a fine-grained convolution (SPD-Conv) was added to the network to avoid losing fine-grained information during downsampling and retain important target information. A P2 small target detection layer was added after the basic model's backbone network to improve the recognition of pedestrians and leaks with a small pixel ratio in the image. This also enhanced the model's ability to recognize people and leaks on the dam surface, ultimately resulting in an improved YOLOv8 model.

[0020] S4: Model training

[0021] Based on the dam underwater defect target detection dataset generated in step S2, the improved YOLOv8 model built in step S3 is trained and optimized. The hyperparameters are optimized according to the results on the training and test sets to obtain the model with the best overall detection accuracy, detection efficiency, and model size.

[0022] The main steps of model training are as follows:

[0023] (1) Set the hyperparameters of the training network, including the number of training rounds epochs, batch size batch_size, initial learning rate lr, and the number of rounds of mosaic training close_mosaic. Adjust the hyperparameters to ensure that the improved YOLOv8 model is trained to convergence and does not overfit. The trained model parameter file best.pt is saved in the weights folder.

[0024] (2) Load the best.pt initialization model and perform a detection performance test on the trained YOLOv8 model based on the test set. The detection performance of the model is evaluated using evaluation indicators including precision (P), recall (R), detection accuracy of various defects (AP), average detection accuracy (mAP), and frame rate (FPS). The range of P, R, F1-score, AP, and mAP is [0, 1]. The closer the value is to 1, the better the detection performance of the model. To meet the needs of real-time detection, FPS should be greater than 30. Different hyperparameters are set according to the evaluation indicators, and different models are trained. The model with the best comprehensive index is used for real-time detection of personnel and leakage on the dam surface.

[0025] S5: Deployment and Application

[0026] The trained YOLOv8 detection model weights are deployed on a mobile workstation. The high-definition camera and infrared spectrum camera carried by the drone are used to capture the dam surface scene in real time and transmit it to the ground workstation for immediate inspection. At the same time, the defect detection results are displayed on the workstation and stored locally.

[0027] Compared with the existing technology, the beneficial effects of the present invention are:

[0028] (1) The present invention performs real-time and efficient detection of personnel and leakage on the dam surface based on the improved YOLOv8 deep learning target detection network, which can reduce the cost and danger of daily manual detection and improve the efficiency of personnel and leakage detection on the dam surface of hydraulic structures.

[0029] (2) The present invention improves the YOLOv8 network structure to make it suitable for the detection of people and leakage images on the dam surface, improves the detection accuracy of people and leakage on the dam surface, enhances the robustness of the network, and can effectively reduce interference such as color distortion, motion blur, low contrast, and uneven lighting. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a schematic diagram of the improved YOLOv8 network structure of the present invention;

[0031] Figure 2 A schematic diagram of a method flow chart provided in an embodiment of the present invention;

[0032] Figure 3 This is the input and output result diagram of pedestrians and leakage on the dam surface in the present invention. DETAILED DESCRIPTION

[0033] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.

[0034] In order to deepen the understanding of the present invention by those skilled in the art, the present invention is further described in detail below with reference to the accompanying drawings and examples. In order to improve the performance of YOLOv8 in pedestrian and leakage detection tasks on the dam surface, the present invention improves the original structure, such as Figure 1 shown.

[0035] The YOLOv8 network is a member of the YOLO family of single-stage object detection networks. It consists of three main components: the backbone network, the neck network, and the detection head, totaling 22 layers. Compared to YOLOv5, YOLOv8 replaces the C3 module with the C2f module. The detection head uses a decoupled-head architecture, removing the object branch and separating the classification and detection heads. Furthermore, it is based on an anchor-free network framework.

[0036] The C3 module in the traditional YOLOv5 uses residual connections, while the C2f in YOLOv8 refers to Densenet and adds more skip-layer connections, cancels the convolution operation in the branch, and adds additional Split operations, making the feature information richer while reducing the amount of computation, ensuring a balance between the two.

[0037] The SPPF architecture uses three consecutive max pooling operations with a residual structure. The convolution kernel is uniformly 5×5, and the results before and after each pooling are concatenated. Because the feature map becomes smaller after feature extraction during max pooling, padding is increased before feature extraction to ensure that the feature map size remains constant after each pooling. YOLOv8 applies different detectors at different layers of the network, each responsible for predicting a bounding box at a specific scale. This design allows YOLOv8 to capture information about objects of different scales, improving object detection accuracy.

[0038] like Figure 1As shown in the figure, based on the YOLOv8 model, the present invention adds fine-grained convolution to the network, replaces nn.Upsample with Dy_sample, uses SPPF_improve to replace the SPPF module, and adds a small target detection layer to improve the network's ability to adapt to the geometric changes in the scale and proportion of pedestrians and leakage on the dam surface or the geometric transformation of the model, increase the focus on small target features, and improve the model's ability to recognize pedestrians and leakage on the dam surface.

[0039] A method for detecting personnel and leakage on the dam surface based on the improved YOLO v8 model is described in further detail below with reference to the accompanying drawings and specific implementation cases.

[0040] like Figure 2 FIG. 1 is a flow chart of a method according to an embodiment of the present invention, which specifically includes the following steps:

[0041] (1) Data collection of pedestrian and leakage images on the dam surface

[0042] A drone was flown over the dam to collect data on pedestrians and seepage on the dam surface. Due to obstacle avoidance, the drone needed to maintain a certain altitude, 15-20 meters above the dam surface, to collect diverse data on pedestrians and seepage from different angles. The captured flight videos and images were processed to generate image data, including pedestrians and seepage.

[0043] (2) Data processing of pedestrian and leakage images on the dam surface

[0044] (1) Data annotation

[0045] The annotation of pedestrian and seepage features meets the following standards: infrared seepage images and pedestrian images taken from high altitudes often have slender features, which account for a relatively small proportion of pixels in the image, so a certain proportion should be selected. When annotating, ensure that all features of the target are included in the annotation box, and the annotation box should fit the edge of the target and contain as few background features as possible.

[0046] Based on the above annotation standards, LabelImg software was used to manually annotate pedestrians and leakage on the dam surface of the image dataset used to train the improved YOLOv8. Pedestrians and leakage were labeled as "person" and "leakage" respectively. Rectangular boxes were used to represent the target category and coordinate information, including the center point coordinates, length, width, and category of the labeled box. The box was saved in an .xml file in a one-to-one correspondence with the image.

[0047] (2) Data format conversion

[0048] The above .xml file is not suitable for the reading format of YOLOv8. It needs to be converted into a .txt file through a program for training the YOLOv8 network; the converted dataset is randomly divided into a training set, a test set, and a validation set according to a ratio of 7:2:1, which are used for network training, validation during training, and final performance testing respectively; the dataset includes two folders, images and labels, each of which has three folders, train, test, and val. The target images and the target annotation information correspond one-to-one, and the final dam surface pedestrian and leakage target detection dataset is obtained.

[0049] (3) Build and improve the YOLOv8 network structure

[0050] (1) Model construction

[0051] Build a YOLOv8 object detection model, which mainly consists of a backbone network (Backbone), a neck network (Neck), and a detection head (Head). Considering detection efficiency, detection accuracy, and model parameter size, YOLOv8n is selected as the base model. The model depth, width, and maximum number of channels (max_channels) are 0.33, 0.25, and 1024 respectively.

[0052] (2) Model improvement

[0053] To address the problem that the pixel values of high-altitude drone targets are small and the features are not obvious, resulting in poor model detection performance, the YOLOv8 network structure is improved to enhance its ability to detect pedestrians and leakage on the dam surface. The network improvements are as follows:

[0054] Based on the YOLOv8 model, the present invention adds fine-grained convolution to the network, replaces nn.Upsample with Dy_sample, uses SPPF_improve to replace the SPPF module, and adds a small target detection layer, thereby improving the network's ability to adapt to the geometric changes in the scale and proportion of pedestrians and leakage on the dam surface or the geometric transformation of the model, increasing the attention to small target features, and improving the model's ability to recognize pedestrians and leakage on the dam surface. Finally, an improved YOLOv8 model is obtained. Fine-grained convolution SPD-Conv not only improves the original convolution downsampling method, but also imitates the attention mechanism to a certain extent, so that the network can focus more on these small targets when processing images containing small targets, thereby improving its detection performance. It prevents the model from losing fine-grained information when processing small targets and low-resolution images, thereby improving the learning effect of small target features. These improvements enable the model to perform excellent performance when processing targets of various sizes, greatly enhancing model performance. The SPD-Conv module can be expressed as:

[0055]

[0056] SPD-Conv can effectively reduce the loss of fine-grained information and learn efficient feature representations. To this end, fine-grained convolution SPD-Conv is introduced to replace the convolution downsampling module with a stride of 2 in the YOLOv8 model. This novel convolution method aims to achieve finer-grained feature learning to avoid the loss of small features.

[0057] For any given feature map X of size (S, S, C1), its sub-feature map sequence can be cut out as shown in equations (1) to (3), where i+x and j+y of X(i, j) are divisible by scale to form a sub-map f x,y , that is, X is downsampled by the scale factor to obtain its sub-feature map. In general, for any (original) feature map X, a sub-map f can be formed by selecting all entries X(i, j) such that i+x and j+y are divisible by scale. x,y In this way, each sub-map is equivalent to downsampling X by scale.

[0058] (IV) Training and optimization of dam surface pedestrian and leakage detection models

[0059] The model training task of this embodiment is run on a workstation equipped with an NVDIA Quadro P5000 graphics card, an Intel(R) Xeon(R) Silver 4214 CPU processor, a Windows 10 operating system, and 128GB of RAM.

[0060] Based on the pedestrian and seepage target detection dataset on the dam surface generated in step S2, the YOLOv8 model built and improved in step S3 is trained and optimized. The model hyperparameters are optimized based on the results of the training and test sets to obtain the optimal model with the best detection accuracy, detection efficiency, and model size. The main steps of model training are as follows:

[0061] (1) Set the hyperparameters for the training network. The initial number of epochs is set to 200, the batch size is set to 8, the initial learning rate lr is set to 0.01, and the number of iterations for mosaic training (close_mosaic) is set to 10, that is, mosaic training is closed for the last 10 rounds. The training and validation loss functions are both stable and convergent. After the model training is completed, the model parameters best.pt are saved in the weights folder.

[0062] (2) After training, the test set is used to evaluate the detection and generalization performance of the model. The test set is input into the trained model best.pt and the accuracy in the test set is calculated. The closer the values of P, R, F1-score, AP, and mAP are to 1, the better the detection performance of the model. To meet the needs of real-time detection, FPS should be greater than 30. Different hyperparameters are set according to the evaluation indicators, and different models are trained. The model with the best comprehensive indicators is used for real-time detection of pedestrians and leakage on the dam surface.

[0063] (V) Deployment and Application

[0064] The trained YOLOv8 detection model weights are deployed on a mobile workstation. The high-definition camera and infrared spectrum camera carried by the drone are used to capture the dam surface scene in real time and transmit it to the ground workstation for immediate detection. At the same time, the defect detection results are displayed on the workstation and stored locally. Figure 3 shown.

[0065] In summary, this invention improves the low efficiency and poor accuracy of pedestrian and leakage detection on dam surfaces. Using a self-developed dataset, the model implemented in this invention significantly improves all indicators, validating the effectiveness and practicality of this method. This work provides an efficient and accurate surface detection solution for dam inspections, with promising applications and practical significance.

[0066] It will be easily understood by those skilled in the art that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting personnel and leakage on the dam surface based on the improved YOLO v8 model, characterized in that: The following steps are involved: S1. Collect data Collect leakage data on the dam surface using pedestrians and infrared spectroscopy; The collected video is processed to obtain images of people and leakage on the dam surface; S2. Data Processing Target pedestrian and seepage features and mark compliance with standards; The LabelImg software was used to manually annotate the images of people and leakage on the dam surface in the image dataset of the improved YOLOv8 model. The defect categories and coordinate information were represented by rectangular boxes, which were matched one-to-one with the images of people and leakage on the dam surface to obtain the dam surface people and leakage target detection dataset. The dataset of personnel and leakage detection on the dam surface is randomly divided into training set, test set and validation set; S3. Model structure improvement (1) Model construction A YOLOv8 model was built, consisting of a backbone network, a neck network, and a detection head. Images of people and leaks on the dam surface were first fed into the backbone network. The features extracted by the backbone network were then fed into the neck network. Finally, the detection head identified and labeled the defect categories. (2) Model improvement The attention mechanism SPD-Conv is introduced into the model, the P2 small object detection head is added, the SPPF module is optimized, and the nn.Upsample module is replaced by the Dy_Sample module to obtain an improved YOLOv8 model; S4. Model training Based on a dataset for detecting people and leakage targets on the dam surface, we trained and optimized the improved YOLOv8 model. We optimized hyperparameters based on the results from the training and test sets to obtain a model with the best overall performance in detection accuracy, efficiency, and model size. S5: Deployment and Application The trained YOLOv8 detection model weights are deployed on a mobile workstation. The dam surface scene is photographed in real time and transmitted to the ground workstation for immediate detection. The defect detection results are displayed on the workstation and stored locally.

2. The method for detecting personnel and leakage on the dam surface based on the improved YOLO v8 model according to claim 1, characterized in that: The data collection method of S1 is: The drone was operated upstream of the dam, 10-20m away from the dam surface, to collect data on pedestrians on the dam surface and leakage under infrared spectrum from different angles; the collected drone videos were processed, and images were taken using infrared spectrum cameras and visible light cameras to obtain images of people and leakage on the dam surface.

3. The method for detecting personnel and leakage on the dam surface based on the improved YOLO v8 model according to claim 1, characterized in that: In S2, a rectangular box is used to represent the category and coordinate information of the defect, including the center point coordinates, length, width and category of the marked box.

4. The method for detecting personnel and leakage on the dam surface based on the improved YOLO v8 model according to claim 1, characterized in that: In S2, the dam surface personnel and leakage target detection dataset is randomly divided into training set, test set and validation set in a ratio of 7:2:1, which are used for training the improved YOLOv8 model, validation during training and final performance testing, respectively.

5. The method for detecting personnel and leakage on the dam surface based on the improved YOLO v8 model according to claim 1, characterized in that: In step S4, the steps of model training are as follows: Set the hyperparameters for training the network, including the number of training rounds, batch size, initial learning rate, and the number of rounds of mosaic training (close_mosaic). Adjust the hyperparameters to ensure that the improved YOLOv8 model is trained to convergence and does not overfit. Save the trained model parameter file, best.pt, in the weights folder.