A dike damage identification method based on improved Yolov8 model

By improving the Yolov8 model, combining digital twin technology and multi-dimensional attention mechanism, the embankment damage features are extracted and reconstructed, which solves the shortcomings of manual detection and the low accuracy of computer vision technology in traditional embankment damage identification, achieving efficient and accurate Damage identification of embankments.

CN118334526BActive Publication Date: 2024-09-10GUANGDONG HUANAN HYDROPOWER HIGH-TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410750870.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-10
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

Traditional embankment damage identification relies on manual inspection, which has safety risks, incomplete data collection, low accuracy and low efficiency. Existing computer vision technology has problems with image recognition deviation and low accuracy in embankment damage identification.

Method used

An embankment damage identification method based on the improved Yolov8 model is used to construct an embankment damage model through digital twin technology, image collection and preprocessing are performed, the ODConv multi-dimensional attention mechanism and CA attention mechanism are used to extract damage features, and the DySample module is used for feature reconstruction, and The Yolov8 model is improved and reconstructed in multiple layers to generate an optimized embankment damage identification model.

Benefits of technology

It improves the accuracy and efficiency of embankment damage identification, enhances the generalization ability and feature expression ability of the model, provides scientific embankment damage identification data, and provides a basis for embankment maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334526B
    Figure CN118334526B
Patent Text Reader

Abstract

The present invention relates to the technical field of levee damage identification, and in particular to a levee damage identification method based on an improved Yolov8 model. The method comprises the following steps: constructing a levee damage model using digital twins, and collecting levee damage images according to the levee damage model, thereby obtaining a levee damage image set; performing image preprocessing on the levee damage image set to generate a standard levee damage image set; marking damaged targets on the standard levee damage image set to generate a levee damage identification data set; performing data enhancement on the levee damage identification data set to generate an enhanced levee damage identification data set; performing data segmentation on the enhanced local damage identification data set to generate a model training set, a model test set, and a model verification set. The present invention improves the accuracy of the Yolov8 model and levee damage identification through technologies such as digital twin technology, multi-dimensional attention mechanism, feature reconstruction, and model multi-layer optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of levee damage identification, and in particular to a levee damage identification method based on an improved Yolov8 model. Background Art

[0002] At present, traditional levee damage identification generally relies on manual inspection, which mainly relies on inspectors to use simple auxiliary equipment for direct observation. However, this method has many disadvantages, such as large safety hazards, incomplete data collection and low accuracy. At the same time, the results are easily affected by the subjective judgment of inspectors, and the overall efficiency is also low. In recent years, computer vision technology has been widely used in automatic detection and identification of levee damage due to its non-destructive, high-precision and high-efficiency characteristics. However, in actual work, how to quickly and accurately identify levee damage is still an urgent problem to be solved. The one-stage target detection network, especially compared with the two-stage network, has obvious advantages in detection speed, so it is very suitable for fields such as industrial inspection that require high real-time performance. In terms of one-stage networks, the Yolo series of models have attracted widespread attention. However, the traditional attention mechanisms used in the Yolo series of models, such as Squeeze-and-inspire-attention and Convolutional-Block-attention-Module, have some shortcomings. Among them, the SE attention mechanism ignores the position information of the image, resulting in deviations in image recognition. CBAM is a simple and effective feed-forward convolutional neural network attention module, but it can only extract local position attention information and lacks the ability to extract long-distance relationships, which leads to low accuracy in embankment damage identification. Summary of the invention

[0003] Based on this, it is necessary to provide a levee damage identification method based on the improved Yolov8 model to solve at least one of the above technical problems.

[0004] To achieve the above purpose, a dike damage identification method based on an improved Yolov8 model is provided, the method comprising the following steps:

[0005] Step S1: construct a levee damage model using digital twins, and collect levee damage images based on the levee damage model to obtain a levee damage image set;

[0006] Step S2: performing image preprocessing on the levee damage image set to generate a standard levee damage image set; performing damage target labeling on the standard levee damage image set to generate a levee damage identification data set;

[0007] Step S3: perform data enhancement on the levee damage identification dataset to generate an enhanced levee damage identification dataset; perform data segmentation on the enhanced local damage identification dataset to generate a model training set, a model test set, and a model verification set;

[0008] Step S4: Use the ODConv multi-dimensional attention mechanism to perform four-dimensional processing in the kernel space to generate four-dimensional output data in the kernel space; extract key damage feature areas from the standard levee damage image set through the CA attention mechanism to generate a damage feature map;

[0009] Step S5: reconstruct the damaged feature map using the DySample module to generate a damaged feature reconstruction map; improve the preset Yolov8 model in multiple layers according to the model training set and the model verification set to generate a Yolov8 optimized model layer; reconstruct the Yolov8 model layer using the four-dimensional output data of the kernel space, the damaged feature reconstruction map and the model test set to generate an improved Yolov8 model;

[0010] Step S6: Input the standard levee damage image set into the improved Yolov8 model to perform levee damage identification optimization, thereby generating local damage identification optimization data.

[0011] The present invention constructs a digital twin model of the levee by using sensor data, historical data and physical models to simulate the damage of the levee under various conditions. Image acquisition is performed according to the damage generated by the digital twin model to obtain an image set covering various damage types and severity levels, which can generate highly realistic levee damage images, improve the diversity of the data set, accurately simulate various damage scenarios, and improve the generalization ability of the model. The image preprocessing of the levee damage image set is performed to perform operations such as denoising, resizing, and color standardization to generate a unified standard image set. The damaged targets in the image are manually or semi-automatically annotated to generate an identification data set containing damage type and severity annotations, which can improve image quality, ensure the consistency of input data, and provide accurate annotation information, laying the foundation for model training. The scale of the data set is expanded by operations such as rotation, flipping, and scaling. The enhanced data set is divided into a training set, a test set, and a validation set, which can increase the diversity of the data set, reduce the risk of overfitting, and reasonably divide the data set to ensure the scientific nature of model training and evaluation. The feature map is processed in four dimensions to capture complex spatial and channel relationships. Extracting key damage feature areas in the image and generating damage feature maps can better capture complex features, improve the expression ability of the model, and accurately extract key areas to enhance the accuracy of damage identification. Reconstructing the feature map to improve the quality of feature representation, optimizing the YOLOv8 model layer according to the training set and the validation set to improve its sensitivity to features, and using the four-dimensional output data of the kernel space, the damage feature reconstruction map and the model test set to reconstruct the final model can improve the quality of feature reconstruction, so that the model can better identify damage features. Through multi-level optimization and reconstruction, the detection performance of the YoLov8 model is significantly improved. The preprocessed image set is input into the improved YOLOv8 model for damage identification, and the model output results are analyzed and optimized to generate the final damage identification data. The improved model is used for efficient and accurate damage identification, and optimized damage identification data is generated to provide a scientific basis for levee maintenance. Therefore, the present invention improves the accuracy of the Yolov8 model and levee damage identification through technologies such as digital twin technology, multi-dimensional attention mechanism, feature reconstruction and model multi-layer optimization.

[0012] The beneficial effect of the present invention is that the real levee damage situation can be simulated through digital twin technology, which helps to understand the influence of different damage modes and factors. The levee damage image set generated by the digital twin model can provide a large amount of training data for training and evaluating subsequent machine learning models. Image preprocessing can improve image quality and reduce noise, which is helpful for subsequent feature extraction and model training. Target annotation of the standard levee damage image set can generate accurate damaged target location information, providing supervised learning data for subsequent damage identification. Data enhancement can increase the diversity of data by rotation, scaling, flipping, etc., and improve the robustness and generalization ability of the model. Data set partitioning can divide the data set into training set, test set and validation set for model training, evaluation and tuning. Using the ODConv multi-dimensional attention mechanism and CA attention mechanism, key damage feature information can be extracted to help the model better understand and identify levee damage. Using the DySample module to reconstruct the damage feature map can enhance the expression and discrimination ability of features. Multi-layer improvement and model reconstruction of the preset Yolov8 model can improve the performance and accuracy of the model. Using the improved Yolov8 model to optimize the identification of levee damage can improve the accuracy and efficiency of identification and provide optimized data for the identification of local damage. Therefore, the present invention improves the accuracy of the Yolov8 model and levee damage identification through technologies such as digital twin technology, multi-dimensional attention mechanism, feature reconstruction and model multi-layer optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a schematic diagram of the steps of a dike damage identification method based on the improved Yolov8 model;

