Road ponding recognition method, device and equipment and readable storage medium

By introducing the deformable convolution module and attention mechanism into the YOLOv8 model, combined with the HIoU loss function, low-cost, high-accuracy identification of road water accumulation is achieved, which solves the problem of high investment in the existing technology and improves the accuracy of identification. Reliability and accuracy.

CN118570649APending Publication Date: 2024-08-30GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD

Patent Information

Application Number
CN202410920224.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The investment cost of the existing road water accumulation identification method is high, and the sensors are easily damaged and need to be replaced from time to time, resulting in high costs.

Method used

Using the YOLOv8 model with a deformable convolution module added to the Backbone level and an attention mechanism CBAM added to the Neck level, the water accumulation recognition model is trained through the HIoU loss function, water accumulation is recognized on road pictures, and the detection frame regression loss is dynamically adjusted to improve recognition. Accuracy and reliability.

Benefits of technology

It reduces the cost of road water identification, improves the accuracy and reliability of identification, avoids missed detection of small targets, and obtains pictures through road monitoring without additional investment, which enhances the stability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570649A
    Figure CN118570649A
Patent Text Reader

Abstract

The invention discloses a road waterlogging identification method, device and equipment and a readable storage medium, the method can obtain a to-be-identified road picture and a waterlogging identification model, the waterlogging identification model is a YOLOv8 model with a deformable convolution module added in a Backbone level and a CBAM added in a Neck level, and the waterlogging identification model is a YOLOv8 model with the deformable convolution module added in the Backbone level and the YOLOv8 model added in the Neck level. The ponding recognition model is obtained by training a HIoU loss function for dynamically adjusting regression loss of a detection frame; and performing ponding identification on the road picture by using the ponding identification model, and evaluating whether the road picture indicates that the corresponding road has ponding. On the basis, accumulated water detection can be completed through recognition of the road picture, extra cost is not needed for obtaining the road picture, the CBAM and the deformable convolution module can improve the attention degree of a small target, missing detection is avoided, and the HIoU loss function improves the reliability of the accumulated water recognition model. Therefore, the reliability and accuracy of road ponding recognition are improved while the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and more specifically, to a method, device, equipment and readable storage medium for identifying road water accumulation. Background Art

[0002] In recent years, extreme weather has occurred frequently, and heavy rainfall has occurred from time to time. Heavy rainfall can easily lead to a large amount of water accumulation in low-lying roads and tunnels, which can easily lead to a series of adverse effects such as traffic congestion and vehicle accidents. In order to avoid adverse consequences, it is of great significance to identify and deal with road waterlogging in a timely manner.

[0003] In the prior art, attempts are made to analyze sensor signals in low-lying areas of the road to identify whether there is water on the road. However, since the sensors are installed beside the road, they are easily damaged by passing vehicles and need to be replaced from time to time, which is costly. Summary of the invention

[0004] In view of this, the present application provides a road waterlogging identification method, device, equipment and readable storage medium, which are used to solve the disadvantage of high investment cost in the existing road waterlogging identification method.

[0005] In order to achieve the above objectives, the proposed solution is as follows:

[0006] A method for identifying road waterlogging, comprising:

[0007] Obtain a road image to be identified and a waterlogging recognition model, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer, and the waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss;

[0008] The water accumulation recognition model is used to recognize water accumulation on the road image, and whether the road image indicates that water accumulation exists on the corresponding road is evaluated.

[0009] Optionally, the using the water accumulation recognition model to recognize water accumulation on the road image to evaluate whether the road image indicates that water accumulation exists on the road includes:

[0010] The Backbone layer including the deformable convolution module is used to extract features of regular objects and irregular objects in road images to obtain multiple feature information;

[0011] The Neck layer including the attention mechanism CBAM is used to adjust the channel weight and spatial weight of each feature information, and multiple feature information are fused to obtain fused features;

[0012] The waterlogging recognition model is used to determine whether the road image indicates that waterlogging exists on the corresponding road based on the fusion features, and when the road image indicates that waterlogging exists on the corresponding road, a target detection frame indicating the location of the waterlogging is marked in the road image.

