Slope apparent disease detection method based on enhanced multi-scale fusion
By using an enhanced multi-scale fusion method in the detection of apparent slope diseases, the YOLOv8 object detection algorithm is improved, and the problems of low detection accuracy, large calculation amount and low efficiency in the prior art are solved, and high-precision, high efficiency and real-time detection effects are achieved.
Patent Information
- Application Number
- CN202510165073.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art has problems such as low detection accuracy, large calculation amount, low efficiency, poor real-time and insufficient robustness in the detection of apparent slope diseases.
The slope apparent disease detection method based on enhanced multi-scale fusion is adopted, and the YOLOv8 object detection algorithm is improved. Multi-scale convolution modules and multi-branch convolution modules are embedded in the backbone network, and a weighted bidirectional feature pyramid network is integrated into the feature fusion network, and auxiliary detection heads are added to the detection head network, and bounding box regression loss function NWDLoss and classification loss function BCE Loss are used for training.
It improves the accuracy and efficiency of slope apparent disease detection, reduces the amount of calculation, and enhances the real-time and robustness of detection.
Smart Images

Figure CN120107187A_ABST
Abstract
Description
(I) Technical field:
[0001] The present invention relates to a method for detecting apparent diseases of slopes, and in particular to a method for detecting apparent diseases of slopes based on enhanced multi-scale fusion. (II) Background technology:
[0002] With the improvement of national infrastructure, highway construction has extended and radiated to mountainous areas. The slope engineering problems of highways, especially expressways, are very prominent. The slopes of expressways are steep, and high slopes are prone to geological disasters such as slope damage and collapse, landslides, etc., which block drainage ditches, cause casualties of vehicles and damage to expressways. Expressways urgently need to strengthen risk warning capabilities and have effective response plans.
[0003] The transportation industry also focuses on the intelligent management and maintenance of transportation infrastructure, increases the integrated development of new-generation information technology and highway infrastructure, promotes the digitalization of infrastructure, improves the highway network's early warning and prevention system, enhances highway disaster prevention, mitigation and resistance capabilities, and plays the role of highway transportation as the "lifeline."
[0004] At present, there are mainly the following methods for detecting apparent slope diseases. The first method mainly relies on geological surveys, regular inspections and simple physical measurement techniques. These traditional slope detection methods have limitations in the real-time, accuracy and monitoring range of data collection, and are inefficient. The second method is to use high-resolution images obtained by drones or satellite remote sensing, and identify terrain changes such as cracks, spalling, and settlement through digital image processing techniques such as grayscale co-occurrence matrix and texture analysis. This method is inefficient and time-consuming for detecting apparent slope diseases. The third method is edge detection such as the Canny operator and regional growth method such as Felzenszwalb segmentation, which extracts and classifies image features to distinguish between normal and diseased areas. The detection accuracy and efficiency of this type of method need to be improved. The fourth method is based on traditional machine learning support vector machine (SVM), random forest or deep neural network, which can be used as a supervised learning model. The training data set usually contains sample images of unhealthy slopes and their labels, which are used to predict the degree of disease in new images. The sizes of slope diseases vary significantly, the characteristics of diseases vary significantly, and the details and global features are not well balanced. Therefore, it is difficult for such methods to perform efficient and accurate detection of slope diseases. In addition, the slope image itself contains a lot of noise, light and dark changes, dust, vegetation occlusion, etc., which have a great impact on the detection results. (III) Summary of the invention:
[0005] The technical problem to be solved by the present invention is to provide a method for detecting apparent slope defects based on enhanced multi-scale fusion, which can realize the detection of apparent slope defects such as slope landslides, cracks, damages, and drainage channel blockages. It not only has high detection accuracy, but also reduces the amount of calculation, improves detection efficiency, and is more real-time and highly robust.
[0006] The technical solution of the present invention:
[0007] A slope apparent disease detection method based on enhanced multi-scale fusion includes the following steps:
[0008] Step 1: Collect and obtain images of apparent damage on slopes (such as high slopes on highways);
[0009] Next, the acquired image data of slope surface diseases are preprocessed to construct a complete slope surface disease dataset for training neural networks and for training deep learning models.
[0010] Step 2: Use data enhancement method to preprocess the acquired image data of slope surface diseases to form a more complete data set, which is conducive to improving the robustness and generalization ability of the model; data enhancement method includes flipping, translation, cropping and adding Gaussian noise;
[0011] Step 3: Use Labelimg software to annotate the image of slope apparent disease preprocessed in step 2, and mark the landslide area, crack area, damaged area and drainage channel blockage area respectively. For example, the landslide area is marked as 0, the crack area is marked as 1, the damaged area is marked as 2, and the drainage channel blockage area is marked as 3, thereby obtaining the slope apparent disease data set;
[0012] Step 4: randomly divide the slope apparent disease data set in step 3 into a training set and a test set according to a certain ratio, wherein the training set is used for training the model, and the test set is used for monitoring the performance of the model during the training process, optimizing hyperparameters, and avoiding overfitting;
[0013] Step 5: Design and construct an improved and optimized YOLOv8 target detection algorithm, use the YOLOv8 target detection algorithm as a slope apparent disease detection model, and initialize the hyperparameters of the slope apparent disease detection model; the YOLOv8 target detection algorithm contains a backbone network (Backbone), a feature fusion network (Neck) and a detection head network (Head). The optimization method of the YOLOv8 target detection algorithm is as follows:
[0014] Embed the multi-scale convolution (MSC) module, the multi-branch convolution module (RFB) and the cross attention mechanism SE in the backbone network;
[0015] The weighted bidirectional feature pyramid network (BiFPN) is integrated into the feature fusion network (Neck), and the high-level features with strong semantic information and the low-level features with rich detail information are fused by using top-down and bottom-up paths. The full combination of low-level features and high-level features can further enhance the model's ability to process multi-scale features and improve detection performance, especially in scenarios with large differences in target size (such as cracks, small depressions, and large-scale spalling and landslides in high slope surface disease detection). The Anchor-Free mechanism used by YOLOv8 can directly predict the center point and bounding box size of the target, reduce excessive calculations, and improve accuracy.
[0016] Three auxiliary detection heads (DetectAux) are added on the basis of the three main detection heads (Detect) in the detection head network (Head). The auxiliary detection heads and the main detection heads share the input feature extraction layer. The three main detection heads and the three auxiliary detection heads extract the features of six feature layers in parallel, which can greatly improve the detection performance. The auxiliary detection heads detect and fuse the up-sampled and down-sampled features to obtain different information of the same target, assisting the main detection head to better learn and identify the target, so that the main detection head has extremely powerful detection capabilities for complex targets. The auxiliary detection heads also help the network to better propagate gradients, accelerate training and prevent gradient disappearance.
[0017] Step 6, use the training set to train the slope apparent disease detection model. After each training, calculate the error loss value between the actual output of the slope apparent disease detection model and the target output; during the entire training process, if the performance index of the slope apparent disease detection model (such as the mean average precision mAP) meets the set requirements and remains stable or the error loss value continues to decrease and is less than the set threshold or the number of training times reaches the set maximum number, then stop the training, otherwise adjust the hyperparameters of the slope apparent disease detection model and continue the training; after stopping the training, save the network weight parameters at this time (for the detection and segmentation of slope apparent diseases);
[0018] Step 7: Input the test set into the slope apparent disease detection model, detect the slope apparent disease, and output the prediction result of the slope apparent disease.
[0019] Observe the prediction results of slope apparent diseases, use the target detection model performance evaluation parameters (such as mean average precision mAP, recall rate Recall or precision Precision) to evaluate whether the performance of the slope apparent disease detection model meets the requirements, save the slope apparent disease detection model structure and weight parameters that meet the requirements, and use them for intelligent detection and segmentation of slope apparent diseases.
[0020] In step 1, the slope surface diseases include landslides, cracks, damage and drainage channel blockage, and the image of the slope surface diseases is a high-resolution image.
[0021] In step 4, the slope apparent disease dataset in step 3 is randomly divided into a training set and a test set in a ratio of 4:1.
[0022] In step 5, the backbone network (Backbone) uses 5 standard convolutional layers to preliminarily extract low-level features, and uses 4 C2f (Cross Stage Partial Feature Fusion) modules integrated with multi-scale convolution (MSC) to increase the fusion of features at different scales and alleviate the problem of difficulty in distinguishing between background features and target features; a multi-branch convolution module (RFB, Receptive Field Block) is used and the cross-attention mechanism SE is integrated to replace the SPPF (Spatial Pyramid Pooling Fast) module of the YOLOv8 target detection algorithm to improve the receptive field of the slope surface disease detection model and increase its detection accuracy.
[0023] Redundant areas may be generated when extracting features. In order to remove the redundant areas, the DIoU-NMS (NonMaximum suppression) algorithm is used to improve and optimize the backbone network to accurately remove the redundant areas generated when extracting low-level features.
[0024] For the YOLOv8 target detection algorithm in step 5, bounding-box regression is used to obtain the bounding box parameters used for regression prediction of the target. The bounding box parameters are used to accurately describe the position and size of the target in the image. The classification branch module is used to classify the targets in each bounding box to determine the category to which the target belongs.
[0025] In step 5, the hyperparameters include learning rate, number of iterations, weight decay, and momentum.
[0026] The learning rate is mainly scheduled using cosine annealing.
[0027] In step 6, the training of the slope apparent disease detection model includes forward propagation and back propagation.
[0028] A complete iterative training includes a forward propagation and a back propagation. Each training extracts a fixed number of sample data from the training set and inputs them into the slope surface disease detection model. The fixed number of samples (Batch Size) is 32. The image to be detected is input into the model. The image to be detected first extracts features through the backbone network, then passes through the feature fusion network (BiFPN) for multi-scale feature fusion, and finally predicts the target bounding box position and target category through the detection head. The actual output of the slope surface disease detection model calculates the error value through the loss function. The loss function includes NWDLoss and BCE Loss, and the weighted sum of these errors constitutes the final loss. Through back propagation, an optimizer (such as SGD or AdamW) is used to update the weight parameters of the model according to the gradient, and the training is continuously iterated. The training process is usually based on a fixed number of training rounds (Epoch), and an early stopping mechanism (Early Stopping) can be set. By monitoring the changes in performance indicators (such as loss or mAP) on the test set, when the performance no longer improves or the loss no longer decreases, the training is terminated in advance to avoid overfitting.
[0029] In step 6, the bounding box regression loss function NWDLoss and the classification loss function BCE Loss (Binary Cross-Entropy Loss) are used to calculate the error between the predicted value and the true value in the training of the slope surface disease detection model, and the direction and amplitude of parameter update are guided by gradient calculation and optimizer (SGD or AdamW) to minimize the loss and thus optimize the model performance; the bounding box regression loss function NWDLoss is used instead of the original bounding box regression loss function CIoULoss, which has more advantages in measuring the similarity between the predicted box and the true box of smaller objects, and can improve the detection accuracy;
[0030] The bounding box regression loss function NWDLoss is calculated as follows:
[0031]
[0032] L NWD =1-NWD(N p ,N g )
[0033] Where N p Represents the Gaussian distribution formula of the prediction box, N g Represents the Gaussian distribution formula of the real box, cx p 、cy p 、w p 、h pRespectively represent the center coordinate x, center coordinate y, width, height, cx g 、cy g 、w g 、h g They represent the center coordinate x, center coordinate y, width, and height of the real box respectively, and e represents a constant determined by the average size of the target in the data set;
[0034] The classification loss function BCE Loss is calculated as follows:
[0035]
[0036] In the formula, y i,j represents the true label of the disease category, that is, the true label of the jth category in the i-th sample; p i,j Represents the category probability predicted by the model, that is, the predicted probability of the jth category in the i-th sample; M is the number of targets contained in the detection box; Z is the number of categories;
[0037] The optimizer uses Stochastic Gradient Descent (SGD).
[0038] Define the cost function C(ω,b),
[0039] The cost function C(ω,b) is calculated as:
[0040] Among them, ω, b are weight parameters, x represents the sample, y(x) is the actual output of the model input x, a is the target expected output of the model input x, and n is the total number of samples;
[0041] The update formula of the weight parameter is as follows:
[0042]
[0043] In the formula, η is the learning rate, C is the cost function, ω and b are the weight parameters of the slope apparent disease detection model, ω ′ 、b ′ is the updated weight parameter.
[0044] The learning rate η is scheduled using cosine annealing.
[0045] Beneficial effects of the present invention:
[0046] 1. The present invention optimizes the backbone network of the YOLOv8 target detection algorithm. The backbone network uses 5 standard convolution layers to preliminarily extract low-level features, and uses 4 C2f modules integrated with multi-scale convolutions to increase the fusion of features at different scales, thereby alleviating the problem of the difficulty in distinguishing between background features and target features. The multi-branch convolution module RFB is used and the cross-attention mechanism is integrated to replace the SPPF module of the YOLOv8 target detection algorithm, thereby improving the receptive field of the slope apparent disease detection model and increasing its detection accuracy.
[0047] 2. The present invention optimizes the feature fusion network of the YOLOv8 target detection algorithm, and integrates the weighted bidirectional feature pyramid into the feature fusion network, so that the high-level features with strong semantic information and the low-level features with rich detail information interact more fully, further enhancing the model's ability to process multi-scale features and improving detection performance; and YOLOv8 uses the Anchor-Free mechanism to directly predict the center point and bounding box size of the target, reducing excessive calculations, which not only improves the detection efficiency but also improves the calculation accuracy.
[0048] 3. The present invention optimizes the detection head network of the YOLOv8 target detection algorithm, and adds three auxiliary detection heads (DetectAux) on the basis of the three main detection heads (Detect) in the detection head network (Head). The auxiliary detection heads and the main detection head share the input feature extraction layer, and the features of 6 feature layers are extracted in parallel by three main detection heads and three auxiliary detection heads, which greatly improves the detection performance; the auxiliary detection heads detect and fuse the features of upsampling and downsampling to obtain different information of the same target, and assist the main detection head to better learn and identify targets, so that the main detection head has extremely powerful detection capabilities for complex targets.
[0049] 4. The present invention uses the bounding box regression loss function NWDLoss instead of the original bounding box regression loss function CIoULoss, which can improve the detection accuracy when measuring the similarity between the predicted box and the real box of a smaller object, and has more advantages. (IV) Description of the drawings:
[0050] Figure 1 This is the network structure diagram of the optimized YOLOv8 target detection algorithm. (V) Specific implementation methods:
[0051] The slope apparent disease detection method based on enhanced multi-scale fusion contains the following steps:
[0052] Step 1: Collect and obtain images of apparent damage on slopes (such as high slopes on highways);
[0053] Next, the acquired image data of slope surface diseases are preprocessed to construct a complete slope surface disease dataset 1 for training neural networks, which is used for training deep learning models.
[0054] Step 2: Use data enhancement method to preprocess the acquired image data of slope surface diseases to form a more complete data set, which is conducive to improving the robustness and generalization ability of the model; data enhancement method includes flipping, translation, cropping and adding Gaussian noise;
[0055] Step 3: Use Labelimg software to annotate the image of slope apparent disease preprocessed in step 2, and mark the landslide area, crack area, damaged area and drainage channel blockage area respectively. For example, the landslide area is marked as 0, the crack area is marked as 1, the damaged area is marked as 2, and the drainage channel blockage area is marked as 3, thereby obtaining the slope apparent disease data set 1;
[0056] Step 4: randomly divide the slope apparent disease data set 1 in step 3 into a training set and a test set according to a certain ratio, wherein the training set is used for training the model, and the test set is used for monitoring the performance of the model during the training process, optimizing hyperparameters, and avoiding overfitting;
[0057] Step 5: Design and build an improved and optimized YOLOv8 target detection algorithm ( Figure 1 As shown in the figure, the YOLOv8 target detection algorithm is used as the slope apparent disease detection model, and the hyperparameters of the slope apparent disease detection model are initialized; the YOLOv8 target detection algorithm contains a backbone network (Backbone), a feature fusion network (Neck) and a detection head network (Head). The optimization method of the YOLOv8 target detection algorithm is as follows:
[0058] Embed the multi-scale convolution (MSC) module, the multi-branch convolution module (RFB) and the cross attention mechanism SE in the backbone network;
[0059] The weighted bidirectional feature pyramid network (BiFPN) is integrated into the feature fusion network (Neck), and the high-level features with strong semantic information and the low-level features with rich detail information are fused by using top-down and bottom-up paths. The full combination of low-level features and high-level features can further enhance the model's ability to process multi-scale features and improve detection performance, especially in scenarios with large differences in target size (such as cracks, small depressions, and large-scale spalling and landslides in high slope surface disease detection). The Anchor-Free mechanism used by YOLOv8 can directly predict the center point and bounding box size of the target, reduce excessive calculations, and improve accuracy.
[0060] Three auxiliary detection heads (DetectAux) are added on the basis of the three main detection heads (Detect) in the detection head network (Head). The auxiliary detection heads and the main detection heads share the input feature extraction layer. The three main detection heads and the three auxiliary detection heads extract the features of six feature layers in parallel, which can greatly improve the detection performance. The auxiliary detection heads detect and fuse the up-sampled and down-sampled features to obtain different information of the same target, assisting the main detection head to better learn and identify the target, so that the main detection head has extremely powerful detection capabilities for complex targets. The auxiliary detection heads also help the network to better propagate gradients, accelerate training and prevent gradient disappearance.
[0061] Step 6, use the training set to train the slope apparent disease detection model. After each training, calculate the error loss value between the actual output of the slope apparent disease detection model and the target output; during the entire training process, if the performance indicator mean average precision mAP of the slope apparent disease detection model reaches the set requirements and remains stable or the error loss value continues to decrease and is less than the set threshold or the number of training times reaches the set maximum number of times, then stop the training, otherwise adjust the hyperparameters of the slope apparent disease detection model and continue the training; after stopping the training, save the network weight parameters at this time (for the detection and segmentation of slope apparent diseases);
[0062] Step 7: Input the test set into the slope apparent disease detection model, detect the slope apparent disease, and output the prediction result of the slope apparent disease.
[0063] Observe the prediction results of slope apparent diseases, use the target detection model performance evaluation parameter mean average precision mAP to evaluate whether the performance of the slope apparent disease detection model meets the requirements, save the slope apparent disease detection model structure and weight parameters that meet the requirements, and use them for intelligent detection and segmentation of slope apparent diseases.
[0064] In step 1, the slope surface diseases include landslides, cracks, damage and drainage channel blockage, and the image of the slope surface diseases is a high-resolution image.
[0065] In step 4, the slope apparent disease data set 1 in step 3 is randomly divided into a training set and a test set in a ratio of 4:1.
[0066] In step 5, the backbone network (Backbone) uses 5 standard convolutional layers to preliminarily extract low-level features, and uses 4 C2f (Cross Stage Partial Feature Fusion) modules integrated with multi-scale convolution (MSC) to increase the fusion of features at different scales and alleviate the problem of difficulty in distinguishing between background features and target features; a multi-branch convolution module (RFB, Receptive Field Block) is used and the cross-attention mechanism SE is integrated to replace the SPPF (Spatial Pyramid Pooling Fast) module of the YOLOv8 target detection algorithm to improve the receptive field of the slope surface disease detection model and increase its detection accuracy.
[0067] Redundant areas may be generated when extracting features. In order to remove the redundant areas, the DIoU-NMS (NonMaximum suppression) algorithm is used to improve and optimize the backbone network to accurately remove the redundant areas generated when extracting low-level features.
[0068] For the YOLOv8 target detection algorithm in step 5, bounding-box regression is used to obtain the bounding box parameters used for regression prediction of the target. The bounding box parameters are used to accurately describe the position and size of the target in the image. The classification branch module is used to classify the targets in each bounding box to determine the category to which the target belongs.
[0069] In step 5, the hyperparameters include learning rate, number of iterations, weight decay, and momentum; the initialization hyperparameters are: learning rate is 0.001, maximum number of iterations is 500, weight decay is 0.0005, and momentum is 0.8.
[0070] The learning rate is mainly scheduled using cosine annealing.
[0071] In step 6, the training of the slope apparent disease detection model includes forward propagation and back propagation.
[0072] A complete iterative training includes a forward propagation and a back propagation. Each training extracts a fixed number of sample data from the training set and inputs them into the slope surface disease detection model. The fixed number of samples (Batch Size) is 32. The image to be detected is input into the model. The image to be detected first extracts features through the backbone network, then passes through the feature fusion network (BiFPN) for multi-scale feature fusion, and finally predicts the target bounding box position and target category through the detection head. The actual output of the slope surface disease detection model calculates the error value through the loss function. The loss function includes NWDLoss and BCE Loss, and the weighted sum of these errors constitutes the final loss. Through back propagation, the optimizer SGD is used to update the weight parameters of the model according to the gradient, and the training is continuously iterated. The training process is usually based on a fixed number of training rounds (Epoch), and an early stopping mechanism can be set. By monitoring the changes in performance indicators (such as loss or mAP) on the test set, when the performance no longer improves or the loss no longer decreases, the training is terminated in advance to avoid overfitting.
[0073] In step 6, the bounding box regression loss function NWDLoss and the classification loss function BCE Loss (Binary Cross-Entropy Loss) are used in the training of the slope surface disease detection model to calculate the error between the predicted value and the true value, and the direction and amplitude of the parameter update are guided by gradient calculation and optimizer SGD to minimize the loss and thus optimize the model performance; the bounding box regression loss function NWDLoss is used instead of the original bounding box regression loss function CIoU Loss, which has more advantages in measuring the similarity between the predicted box and the true box of smaller objects, and can improve the detection accuracy;
[0074] The bounding box regression loss function NWDLoss is calculated as follows:
[0075]
[0076] L NWD =1-NWD(N p ,N g )
[0077] Where N p Represents the Gaussian distribution formula of the prediction box, N g Represents the Gaussian distribution formula of the real box, cx p 、cy p 、w p 、h p Respectively represent the center coordinate x, center coordinate y, width, height, cx g 、cy g 、w g、h g They represent the center coordinate x, center coordinate y, width, and height of the real box respectively, and e represents a constant determined by the average size of the target in the data set;
[0078] The classification loss function BCE Loss is calculated as follows:
[0079]
[0080] In the formula, y i,j represents the true label of the disease category, that is, the true label of the jth category in the i-th sample; p i,j Represents the category probability predicted by the model, that is, the predicted probability of the jth category in the i-th sample; M is the number of targets contained in the detection box; Z is the number of categories;
[0081] The optimizer uses Stochastic Gradient Descent (SGD).
[0082] Define the cost function C(ω,b),
[0083] The cost function C(ω,b) is calculated as:
[0084] Among them, ω, b are weight parameters, x represents the sample, y(x) is the actual output of the model input x, a is the target expected output of the model input x, and n is the total number of samples;
[0085] The update formula of the weight parameter is as follows:
[0086]
[0087] In the formula, η is the learning rate, C is the cost function, ω and b are the weight parameters of the slope apparent disease detection model, ω ′ 、b ′ is the updated weight parameter.
[0088] The learning rate η is scheduled using cosine annealing.
Claims
1. A slope apparent disease detection method based on enhanced multi-scale fusion, characterized in that: Contains the following steps: Step 1, obtaining an image of slope surface damage; Step 2: Use data enhancement method to preprocess the acquired image of slope surface damage; Data augmentation methods include flipping, translation, cropping, and adding Gaussian noise; Step 3: Use Labelimg software to annotate the image of slope apparent disease preprocessed in step 2, and mark the landslide area, crack area, damaged area and drainage channel blockage area respectively, to obtain the slope apparent disease data set; Step 4: randomly divide the slope apparent disease data set in step 3 into a training set and a test set according to a certain ratio; Step 5: Build an optimized YOLOv8 target detection algorithm, use the YOLOv8 target detection algorithm as a slope apparent disease detection model, and initialize the hyperparameters of the slope apparent disease detection model; the YOLOv8 target detection algorithm contains a backbone network, a feature fusion network, and a detection head network. The optimization method of the YOLOv8 target detection algorithm is as follows: Embed multi-scale convolution modules, multi-branch convolution modules and cross-attention mechanisms in the backbone network; Integrate the weighted bidirectional feature pyramid network into the feature fusion network; Three auxiliary detection heads are added on the basis of the three main detection heads in the detection head network. The auxiliary detection heads and the main detection heads share the input feature extraction layer. The features of six feature layers are extracted in parallel by the three main detection heads and the three auxiliary detection heads. The auxiliary detection heads detect and fuse the up-sampled and down-sampled features to obtain different information of the same target, assist the main detection head in learning and identifying the target, and help the network propagate gradients, accelerate training and prevent gradient disappearance. Step 6: Use the training set to train the slope apparent disease detection model. After each training, calculate the error loss value between the actual output of the slope apparent disease detection model and the target output. During the entire training process, if the performance index of the slope apparent disease detection model meets the set requirements and remains stable, or the error loss value continues to decrease and is less than the set threshold, or the number of training times reaches the set maximum number, stop the training. Otherwise, adjust the hyperparameters of the slope apparent disease detection model and continue the training. After stopping the training, save the network weight parameters at this time. Step 7: Input the test set into the slope apparent disease detection model, detect the slope apparent disease, and output the prediction result of the slope apparent disease.
2. The method for detecting slope surface defects based on enhanced multi-scale fusion according to claim 1 is characterized by: In the step 1, the slope surface damage includes landslides, cracks, damage and drainage channel blockage, and the image of the slope surface damage is a high-resolution image.
3. The slope apparent disease detection method based on enhanced multi-scale fusion according to claim 1 is characterized by: In step 4, the slope apparent disease data set in step 3 is randomly divided into a training set and a test set in a ratio of 4:
1.
4. The slope apparent disease detection method based on enhanced multi-scale fusion according to claim 1 is characterized in that: In step 5, the backbone network uses 5 standard convolutional layers to preliminarily extract low-level features, and uses 4 C2f modules that incorporate multi-scale convolutions to increase the fusion of features at different scales; a multi-branch convolutional module is used and the cross-attention mechanism is integrated to replace the SPPF module of the YOLOv8 target detection algorithm.
5. The method for detecting slope surface defects based on enhanced multi-scale fusion according to claim 4 is characterized in that: The backbone network is optimized using the DIoU-NMS non-maximum suppression algorithm to remove redundant regions generated when extracting low-level features.
6. The slope apparent disease detection method based on enhanced multi-scale fusion according to claim 1 is characterized in that: The YOLOv8 target detection algorithm in step 5 obtains bounding box parameters for regression prediction of the target through border regression, uses the bounding box parameters to describe the position and size of the target in the image, and classifies the targets in each bounding box through the classification branch module to determine the category to which the target belongs.
7. The method for detecting slope surface defects based on enhanced multi-scale fusion according to claim 1 is characterized by: In step 5, the hyperparameters include learning rate, number of iterations, weight decay and momentum.
8. The method for detecting slope surface defects based on enhanced multi-scale fusion according to claim 7 is characterized by: The learning rate is scheduled using a cosine annealing method.
9. The method for detecting slope surface defects based on enhanced multi-scale fusion according to claim 1 is characterized by: In step 6, the training of the slope apparent disease detection model includes forward propagation and back propagation.
10. The method for detecting slope surface defects based on enhanced multi-scale fusion according to claim 1 is characterized by: In step 6, the bounding box regression loss function NWDLoss and the classification loss function BCE Loss are used in the training of the slope apparent disease detection model to calculate the error between the predicted value and the true value, and the direction and amplitude of parameter update are guided by gradient calculation and optimizer to optimize the model performance; The bounding box regression loss function NWDLoss is calculated as follows: L NWD =1-NWD(N p ,OF g ) Where N p Represents the Gaussian distribution formula of the prediction box, N g Represents the Gaussian distribution formula of the real box, cx p 、cy p 、w p 、h p Respectively represent the center coordinate x, center coordinate y, width, height, cx g 、cy g 、w g 、h g They represent the center coordinate x, center coordinate y, width, and height of the real box respectively, and e represents a constant determined by the average size of the target in the data set; The classification loss function BCE Loss is calculated as follows: In the formula, y i,j represents the true label of the disease category, that is, the true label of the jth category in the i-th sample; p i,j represents the category probability predicted by the model, that is, the predicted probability of the jth category in the i-th sample; M is the number of targets contained in the detection box; Z is the number of categories; The optimizer uses stochastic gradient descent. Define the cost function C(ω,b), The cost function C(ω,b) is calculated as: Among them, ω, b are weight parameters, x represents the sample, y(x) is the actual output of the model input x, a is the target expected output of the model input x, and n is the total number of samples; The update formula of the weight parameter is as follows: In the formula, η is the learning rate, C is the cost function, ω and b are the weight parameters of the slope apparent disease detection model, ω ′ , b ′ is the updated weight parameter.
Citation Information
Cited By
River bank collapse identification method and system based on multi-feature progressive detection and fusion verification
CN121708476A