[0014] Figure 2 for Figure 1 Detailed implementation steps of step S1 in FIG.

[0015] Figure 3 for Figure 1 Detailed implementation steps of step S2 in FIG.

[0016] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0017] The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.

[0018] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.

[0019] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0020] To achieve this, please refer to Figures 1 to 3 , a dike damage identification method based on an improved Yolov8 model, the method comprising the following steps:

[0021] Step S1: construct a levee damage model using digital twins, and collect levee damage images based on the levee damage model to obtain a levee damage image set;

[0022] Step S2: performing image preprocessing on the levee damage image set to generate a standard levee damage image set; performing damage target labeling on the standard levee damage image set to generate a levee damage identification data set;

[0023] Step S3: perform data enhancement on the levee damage identification dataset to generate an enhanced levee damage identification dataset; perform data segmentation on the enhanced local damage identification dataset to generate a model training set, a model test set, and a model verification set;

[0024] Step S4: Use the ODConv multi-dimensional attention mechanism to perform four-dimensional processing in the kernel space to generate four-dimensional output data in the kernel space; extract key damage feature areas from the standard levee damage image set through the CA attention mechanism to generate a damage feature map;

[0025] Step S5: reconstruct the damaged feature map using the DySample module to generate a damaged feature reconstruction map; improve the preset Yolov8 model in multiple layers according to the model training set and the model verification set to generate a Yolov8 optimized model layer; reconstruct the Yolov8 model layer using the four-dimensional output data of the kernel space, the damaged feature reconstruction map and the model test set to generate an improved Yolov8 model;

[0026] Step S6: Input the standard levee damage image set into the improved Yolov8 model to perform levee damage identification optimization, thereby generating local damage identification optimization data.

[0027] The present invention constructs a digital twin model of the levee by using sensor data, historical data and physical models to simulate the damage of the levee under various conditions. Image acquisition is performed according to the damage generated by the digital twin model to obtain an image set covering various damage types and severity levels, which can generate highly realistic levee damage images, improve the diversity of the data set, accurately simulate various damage scenarios, and improve the generalization ability of the model. The image preprocessing of the levee damage image set is performed to perform operations such as denoising, resizing, and color standardization to generate a unified standard image set. The damaged targets in the image are manually or semi-automatically annotated to generate an identification data set containing damage type and severity annotations, which can improve image quality, ensure the consistency of input data, and provide accurate annotation information, laying the foundation for model training. The scale of the data set is expanded by operations such as rotation, flipping, and scaling. The enhanced data set is divided into a training set, a test set, and a validation set, which can increase the diversity of the data set, reduce the risk of overfitting, and reasonably divide the data set to ensure the scientific nature of model training and evaluation. The feature map is processed in four dimensions to capture complex spatial and channel relationships. Extracting key damage feature areas in the image and generating damage feature maps can better capture complex features, improve the expression ability of the model, and accurately extract key areas to enhance the accuracy of damage identification. Reconstructing the feature map to improve the quality of feature representation, optimizing the YOLOv8 model layer according to the training set and the validation set to improve its sensitivity to features, and using the four-dimensional output data of the kernel space, the damage feature reconstruction map and the model test set to reconstruct the final model can improve the quality of feature reconstruction, so that the model can better identify damage features. Through multi-level optimization and reconstruction, the detection performance of the YoLov8 model is significantly improved. The preprocessed image set is input into the improved YOLOv8 model for damage identification, and the model output results are analyzed and optimized to generate the final damage identification data. The improved model is used for efficient and accurate damage identification, and optimized damage identification data is generated to provide a scientific basis for levee maintenance. Therefore, the present invention improves the accuracy of the Yolov8 model and levee damage identification through technologies such as digital twin technology, multi-dimensional attention mechanism, feature reconstruction and model multi-layer optimization.

[0028] In the embodiment of the present invention, reference Figure 1 The above is a schematic flow chart of the steps of a dike damage identification method based on the improved Yolov8 model of the present invention. In this example, the dike damage identification method based on the improved Yolov8 model includes the following steps:

[0029] Step S1: construct a levee damage model using digital twins, and collect levee damage images based on the levee damage model to obtain a levee damage image set;

[0030] In an embodiment of the present invention, relevant data of the levee structure are collected, including sensor data, geographic information, structural parameters, etc. A mathematical model or a computational model is established using these data to simulate the damage of the levee under different environmental conditions, such as water level changes, geological conditions, etc. The input and output of the model, as well as the model parameters, are determined. Based on the constructed digital twin model, the damage mode and scenario are determined. In a simulated or real environment, images of levee damage are collected using cameras, drones, or other equipment. Ensure that the collected images cover various types and degrees of damage. Sort and classify the collected images, and mark them according to different types and degrees of damage. Ensure that the image set contains sufficient samples and diversity to cover various levee damage situations.

[0031] Step S2: performing image preprocessing on the levee damage image set to generate a standard levee damage image set; performing damage target labeling on the standard levee damage image set to generate a levee damage identification data set;

[0032] In an embodiment of the present invention, noise in an image is removed by using a filter or other denoising algorithm. The contrast, brightness, etc. of the image are adjusted to enhance the quality and clarity of the image. The images are adjusted to the same size to ensure consistency in subsequent processing. The colors of the images are standardized to eliminate color differences between different images. Image annotation tools (such as LabelImg, VIA, etc.) are used to manually annotate damaged targets in a standard levee damage image set. Information such as the location, type, and extent of the damaged targets are annotated to facilitate subsequent model learning and recognition. The preprocessed and annotated images are organized into a data set, including image files and corresponding annotation files. The data set is divided into a training set, a validation set, and a test set for model training, evaluation, and testing.

[0033] Step S3: perform data enhancement on the levee damage identification dataset to generate an enhanced levee damage identification dataset; perform data segmentation on the enhanced local damage identification dataset to generate a model training set, a model test set, and a model verification set;

[0034] In an embodiment of the present invention, data enhancement is performed on the levee damage identification dataset, which includes rotation: randomly selecting a certain angle range for rotation to increase the diversity of the dataset. Flipping: flipping the image horizontally or vertically to expand the variation of the dataset. Scaling: randomly scaling the size of the image to increase the samples of scale variation. Translation: randomly translating the image in the horizontal and vertical directions to introduce translation variation. Brightness / contrast adjustment: randomly adjusting the brightness and contrast of the image to increase the variation of the image. Adding noise: adding random noise to the image to improve the robustness of the model. The dataset is divided into a training set, a test set, and a validation set, usually in a ratio of 7:2:1. Ensure that each dataset contains images of various types and degrees of damage to ensure the generalization ability of the model in different situations. For the local damage identification enhanced dataset, the same data enhancement method can be used for processing, and then the same dataset division is performed.

[0035] Step S4: Use the ODConv multi-dimensional attention mechanism to perform four-dimensional processing in the kernel space to generate four-dimensional output data in the kernel space; extract key damage feature areas from the standard levee damage image set through the CA attention mechanism to generate a damage feature map;

[0036] In an embodiment of the present invention, the ODConv multi-dimensional attention mechanism is used to process the image data in the levee damage identification dataset, and the concept of four-dimensional kernel space is introduced, that is, multi-dimensional attention calculation is performed on the channel dimension, spatial dimension and depth dimension. ODConv (Octave Convolution) is a special convolution operation that can process feature maps of different scales at the same time, gradually reduce the computational complexity through frequency division and resolution, and use the multi-dimensional attention mechanism to weightedly fuse feature maps of different scales to improve the perception and generalization capabilities of the model. The Channel Attention (CA) attention mechanism is used to extract key damage feature areas from feature maps in the standard levee damage image set. Through the CA attention mechanism, the channel information of the image features is weighted to highlight important feature information, thereby improving the recognition accuracy and robustness of the damaged feature areas.