[0013] Optionally, training the water accumulation recognition model includes:

[0014] Build the target YOLOv8 model with deformable convolution modules added to the Backbone layer and attention mechanism CBAM added to the Neck layer;

[0015] Acquire multiple training images, each training image consists of two types of images, one type of image is a road image marked with a corresponding waterlogging boundary box, and the other type of image is a road image without waterlogging;

[0016] For each training image, input the training image into the target YOLOv8 model to obtain a recognition result corresponding to the training image; using the HIoU loss function, based on the training image and the recognition result, calculate a loss value; based on the loss value, adjust the parameters of the target YOLOv8 model;

[0017] The final target YOLOv8 model is used as the water accumulation recognition model.

[0018] Optionally, the target YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer includes:

[0019] Build the YOLOv8 model;

[0020] Replace multiple C2f modules at the Backbone level of the YOLOv8 model with deformable convolution modules;

[0021] An attention mechanism CBAM is added after the upsampl module at the Neck level of the YOLOv8 model, and an attention mechanism CBAM is added after each C2f module of the downsampling structure and before the CBS module to form a target YOLOv8 model.

[0022] Optionally, when the training image corresponding to any recognition result is a road image annotated with a corresponding waterlogging boundary box, the recognition result further includes a corresponding training image with an added predicted waterlogging anchor box;

[0023] The expression of the HIoU loss function is as follows:

[0024]

[0025]

[0026]

[0027]

[0028]

[0029]

[0030] In the formula, is the loss value; is the attenuation parameter; is the area ratio parameter; The horizontal coordinate of the center point of the predicted water accumulation anchor frame; The ordinate of the center point of the predicted water accumulation anchor frame; To predict the width of the water anchor frame; To predict the height of the water anchor frame; is the horizontal coordinate of the center point of the water accumulation boundary box; is the ordinate of the center point of the water accumulation boundary box; is the width of the water boundary box; is the height of the water boundary box; To predict the width of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; To predict the height of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; , is the preset intermediate parameter; describes the consistency of aspect ratio; is the width of the minimum bounding box; is the height of the minimum bounding box.

[0031] Optionally, based on the loss value, adjusting parameters of the target YOLOv8 model includes:

[0032] Based on the loss value, the gradient descent method is used to adjust the parameters of the attention mechanism CBAM and the deformable convolution module of the target YOLOv8 model.

[0033] Optionally, the acquiring a plurality of training images includes:

[0034] Collect multiple images through web crawling techniques;

[0035] The format of each image is converted, and target images with accumulated water are screened from multiple images after the format conversion, and a bounding box of accumulated water is marked in each target image.

[0036] A road water accumulation identification device, comprising:

[0037] An acquisition module is used to acquire a road image to be identified and a waterlogging recognition model. The waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer. The waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss.

[0038] A utilization module is used to utilize the water accumulation recognition model to perform water accumulation recognition on the road image, and evaluate whether the road image indicates that water accumulation exists on the corresponding road.

[0039] A road water accumulation identification device, comprising a memory and a processor;

[0040] The memory is used to store programs;

[0041] The processor is used to execute the program to implement the various steps of the above-mentioned road water accumulation identification method.

[0042] A readable storage medium stores a computer program thereon, characterized in that when the computer program is executed by a processor, each step of the above-mentioned road water accumulation identification method is implemented.

