Dam underwater multi-class disease intelligent detection method and system under weak computing power condition
By fusing the deformable convolution DConv and SE attention mechanisms in the YOLOv7 algorithm, and using technical means such as MPDIoU loss function and sparse training, an intelligent detection model of underwater multi-category diseases of dams under weak computing power conditions was constructed, solving the problems of large model parameters and high computing power requirements in the existing technology, and achieving high precision and robust disease detection effects.
Patent Information
- Application Number
- CN202510248936.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-04
AI Technical Summary
The existing deep learning-based object detection algorithm has problems such as large model parameters and high computing power requirements in the detection of multiple categories of dam underwater diseases, which leads to the inability to run smoothly on commonly used detection equipment on the front line of the engineering, and the error and missed detection rates are high.
Based on the single-stage object detection algorithm YOLOv7, the deformable convolution DConv and SE attention mechanism are integrated in the backbone network, the MPDIoU loss function is used to enhance the matching degree of the prediction box and the real box, and lightweight processing is carried out through sparse training and structured pruning strategies to build an intelligent detection model for underwater multi-category diseases of the dam under weak computing power conditions.
The detection accuracy of cracks, exposed ribs, holes and peeling is significantly improved, and the robustness and adaptability of the model are enhanced, so that it can run smoothly on weak computing equipment to meet the needs of intelligent detection.
Smart Images