[0037] Step S5: reconstruct the damaged feature map using the DySample module to generate a damaged feature reconstruction map; improve the preset Yolov8 model in multiple layers according to the model training set and the model verification set to generate a Yolov8 optimized model layer; reconstruct the Yolov8 model layer using the four-dimensional output data of the kernel space, the damaged feature reconstruction map and the model test set to generate an improved Yolov8 model;

[0038] In an embodiment of the present invention, the damaged feature map is reconstructed by using the DySample (Dynamic Sampling) module. The DySample module can dynamically adjust the sampling rate of the feature map, thereby realizing the reconstruction of the damaged feature map and improving the characterization capability of the damaged features. The preset YOLOv8 model is improved and optimized at multiple levels using the model training set and the validation set. According to the training results of the model training set and the validation set, each layer of the YOLOv8 model is adjusted and optimized to improve the performance and generalization ability of the model. The four-dimensional output data of the kernel space generated in step S4 is used as part of the reconstruction process. The damaged feature reconstruction map generated by the DySample module is used as the input of the reconstruction process. The Yolov8 model layer is reconstructed using the model test set to verify the performance of the model on real data.

[0039] Step S6: Input the standard levee damage image set into the improved Yolov8 model to perform levee damage identification optimization, thereby generating local damage identification optimization data.

[0040] In the embodiment of the present invention, the preprocessed and standardized standard levee damage image set is used as input data. The improved YOLOv8 model is used to optimize the levee damage recognition. The recognition results of the model for the standard levee damage image set are compared with the annotations to evaluate the accuracy and performance of the model. According to the recognition results of the model, local damage recognition optimization data is generated, including correction of the recognition results, extraction of local damage features, etc.

[0041] Preferably, step S1 comprises the following steps:

[0042] Step S11: Acquire levee physical property data, levee environment data and levee historical damage data;

[0043] Step S12: constructing a digital twin levee model based on the levee physical property data, levee environment data and levee historical damage data through virtual simulation technology to generate a digital twin levee model;

[0044] Step S13: simulating the levee damage under different environmental conditions on the digital twin levee model to generate a simulated levee damage data set, wherein the different environmental conditions include meteorological environmental conditions, hydrological environmental conditions and low-quality environmental conditions;

[0045] Step S14: Analyze the levee vulnerability range by simulating the levee damage data set to generate levee vulnerability range data; and collect levee damage images of the levee using a camera based on the levee vulnerability range data to generate a levee damage image set.

[0046] The present invention obtains the physical property data of the levee, such as structural parameters, material properties, etc. Data on the environment around the levee, including meteorological, hydrological and other environmental conditions, are collected. Historical damage data of the levee is obtained to understand the past damage and its causes. Using virtual simulation technology, the acquired physical property data, environmental data and historical damage data are integrated to establish a digital twin levee model. The digital twin levee model can simulate the behavior and response of the levee under different environmental conditions. Based on the digital twin levee model, the levee damage situation under different environmental conditions is simulated. A simulated levee damage situation data set is generated, including damage situations under different meteorological, hydrological and geological environmental conditions. Based on the simulated levee damage situation data set, the levee vulnerability range is analyzed to determine the area where the damage occurs. According to the determined vulnerable range, the levee is damaged by using a camera to collect images of the levee, and a levee damage image set is generated, which provides a comprehensive levee data foundation, including physical properties, environmental conditions and historical damage situations. A digital twin levee model is established, which can simulate the levee damage situation under different environmental conditions. A simulated levee damage data set was generated, providing effective data support for subsequent levee damage identification and prevention. An levee vulnerability range analysis was conducted, which helped to identify key monitoring areas and improve the early warning and response capabilities of levee damage.

[0047] As an example of the present invention, refer to Figure 2 As shown, in this example, step S1 includes:

[0048] Step S11: Acquire levee physical property data, levee environment data and levee historical damage data;

[0049] In the embodiment of the present invention, the ground measurement of the levee is carried out by using measuring equipment such as a total station and a laser scanner to obtain physical property data such as its shape, elevation, and length. The structural parameters of the levee are measured, including slope, width, height, etc. The materials used for the levee are tested to obtain their physical property data, such as strength, density, and permeability. Meteorological data of the area where the levee is located, including temperature, rainfall, wind speed, etc., are obtained from meteorological stations, meteorological satellites, etc. Hydrological data of nearby waters, including water level, flow, wave height, etc., are obtained from hydrological stations, hydrological sensors, etc. Geological information around the levee is collected, such as stratigraphic structure, soil type, seismic activity, etc. An on-site survey of the levee is conducted to collect actual observation data on historical damage. Relevant archival materials, reports, and literature are consulted to understand the historical damage and repair records of the levee. The historical changes of the levee are analyzed using remote sensing technology, such as satellite remote sensing images and aerial images.

[0050] Step S12: constructing a digital twin levee model based on the levee physical property data, levee environment data and levee historical damage data through virtual simulation technology to generate a digital twin levee model;

[0051] In the embodiment of the present invention, the physical property data of the levee, the environmental data of the levee and the historical damage data of the levee obtained in step S11 are sorted and prepared to ensure the integrity and accuracy of the data. Select appropriate virtual simulation software or platform, such as COMSOL Multiphysics, ANSYS, OpenFOAM, etc., to establish a digital twin levee model. According to the physical property data of the levee, the geometric model of the levee is established using simulation software, including information such as the shape, size, and material of the levee. According to the levee environmental data, set the simulation environment parameters, including meteorological conditions, hydrological conditions, geological conditions, etc., to simulate the actual environment. According to the historical damage data of the levee, set the corresponding boundary conditions or loading conditions to simulate the damage of the levee, such as flood impact, earthquake action, etc. According to the actual observation data or experimental results, calibrate and adjust the model parameters to improve the accuracy and reliability of the simulation results. Verify the established digital twin levee model, compare it with the actual observation data, and evaluate the accuracy and credibility of the model. Carry out simulation tests, compare the degree of agreement between the simulation results and the measured results, correct and improve the model, and generate a digital twin levee model after the model is verified.

[0052] Step S13: simulating the levee damage under different environmental conditions on the digital twin levee model to generate a simulated levee damage data set, wherein the different environmental conditions include meteorological environmental conditions, hydrological environmental conditions and low-quality environmental conditions;

[0053] In the embodiment of the present invention, the corresponding simulation parameters are set according to different environmental conditions to be simulated, including meteorological environmental conditions, hydrological environmental conditions and geological environmental conditions. Meteorological environmental conditions include temperature, wind speed, rainfall, etc.; hydrological environmental conditions include water level, flow, etc.; geological environmental conditions include stratigraphic structure, seismic activity, etc. According to the simulation purpose and environmental conditions, a suitable damage simulation method is selected. For example, for the damage of the levee under hydrological environmental conditions, flood impact or debris flow impact can be simulated. Numerical simulation methods such as finite element method (Finite Element Method, FEM), finite volume method (Finite Volume Method, FVM), etc. can be used to perform numerical simulation of the levee damage. According to the selected damage simulation method and environmental conditions, the damage of the digital twin levee model is simulated. During the simulation process, according to different environmental conditions, the simulation parameters are gradually adjusted to simulate the damage of the levee under different environments. The simulated levee damage data is recorded, including information such as damage location, damage degree, damage form, etc. According to different environmental conditions and simulation results, a data set for simulating levee damage is generated.

[0054] Step S14: Analyze the levee vulnerability range by simulating the levee damage data set to generate levee vulnerability range data; and collect levee damage images of the levee using a camera based on the levee vulnerability range data to generate a levee damage image set.