[0043] It can be seen from the above technical solutions that the road waterlogging recognition method provided by the present application can use the waterlogging recognition model to recognize waterlogging on road images and evaluate whether the road images indicate that there is waterlogging on the corresponding road, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer. Based on this, the present application can complete waterlogging detection by recognizing road images, and the ease of obtaining road images is relatively low. For example, it can be obtained through road monitoring, and road monitoring is an inherent device of the road, and no additional investment cost is required, which further reduces the cost of road waterlogging recognition. At the same time, the waterlogging recognition model of the present application is added with a deformable convolution module and an attention mechanism, which can aggregate feature information, improve channel attention, improve the attention of small targets, avoid missing detection of small liquid surfaces of waterlogging, and further improve the reliability of road waterlogging detection. And the waterlogging recognition model is obtained by training the HIoU loss function used to dynamically adjust the regression loss of the detection frame, and can dynamically adjust the regression loss during the training process, improve the reliability of the waterlogging recognition model, and further improve the accuracy of road waterlogging recognition in the present application. It can be seen that the present application can further improve the reliability and accuracy of road waterlogging identification while reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0045] Figure 1 A flow chart of a method for identifying road waterlogging disclosed in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the structure of a water accumulation identification model provided in an embodiment of the present application;

[0047] Figure 3 This is a structural block diagram of a road water accumulation identification device disclosed in an embodiment of the present application;

[0048] Figure 4 This is a hardware structure block diagram of a road water accumulation identification device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] The present application can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or equipment, etc.

[0051] Next, combine Figure 1 The road waterlogging identification method of the present application is introduced in detail, including the following steps:

[0052] Step S1: Obtain a road image to be identified and a waterlogging identification model.

[0053] Specifically, the water accumulation recognition model can be a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer.

[0054] The deformable convolution module (DCN block) modifies the sampling results to achieve the effect of deforming the convolution kernel. represent To expand, the following formula shows the calculation process of deformable convolution:

[0055]

[0056] Deformable convolution is the result of convolution on the input feature map. A set of offsets (x, y) is learned through convolution at each pixel of the input feature map, and the same predicted offset is used on different channels of the same feature map.

[0057] The penultimate and third C2f modules at the Backbone level are replaced by deformable convolution modules. That is, the convolutions corresponding to the P3 and P4 detection layers at the Backbone level are replaced by deformable convolution modules to improve the focus on small and medium-sized objects.

[0058] The attention mechanism CBAM consists of two components; the first component is the channel structure, and the second component is the spatial structure, which serially constitute the attention mechanism CBAM.

[0059] The attention mechanism uses the maximum pooling operation and the average pooling operation to aggregate spatial information for the input feature map, and outputs two C-dimensional pooled feature maps, Favg and Fmax. Favg and Fmax are input into the multilayer perceptron ML containing the hidden layer to obtain two channel attention maps with parameters of 1×1×C. In order to reduce the number of parameters, the hidden layer neurons need to compress the input information, and the number of neurons is C / r, where r is called the compression ratio. Adding the output of the previous step, we can get the channel attention map Mc.

[0060] Mc is expressed by the following formula:

[0061]

[0062] The spatial attention module first performs average pooling and maximum pooling operations on F′ according to the channel dimension, outputs two feature maps Favg and Fmax, and the output parameters are 1×H×W. The two feature maps are concatenated in the channel dimension to obtain the concatenated spatial feature map. For the concatenated feature map, a convolutional layer with a size of 7x7 is used to further generate the spatial attention map Ms.

[0063] Ms is expressed by the following formula:

[0064]

[0065] An attention mechanism CBAM is added after the upsample structure of the PAN-FPN upsampling stage at the Neck level.

[0066] In the Neck-level PAN-FPN downsampling stage, an attention mechanism CBAM is added before the convolution of the CBS module after each C2f module. That is, feature attention enhancement operation is performed before feature fusion. The model can pay more attention to small target information, enhance the focus on the target, and improve the recognition accuracy of small targets.

[0067] The water accumulation recognition model is trained using the HIoU loss function which is used to dynamically adjust the detection box regression loss.

[0068] Road images can be obtained in a variety of ways. For example, they can be captured from road surveillance videos or collected by drones.

[0069] Step S2: using the water accumulation recognition model to recognize water accumulation on the road image, and evaluating whether the road image indicates that water accumulation exists on the corresponding road.

[0070] Specifically, the road image can be input into the waterlogging recognition model to obtain the output result

[0071] Determine whether there is a target detection frame in the output result. If so, it indicates that there is water accumulation on the road corresponding to the road image; if not, it indicates that there is no water accumulation on the corresponding road.