Figure CN119762957A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of underwater target detection, and specifically relates to an intelligent detection method and system for multi-category underwater diseases of a dam under weak computing power conditions. Background Art
[0002] Under the coupling effect of external erosion and complex loads, the underwater part of the dam will inevitably develop various underwater defects such as cracks, spalling, exposed reinforcement and holes, which will affect the safety and durability of the dam. Therefore, it is necessary to strengthen the underwater disease detection and hazard removal and reinforcement work of the dam.
[0003] Traditional underwater detection methods are mainly based on visual inspection and exploration by professional divers. Engineering practice shows that this method not only has low detection efficiency, but also easily creates safety hazards and is greatly affected by subjective factors of the inspectors. With the development of remote control and machine vision technology, many technicians have achieved efficient and contactless underwater disease detection by using underwater robots equipped with high-definition optical cameras and using deep learning-based target detection algorithms to extract underwater disease information end-to-end. However, the existing deep learning-based target detection algorithms have objective factors such as large model parameters and high computing power requirements, while the overall computing power of the detection equipment commonly used in the engineering front line is relatively weak, resulting in the inability to run the detection algorithm smoothly.
[0004] There are two types of deep learning-based target detection algorithms: two-stage detection and single-stage detection. The former roughly generates candidate boxes and then extracts information in detail, while the latter directly classifies and regresses information, which can significantly improve detection efficiency with a small loss of accuracy. YOLOv7 is a more mature and reliable single-stage target detection algorithm in existing general scenarios. For a relatively single target category, it can improve detection efficiency while ensuring high accuracy. However, underwater structures of dams often have cracks, spalling, exposed steel bars, holes and other defects, and the sizes and shapes of different defects vary greatly, resulting in high false detection and missed detection rates when using YOLOv7 directly. Summary of the invention
[0005] In view of the weak computing power of existing detection equipment and the shortcomings of detection methods, the present invention provides an intelligent detection method for underwater multi-category diseases of dams under weak computing power conditions. Based on the single-stage target detection algorithm YOLOv7, the deformable convolution DConv and SE attention mechanism are integrated in the backbone network of the algorithm to give more weight information to the disease features, thereby improving the detection accuracy of the model for disease targets in complex underwater environments; the MPDIoU loss function is used in the head network of the algorithm to enhance the matching degree between the predicted box and the real box, and improve the detection accuracy of disease targets with excessive aspect ratio differences; through sparse training and structured pruning strategies, redundant parameters such as the scaling coefficient of small-scale channels in the algorithm are removed to achieve lightweight and reduce the computing power requirements for operation; finally, an intelligent detection model for underwater multi-category diseases of dams under weak computing power conditions is constructed, so as to maintain high detection accuracy while running smoothly in the weak computing power detection equipment on the front line of the project, and realize accurate identification and detection of various underwater diseases such as cracks, exposed reinforcement, holes and spalling, so as to meet the needs of intelligent detection.
[0006] In order to solve the above technical problems, the present invention is implemented by the following technical solutions: An intelligent detection method for underwater multi-category dam diseases under weak computing power conditions includes the following steps: Step S1: Data collection: Obtain underwater structural disease videos of dams at the project site, extract and filter disease images frame by frame from the underwater disease videos, and all filtered images constitute a multi-category underwater dam disease dataset; Step S2: Data labeling: label each underwater disease image with information about the disease category and the disease area, and divide the labeled data set into a training set, a validation set, and a test set in a ratio of 3:1:1; Step S3: Model construction: Based on the single-stage target detection algorithm YOLOv7, an intelligent detection model for underwater multi-category dam diseases under weak computing power conditions is constructed. The deformable convolution DConv and SE attention mechanism are integrated in the backbone network. The MPDIoU loss function is used in the algorithm head network. The detection model is trained with the training set and the validation set respectively. The recognition performance of the detection model is tested with the test set. In the training stage, the model is lightweighted through sparse training and structured pruning strategies to obtain the pre-trained intelligent detection model for underwater multi-category dam diseases under weak computing power conditions. Step S4: Intelligent detection: Re-collect unlabeled images of underwater dam structural defects, and use the intelligent detection model of multiple categories of underwater dam defects under weak computing power conditions obtained in step S3 to perform detection and obtain information on the types of underwater dam defects.
[0007] Further optimization, in step S1, underwater dam disease information is collected using an underwater robot equipped with a high-definition camera. The original sampling data is an avi format video with a sampling frame rate of 30 frames per second. An underwater disease dataset of hydraulic concrete structures is constructed by capturing one picture every five frames, covering four types of underwater diseases: cracks, exposed reinforcement, holes, and spalling, as well as the aggregation of multiple underwater diseases.
[0008] Further optimization, in step S2, the visual annotation software Labelimg is used to annotate each image in the data set to generate an xml file, and the position of the underwater dam disease area in the image is determined by the annotated rectangular box, where the annotation information includes the underwater dam disease category, the coordinates of the center point of the rectangular box, and the length and width of the rectangular box, which is converted into the YOLO label format after normalization and saved as a txt file.
[0009] Further optimization, the specific process of constructing the intelligent detection model for underwater multi-category dam diseases under weak computing power conditions in step S3 is as follows: Step S3-1: Integrate the deformable convolution DConv and SE attention mechanism in the YOLOv7 backbone network to make the model focus on underwater disease features, enhance the model's ability to resist interference from complex underwater backgrounds, and enhance its ability to extract irregular small target disease features such as exposed tendons and holes. The calculation method is: ; Where: x and y are the relative positions of the convolution kernel and the feature map, w() represents the vector weight, P n and P0 is the position vector, ΔP n is the direction vector, is the new feature map, F scale Indicates the operation process, u c represents the original feature map, s c Represents the channel weight.
[0010] Step S3-2: The bounding box loss function of YOLOv7 is CIoU, and the definition of the aspect ratio used is a relative value, not an absolute value. Therefore, in the process of underwater disease detection, CIoU is difficult to handle situations where the aspect ratio of target diseases such as large-area peeling and cracks is large. In order to better meet the needs of underwater disease detection, the present invention uses the MPDIoU loss function in the detection model head network. MPDIoU reduces the loss by shortening the absolute distance between the two foot points, solving the problem that the existing CIoU loss function cannot effectively optimize the predicted box and the real box with the same aspect ratio but different length and width values. This method has simple calculation steps, can adapt to detection targets of different sizes, and identify and detect cracks, peeling and other diseases with excessively large aspect ratio differences in complex underwater environments; in underwater environments where diseases are concentrated, a prediction box can be quickly formed and different diseases can be accurately selected, thereby improving the confidence of the bounding box, making the prediction box positioning accurate, and the prediction results accurate, reducing the situation of false detection due to incorrect prediction box position. The MPDIoU loss function is: ; In the above formula: h and w represent the height and width of the image respectively, d1 represents the distance between the upper left corner and the lower right corner of the predicted rectangular box, d2 represents the distance between the upper left corner and the lower right corner of the real rectangular box, (x1, y1) (x2, y2) represent the coordinates of the upper left corner and the lower right corner of the predicted rectangular box respectively, (x t 1, y t 1)(x t 2, y t 2) Represent the coordinates of the upper left corner and lower right corner of the real rectangular box respectively.
[0011] Step S3-3: Using transfer learning, apply the pre-trained weights of YOLOv7 in the COCO dataset to the intelligent detection model of underwater multi-category diseases in dams.
[0012] Step S3-4: Use Mosaic data enhancement on the dataset. The specific process is as follows: first, randomly extract four pictures and corresponding labels from the dataset each time; then randomly select splicing reference points, flip, scale and transform the color gamut of the four pictures respectively, and place them in the upper left, upper right, lower left and lower right positions of the reference points in turn, and splice them into a new combined image; finally, delete the detection box coordinates that exceed the boundary and generate labels for the combined image to increase data diversity and improve the robustness of the model.
[0013] Step S3-5: Perform structured pruning on the detection model, specifically including: first, during the model training process, set the L1 regularization parameter, perform sparse processing on the model parameters, and filter out unimportant parameters using the following formula: ; In the above formula:L CE is the cross entropy loss function; c is the feature scaling factor, where R(γ)=|γ| ; l is a hyperparameter, l The larger the filtering, the more parameters there are, and the closer the parameters in the BN layer will be to 0.
[0014] Then, the output of the convolution layer is normalized to ensure that the model can converge quickly and improve generalization ability. During the normalization process, the BN layer implements channel scaling, defines the scaling factor of each channel in the convolution layer, and performs sparse regularization on these scaling factors to determine unimportant channels and prune unimportant channels to complete the lightweight pruning of the model, reduce the number of parameters, and reduce the computing power requirements. The calculation method is as follows: ; In the above formula: Z in and Z out They are the input and output of the convolutional layer respectively; m d and s d are the mean and variance of the corresponding activated channels respectively; e is the offset parameter, used for numerical stability; β is the offset coefficient corresponding to the activated channel; c is the scaling factor, corresponding to the channel activation level. c When it becomes smaller, the corresponding activation function value will also become smaller; k i Indicates the first i samples; D represents the dictionary matrix; m i Represents a sparse vector.
[0015] An intelligent detection system for underwater multi-category dam diseases under weak computing power conditions, including: Data acquisition module: used to obtain videos of underwater structural defects of dams at the construction site and extract defect images frame by frame from the videos; Data labeling module: used to label each underwater dam disease image with the disease category and disease area information; Model building module: Based on the single-stage target detection algorithm YOLOv7, it integrates deformable convolution DConv and SE attention mechanism in the backbone network, uses MPDIoU loss function in the algorithm head network, and lightweights the model through sparse training and structured pruning strategy; Model training and testing module: used to use the optimized model to train and test on weak computing power devices to verify its detection accuracy and operating efficiency.
[0016] Further optimization, in the model building module, the implementation methods of the deformable convolution DConv, SE attention mechanism, MPDIoU loss function, Mosaic data enhancement method and structured pruning strategy are respectively consistent with the above methods.
[0017] For further optimization, the data acquisition module uses an underwater robot adapted to the underwater environment of the dam, equipped with a high-definition, waterproof, low-light camera, and transmits the collected video data to the data processing equipment via wired or wireless transmission.
[0018] For further optimization, the data annotation module installs and configures the visual annotation software Labelimg, and the annotators use the software to annotate the images and perform quality checks to ensure the accuracy and consistency of the annotations.
[0019] Compared with the prior art, the present invention has the following beneficial effects: 1. Improved detection accuracy: This paper is based on the single-stage target detection algorithm YOLOv7. It integrates deformable convolution Dconv and SE attention mechanism in its backbone network, gives more weight information to the defect features, enhances the model's ability to extract underwater defect features, and significantly improves the detection accuracy of defects such as cracks, exposed reinforcement, holes and spalling.
[0020] 2. Enhanced robustness: Through Mosaic data enhancement and MPDIoU loss function, the model's adaptability to complex underwater environments and the detection accuracy of disease targets with large aspect ratio differences are improved.
[0021] 3. Model lightweighting: Sparse training and structured pruning strategies are adopted to reduce the number of detection model parameters and the computing power requirements, so that it can run smoothly on devices with weak computing power.
[0022] 4. Strong practicality: This method can realize efficient and accurate disease detection in weak computing power detection equipment on the front line of engineering, meeting the needs of intelligent detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a method for intelligently detecting multiple types of underwater dam diseases under weak computing power conditions according to the present invention; Figure 2 It is the deformable volume DConv convolution feature extraction map of the present invention; Figure 3 Schematic diagram of the SE attention mechanism of the present invention; Figure 4This is an example diagram of the detection box matching of the MPDIoU loss function of the present invention; Figure 5 This is an example of a picture enhanced by Mosaic data in the present invention; Figure 6 This is a diagram of the pruning process of the intelligent detection model of the present invention; Figure 7 It is a schematic diagram of the intelligent detection model of multiple categories of underwater diseases of dams under the condition of weak computing power of the present invention; Figure 8 The figure is a comparison chart of the detection effects of the method of the present invention and the prior art on multiple categories of underwater diseases of dams. DETAILED DESCRIPTION
[0024] The specific implementation of the present invention is described below in conjunction with the accompanying drawings to facilitate the understanding of the present invention by those skilled in the art. Obviously, the present invention is not limited to the scope of the specific implementation. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are non-creative work, and all inventions and creations using the invention concept of this law are protected.
[0025] Example 1: Figure 1 As shown in the figure, an intelligent detection method for underwater multi-category dam diseases under weak computing power conditions is provided. The specific steps are as follows: Step S1: Obtain underwater structural disease videos of dams at the construction site, extract and filter disease images frame by frame from the underwater disease videos to construct a multi-category underwater dam disease dataset.
[0026] In this embodiment, the detection surface of the underwater structure of the dam is selected, and the underwater disease detection work is carried out using an underwater robot equipped with a high-definition camera. Considering the detection environment requirements of the underwater robot, the underwater detection platform generally adopts the full-process video recording mode for detection. The original sampling data is an avi format video with a sampling frame rate of 30 frames per second. The video stream is converted into JPG format image data by intercepting one picture every 5 frames to construct an underwater disease data set for hydraulic concrete structures, covering four types of underwater diseases: cracks, exposed reinforcement, holes and spalling, as well as the aggregation of multiple underwater diseases.
[0027] Step S2: Label each underwater disease image with information about the disease category and the diseased area, and divide the labeled data set into a training set, a validation set, and a test set in a ratio of 3:1:1.
[0028] In this embodiment, the underwater disease image is annotated using the visual annotation software Labelimg to distinguish the underwater disease unit from the background unit. The position of the underwater disease area in the image is determined by the annotated rectangular frame, wherein the generated xml file includes the underwater disease category, the coordinates of the center point of the rectangular frame, and the length and width information of the rectangular frame, so as to check the correctness of the annotation information. In order to facilitate the subsequent target detection model training, the generated xml file needs to be normalized, converted into the YOLO label format and saved as a txt file.
[0029] Step S3: Based on the single-stage target detection algorithm YOLOv7, a multi-category intelligent detection model for underwater dam diseases under weak computing power conditions is constructed. During the training phase, Mosaic data enhancement is used on the data set, and structured pruning is performed on the detection model to reduce the number of parameters and running computing power requirements, and a pre-trained multi-category intelligent detection model for underwater dam diseases under weak computing power conditions is obtained, such as Figure 7 shown.
[0030] The specific process of building an intelligent detection model for underwater multi-category dam diseases under weak computing power conditions includes: Step S3-1: Integrate the deformable convolution DConv and SE attention mechanism in the YOLOv7 backbone network. Figure 2 As shown in the figure, the deformable convolution kernel can approximately imitate the shape and size of the exposed steel bar disease in the feature map, and the obtained feature points more accurately express the characteristics of irregular small target diseases and eliminate the interference of the background. Figure 3 In the example, the original image X is convolved to obtain the feature map U, and then squeezed (F sq ) and incentive (F ex ) step to give multiple weights to the defects in the image and generate a new feature map, so that the model focuses on the underwater defect features, enhances the model's ability to resist interference from complex underwater backgrounds, and enhances its ability to extract irregular small target defect features such as exposed tendons and holes. The calculation method of the deformable convolution DConv and SE attention mechanism is: ; Where: x and y are the relative positions of the convolution kernel and the feature map, w() represents the vector weight, P n and P0 is the position vector, ΔP n is the direction vector, is the new feature map, F scale Indicates the operation process, u c represents the original feature map, s c Represents the channel weight.
[0031] Step S3-2: The bounding box loss function of YOLOv7 is CIoU, and the definition of the aspect ratio used is a relative value, not an absolute value. Therefore, in the process of underwater disease detection, CIoU has difficulty in handling situations where the aspect ratios of target diseases are greatly different, such as large-scale spalling and cracks. In order to better meet the needs of underwater disease detection, the MPDIoU loss function is used in the model head network. MPDIoU reduces the loss by shortening the absolute distance between the two foot points, solving the problem that the existing CIoU loss function cannot effectively optimize the predicted box and the real box with the same aspect ratio but different length and width values. An example is shown below. Figure 4 As shown in the figure, the red true frame accurately contains the crack disease, while the yellow predicted frame has a slight deviation. By calculating and reducing the distance between the foot points of the two frames, the predicted frame and the true frame are overlapped, thereby improving the prediction accuracy.
[0032] This method has simple calculation steps and can adapt to detection targets of different sizes. It can identify and detect cracks, peeling and other defects with large aspect ratio differences in complex underwater environments. In underwater environments where defects are concentrated, it can quickly form a prediction frame and accurately select different defects, improve the confidence of the bounding box, make the prediction frame positioning accurate, and reduce the situation of false detection due to incorrect prediction frame position. The calculation method is: ; Where: h and w represent the height and width of the image, d1 and d2 represent the distance between the upper left corner and lower right corner of the predicted box and the real box, (x1, y1) (x2, y2) represent the upper left corner and lower right corner of the predicted box, (x t 1, y t 1)(x t 2, y t 2) Represent the upper left corner and lower right corner of the real box respectively.
[0033] Step S3-3: Use transfer learning to apply the pre-trained weights of YOLOv7 in the COCO dataset to the underwater disease target detection model of hydraulic concrete structures.
[0034] Step S3-4: The specific process of the Mosaic data enhancement method is to first randomly extract four pictures and corresponding labels from the data set each time, then randomly select the splicing reference point, flip, scale and color gamut transform the four pictures respectively, and then place them in the upper left, upper right, lower left and lower right positions of the reference point in turn, splice them into a new combined picture, and finally process the coordinates of the detection box that exceeds the boundary, generate the label of the combined picture, so as to increase the diversity of the data and improve the robustness of the model. The picture example after Mosaic data enhancement is as follows: Figure 5 As shown, the combination of the four pictures accurately identified four types of defects: cracks, exposed reinforcement, holes, and spalling, without any misdetection or omission.
[0035] Step S3-5: The structured pruning method uses L1 regularization to sparse the model parameters and filter out unimportant parameters. The calculation method is as follows: ; Where: L CE is the cross entropy loss function; c is the feature scaling factor, where R(γ)=|γ| ; l is a hyperparameter, l The larger the filtering, the more parameters there are, and the closer the parameters in the BN layer will be to 0.
[0036] The output of the convolutional layer is then normalized to ensure that the model can converge quickly and improve generalization capabilities. During the normalization process, the BN layer implements channel scaling, defines the scaling factor of each channel in the convolutional layer, and performs sparse regularization on these scaling factors to determine unimportant channels and prune unimportant channels to complete lightweight pruning of the model, reduce the number of parameters, and reduce the computing power requirements. Figure 6 As shown, the scaling factor of each channel is calculated, the smaller part of the coefficient is subtracted, and the larger part of the coefficient is left to participate in the convolution process. The calculation method is as follows: ; Where: Z in and Z out are input and output respectively; m d and s d are the mean and variance of the corresponding activated channels respectively; e is the offset parameter, used for numerical stability; β is the offset coefficient corresponding to the activated channel, c is the scaling factor, corresponding to the channel activation level. c When it becomes smaller, the corresponding activation function value will also become smaller. x i Indicates the first i samples; D represents the dictionary matrix; m i Represents a sparse vector.
[0037] Step S4: Reacquire a portion of unlabeled underwater dam structure disease images, and use the dam underwater multi-category disease intelligent detection model under weak computing power conditions obtained in S3 to perform detection to obtain underwater disease type information.
[0038] Ablation experiment: For four common underwater diseases, namely cracks, exposed reinforcement, holes and spalling, as well as the aggregation of multiple underwater diseases, Faster R-CNN, YOLOv3, YOLOv4, YOLOv5 and YOLOv7 are used as benchmark methods to verify that the method of the present invention has strong detection and recognition capabilities and robustness in detecting multiple categories of underwater disease targets. The specific detection effect comparison is shown in the figure below. Figure 8 shown.
[0039] An ablation experiment was conducted on the detection ability of the model after training. The accuracy (P), recall (R), average precision (AP), harmonic mean of precision and recall (F1), and mean average precision with an intersection-over-union ratio of 0.5 (mAP0.5) were used as evaluation indicators of model detection accuracy. The amount of floating-point computation (GFLOPs) and the amount of parameters (Params) were used as lightweight evaluation indicators for model detection. The results are shown in Table 1.
[0040] Table 1 Ablation experiment results
[0041] As can be seen from Table 1, the original YOLOv7 algorithm has an average accuracy of more than 90% for crack and spalling diseases, but the average accuracy for exposed rebar and hole diseases is low, with the F1 value of the four types of disease detection being only 80.5% and the mAP0.5 value being only 87.72%. After the fusion of the deformable convolution Dconv, the model can make the convolution kernel close to the shape and size of the feature map according to the characteristics of the disease, thereby improving the recognition ability of irregular small target diseases. Therefore, the AP of the model for exposed rebar and hole disease detection is increased to more than 80%, and the F1 value and mAP0.5 value of the four types of disease detection are increased to 86.75% and 90.78% respectively. Adding SE attention mechanism on the basis of Dconv fusion can give more weight to the disease information during convolution, and improve the ability and accuracy of disease feature extraction and recognition as a whole. The AP of the model for the detection of four types of diseases has been improved, among which cracks and spalling diseases have reached more than 95%, hole diseases have been significantly improved to 96.09%, exposed steel bar diseases are close to 84%, and the F1 value and mAP0.5 value of the four types of disease detection have reached 88% and 93.84% respectively. Finally, the loss function is replaced with MPDIoU loss function to improve the matching degree between the model prediction frame and the real frame, and the overall recognition and detection ability of underwater diseases with large aspect ratio differences is improved. The model has an AP of 90.84% for exposed steel bar disease detection, and the AP of the other three types of diseases has also reached more than 95%. The F1 value and mAP of the four types of disease detection have reached 90.75% and 96.02% respectively. Compared with the original YOLOv7 algorithm, the model described in the present invention has improved detection AP for various diseases, among which exposed rebar disease is improved by 18.73%, and hole disease is improved by 11.94%, which is the most obvious; the F1 value of the four types of disease detection is improved by 10.25%, the mAP value is improved by 8.30%, and the floating-point calculation amount and parameter amount are reduced by 0.04G and 0.02M respectively. Overall, the detection capability of the model is significantly improved.
[0042] Embodiment 2: An intelligent detection system for multiple types of underwater dam diseases under weak computing power conditions, comprising: Data acquisition module: used to obtain videos of underwater structural defects of dams at the construction site and extract defect images frame by frame from the videos; Data annotation module: used to annotate each underwater disease image with information about the disease category and disease area; Model building module: Based on the single-stage target detection algorithm YOLOv7, it integrates deformable convolution DConv and SE attention mechanism in the backbone network, uses MPDIoU loss function in the algorithm head network, and lightweights the model through sparse training and structured pruning strategy; Model training and testing module: Use the optimized model to train and test on weak computing power devices to verify its detection accuracy and operating efficiency.
[0043] In the model building module, the implementation methods of the deformable convolution DConv, SE attention mechanism, MPDIoU loss function, Mosaic data enhancement method and structured pruning strategy are respectively consistent with the methods described in Example 1.
[0044] The data acquisition module uses an underwater robot adapted to the underwater environment of the dam, equipped with a high-definition, waterproof, low-light camera, and transmits the collected video data to the data processing equipment through wired or wireless transmission.
[0045] The data annotation module installs and configures the visual annotation software Labelimg, and the annotators use the software to annotate the images and perform quality checks to ensure the accuracy and consistency of the annotations.
[0046] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0047] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in this field.
Claims
1. An intelligent detection method for multiple categories of underwater dam diseases under weak computing power conditions, characterized in that: The following steps are involved: Step S1: Data collection: Obtain underwater structural disease videos of dams at the project site, extract and filter disease images frame by frame from the underwater disease videos, and use all filtered images to form a multi-category underwater dam disease dataset; Step S2: Data labeling: label each underwater dam disease image with the disease category and disease area information, and divide the labeled data set into a training set, a validation set, and a test set in a ratio of 3:1:1; Step S3: Model construction: Based on the single-stage target detection algorithm YOLOv7, an intelligent detection model for underwater multi-category dam diseases under weak computing power conditions is constructed. The deformable convolution DConv and SE attention mechanism are integrated in the backbone network, and the MPDIoU loss function is used in the algorithm head network; the detection model is trained with the training set and the validation set respectively, and the recognition performance of the detection model is tested with the test set. During the training stage, the model is lightweighted through sparse training and structured pruning strategies to obtain a pre-trained intelligent detection model for underwater multi-category dam diseases under weak computing power conditions; Step S4: Intelligent detection: Re-collect unlabeled images of underwater dam structural defects, and use the intelligent detection model of multiple categories of underwater dam defects under weak computing power conditions obtained in step S3 to perform detection and obtain information on the types of underwater dam defects.
2. According to the method of intelligent detection of multiple categories of underwater dam diseases under weak computing power conditions in claim 1, it is characterized in that: In step S1, underwater dam information is collected using an underwater robot equipped with a high-definition camera. The original sampling data is an avi format video with a sampling frame rate of 30 frames per second. An underwater disease dataset of hydraulic concrete structures is constructed by capturing one picture every five frames.
3. The method for intelligent detection of multiple types of underwater diseases of hydraulic concrete structures according to claim 2 is characterized in that: In the data annotation process of step S2, the visual annotation software Labelimg is used to annotate each image in the data set to generate an xml file, and the position of the underwater disease area of the dam in the image is determined by the annotated rectangular frame; wherein the annotation information includes the category of the underwater disease of the dam, the coordinates of the center point of the rectangular frame, and the length and width of the rectangular frame, which is converted into the YOLO label format after normalization and saved as a txt file.
4. According to the method of intelligent detection of multiple categories of underwater dam diseases under weak computing power conditions as described in claim 3, it is characterized in that: The specific process of constructing the intelligent detection model for underwater multi-category dam diseases under weak computing power conditions in step S3 is as follows: Step S3-1: Integrate the deformable convolution DConv and SE attention mechanism in the YOLOv7 backbone network to make the model focus on the underwater disease characteristics of the dam, enhance the model's ability to resist the interference of complex underwater backgrounds and the ability to extract irregular small target disease characteristics. The calculation method is: ; ; Where: x and y are the relative positions of the convolution kernel and the feature map, R is a regular sampling grid, w() represents the vector weight, and P n and P0 is the position vector, ΔP n is the direction vector, is the new feature map, F scale Indicates the operation process, u c represents the original feature map, s c represents the channel weight; Step S3-2: Use the MPDIoU loss function in the detection model head network, specifically: ; In the above formula: h and w represent the height and width of the image respectively, d1 represents the distance between the upper left corner and the lower right corner of the predicted rectangle, d2 represents the distance between the upper left corner and the lower right corner of the real rectangle; (x1, y1) and (x2, y2) represent the coordinates of the upper left corner and the lower right corner of the predicted rectangle respectively; (x1, y1) and (x2, y2) represent the coordinates of the upper left corner and the lower right corner of the predicted rectangle respectively; (x t 1, y t 1) (x t 2, y t 2) Represent the coordinates of the upper left corner and lower right corner of the real rectangular box respectively; Step S3-3: Using transfer learning, apply the pre-trained weights of YOLOv7 in the COCO dataset to the dam underwater multi-category disease intelligent detection model; Step S3-4: Mosaic data enhancement is used on the dataset. The specific process is as follows: first, four pictures and corresponding labels are randomly extracted from the dataset each time; then, the splicing reference points are randomly selected, and the four pictures are flipped, scaled, and color gamut transformed respectively, and then placed at the upper left, upper right, lower left, and lower right positions of the reference points in turn to splice into a new combined image; finally, the detection box coordinates that exceed the boundary are deleted, and the labels of the combined image are generated to increase the diversity of the data and improve the robustness of the model; Step S3-5: Perform structured pruning on the detection model, specifically including: First, during the model training process, set the L1 regularization parameter to perform sparse processing on the model parameters and filter out unimportant parameters using the following formula: ; In the above formula: L CE is the cross entropy loss function; γ is the feature scaling factor, where R(γ)=|γ| ; λ is a hyperparameter, λ The larger the number of filtered parameters, the closer the parameters in the BN layer will be to 0; Then, the output of the convolution layer is normalized to ensure that the model can converge quickly and improve generalization ability. During the normalization process, the BN layer implements channel scaling, defines the scaling factor of each channel in the convolution layer, performs sparse regularization on the scaling factor to determine unimportant channels, and prunes unimportant channels to complete lightweight pruning of the model, reduce the number of parameters, and reduce the computing power requirements. The calculation method is as follows: ; In the above formula: Z in and Z out They are the input and output of the convolutional layer respectively; μ d and σ d are the mean and variance of the corresponding activated channels respectively; ε is the offset parameter, used for numerical stability; β is the offset coefficient corresponding to the activated channel; γ is the scaling factor, corresponding to the channel activation level. γ When it becomes smaller, the corresponding activation function value will also become smaller; k i Indicates the first i samples; D represents the dictionary matrix; μ i Represents a sparse vector.
5. An intelligent detection system for multiple types of underwater dam diseases under weak computing power conditions, characterized in that: include: Data acquisition module: used to obtain videos of underwater structural defects of dams at the construction site and extract defect images frame by frame from the videos; Data labeling module: used to label each underwater dam disease image with the disease category and disease area; Model building module: Based on the single-stage target detection algorithm YOLOv7, it integrates deformable convolution DConv and SE attention mechanism in the backbone network, uses MPDIoU loss function in the algorithm head network, and lightweights the model through sparse training and structured pruning strategy; Model training and testing module: Use the optimized model to train and test on weak computing power devices to verify its detection accuracy and operating efficiency.
6. The intelligent detection system for underwater multi-category dam diseases under weak computing power conditions according to claim 5 is characterized in that: In the model building module, the implementation methods of the deformable convolution DConv, SE attention mechanism, MPDIoU loss function, Mosaic data enhancement method and structured pruning strategy are respectively consistent with the method described in claim 4.
7. According to claim 6, the intelligent detection system for multiple types of underwater dam diseases under weak computing power conditions is characterized in that: The data acquisition module uses an underwater robot adapted to the underwater environment of the dam, equipped with a high-definition, waterproof, low-light camera, and transmits the collected video data to the data processing equipment through wired or wireless transmission.
8. The intelligent detection system for underwater multi-category dam diseases under weak computing power conditions according to claim 7 is characterized in that: The data annotation module installs and configures the visual annotation software Labelimg, and the annotators use the software to annotate the images and perform quality checks to ensure the accuracy and consistency of the annotations.
Citation Information
Patent Citations
Real-time detection method for hidden danger diseases of dam deepwater structure
CN117372854A
Complex scene fire detection method based on multi-feature extraction
CN117789105A
Unmanned aerial vehicle image target detection method based on separable convolution and re-parameterization
CN118135432A
Crop pest larva detection method based on YOLOv7-SV
CN119049024A
Cited By
Pavement disease intelligent sorting platform based on AI identification
CN120494432A
AI-based intelligent road defect sorting platform
CN120494432B