[0055] In an embodiment of the present invention, the vulnerable range of the levee under different environmental conditions is determined based on the levee damage data set obtained by simulation. Appropriate analysis methods, such as GIS spatial analysis, statistical analysis, etc., are used to determine the areas with a high possibility of levee damage and delineate the vulnerable range. According to the determined vulnerable range of the levee, cameras are installed at key locations to monitor the real-time situation of the levee. An image acquisition strategy is formulated, including acquisition frequency, acquisition period, acquisition angle, etc., to ensure comprehensive monitoring and recording of levee damage. Ensure that the acquired images are of good quality and high clarity, and can accurately reflect the damage of the levee. The acquired levee damage images are processed and managed, including image denoising, image enhancement, etc., to improve the image quality. Based on the acquired images, a levee damage image set is constructed, including samples of levee damage images under different environmental conditions. The generated levee vulnerability range data and levee damage image set are verified to ensure the accuracy and integrity of the data.

[0056] Preferably, step S2 comprises the following steps:

[0057] Step S21: performing image denoising on the levee damage image set to generate a levee damage denoised image set; performing image contrast enhancement on the levee damage denoised image set to generate a standard levee damage image set;

[0058] Step S22: performing dike damage contour segmentation on the standard dike damage image set to generate a dike damage contour segmentation image; performing dike damage visual feature extraction on the dike damage contour segmentation image to generate dike damage contour visual feature data;

[0059] Step S23: classifying the damage type of the standard levee damage image set based on the levee damage contour visual feature data to generate a levee damage type classification image; annotating the levee damage type classification image with the damage severity to generate an levee damage initial annotated image set;

[0060] Step S24: Identify the damaged target center point of the initial annotated image set of levee damage to generate the target center point of levee damage; accurately annotate the bounding box and attributes of the initial annotated image set of levee damage according to the target center point of levee damage, thereby generating a levee damage identification data set.

[0061] The present invention removes noise from the image set by performing image denoising on the levee damage image set, and uses common denoising algorithms such as median filtering and Gaussian filtering. The denoised image is contrast enhanced, and techniques such as histogram equalization and contrast stretching can be used to enhance the visual effect of the image, making the image clearer and easier to analyze. The denoised and enhanced image is segmented for the levee damage contour, and an image segmentation algorithm such as an edge detection algorithm (Sobel, Canny, etc.) or a semantic segmentation algorithm is used to extract the levee damage contour in the image. The segmented contour image is subjected to levee damage visual feature extraction, and the shape, texture, color and other features of the contour are extracted to describe the morphology and characteristics of the damage. Based on the extracted visual feature data of the levee damage contour, a classification algorithm (such as a convolutional neural network, a support vector machine, etc.) is used to classify the damage type of the standard levee damage image set, and the images are divided into different damage types. The classified images are labeled with the severity of the damage, and the images are labeled according to the degree of damage, such as slight, medium, severe and other levels. The damaged target center point is identified in the annotated image set, and the center point position of the damaged target in the image is identified using target detection algorithms such as YOLO and Faster R-CNN. According to the identified center point position, the image set is accurately annotated with bounding boxes and attributes, and the location, size, shape and other attribute information of the damaged target are annotated to generate a levee damage identification dataset, which helps to improve the ability to identify and analyze levee damage and provide support for subsequent levee maintenance and management.

[0062] As an example of the present invention, refer to Figure 3 As shown, in this example, step S2 includes:

[0063] Step S21: performing image denoising on the levee damage image set to generate a levee damage denoised image set; performing image contrast enhancement on the levee damage denoised image set to generate a standard levee damage image set;

[0064] In the embodiment of the present invention, by selecting a suitable image denoising algorithm, common algorithms include median filtering, Gaussian filtering, bilateral filtering, etc. According to the characteristics and noise conditions of the levee damage image, the most suitable algorithm is selected. According to the actual situation, the parameters of the denoising algorithm, such as the size of the filter, the type of the filter, etc., are adjusted to obtain the best denoising effect. The selected denoising algorithm is applied to each image in the levee damage image set to generate a levee damage denoised image set. A suitable image contrast enhancement method is selected, and common methods include histogram equalization, adaptive histogram equalization, contrast stretching, etc. The most suitable method is selected according to the characteristics of the image and the area to be enhanced. According to the actual situation, the parameters of the contrast enhancement method, such as contrast gain, brightness adjustment, etc., are adjusted to obtain the best enhancement effect. The selected contrast enhancement method is applied to each image in the levee damage denoised image set to generate a standard levee damage image set. The generated levee damage denoised image set and the standard levee damage image set are visually evaluated to ensure that the denoising and enhancement effects meet expectations and the image clarity and contrast are improved. According to the evaluation results, the parameters are adjusted and optimized to further improve the image quality and visual effect.

[0065] Step S22: performing dike damage contour segmentation on the standard dike damage image set to generate a dike damage contour segmentation image; performing dike damage visual feature extraction on the dike damage contour segmentation image to generate dike damage contour visual feature data;

[0066] In an embodiment of the present invention, by selecting a suitable image segmentation algorithm, common algorithms include edge detection algorithms (such as Sobel, Canny), semantic segmentation algorithms (such as Mask R-CNN, U-Net), etc. The parameters of the image segmentation algorithm, such as threshold, kernel size, etc., are adjusted according to actual conditions to obtain a clear and accurate levee damage contour. The selected image segmentation algorithm is applied to each image in the standard levee damage image set to generate a levee damage contour segmentation image set. A suitable feature extraction method is selected, and common methods include shape feature extraction, texture feature extraction, color feature extraction, etc. The most appropriate method is selected according to the characteristics of the levee damage and the analysis requirements. Feature extraction is performed on the segmented levee damage contour image to describe the visual features of the shape, texture, color, etc. of the levee damage. The extracted visual features are quantified into digital or vector form for subsequent analysis and processing.

[0067] Step S23: classifying the damage type of the standard levee damage image set based on the levee damage contour visual feature data to generate a levee damage type classification image; annotating the levee damage type classification image with the damage severity to generate an levee damage initial annotated image set;

[0068] In an embodiment of the present invention, by selecting a suitable classification algorithm, common algorithms include support vector machine (SVM), K nearest neighbor (KNN), decision tree, deep learning model (such as convolutional neural network), etc. Select the most suitable algorithm according to the characteristics of the data and the complexity of the classification task. Divide the standard levee damage image set into a training set and a test set according to a certain ratio to ensure that the classification model has good generalization ability. Use the training set to train the classification model and adjust the model parameters to maximize the classification accuracy and generalization ability. Use the test set to evaluate the trained model, analyze the classification accuracy, recall rate and other indicators, and adjust and optimize the model according to the evaluation results. Set the classification standard of the degree of damage according to the actual situation, which can be slight, moderate, severe and other levels. With the help of professionals or annotation tools, annotate the classified images with the severity of damage to ensure accurate and consistent annotations.

[0069] Step S24: Identify the damaged target center point of the initial annotated image set of levee damage to generate the target center point of levee damage; accurately annotate the bounding box and attributes of the initial annotated image set of levee damage according to the target center point of levee damage, thereby generating a levee damage identification data set.

[0070] In the embodiment of the present invention, step S24 is performed: the damaged target center point is identified for the initial annotated image set of levee damage to generate the damaged target center point of the levee damage; the initial annotated image set of levee damage is accurately annotated with bounding boxes and attributes according to the damaged target center point of the levee damage, thereby generating a levee damage identification data set. The target detection model is trained using the previous initial annotated image set of levee damage. The annotated damaged area can be used as training data to ensure that the model can accurately identify the center point of the damaged target. The trained model is applied to the initial annotated image set of levee damage to identify the center point of each damaged target and generate the damaged target center point data of the levee damage. According to the identified damaged target center point, the bounding box of each damaged target is drawn in the image. Automatic annotation tools or manual assisted annotation tools can be used to ensure the accuracy of the bounding box. The bounding box of each damaged target is annotated with attributes, including damage type (such as cracks, collapse, etc.), damage degree (minor, medium, severe), etc. These attribute information can be obtained by analyzing the previous damage visual feature data and classification results. All annotation results are integrated into a complete embankment damage identification dataset, which includes the damaged target center point, bounding box and attribute information of each image.