[0072] It can be seen from the above technical solutions that the road waterlogging recognition method provided by the present application can use the waterlogging recognition model to recognize waterlogging on road images and evaluate whether the road images indicate that there is waterlogging on the corresponding road, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer. Based on this, the present application can complete waterlogging detection by recognizing road images, and the ease of obtaining road images is relatively low. For example, it can be obtained through road monitoring, and road monitoring is an inherent device of the road, and no additional investment cost is required, which further reduces the cost of road waterlogging recognition. At the same time, the waterlogging recognition model of the present application is added with a deformable convolution module and an attention mechanism, which can aggregate feature information, improve channel attention, improve the attention of small targets, avoid missing detection of small liquid surfaces of waterlogging, and further improve the reliability of road waterlogging detection. And the waterlogging recognition model is obtained by training the HIoU loss function used to dynamically adjust the regression loss of the detection frame, and can dynamically adjust the regression loss during the training process, improve the reliability of the waterlogging recognition model, and further improve the accuracy of road waterlogging recognition in the present application. It can be seen that the present application can further improve the reliability and accuracy of road waterlogging identification while reducing costs.

[0073] In some embodiments of the present application, a process of training a waterlogging recognition model is added, and the process will be described in detail below. The steps are as follows:

[0074] S10. Build the target YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer.

[0075] Specifically, a YOLOv8 model can be constructed, and a deformable convolution module can be added to the Backbone layer, and an attention mechanism CBAM can be added to the Neck layer to form a target YOLOv8 model.

[0076] S11. Acquire multiple training images, each training image consists of two types of images, one type of image is a road image marked with a corresponding waterlogging boundary box, and the other type of image is a road image without waterlogging.

[0077] Specifically, two types of training images may be obtained, one type of training images being road images annotated with corresponding waterlogging boundary boxes, and the other type of training images being real road images without waterlogging.

[0078] S12. For each training image, input the training image into the target YOLOv8 model to obtain a recognition result corresponding to the training image; use the HIoU loss function to calculate a loss value based on the training image and the recognition result; and adjust parameters of the target YOLOv8 model based on the loss value.

[0079] Specifically, each training image can be input into the target YOLOv8 model to obtain the corresponding recognition result.

[0080] The HIoU loss function can be used to calculate the loss value between each training image and its corresponding recognition result, and the parameters of the target YOLOv8 model can be adjusted based on the loss value.

[0081] Each recognition result includes evaluation information indicating whether there is water accumulation on the corresponding road. When the evaluation information indicates that there is water accumulation on the corresponding road, the corresponding recognition result also includes a corresponding training image marked with a predicted water accumulation anchor frame.

[0082] S13. Use the final target YOLOv8 model as a water accumulation recognition model.

[0083] Specifically, after the loss value is less than a preset loss threshold, the training can be stopped, and the trained target YOLOv8 model can be used as a water accumulation recognition model.

[0084] It can be seen from the above technical solution that, compared with the previous embodiment, this embodiment provides an optional method for training a waterlogging recognition model. The waterlogging recognition model can be better trained through the above method, thereby improving the practicality of the present application.

[0085] In some embodiments of the present application, the process of step S10, constructing a target YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer is described in detail, and the steps are as follows:

[0086] S100. Build a YOLOv8 model.

[0087] Specifically, an open source YOLOv8 model can be built.

[0088] S101. Replace multiple C2f modules at the Backbone level of the YOLOv8 model with deformable convolution modules.

[0089] Specifically, the penultimate and third C2f modules of the Backbone layer of the YOLOv8 model can be replaced with deformable convolution modules.

[0090] S102, adding an attention mechanism CBAM after the upsample module at the Neck level of the YOLOv8 model, and adding an attention mechanism CBAM after each C2f module of the downsampling structure and before the CBS module to form a target YOLOv8 model.