[0071] Preferably, marking the damage severity of the levee damage type classification image includes:

[0072] Segment the crack area of ​​the embankment damage type classification image to generate a crack area image;

[0073] Performing crack attribute analysis on the crack region image to generate crack region attribute data, wherein the crack region attribute data includes crack length data, crack width data and crack position data;

[0074] Based on the entropy weight method, attribute weighting is performed on the crack length data, crack width data and crack position data to obtain the first weight of crack damage, the second weight of crack damage and the third weight of crack damage; the first weight of crack damage, the second weight of crack damage and the third weight of crack damage are weighted averaged to generate the average weight of crack damage;

[0075] The damage severity is assessed based on the crack damage mean weight and the preset standard crack damage threshold to generate embankment damage severity data. Based on the embankment damage severity data, the embankment damage type classification images are labeled to generate an initial annotated image set of embankment damage.

[0076] The present invention can accurately identify and quantify the length, width and position of cracks through crack area segmentation and attribute analysis, ensuring the accuracy of damage severity assessment. Attribute weighting and averaging processing make the assessment process more scientific and objective, reducing the influence of human subjective factors. Image processing and analysis technology are used to automate the segmentation and attribute extraction of crack areas, greatly improving data processing efficiency. The attribute weighting and assessment method based on the entropy weight method can quickly calculate the degree of crack damage and improve the efficiency of the overall process. Comprehensively considering multi-dimensional attributes such as crack length, width and position, the damage assessment results are more comprehensive and scientific through scientific weight calculation methods. The entropy weight method is used to assign weights to ensure that the influence of each attribute in the damage assessment is reasonably distributed, avoiding assessment bias caused by a single attribute. The damage severity data is image-labeled, and the generated initial annotated image set of levee damage makes the damage information visual, which is convenient for intuitive understanding and subsequent analysis. The image labeling method enables levee management personnel to quickly identify and locate severely damaged areas, facilitating timely maintenance measures.

[0077] In the embodiment of the present invention, by using image segmentation technology, such as semantic segmentation based on edge detection, region growing or deep learning, the crack region image is segmented for the classification image of the levee damage type to generate a crack region image. The crack attribute analysis is performed on the crack region image, and the attribute data such as the length, width and position of the crack region are extracted using image processing technology and computer vision algorithm. The attribute data such as the length, width and position of the crack are weighted based on the entropy weight method to obtain the weight value of the crack damage. The entropy weight method is a multi-attribute decision analysis method that can effectively quantify the importance of different attributes. The weight value of the crack damage is averaged to obtain the mean weight of the crack damage to comprehensively reflect the degree of damage of the crack. According to the preset standard crack damage threshold, the mean weight of the crack damage is evaluated to determine the severity of the crack damage. Different thresholds can be set according to the specific situation to divide the damage levels of different degrees. According to the levee damage severity data, the levee damage type classification image is marked, and the damaged areas of different degrees can be marked by color, label or border to generate the initial annotated image set of levee damage.

[0078] Preferably, step S3 comprises the following steps:

[0079] Step S31: performing image data enhancement on the levee damage identification dataset to generate an enhanced levee damage identification dataset, wherein the image data enhancement includes randomly changing image brightness, converting color space, changing saturation, changing hue, zero padding, random horizontal flipping, and random cropping methods;

[0080] Step S32: Divide the levee damage identification enhanced dataset into a model training set, a model testing set and a model verification set in a ratio of 7:2:1.

[0081] The present invention adjusts the brightness of the image so that the model is robust to images under different brightness conditions. Convert the image to different color spaces, such as RGB, HSV, etc., to increase the adaptability of the model to different color spaces. Adjust the saturation and hue of the image to increase the diversity of the image and improve the generalization ability of the model. Fill the image boundaries or blank areas to keep the input image size consistent and avoid information loss. Randomly flip the image horizontally to increase the diversity of the data set and reduce the risk of overfitting. Randomly crop the image to change the area and content of the image to increase the diversity of the data set. Dividing the levee damage identification enhanced data set into a model training set, a model test set, and a model verification set in a ratio of 7:2:1 can effectively increase the diversity and quantity of the data set and improve the generalization ability and robustness of the model.

[0082] In an embodiment of the present invention, the brightness of an image is randomly adjusted to increase or decrease within a certain range. The image is converted from the RGB color space to other color spaces such as HSV and LAB. The saturation and hue of the image are randomly adjusted to vary within a certain range. Zero-value pixels are added to the image boundary or blank area to keep its size unchanged. Images are randomly selected for horizontal flipping to increase the diversity of the data set. Regions of the image are randomly selected for cropping to change the content and structure of the image and generate an enhanced data set for levee damage identification. The enhanced data set for levee damage identification is divided into a model training set, a model test set, and a model validation set in a ratio of 7:2:1. According to the total amount of the data set, it is divided into a training set, a test set, and a validation set in a ratio of 7:2:1. By random sampling, the randomness and representativeness of the data set are ensured, and the deviation of the data set division is avoided.

[0083] Preferably, using the ODConv multi-dimensional attention mechanism to perform four-dimensional processing of the kernel space includes:

[0084] Get input features;

[0085] Use global average pooling to perform feature conversion compression on the input features to obtain a compressed input feature vector;

[0086] The compressed input feature vector is mapped into a low-dimensional space through a fully connected layer to generate an input feature space mapping vector, and the input feature space mapping vector is removed by a ReLU function for non-positive values ​​to generate a feature attention scalar, wherein the feature attention scalar includes a first feature attention scalar, a second feature attention scalar, a third feature attention scalar, and a fourth feature attention scalar;

[0087] The first feature attention scalar, the second feature attention scalar, and the third feature attention scalar are feature-weighted according to the Sigmoid function to generate the first feature attention weight, the second feature attention weight, and the third feature attention weight; the fourth feature attention scalar is feature-weighted according to the Softmax function to generate the fourth feature attention weight;

[0088] The first feature attention weight, the second feature attention weight, the third feature attention weight and the fourth feature attention weight are weighted summed and verified. When the sum of the first feature attention weight, the second feature attention weight, the third feature attention weight and the fourth feature attention weight is 1, ODConv is used based on the fully connected layer to perform a four-dimensional kernel space prediction on the input feature and the feature attention scalar, and generate a four-dimensional kernel space output data;

[0089] When the sum of the first feature attention weight, the second feature attention weight, the third feature attention weight and the fourth feature attention weight is not 1, the input feature is reacquired.

[0090] The present invention can effectively model the importance of different features by globally processing the input features and calculating the feature attention weights. In addition, by weighting the feature attention scalar, different degrees of attention to different features can be achieved, thereby better capturing the relevant information of the input features. The final generated four-dimensional output data in the kernel space can more comprehensively reflect the complexity and diversity of the input features, which helps to improve the performance and generalization ability of the model.

[0091] In the embodiment of the present invention, ODConv is combined with global average pooling (GAP), fully connected layer (FC) and Sigmoid activation function to generate a specific attention scalar for weighted convolution kernel. First, the input feature x is converted into a compressed feature vector by global average pooling. Subsequently, this feature vector is mapped to a low-dimensional space through a fully connected layer. In this process, the positive values ​​are screened and retained by the ReLU function, laying the foundation for the subsequent creation of four different attention scalars. These scalars are predicted by their respective fully connected layers and the corresponding feature vectors are output, which are respectively designed to locate the damaged area of ​​the levee, deeply analyze the structural characteristics, and describe the local features in detail. In order to ensure the standardization of the weights, the outputs of the first three branches are processed by the Sigmoid function, while the fourth branch uses the Softmax function to ensure that the sum of all weights is exactly 1. Specifically, the input features to be processed are obtained from the data set, and the features are specifically images, videos, texts, etc. The input features are subjected to global average pooling and converted into a feature vector, which represents the feature expression of the entire input feature. The feature vector obtained by global average pooling is mapped through a fully connected layer to a low-dimensional space, and the ReLU function is used for nonlinear processing to obtain the feature attention scalar. The feature attention scalar is normalized, for example, the first three feature attention scalars are normalized using the Sigmoid function to obtain the attention weights, and the fourth feature attention scalar is normalized using the Softmax function to obtain the attention weights. The attention weights of the four features are normalized to ensure that their sum is 1 to ensure the validity and consistency of the attention weights. If the sum of the four attention weights is 1, the ODConv module is used to perform a four-dimensional prediction of the input features and the feature attention scalar in the kernel space to generate four-dimensional output data in the kernel space. If the sum of the four attention weights is not 1, the input features need to be re-acquired and re-processed to ensure the correctness of the attention weights.

[0092] Preferably, using ODConv based on the fully connected layer to perform a four-dimensional prediction of the kernel space on the input features and the feature attention scalar includes:

[0093] Based on the fully connected layer, the full-dimensional dynamic convolution ODConv is used to perform four-dimensional parallel convolution in the kernel space on the input features and feature attention scalars, and generate four-dimensional output data in the kernel space, where the four-dimensional parallel convolution in the kernel space includes position multiplication operations in the spatial dimension, channel multiplication operations in the input channel dimension, filter multiplication operations in the output channel dimension, and kernel multiplication operations in the convolution kernel space;

[0094] The formula of ODConv parallel convolution is as follows:

[0095]

[0096] In the formula, Represents the entire convolution kernel The attention scalar, Represents along the convolution kernel The attention scalar introduced by the spatial dimension of Represents along the convolution kernel The attention scalar introduced by the input channel dimension, Represents along the convolution kernel The attention scalar introduced by the output channel dimension of represents the multiplication operations along different dimensions of the kernel space, represents the convolution operation, represents the input features, Represents the output features.

[0097] The present invention prepares input features and corresponding feature attention scalars. The input feature is usually a feature map, and the feature attention scalar is calculated in the previous step. The input feature is multiplied by the attention scalar in the spatial dimension to enhance or weaken the feature response of different spatial positions. The input feature is multiplied by the attention scalar in the input channel dimension to enhance or weaken the feature response of different channels. The input feature is multiplied by the attention scalar in the output channel dimension to enhance or weaken the feature response of different output channels. The results obtained by the above three multiplication operations are convolved with the convolution kernel to obtain the final output features. The input features and feature attention scalars can be effectively utilized to perform parallel convolution operations in the four dimensions of the kernel space, thereby enhancing the model's ability to express features and improving model performance.

[0098] In the embodiment of the present invention, by using full-dimensional dynamic convolution ODConv to learn convolution kernel features along all four dimensions of the convolution kernel space in parallel, the four dimensions calculated by ODConv along the convolution kernel are: position multiplication operation of spatial dimension, channel multiplication operation of input channel dimension, filter multiplication operation of output channel dimension, and kernel multiplication operation of convolution kernel space. Specifically, the input features are obtained. and the corresponding feature attention scalar . Input features Attention scalar with spatial dimensions Perform element-by-element multiplication to obtain the multiplication result , the input feature The attention scalar with input channel dimension Perform element-by-element multiplication to obtain the multiplication result . The multiplication result The attention scalar with the output channel dimension Perform element-by-element multiplication to obtain the multiplication result . The multiplication result With convolution kernel Perform convolution operation to obtain output features The output features obtained are That is the four-dimensional output data in the kernel space, which contains the input features and feature attention scalar information.

[0099] Preferably, extracting key damage feature areas from a standard levee damage image set by using a CA attention mechanism includes:

[0100] Extract key damage features from the standard levee damage image set to obtain the key damage features of the levee;

[0101] Taking the key damage features of the levee as input, the key damage features of the levee are encoded in the horizontal and vertical directions using global average pooling to generate a key damage width feature map and a key damage height feature map of the levee;

[0102] Performing dimension transformation on the dike key damage width feature map, and splicing the dike key damage width feature map and the dike key damage height feature map after dimension transformation to generate a dike key damage splicing intermediate feature map;

[0103] Based on the preset 1×1 convolution, the feature map channel number of the spliced ​​intermediate feature map of the key damage of the levee is compressed to obtain the compressed feature map of the key damage of the levee; the BN batch normalization and nonlinear operation are used to perform feature mapping on the compressed feature map of the key damage of the levee to generate the mapping feature map of the key damage of the levee;

[0104] Based on the preset 1×1 convolution, the spatial dimension tensor decomposition of the key damage mapping feature map of the levee is performed to generate the key damage width dimension of the levee and the key damage height dimension of the levee; the attention weight of the key damage width dimension of the levee and the key damage height dimension of the levee are calculated using the Sigmoid activation function to obtain the attention weight of the key damage width of the levee and the attention weight of the key damage height of the levee;

[0105] According to the attention weight of the critical damage width of the levee and the attention weight of the critical damage height of the levee, a weighted calculation is performed on the critical damage width feature map of the levee and the critical damage height feature map of the levee, so as to obtain a weighted feature map of the critical damage width of the levee and a weighted feature map of the critical damage height of the levee;

[0106] The feature maps of the critical damage width weighted feature map of the levee and the critical damage height weighted feature map of the levee are integrated to generate a damage feature map.

[0107] The present invention obtains the key damage features of the levee by extracting features from the standard levee damage image set. The key damage features of the levee are encoded in the horizontal and vertical directions using global average pooling to generate a key damage width feature map and a key damage height feature map. The key damage width feature map of the levee is transposed in dimension, and the key damage width feature map and the key damage height feature map of the levee after dimension transposition are spliced ​​to generate a key damage splicing intermediate feature map. The key damage splicing intermediate feature map is compressed based on the preset 1×1 convolution to obtain a key damage compression feature map; the key damage compression feature map of the levee is mapped using BN batch normalization and nonlinear operation to generate a key damage mapping feature map of the levee. Based on the preset 1×1 convolution, the spatial dimension tensor decomposition of the key damage mapping feature map of the levee is performed to obtain the key damage width dimension and the key damage height dimension of the levee; the attention weight of the key damage width dimension and the key damage height dimension of the levee is calculated using the Sigmoid activation function to obtain the key damage width attention weight and the key damage height attention weight of the levee. According to the key damage width attention weight and the key damage height attention weight of the levee, the key damage width feature map and the key damage height feature map of the levee are weighted, so as to obtain the key damage width weight feature map and the key damage height weight feature map of the levee; the key damage width weight feature map and the key damage height weight feature map of the levee are integrated to generate a damage feature map. The CA attention mechanism and feature extraction technology are used to effectively extract the key damage feature area from the standard levee damage image, which provides strong support for subsequent damage identification and analysis.

[0108] In an embodiment of the present invention, the CA attention mechanism is used to firstly perform feature encoding on the input features passed in along the horizontal and vertical directions using global average pooling to obtain feature maps in the width and height directions; then, the output dimension of the feature map in the width direction is swapped and spliced ​​with the feature map in the height direction, and after splicing, the number of channels of the obtained intermediate feature map is compressed to C / r (r is the reduction factor) using 1×1 convolution; then, BN (Batch Normalization) batch normalization and nonlinear operation are used to perform feature mapping on the feature map, and after mapping, 1×1 convolution is used to decompose the feature map into two independent tensors along the spatial dimension, wherein the output dimension of the feature map in the width direction is restored to the input state; then, the Sigmoid activation function is used to obtain the attention weights in the two directions respectively; finally, a feature map with attention weights in both directions is obtained by multiplication weighted calculation on the original feature map.

[0109] Preferably, reconstructing the damaged feature map using the DySample module includes:

[0110] Randomly collect feature points on the damage feature map to obtain a feature sampling set;

[0111] The DySample module is used to resample the damage feature map according to the feature sampling set to generate a damage resampled feature map;

[0112] Perform pixel shuffling on the damaged resampled feature map to generate a damaged resampled shuffled feature map;

[0113] The damaged resampled shuffled feature map is bilinearly interpolated based on the grid sampling function to generate a damaged feature reconstruction map.