[0091] Specifically, the attention mechanism CBAM can be added after the nearest neighbor interpolation upsample structure in the PAN-FPN upsampling stage of the Neck layer of the YOLOv8 model, and the attention mechanism CBAM can be added before the convolution of the CBS module after each C2f module in the PAN-FPN downsampling stage, such as Figure 2 shown.

[0092] It can be seen from the above technical solution that this embodiment provides an optional method for constructing a target YOLOv8 model. Through the above method, the attention mechanism CBAM and the deformable convolution module can be added to the YOLOv8 model, which further improves the attention of the water accumulation recognition model to small and medium-sized targets and further avoids missed detection of water accumulation.

[0093] Furthermore, the expression of the HIoU loss function is as follows:

[0094] The predicted water anchor frame is B = [ x y w h ] , the water boundary box is B gt = [ x gt y gt w gt h gt ]

[0095]

[0096]

[0097]

[0098]

[0099]

[0100]

[0101] In the formula, is the loss value; is the attenuation parameter; is the area ratio parameter; The horizontal coordinate of the center point of the predicted water accumulation anchor frame; The ordinate of the center point of the predicted water accumulation anchor frame; To predict the width of the water anchor frame; To predict the height of the water anchor frame; is the horizontal coordinate of the center point of the water accumulation boundary box; is the ordinate of the center point of the water accumulation boundary box; is the width of the water boundary box; is the height of the water boundary box; To predict the width of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; To predict the height of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; , is the preset intermediate parameter; describes the consistency of aspect ratio; is the width of the minimum bounding box; is the height of the minimum bounding box.

[0102] In the early stage of training, the IoU between the predicted water accumulation anchor box and the water accumulation bounding box is relatively small. At this time, the target YOLOv8 model should focus on improving the IoU between the predicted water accumulation anchor box and the water accumulation bounding box for the candidate box regression. In It can amplify the penalty for smaller IoU.

[0103] In the late stage of training, the predicted water accumulation anchor box and the water accumulation boundary box have a large IoU overlap. At this time, the first item of the HIoU loss is In It decays to a smaller value. At this time, the target YOLOv8 model will automatically focus the regression of the predicted water accumulation anchor box on the center point and the regression of the aspect ratio, so that the predicted water accumulation anchor box can be further regressed to the water accumulation boundary box, improving the model performance.

[0104] It can be seen from the above expression that the HIoU loss function can dynamically adjust the regression loss of the detection box while weakening the penalty of geometric metrics such as distance and aspect ratio, improving the consideration of multiple factors such as IoU, position, size, shape, etc. between the annotation box in the recognition result and the annotation box of the training image, thereby further improving the accuracy of target detection.

[0105] In some embodiments of the present application, the process of obtaining multiple training images in step S11 is described in detail, and the steps are as follows:

[0106] S110, collecting multiple images through network crawling technology.

[0107] Specifically, multiple road-related images can be collected from public data sets of road waterlogging through web crawler technology and capture technology.

[0108] S111 , performing format conversion on each image, screening target images with accumulated water from the multiple images after format conversion, and marking a bounding box of accumulated water in each target image.

[0109] Specifically, each image may be converted into a unified format, and target images related to road waterlogging may be screened from each image after the format conversion.

[0110] The target detection dataset annotation tool LabelImg is used to annotate the water accumulation bounding box of the target image.

[0111] It can be seen from the above technical solution that this embodiment provides an optional method for constructing multiple training images. Through the above method, the acquisition of training images can be better completed and the accuracy of the water accumulation recognition model can be improved.

[0112] In some embodiments of the present application, the process of adjusting the parameters of the target YOLOv8 model based on the loss value in S12 is described in detail, and the steps are as follows:

[0113] S120. Based on the loss value, a gradient descent method is used to adjust parameters of the attention mechanism CBAM and the deformable convolution module of the target YOLOv8 model.

[0114] Specifically, the gradient descent method can be used to refer to the loss value to adjust the parameters of the target YOLOv8 model by adding a Backbone layer with a deformable convolution module and a Neck layer with an attention mechanism CBAM.