[0114] The present invention collects random feature points of a damaged feature map to obtain a feature sampling set. The DySample module is used to resample the damaged feature map according to the feature sampling set to generate a damaged resampled feature map. The DySample module can flexibly sample the feature map according to the position information of the sampling set, thereby obtaining a feature map with higher resolution or different resolutions. Pixel shuffling is performed on the damaged resampled feature map to generate a damaged resampled shuffled feature map. The pixel shuffling operation can increase the diversity and robustness of the feature map, and help improve the generalization ability of the feature map. Bilinear interpolation is performed on the damaged resampled shuffled feature map based on the grid sampling function to generate a damaged feature reconstruction map. Bilinear interpolation can effectively fill the gaps between pixels, restore the detailed information of the feature map, and make the reconstructed feature map smoother and more continuous.

[0115] In an embodiment of the present invention, a certain number of feature points are randomly selected on the damaged feature map as a feature sampling set. The selection of these feature points can be based on a random sampling method to ensure that the sampling set covers the entire area of ​​the damaged feature map. The DySample module is used to resample the damaged feature map according to the feature sampling set. The DySample module can flexibly sample the feature map according to the position information of the sampling set to obtain a resampled feature map with higher resolution or different resolutions. A pixel shuffling operation is performed on the damaged resampled feature map. Pixel shuffling can randomly adjust the position or pixel value of the pixels in the feature map, increase the diversity and robustness of the feature map, and help improve the generalization ability of the feature map. Based on the grid sampling function, bilinear interpolation is performed on the damaged resampled shuffled feature map. Bilinear interpolation can effectively fill the gaps between pixels and restore the detailed information of the feature map, making the reconstructed feature map smoother and continuous. For example, given a size of The feature map X and a size of The grid sampling function uses the locations in S to resample the assumed bilinear interpolation X to a size of X', that is ; Given the upsampling scale factor s and size The feature map X of which the input and output channel numbers are C and 2s2 linear layers are used to generate a The offset O is then reshaped into The sampling set S is the sum of the offset O and the original sampling grid G, that is, ; ; Finally, using the sampling set by the grid sample, we can generate a grid of size The upsampled feature map X'.

[0116] Preferably, improving the preset Yolov8 model in multiple layers according to the damage feature reconstruction graph and the four-dimensional output data of the kernel space, and reconstructing the Yolov8 model layer using the model training set, the model test set and the model verification set include:

[0117] According to the damaged feature reconstruction graph and the four-dimensional output data of the kernel space, the backbone network in the preset Yolov8 model is replaced with the ODConv second convolutional layer to generate the ODConv second convolutional layer, and the preset Yolov8 model is optimized for the first time based on the ODConv second convolutional layer, thereby generating the first improved Yolov8 model;

[0118] The first improved Yolov8 model is damaged by using the model training set to generate the second improved Yolov8 model;

[0119] Input the model verification set into the second improved Yolov8 damage model to identify damaged targets, thereby generating a Yolov8 optimized model layer;

[0120] The Yolov8 model layer is reconstructed using the four-dimensional output data of the kernel space, the damaged feature reconstruction map and the model test set to generate an improved Yolov8 model.

[0121] The present invention replaces the ODConv second convolution layer of the backbone network in the preset Yolov8 model through the damaged feature reconstruction graph and the four-dimensional output data of the kernel space, and generates a new ODConv second convolution layer. The Yolov8 model is optimized for the first time using the new ODConv second convolution layer to generate a first improved Yolov8 model. The first improved Yolov8 model is trained using a model training set to optimize model parameters and improve the accuracy of damaged target recognition. The model verification set is input into the damaged model of the first improved Yolov8 to identify damaged targets and generate a Yolov8 optimized model layer. The Yolov8 model layer is reconstructed using the four-dimensional output data of the kernel space, the damaged feature reconstruction graph and the model test set to generate an improved Yolov8 model, which can gradually improve the Yolov8 model to make it more suitable for damaged target recognition tasks and improve the performance and accuracy of the model.

[0122] In an embodiment of the present invention, the second convolutional layer of the backbone network in the preset Yolov8 model is replaced with ODConv according to the damage feature reconstruction map and the four-dimensional output data of the kernel space, so as to construct a first improved Yolov8 model; the damage of the first improved Yolov8 is trained with the enhanced training set, and the CA module is integrated into the first two C2F architectures to construct a second improved Yolov8 damage model; the damage of the validation set is input into the second improved Yolov8 damage model to complete the damage target identification, and the third improved Yolov8 optimization model layer is constructed, and DySample is used to replace the traditional upsampling method, and the Yolov8 model layer is reconstructed using the four-dimensional output data of the kernel space, the damage feature reconstruction map and the model test set to generate an improved Yolov8 model.

[0123] The beneficial effect of the present invention is that the real levee damage situation can be simulated through digital twin technology, which helps to understand the influence of different damage modes and factors. The levee damage image set generated by the digital twin model can provide a large amount of training data for training and evaluating subsequent machine learning models. Image preprocessing can improve image quality and reduce noise, which is helpful for subsequent feature extraction and model training. Target annotation of the standard levee damage image set can generate accurate damaged target location information, providing supervised learning data for subsequent damage identification. Data enhancement can increase the diversity of data by rotation, scaling, flipping, etc., and improve the robustness and generalization ability of the model. Data set partitioning can divide the data set into training set, test set and validation set for model training, evaluation and tuning. Using the ODConv multi-dimensional attention mechanism and CA attention mechanism, key damage feature information can be extracted to help the model better understand and identify levee damage. Using the DySample module to reconstruct the damage feature map can enhance the expression and discrimination ability of features. Multi-layer improvement and model reconstruction of the preset Yolov8 model can improve the performance and accuracy of the model. Using the improved Yolov8 model to optimize the identification of levee damage can improve the accuracy and efficiency of identification and provide optimized data for the identification of local damage. Therefore, the present invention improves the accuracy of the Yolov8 model and levee damage identification through technologies such as digital twin technology, multi-dimensional attention mechanism, feature reconstruction and model multi-layer optimization.

[0124] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