[0115] It can be seen from the above technical solution that this embodiment provides an optional method for parameter adjustment. Through the above method, the gradient descent method can be used to adjust the parameters, further improving the accuracy of the parameter adjustment.

[0116] In some embodiments of the present application, step S2, using the water accumulation recognition model to identify water accumulation on the road image, and evaluating whether the road image indicates that there is water accumulation on the corresponding road, is described in detail, and the steps are as follows:

[0117] S20, using the Backbone layer including the deformable convolution module to extract features of regular objects and irregular objects in the road image to obtain multiple feature information.

[0118] Specifically, the input layer of the water accumulation recognition model can be used to adaptively calculate anchor frames and adaptively scale images. The Backbone layer including the deformable convolution module can be used to extract features of irregular-shaped objects and regular-shaped objects in the scaled road image, and multiple feature information can be obtained after extraction.

[0119] S21. Use the Neck layer including the attention mechanism CBAM to adjust the channel weight and spatial weight of each feature information, perform feature fusion on multiple feature information, and obtain fused features.

[0120] Specifically, the Neck layer including the attention mechanism CBAM is used to adaptively select and adjust the channel weights and spatial weights of feature information, capture and represent important features in the image, and perform feature fusion on multiple feature information to obtain fused features.

[0121] S22. Using the water accumulation recognition model based on the fusion features, determine whether the road image indicates that water accumulation exists on the corresponding road, and if the road image indicates that water accumulation exists on the corresponding road, mark a target detection frame indicating the location of the water accumulation in the road image.

[0122] Specifically, the Head level of the water accumulation recognition model is used to determine whether the road image indicates that water accumulation exists on the corresponding road based on the fusion features, and when the road image indicates that water accumulation exists on the corresponding road, a target detection box indicating the location of the water accumulation is marked in the road image.

[0123] It can be seen from the above technical solution that this embodiment provides an optional method for evaluating whether the road image indicates that there is water accumulation on the corresponding road. Through the above method, the Backbone layer including the deformable convolution module and the Neck layer including the attention mechanism CBAM can be used to improve the adaptability of the water accumulation recognition model to irregularly shaped target objects, expand its receptive field, and increase the attention of the water accumulation recognition model to small and medium-sized targets, thereby further improving the recognition accuracy of this application.

[0124] Next, we will combine Figure 3The road water accumulation identification device provided in the present application is introduced in detail. The road water accumulation identification device provided below can be compared with the road water accumulation identification method provided above.

[0125] See also Figure 3 It can be found that the road water accumulation identification device may include:

[0126] An acquisition module 10 is used to acquire a road image to be identified and a waterlogging recognition model, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer, and the waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss;

[0127] The utilizing module 20 is configured to utilize the water accumulation recognition model to perform water accumulation recognition on the road image, and evaluate whether the road image indicates that water accumulation exists on the corresponding road.

[0128] Further, the utilization module may include:

[0129] A feature information acquisition unit, used to extract features of regular objects and irregular objects in the road image using the Backbone layer including the deformable convolution module to obtain multiple feature information;

[0130] The feature fusion unit is used to adjust the channel weight and spatial weight of each feature information by using the Neck level including the attention mechanism CBAM, and fuse multiple feature information to obtain fused features;

[0131] The water accumulation judgment unit is used to use the water accumulation recognition model to judge whether the road image indicates that there is water accumulation on the corresponding road based on the fusion feature, and when the road image indicates that there is water accumulation on the corresponding road, mark the target detection frame indicating the location of the water accumulation in the road image.

[0132] Furthermore, the road water accumulation identification device may also include:

[0133] The target model building module is used to build the target YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer;

[0134] A training image acquisition module is used to acquire multiple training images, each training image is composed of two types of images, one type of image is a road image marked with a corresponding waterlogging boundary box, and the other type of image is a road image without waterlogging;

[0135] A parameter adjustment module is used for inputting each training image into a target YOLOv8 model to obtain a recognition result corresponding to the training image; using the HIoU loss function, based on the training image and the recognition result, calculating a loss value; and adjusting parameters of the target YOLOv8 model based on the loss value;