[0125] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A dike damage identification method based on the improved Yolov8 model, It is characterized in that The following steps are involved: Step S1: construct a levee damage model using digital twins, and collect levee damage images based on the levee damage model to obtain a levee damage image set; Step S1 includes the following steps: Step S11: Acquire levee physical property data, levee environment data and levee historical damage data; Step S12: constructing a digital twin levee model based on the levee physical property data, levee environment data and levee historical damage data through virtual simulation technology to generate a digital twin levee model; Step S13: simulating the levee damage under different environmental conditions on the digital twin levee model to generate a simulated levee damage data set, wherein the different environmental conditions include meteorological environmental conditions, hydrological environmental conditions and low-quality environmental conditions; Step S14: analyzing the vulnerable range of the levee by simulating the levee damage data set to generate levee vulnerable range data; collecting levee damage images of the levee using a camera based on the levee vulnerable range data to generate a levee damage image set; Step S2: performing image preprocessing on the levee damage image set to generate a standard levee damage image set; performing damage target labeling on the standard levee damage image set to generate a levee damage identification data set; Step S3: perform data enhancement on the levee damage identification dataset to generate an enhanced levee damage identification dataset; perform data segmentation on the enhanced local damage identification dataset to generate a model training set, a model test set, and a model verification set; Step S4: Using the ODConv multi-dimensional attention mechanism to perform four-dimensional processing in the kernel space and generate four-dimensional output data in the kernel space; extracting key damage feature areas from the standard levee damage image set through the CA attention mechanism and generating a damage feature map; Using the ODConv multi-dimensional attention mechanism to perform four-dimensional processing in the kernel space includes: Get input features; Use global average pooling to perform feature conversion compression on the input features to obtain a compressed input feature vector; The compressed input feature vector is mapped into a low-dimensional space through a fully connected layer to generate an input feature space mapping vector, and the input feature space mapping vector is removed by a ReLU function for non-positive values ​​to generate a feature attention scalar, wherein the feature attention scalar includes a first feature attention scalar, a second feature attention scalar, a third feature attention scalar, and a fourth feature attention scalar; The first feature attention scalar, the second feature attention scalar, and the third feature attention scalar are feature-weighted according to the Sigmoid function to generate the first feature attention weight, the second feature attention weight, and the third feature attention weight; the fourth feature attention scalar is feature-weighted according to the Softmax function to generate the fourth feature attention weight; The first feature attention weight, the second feature attention weight, the third feature attention weight and the fourth feature attention weight are weighted summed and verified. When the sum of the first feature attention weight, the second feature attention weight, the third feature attention weight and the fourth feature attention weight is 1, ODConv is used based on the fully connected layer to perform a four-dimensional kernel space prediction on the input feature and the feature attention scalar, and generate a four-dimensional kernel space output data; When the sum of the first feature attention weight, the second feature attention weight, the third feature attention weight and the fourth feature attention weight is not 1, the input feature is reacquired; Step S5: reconstructing the damaged feature map using the DySample module to generate a damaged feature reconstruction map; reconstructing the damaged feature map using the DySample module includes: Randomly collect feature points on the damage feature map to obtain a feature sampling set; The DySample module is used to resample the damage feature map according to the feature sampling set to generate a damage resampled feature map; Perform pixel shuffling on the damaged resampled feature map to generate a damaged resampled shuffled feature map; Based on the grid sampling function, bilinear interpolation is performed on the damaged resampled shuffled feature map to generate a damaged feature reconstruction map; the preset Yolov8 model is improved in multiple layers according to the model training set and the model verification set to generate a Yolov8 optimized model layer; the Yolov8 model layer is reconstructed using the four-dimensional output data of the kernel space, the damaged feature reconstruction map and the model test set to generate an improved Yolov8 model; the preset Yolov8 model is improved in multiple layers according to the damaged feature reconstruction map and the four-dimensional output data of the kernel space, and the Yolov8 model layer is reconstructed using the model training set, the model test set and the model verification set, including: According to the damaged feature reconstruction graph and the four-dimensional output data of the kernel space, the backbone network in the preset Yolov8 model is replaced with the ODConv second convolutional layer to generate the ODConv second convolutional layer, and the preset Yolov8 model is optimized for the first time based on the ODConv second convolutional layer, thereby generating the first improved Yolov8 model; The first improved Yolov8 model is damaged by using the model training set to generate the second improved Yolov8 model; Input the model verification set into the second improved Yolov8 damage model to identify damaged targets, thereby generating a Yolov8 optimized model layer; The Yolov8 model layer is reconstructed using the kernel space four-dimensional output data, the damaged feature reconstruction graph and the model test set to generate an improved Yolov8 model. Step S6: Input the standard levee damage image set into the improved Yolov8 model to perform levee damage identification optimization, thereby generating local damage identification optimization data.

2. The dike damage identification method based on the improved Yolov8 model according to claim 1, It is characterized in that Step S2 includes the following steps: Step S21: performing image denoising on the levee damage image set to generate a levee damage denoised image set; performing image contrast enhancement on the levee damage denoised image set to generate a standard levee damage image set; Step S22: performing dike damage contour segmentation on the standard dike damage image set to generate a dike damage contour segmentation image; performing dike damage visual feature extraction on the dike damage contour segmentation image to generate dike damage contour visual feature data; Step S23: classifying the damage type of the standard levee damage image set based on the levee damage contour visual feature data to generate a levee damage type classification image; annotating the levee damage type classification image with the damage severity to generate an levee damage initial annotated image set; Step S24: Identify the damaged target center point of the initial annotated image set of levee damage to generate the target center point of levee damage; accurately annotate the bounding box and attributes of the initial annotated image set of levee damage according to the target center point of levee damage, thereby generating a levee damage identification data set.

3. The dike damage identification method based on the improved Yolov8 model according to claim 2, It is characterized in that The damage severity annotation of the levee damage type classification image includes: Segment the crack area of ​​the embankment damage type classification image to generate a crack area image; Performing crack attribute analysis on the crack region image to generate crack region attribute data, wherein the crack region attribute data includes crack length data, crack width data and crack position data; Based on the entropy weight method, attribute weighting is performed on the crack length data, crack width data and crack position data to obtain the first weight of crack damage, the second weight of crack damage and the third weight of crack damage; the first weight of crack damage, the second weight of crack damage and the third weight of crack damage are weighted averaged to generate the average weight of crack damage; The damage severity is assessed based on the crack damage mean weight and the preset standard crack damage threshold to generate embankment damage severity data. Based on the embankment damage severity data, the embankment damage type classification images are labeled to generate an initial annotated image set of embankment damage.

4. The dike damage identification method based on the improved Yolov8 model according to claim 1, It is characterized in that Step S3 includes the following steps: Step S31: performing image data enhancement on the levee damage identification dataset to generate an enhanced levee damage identification dataset, wherein the image data enhancement includes randomly changing image brightness, converting color space, changing saturation, changing hue, zero padding, random horizontal flipping, and random cropping methods; Step S32: Divide the levee damage identification enhanced dataset into a model training set, a model testing set and a model verification set in a ratio of 7:2:

1.

5. The dike damage identification method based on the improved Yolov8 model according to claim 1, It is characterized in that Based on the fully connected layer, ODConv is used to predict the four dimensions of the kernel space for the input features and feature attention scalars, including: Based on the fully connected layer, the full-dimensional dynamic convolution ODConv is used to perform four-dimensional parallel convolution in the kernel space on the input features and feature attention scalars, and generate four-dimensional output data in the kernel space, where the four-dimensional parallel convolution in the kernel space includes position multiplication operations in the spatial dimension, channel multiplication operations in the input channel dimension, filter multiplication operations in the output channel dimension, and kernel multiplication operations in the convolution kernel space; The formula of ODConv parallel convolution is as follows: In the formula, Represents the entire convolution kernel The attention scalar, Represents along the convolution kernel The attention scalar introduced by the spatial dimension of Represents along the convolution kernel The attention scalar introduced by the input channel dimension, Represents along the convolution kernel The attention scalar introduced by the output channel dimension of represents the multiplication operations along different dimensions of the kernel space, represents the convolution operation, represents the input features, Represents the output features.

6. The dike damage identification method based on the improved Yolov8 model according to claim 1, It is characterized in that The key damage feature area extraction of the standard levee damage image set through the CA attention mechanism includes: Extract key damage features from the standard levee damage image set to obtain the key damage features of the levee; Taking the key damage features of the levee as input, the key damage features of the levee are encoded in the horizontal and vertical directions using global average pooling to generate a key damage width feature map and a key damage height feature map of the levee; Performing dimension transformation on the dike key damage width feature map, and splicing the dike key damage width feature map and the dike key damage height feature map after dimension transformation to generate a dike key damage splicing intermediate feature map; Based on the preset 1×1 convolution, the feature map channel number of the spliced ​​intermediate feature map of the key damage of the levee is compressed to obtain the compressed feature map of the key damage of the levee; the BN batch normalization and nonlinear operation are used to perform feature mapping on the compressed feature map of the key damage of the levee to generate the mapping feature map of the key damage of the levee; Based on the preset 1×1 convolution, the spatial dimension tensor decomposition of the key damage mapping feature map of the levee is performed to generate the key damage width dimension of the levee and the key damage height dimension of the levee; the attention weight of the key damage width dimension of the levee and the key damage height dimension of the levee are calculated using the Sigmoid activation function to obtain the attention weight of the key damage width of the levee and the attention weight of the key damage height of the levee; According to the attention weight of the critical damage width of the levee and the attention weight of the critical damage height of the levee, a weighted calculation is performed on the critical damage width feature map of the levee and the critical damage height feature map of the levee, so as to obtain a weighted feature map of the critical damage width of the levee and a weighted feature map of the critical damage height of the levee; The feature maps of the critical damage width weighted feature map of the levee and the critical damage height weighted feature map of the levee are integrated to generate a damage feature map.