[0136] The model acquisition module is used to use the final target YOLOv8 model as a water accumulation recognition model.

[0137] Furthermore, the target model building module may include:

[0138] YOLOv8 model building unit, used to build the YOLOv8 model;

[0139] A convolution module replacement unit, used to replace multiple C2f modules at the Backbone level of the YOLOv8 model with deformable convolution modules;

[0140] The attention mechanism adding unit is used to add the attention mechanism CBAM after the upsampl module of the Neck layer of the YOLOv8 model, and to add the attention mechanism CBAM after each C2f module of the downsampling structure and before the CBS module to form a target YOLOv8 model.

[0141] Among them, the expression of HIoU loss function is as follows:

[0142] The predicted water anchor frame is B = [ x y w h ] , the water boundary box is B gt = [ x gt y gt w gt h gt ]

[0143]

[0144]

[0145]

[0146]

[0147]

[0148]

[0149] In the formula, is the loss value; is the attenuation parameter; is the area ratio parameter; The horizontal coordinate of the center point of the predicted water accumulation anchor frame; The ordinate of the center point of the predicted water accumulation anchor frame; To predict the width of the water anchor frame; To predict the height of the water anchor frame; is the horizontal coordinate of the center point of the water accumulation boundary box; is the ordinate of the center point of the water accumulation boundary box; is the width of the water boundary box; is the height of the water boundary box; To predict the width of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; To predict the height of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; , is the preset intermediate parameter; describes the consistency of aspect ratio; is the width of the minimum bounding box; is the height of the minimum bounding box.

[0150] Furthermore, the parameter adjustment module may include:

[0151] The loss value utilization unit is used to adjust parameters of the attention mechanism CBAM and the deformable convolution module of the target YOLOv8 model based on the loss value by using a gradient descent method.

[0152] Further, the training image acquisition module may include:

[0153] An image collection unit, used for collecting a plurality of images by using a web crawling technique;

[0154] The format conversion unit is used to convert the format of each image, select target images with accumulated water from the multiple images after the format conversion, and mark the bounding box of accumulated water in each target image.

[0155] The road water accumulation identification device provided in the embodiment of the present application can be applied to road water accumulation identification equipment, such as PC terminals, cloud platforms, servers and server clusters. Figure 4 The hardware structure diagram of the device is shown in Figure 4 , the hardware structure of the device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0156] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0157] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0158] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;

[0159] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0160] Obtain a road image to be identified and a waterlogging recognition model, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer, and the waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss;

[0161] The water accumulation recognition model is used to recognize water accumulation on the road image, and whether the road image indicates that water accumulation exists on the corresponding road is evaluated.

[0162] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0163] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0164] Obtain a road image to be identified and a waterlogging recognition model, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer, and the waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss;

[0165] The water accumulation recognition model is used to recognize water accumulation on the road image, and whether the road image indicates that water accumulation exists on the corresponding road is evaluated.

[0166] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0167] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0168] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0169] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments of the present application can be combined with each other. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for identifying road waterlogging, characterized in that: include: Obtain a road image to be identified and a waterlogging recognition model, wherein the waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer, and the waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss; The water accumulation recognition model is used to recognize water accumulation on the road image, and whether the road image indicates that water accumulation exists on the corresponding road is evaluated.

2. The method for identifying road waterlogging according to claim 1, characterized in that: The step of using the water accumulation recognition model to recognize water accumulation on the road image and evaluating whether the road image indicates that water accumulation exists on the road includes: The Backbone layer including the deformable convolution module is used to extract features of regular objects and irregular objects in road images to obtain multiple feature information; The Neck layer including the attention mechanism CBAM is used to adjust the channel weight and spatial weight of each feature information, and multiple feature information are fused to obtain fused features; The waterlogging recognition model is used to determine whether the road image indicates that waterlogging exists on the corresponding road based on the fusion features, and when the road image indicates that waterlogging exists on the corresponding road, a target detection frame indicating the location of the waterlogging is marked in the road image.

3. The method for identifying road waterlogging according to claim 1, characterized in that: Training the water accumulation recognition model includes: Build the target YOLOv8 model with deformable convolution modules added to the Backbone layer and attention mechanism CBAM added to the Neck layer; Acquire multiple training images, each training image consists of two types of images, one type of image is a road image marked with a corresponding waterlogging boundary box, and the other type of image is a road image without waterlogging; For each training image, input the training image into the target YOLOv8 model to obtain a recognition result corresponding to the training image; using the HIoU loss function, based on the training image and the recognition result, calculate a loss value; based on the loss value, adjust the parameters of the target YOLOv8 model; The final target YOLOv8 model is used as the water accumulation recognition model.

4. The method for identifying road waterlogging according to claim 3, characterized in that: The target YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer includes: Build the YOLOv8 model; Replace multiple C2f modules at the Backbone level of the YOLOv8 model with deformable convolution modules; An attention mechanism CBAM is added after the upsampl module at the Neck level of the YOLOv8 model, and an attention mechanism CBAM is added after each C2f module of the downsampling structure and before the CBS module to form a target YOLOv8 model.

5. The method for identifying road waterlogging according to claim 3, characterized in that: When the training image corresponding to any recognition result is a road image annotated with a corresponding waterlogging boundary box, the recognition result also includes a corresponding training image with an added predicted waterlogging anchor box; The expression of the HIoU loss function is as follows: In the formula, is the loss value; is the attenuation parameter; is the area ratio parameter; The horizontal coordinate of the center point of the predicted water accumulation anchor frame; The ordinate of the center point of the predicted water accumulation anchor frame; To predict the width of the water anchor frame; To predict the height of the water anchor frame; is the horizontal coordinate of the center point of the water accumulation boundary box; is the ordinate of the center point of the water accumulation boundary box; is the width of the water boundary box; is the height of the water boundary box; To predict the width of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; To predict the height of the intersection rectangle between the water accumulation anchor box and the water accumulation bounding box; , is the preset intermediate parameter; describes the consistency of aspect ratio; is the width of the minimum bounding box; is the height of the minimum bounding box.

6. The method for identifying road waterlogging according to claim 3, characterized in that: Based on the loss value, the target YOLOv8 model is parameter adjusted, including: Based on the loss value, the gradient descent method is used to adjust the parameters of the attention mechanism CBAM and the deformable convolution module of the target YOLOv8 model.

7. The method for identifying road waterlogging according to claim 3, characterized in that: The acquiring of a plurality of training images comprises: Collect multiple images through web crawling techniques; The format of each image is converted, and target images with accumulated water are screened from multiple images after the format conversion, and a bounding box of accumulated water is marked in each target image.

8. A road water accumulation identification device, characterized in that: include: An acquisition module is used to acquire a road image to be identified and a waterlogging recognition model. The waterlogging recognition model is a YOLOv8 model with a deformable convolution module added to the Backbone layer and an attention mechanism CBAM added to the Neck layer. The waterlogging recognition model is trained by a HIoU loss function for dynamically adjusting the detection box regression loss. A utilization module is used to utilize the water accumulation recognition model to perform water accumulation recognition on the road image, and evaluate whether the road image indicates that water accumulation exists on the corresponding road.

9. A road waterlogging identification device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the road water accumulation identification method as described in any one of claims 1-7.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the road water accumulation identification method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Road ponding recognition method and system, terminal and storage medium

    CN116740577A

  • Power grid switching operation violation identification method and device

    CN117935361A

  • Marine ship identification method based on deep learning

    CN118053102A

  • Skin detection method and device, electronic equipment and storage medium

    CN118247825A

  • High body seriola quinqueradiata detection method based on YOLOv8 network structure

    CN118279935A

Cited By

  • Financial statement automatic processing method based on statistical analysis and image recognition

    CN119622064A

  • Automated Processing Method for Financial Statements Based on Statistical Analysis and Image Recognition

    CN119622064B

  • Residential area road ponding early warning method and system

    CN120579011A